Code Improvement
[clamp.git] / src / main / resources / META-INF / resources / designer / index.js
1 function activateMenu() {
2   isImportSchema = true;
3 }
4 var abootDiagram = null;
5
6 function cldsOpenDiagram(modelXml) {
7   cldsModelXml = modelXml;
8   console.log("cldsOpenDiagram: cldsModelXml=" + cldsModelXml);
9   $("#cldsopendiagrambtn").click();
10 }
11
12 function cldsGetDiagram() {
13   console.log("cldsGetDiagram: starting...");
14   $("#cldsgetdiagrambtn").click();
15   console.log("cldsGetDiagram: modelXML=" + modelXML);
16   return modelXML;
17 }
18
19 function uploaddata(file) {
20   uploadfile = file;
21   $("#uploadmodel").click();
22
23 }
24
25 function visibility_model() {
26   $("#openmodel").click();
27
28 }
29 (function e(t, n, r) {
30   function s(o, u) {
31     if (!n[o]) {
32       if (!t[o]) {
33         var a = typeof require == "function" && require;
34         if (!u && a) return a(o, !0);
35         if (i) return i(o, !0);
36         var f = new Error("Cannot find module '" + o + "'");
37         throw f.code = "MODULE_NOT_FOUND", f
38       }
39       var l = n[o] = {
40         exports: {}
41       };
42       t[o][0].call(l.exports, function(e) {
43         var n = t[o][1][e];
44         return s(n ? n : e)
45       }, l, l.exports, e, t, n, r)
46     }
47     return n[o].exports
48   }
49   var i = typeof require == "function" && require;
50   for (var o = 0; o < r.length; o++) s(r[o]);
51   return s;
52 })
53
54 ({
55   "\\bpmn-js-examples-master\\modeler\\app\\index.js":
56
57     [function(require, module, exports) {
58
59       'use strict';
60
61
62
63       var $ = require('jquery'),
64         BpmnModeler = require('bpmn-js/lib/Modeler');
65
66       var container = $('#js-drop-zone');
67
68       var canvas = $('#js-canvas');
69
70       var renderer = new BpmnModeler({
71         container: canvas
72       });
73       abootDiagram = renderer;
74
75       var newDiagramXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<bpmn2:definitions xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:bpmn2=\"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\" xmlns:di=\"http://www.omg.org/spec/DD/20100524/DI\" xsi:schemaLocation=\"http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd\" id=\"sample-diagram\" targetNamespace=\"http://bpmn.io/schema/bpmn\">\n  <bpmn2:process id=\"Process_1\" isExecutable=\"false\">\n    <bpmn2:startEvent id=\"StartEvent_1\"/>\n  </bpmn2: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=\"25.0\" y=\"240.0\"/>\n      </bpmndi:BPMNShape>\n    </bpmndi:BPMNPlane>\n  </bpmndi:BPMNDiagram>\n</bpmn2:definitions>";
76       //
77       /*file_generate_test_case.addEventListener('click', function(e) {
78
79
80       });*/
81
82
83
84       function createNewDiagram(newDiagramXML) {
85         openDiagram(newDiagramXML);
86
87       }
88
89       function openDiagram(xml) {
90         renderer.importXML(xml, function(err) {
91
92           if (err) {
93             container
94               .removeClass('with-diagram')
95               .addClass('with-error');
96
97             container.find('.error pre').text(err.message);
98
99             console.error(err);
100           } else {
101             container
102               .removeClass('with-error')
103               .addClass('with-diagram');
104           }
105
106
107         });
108       }
109
110       function saveSVG(done) {
111         renderer.saveSVG(done);
112       }
113
114       function saveDiagram(done) {
115
116         renderer.saveXML({
117           format: true
118         }, function(err, xml) {
119           done(err, xml);
120         });
121       }
122
123
124       function registerFileDrop(container, callback) {
125
126         function handleFileSelect(e) {
127           e.stopPropagation();
128           e.preventDefault();
129
130           var files = e.dataTransfer.files;
131
132           var file = files[0];
133
134           var reader = new FileReader();
135
136           reader.onload = function(e) {
137
138             var xml = e.target.result;
139
140             callback(xml);
141           };
142
143           reader.readAsText(file);
144         }
145
146         function handleDragOver(e) {
147           e.stopPropagation();
148           e.preventDefault();
149
150           e.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
151         }
152         if (container.get(0)) {
153           container.get(0).addEventListener('dragover', handleDragOver, false);
154           container.get(0).addEventListener('drop', handleFileSelect, false);
155         }
156       }
157
158
159       // //// file drag / drop ///////////////////////
160
161       // check file api availability
162       if (!window.FileList || !window.FileReader) {
163         window.alert(
164           'Looks like you use an older browser that does not support drag and drop. ' +
165           'Try using Chrome, Firefox or the Internet Explorer > 10.');
166       } else {
167         registerFileDrop(container, openDiagram);
168       }
169
170       // bootstrap diagram functions
171       function openNewWin(linkURL) {
172         window.open("" + linkURL + "", "_self" /*, "", "scrollbars, top="+winTop+", left="+winLeft+", height="+winHeight+", width="+winWidth+""*/ );
173       }
174
175
176       $(document).on('ready', function(e) {
177
178         /* $('#js-create-diagram').click(function(e) {*/
179         e.stopPropagation();
180         e.preventDefault();
181
182         createNewDiagram(newDiagramXML);
183
184         /*});*/
185         var fileInput = document.getElementById('fileInput');
186         var file_generate_test_case = document.getElementById('file_generate_test_case');
187
188         var downloadLink = $('#js-download-diagram');
189         var downloadSvgLink = $('#js-download-svg');
190         var readLink = $('#file_generate_test_case');
191         $('.buttons a').click(function(e) {
192           if (!$(this).is('.active')) {
193             e.preventDefault();
194             e.stopPropagation();
195           }
196         });
197         $('#openmodel').click(function() {
198
199           createNewDiagram(modelXML);
200
201         });
202
203         $('#cldsgetdiagrambtn').click(function() {
204           console.log("cldsgetdiagrambtn: starting...");
205           exportArtifacts();
206           console.log("cldsgetdiagrambtn: modelXML=" + modelXML);
207         });
208         $('#cldsopendiagrambtn').click(function() {
209           console.log("cldsopendiagrambtn: cldsModelXml=" + cldsModelXml);
210           createNewDiagram(cldsModelXml);
211           exportArtifacts();
212         });
213         $('#uploadmodel').click(function() {
214           var file = uploadfile;
215           var textType = /text.*/;
216
217           var reader = new FileReader();
218
219           reader.onload = function(e) {
220             newDiagramXML = reader.result;
221             e.stopPropagation();
222             e.preventDefault();
223             createNewDiagram(newDiagramXML);
224
225           }
226
227           reader.readAsText(file);
228           exportArtifacts();
229         });
230         if (fileInput) {
231           fileInput.addEventListener('change', function(e) {
232             var file = fileInput.files[0];
233             var textType = /text.*/;
234
235
236             var reader = new FileReader();
237
238             reader.onload = function(e) {
239               newDiagramXML = reader.result;
240               e.stopPropagation();
241               e.preventDefault();
242               createNewDiagram(newDiagramXML);
243
244             }
245
246             reader.readAsText(file);
247             exportArtifacts();
248           });
249         }
250
251         function setEncoded(link, name, data) {
252           var encodedData = encodeURIComponent(data);
253
254           var el = document.getElementById(selected_model);
255           var text = (el.innerText || el.textContent);
256
257
258           if (data) {
259             //var linkURL='data:application/bpmn20-xml;charset=UTF-8,' + encodedData;
260             link.addClass('active').attr({
261               'href': 'data:application/bpmn20-xml;charset=UTF-8,' + encodedData,
262               /*openNewWin( linkURL )*/ /*'*/
263               'download': text.trim() + '.utmxml',
264               'target': '_blank'
265             });
266
267           } else {
268             link.removeClass('active');
269           }
270         }
271
272         function setReadEncoded(link, name, data) {
273           var encodedData = encodeURIComponent(data);
274
275           if (data) {
276             link.addClass('active').attr({
277               'href': 'data:application/bpmn20-xml;charset=UTF-8,' + encodedData,
278               'download': name
279             });
280
281
282           } else {
283             link.removeClass('active');
284           }
285         }
286         var _ = require('lodash');
287         /*var model = $( "#modelName" ).val();
288          */
289
290         var exportArtifacts = _.debounce(function() {
291
292           saveSVG(function(err, svg) {
293             setEncoded(downloadSvgLink, 'diagram.svg', err ? null : svg);
294           });
295
296           saveDiagram(function(err, xml) {
297             setEncoded(downloadLink, "model.utmxml", err ? null : xml);
298           });
299
300         }, 500);
301
302         renderer.on('commandStack.changed', exportArtifacts);
303       });
304     }, {
305       "bpmn-js/lib/Modeler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Modeler.js",
306       "jquery": "\\bpmn-js-examples-master\\modeler\\node_modules\\jquery\\dist\\jquery.js",
307       "lodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\index.js"
308     }],
309   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Modeler.js": [function(require, module, exports) {
310     'use strict';
311
312     var inherits = require('inherits');
313
314     var IdSupport = require('bpmn-moddle/lib/id-support'),
315       Ids = require('ids');
316
317     var Viewer = require('./Viewer');
318
319     var initialDiagram =
320       '<?xml version="1.0" encoding="UTF-8"?>' +
321       '<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
322       'xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
323       'xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" ' +
324       'xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" ' +
325       'targetNamespace="http://bpmn.io/schema/bpmn" ' +
326       'id="Definitions_1">' +
327       '<bpmn:process id="Process_1" isExecutable="false">' +
328       '<bpmn:startEvent id="StartEvent_1"/>' +
329       '</bpmn:process>' +
330       '<bpmndi:BPMNDiagram id="BPMNDiagram_1">' +
331       '<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">' +
332       '<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">' +
333       '<dc:Bounds height="36.0" width="36.0" x="50.0" y="102.0"/>' +
334       '</bpmndi:BPMNShape>' +
335       '</bpmndi:BPMNPlane>' +
336       '</bpmndi:BPMNDiagram>' +
337       '</bpmn:definitions>';
338
339
340     /**
341      * A modeler for BPMN 2.0 diagrams.
342      *
343      *  ## Extending the Modeler
344      *
345      * In order to extend the viewer pass extension modules to bootstrap via the
346      * `additionalModules` option. An extension module is an object that exposes
347      * named services.
348      *
349      * The following example depicts the integration of a simple logging component
350      * that integrates with interaction events:
351      *
352      *
353      * ```javascript
354      *  // logging component function InteractionLogger(eventBus) {
355      * eventBus.on('element.hover', function(event) { console.log() }) }
356      *
357      * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
358      *  // extension module var extensionModule = { __init__: [ 'interactionLogger' ],
359      * interactionLogger: [ 'type', InteractionLogger ] };
360      *  // extend the viewer var bpmnModeler = new Modeler({ additionalModules: [
361      * extensionModule ] }); bpmnModeler.importXML(...); ```
362      *
363      *  ## Customizing / Replacing Components
364      *
365      * You can replace individual diagram components by redefining them in override
366      * modules. This works for all components, including those defined in the core.
367      *
368      * Pass in override modules via the `options.additionalModules` flag like this:
369      *
370      * ```javascript function CustomContextPadProvider(contextPad) {
371      *
372      * contextPad.registerProvider(this);
373      *
374      * this.getContextPadEntries = function(element) { // no entries, effectively
375      * disable the context pad return {}; }; }
376      *
377      * CustomContextPadProvider.$inject = [ 'contextPad' ];
378      *
379      * var overrideModule = { contextPadProvider: [ 'type', CustomContextPadProvider ] };
380      *
381      * var bpmnModeler = new Modeler({ additionalModules: [ overrideModule ]}); ```
382      *
383      * @param {Object}
384      *            [options] configuration options to pass to the viewer
385      * @param {DOMElement}
386      *            [options.container] the container to render the viewer in,
387      *            defaults to body.
388      * @param {String|Number}
389      *            [options.width] the width of the viewer
390      * @param {String|Number}
391      *            [options.height] the height of the viewer
392      * @param {Object}
393      *            [options.moddleExtensions] extension packages to provide
394      * @param {Array
395      *            <didi.Module>} [options.modules] a list of modules to override the
396      *            default modules
397      * @param {Array
398      *            <didi.Module>} [options.additionalModules] a list of modules to
399      *            use with the default modules
400      */
401     function Modeler(options) {
402       Viewer.call(this, options);
403     }
404
405     inherits(Modeler, Viewer);
406
407     Modeler.prototype.createDiagram = function(done) {
408       return this.importXML(initialDiagram, done);
409     };
410
411     Modeler.prototype.createModdle = function() {
412       var moddle = Viewer.prototype.createModdle.call(this);
413
414       IdSupport.extend(moddle, new Ids([32, 36, 1]));
415
416       return moddle;
417     };
418
419
420     Modeler.prototype._interactionModules = [
421       // non-modeling components
422       require('./features/label-editing'),
423       require('./features/keyboard'),
424       require('diagram-js/lib/navigation/zoomscroll'),
425       require('diagram-js/lib/navigation/movecanvas'),
426       require('diagram-js/lib/navigation/touch')
427     ];
428
429     Modeler.prototype._modelingModules = [
430       // modeling components
431       require('diagram-js/lib/features/move'),
432       require('diagram-js/lib/features/bendpoints'),
433       require('diagram-js/lib/features/resize'),
434       require('diagram-js/lib/features/space-tool'),
435       require('diagram-js/lib/features/lasso-tool'),
436       //require('./features/keyboard'),
437       require('./features/snapping'),
438       require('./features/modeling'),
439       require('./features/context-pad'),
440       require('./features/palette')
441     ];
442
443
444     // modules the modeler is composed of
445     //
446     // - viewer modules
447     // - interaction modules
448     // - modeling modules
449
450     Modeler.prototype._modules = [].concat(
451       Modeler.prototype._modules,
452       Modeler.prototype._interactionModules,
453       Modeler.prototype._modelingModules);
454
455
456     module.exports = Modeler;
457
458   }, {
459     "./Viewer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Viewer.js",
460     "./features/context-pad": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\index.js",
461     "./features/keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\index.js",
462     "./features/label-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js",
463     "./features/modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\index.js",
464     "./features/palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\index.js",
465     "./features/snapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\index.js",
466     "bpmn-moddle/lib/id-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\id-support.js",
467     "diagram-js/lib/features/bendpoints": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\index.js",
468     "diagram-js/lib/features/lasso-tool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\index.js",
469     "diagram-js/lib/features/move": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\index.js",
470     "diagram-js/lib/features/resize": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\index.js",
471     "diagram-js/lib/features/space-tool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\index.js",
472     "diagram-js/lib/navigation/movecanvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\index.js",
473     "diagram-js/lib/navigation/touch": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\touch\\index.js",
474     "diagram-js/lib/navigation/zoomscroll": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\index.js",
475     "ids": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\index.js",
476     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
477   }],
478   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Viewer.js": [function(require, module, exports) {
479     'use strict';
480
481     var assign = require('lodash/object/assign'),
482       omit = require('lodash/object/omit'),
483       isString = require('lodash/lang/isString'),
484       isNumber = require('lodash/lang/isNumber');
485
486     var domify = require('min-dom/lib/domify'),
487       domQuery = require('min-dom/lib/query'),
488       domRemove = require('min-dom/lib/remove');
489
490     var Diagram = require('diagram-js'),
491       BpmnModdle = require('bpmn-moddle');
492
493     var Importer = require('./import/Importer');
494
495
496     function initListeners(diagram, listeners) {
497       var events = diagram.get('eventBus');
498
499       listeners.forEach(function(l) {
500         events.on(l.event, l.handler);
501       });
502     }
503
504     function checkValidationError(err) {
505
506       // check if we can help the user by indicating wrong BPMN 2.0 xml
507       // (in case he or the exporting tool did not get that right)
508
509       var pattern = /unparsable content <([^>]+)> detected([\s\S]*)$/;
510       var match = pattern.exec(err.message);
511
512       if (match) {
513         err.message =
514           'unparsable content <' + match[1] + '> detected; ' +
515           'this may indicate an invalid BPMN 2.0 diagram file' + match[2];
516       }
517
518       return err;
519     }
520
521     var DEFAULT_OPTIONS = {
522       width: '100%',
523       height: '100%',
524       position: 'relative',
525       container: 'body'
526     };
527
528
529
530     /**
531      * Ensure the passed argument is a proper unit (defaulting to px)
532      */
533     function ensureUnit(val) {
534       return val + (isNumber(val) ? 'px' : '');
535     }
536
537     /**
538      * A viewer for BPMN 2.0 diagrams.
539      *
540      * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that
541      * include additional features.
542      *
543      *  ## Extending the Viewer
544      *
545      * In order to extend the viewer pass extension modules to bootstrap via the
546      * `additionalModules` option. An extension module is an object that exposes
547      * named services.
548      *
549      * The following example depicts the integration of a simple logging component
550      * that integrates with interaction events:
551      *
552      *
553      * ```javascript
554      *  // logging component function InteractionLogger(eventBus) {
555      * eventBus.on('element.hover', function(event) { console.log() }) }
556      *
557      * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
558      *  // extension module var extensionModule = { __init__: [ 'interactionLogger' ],
559      * interactionLogger: [ 'type', InteractionLogger ] };
560      *  // extend the viewer var bpmnViewer = new Viewer({ additionalModules: [
561      * extensionModule ] }); bpmnViewer.importXML(...); ```
562      *
563      * @param {Object}
564      *            [options] configuration options to pass to the viewer
565      * @param {DOMElement}
566      *            [options.container] the container to render the viewer in,
567      *            defaults to body.
568      * @param {String|Number}
569      *            [options.width] the width of the viewer
570      * @param {String|Number}
571      *            [options.height] the height of the viewer
572      * @param {Object}
573      *            [options.moddleExtensions] extension packages to provide
574      * @param {Array
575      *            <didi.Module>} [options.modules] a list of modules to override the
576      *            default modules
577      * @param {Array
578      *            <didi.Module>} [options.additionalModules] a list of modules to
579      *            use with the default modules
580      */
581     function Viewer(options) {
582
583       this.options = options = assign({}, DEFAULT_OPTIONS, options || {});
584
585       var parent = options.container;
586
587       // support jquery element
588       // unwrap it if passed
589       if (parent.get) {
590         parent = parent.get(0);
591       }
592
593       // support selector
594       if (isString(parent)) {
595         parent = domQuery(parent);
596       }
597
598       var container = this.container = domify('<div class="bjs-container"></div>');
599       if (parent && parent.appendChild) {
600         parent.appendChild(container);
601       }
602
603
604       assign(container.style, {
605         width: ensureUnit(options.width),
606         height: ensureUnit(options.height),
607         position: options.position
608       });
609
610       /**
611        * The code in the <project-logo></project-logo> area must not be changed,
612        * see http://bpmn.io/license for more information
613        *
614        * <project-logo>
615        */
616
617       /* jshint -W101 */
618
619       // inlined ../resources/bpmnjs.png
620       var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC';
621
622       /* jshint +W101 */
623
624       var linkMarkup =
625         '<a href="http://bpmn.io" ' +
626         'target="_blank" ' +
627         'class="bjs-powered-by" ' +
628         'title="Powered by bpmn.io" ' +
629         'style="position: absolute; bottom: 15px; right: 15px; z-index: 100">' +
630         '<img src="data:image/png;base64,' + logoData + '">' +
631         '</a>';
632       if (container && container.appendChild) {
633         container.appendChild(domify(linkMarkup));
634       }
635
636
637       /* </project-logo> */
638     }
639
640     Viewer.prototype.importXML = function(xml, done) {
641
642       var self = this;
643
644       this.moddle = this.createModdle();
645
646       this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {
647
648         if (err) {
649           err = checkValidationError(err);
650           return done(err);
651         }
652
653         var parseWarnings = context.warnings;
654
655         self.importDefinitions(definitions, function(err, importWarnings) {
656           if (err) {
657             return done(err);
658           }
659
660           done(null, parseWarnings.concat(importWarnings || []));
661         });
662       });
663     };
664
665     Viewer.prototype.saveXML = function(options, done) {
666
667       if (!done) {
668         done = options;
669         options = {};
670       }
671
672       var definitions = this.definitions;
673
674       if (!definitions) {
675         return done(new Error('no definitions loaded'));
676       }
677
678       this.moddle.toXML(definitions, options, done);
679     };
680
681
682     Viewer.prototype.createModdle = function() {
683       return new BpmnModdle(this.options.moddleExtensions);
684     };
685
686     Viewer.prototype.saveSVG = function(options, done) {
687
688       if (!done) {
689         done = options;
690         options = {};
691       }
692
693       var canvas = this.get('canvas');
694
695       var contentNode = canvas.getDefaultLayer(),
696         defsNode = canvas._svg.select('defs');
697
698       var contents = contentNode.innerSVG(),
699         defs = (defsNode && defsNode.outerSVG()) || '';
700
701       var bbox = contentNode.getBBox();
702
703       var svg =
704         '<?xml version="1.0" encoding="utf-8"?>\n' +
705         '<!-- created with bpmn-js / http://bpmn.io -->\n' +
706         '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' +
707         '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +
708         'width="' + bbox.width + '" height="' + bbox.height + '" ' +
709         'viewBox="' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '" version="1.1">' +
710         defs + contents +
711         '</svg>';
712
713       done(null, svg);
714     };
715
716     Viewer.prototype.get = function(name) {
717
718       if (!this.diagram) {
719         throw new Error('no diagram loaded');
720       }
721
722       return this.diagram.get(name);
723     };
724
725     Viewer.prototype.invoke = function(fn) {
726
727       if (!this.diagram) {
728         throw new Error('no diagram loaded');
729       }
730
731       return this.diagram.invoke(fn);
732     };
733
734     Viewer.prototype.importDefinitions = function(definitions, done) {
735
736       // use try/catch to not swallow synchronous exceptions
737       // that may be raised during model parsing
738       try {
739         if (this.diagram) {
740           this.clear();
741         }
742
743         this.definitions = definitions;
744
745         var diagram = this.diagram = this._createDiagram(this.options);
746
747         this._init(diagram);
748
749         Importer.importBpmnDiagram(diagram, definitions, done);
750       } catch (e) {
751         done(e);
752       }
753     };
754
755     Viewer.prototype._init = function(diagram) {
756       initListeners(diagram, this.__listeners || []);
757     };
758
759     Viewer.prototype._createDiagram = function(options) {
760
761       var modules = [].concat(options.modules || this.getModules(), options.additionalModules || []);
762
763       // add self as an available service
764       modules.unshift({
765         bpmnjs: ['value', this],
766         moddle: ['value', this.moddle]
767       });
768
769       options = omit(options, 'additionalModules');
770
771       options = assign(options, {
772         canvas: {
773           container: this.container
774         },
775         modules: modules
776       });
777
778       return new Diagram(options);
779     };
780
781
782     Viewer.prototype.getModules = function() {
783       return this._modules;
784     };
785
786     /**
787      * Remove all drawn elements from the viewer.
788      *
789      * After calling this method the viewer can still be reused for opening another
790      * diagram.
791      */
792     Viewer.prototype.clear = function() {
793       var diagram = this.diagram;
794
795       if (diagram) {
796         diagram.destroy();
797       }
798     };
799
800     /**
801      * Destroy the viewer instance and remove all its remainders from the document
802      * tree.
803      */
804     Viewer.prototype.destroy = function() {
805       // clear underlying diagram
806       this.clear();
807
808       // remove container
809       domRemove(this.container);
810     };
811
812     /**
813      * Register an event listener on the viewer
814      *
815      * @param {String}
816      *            event
817      * @param {Function}
818      *            handler
819      */
820     Viewer.prototype.on = function(event, handler) {
821       var diagram = this.diagram,
822         listeners = this.__listeners = this.__listeners || [];
823
824       listeners.push({
825         event: event,
826         handler: handler
827       });
828
829       if (diagram) {
830         diagram.get('eventBus').on(event, handler);
831       }
832     };
833
834     // modules the viewer is composed of
835     Viewer.prototype._modules = [
836       require('./core'),
837       require('diagram-js/lib/features/selection'),
838       require('diagram-js/lib/features/overlays')
839     ];
840
841     module.exports = Viewer;
842
843   }, {
844     "./core": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\core\\index.js",
845     "./import/Importer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Importer.js",
846     "bpmn-moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\index.js",
847     "diagram-js": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\index.js",
848     "diagram-js/lib/features/overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js",
849     "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
850     "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
851     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
852     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
853     "lodash/object/omit": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\omit.js",
854     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js",
855     "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js",
856     "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"
857   }],
858   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\core\\index.js": [function(require, module, exports) {
859     module.exports = {
860       __depends__: [
861         require('../draw'),
862         require('../import')
863       ]
864     };
865   }, {
866     "../draw": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\index.js",
867     "../import": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\index.js"
868   }],
869   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\BpmnRenderer.js": [function(require, module, exports) {
870     'use strict';
871
872     var inherits = require('inherits'),
873       isArray = require('lodash/lang/isArray'),
874       isObject = require('lodash/lang/isObject'),
875       assign = require('lodash/object/assign'),
876       forEach = require('lodash/collection/forEach'),
877       every = require('lodash/collection/every'),
878       includes = require('lodash/collection/includes'),
879       some = require('lodash/collection/some');
880
881     var DefaultRenderer = require('diagram-js/lib/draw/Renderer'),
882       TextUtil = require('diagram-js/lib/util/Text'),
883       DiUtil = require('../util/DiUtil');
884
885     var createLine = DefaultRenderer.createLine;
886
887
888     function BpmnRenderer(events, styles, pathMap) {
889
890       DefaultRenderer.call(this, styles);
891
892       var TASK_BORDER_RADIUS = 10;
893       var INNER_OUTER_DIST = 3;
894
895       var LABEL_STYLE = {
896         fontFamily: 'Arial, sans-serif',
897         fontSize: '12px'
898       };
899
900       var textUtil = new TextUtil({
901         style: LABEL_STYLE,
902         size: {
903           width: 100
904         }
905       });
906
907       var markers = {};
908
909       function addMarker(id, element) {
910         markers[id] = element;
911       }
912
913       function marker(id) {
914         return markers[id];
915       }
916
917       function initMarkers(svg) {
918
919         function createMarker(id, options) {
920           var attrs = assign({
921             fill: 'black',
922             strokeWidth: 1,
923             strokeLinecap: 'round',
924             strokeDasharray: 'none'
925           }, options.attrs);
926
927           var ref = options.ref || {
928             x: 0,
929             y: 0
930           };
931
932           var scale = options.scale || 1;
933
934           // fix for safari / chrome / firefox bug not correctly
935           // resetting stroke dash array
936           if (attrs.strokeDasharray === 'none') {
937             attrs.strokeDasharray = [10000, 1];
938           }
939
940           var marker = options.element
941             .attr(attrs)
942             .marker(0, 0, 20, 20, ref.x, ref.y)
943             .attr({
944               markerWidth: 20 * scale,
945               markerHeight: 20 * scale
946             });
947
948           return addMarker(id, marker);
949         }
950
951
952         createMarker('sequenceflow-end', {
953           element: svg.path('M 1 5 L 11 10 L 1 15 Z'),
954           ref: {
955             x: 11,
956             y: 10
957           },
958           scale: 0.5
959         });
960
961         createMarker('messageflow-start', {
962           element: svg.circle(6, 6, 3.5),
963           attrs: {
964             fill: 'white',
965             stroke: 'black'
966           },
967           ref: {
968             x: 6,
969             y: 6
970           }
971         });
972
973         createMarker('messageflow-end', {
974           element: svg.path('m 1 5 l 0 -3 l 7 3 l -7 3 z'),
975           attrs: {
976             fill: 'white',
977             stroke: 'black',
978             strokeLinecap: 'butt'
979           },
980           ref: {
981             x: 8.5,
982             y: 5
983           }
984         });
985
986         createMarker('data-association-end', {
987           element: svg.path('M 1 5 L 11 10 L 1 15'),
988           attrs: {
989             fill: 'white',
990             stroke: 'black'
991           },
992           ref: {
993             x: 11,
994             y: 10
995           },
996           scale: 0.5
997         });
998
999         createMarker('conditional-flow-marker', {
1000           element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),
1001           attrs: {
1002             fill: 'white',
1003             stroke: 'black'
1004           },
1005           ref: {
1006             x: -1,
1007             y: 10
1008           },
1009           scale: 0.5
1010         });
1011
1012         createMarker('conditional-default-flow-marker', {
1013           element: svg.path('M 1 4 L 5 16'),
1014           attrs: {
1015             stroke: 'black'
1016           },
1017           ref: {
1018             x: -5,
1019             y: 10
1020           },
1021           scale: 0.5
1022         });
1023       }
1024
1025       function computeStyle(custom, traits, defaultStyles) {
1026         if (!isArray(traits)) {
1027           defaultStyles = traits;
1028           traits = [];
1029         }
1030
1031         return styles.style(traits || [], assign(defaultStyles, custom || {}));
1032       }
1033
1034       function drawCircle(p, width, height, offset, attrs) {
1035
1036         if (isObject(offset)) {
1037           attrs = offset;
1038           offset = 0;
1039         }
1040
1041         offset = offset || 0;
1042
1043         attrs = computeStyle(attrs, {
1044           stroke: 'black',
1045           strokeWidth: 2,
1046           fill: 'white'
1047         });
1048
1049         var cx = width / 2,
1050           cy = height / 2;
1051
1052         return p.circle(cx, cy, Math.round((width + height) / 4 - offset)).attr(attrs);
1053       }
1054
1055       function drawRect(p, width, height, r, offset, attrs) {
1056
1057         if (isObject(offset)) {
1058           attrs = offset;
1059           offset = 0;
1060         }
1061
1062         offset = offset || 0;
1063
1064         attrs = computeStyle(attrs, {
1065           stroke: 'black',
1066           strokeWidth: 2,
1067           fill: 'white'
1068         });
1069
1070         return p.rect(offset, offset, width - offset * 2, height - offset * 2, r).attr(attrs);
1071       }
1072
1073       function drawDiamond(p, width, height, attrs) {
1074
1075         var x_2 = width / 2;
1076         var y_2 = height / 2;
1077
1078         var points = [x_2, 0, width, y_2, x_2, height, 0, y_2];
1079
1080         attrs = computeStyle(attrs, {
1081           stroke: 'black',
1082           strokeWidth: 2,
1083           fill: 'white'
1084         });
1085
1086         return p.polygon(points).attr(attrs);
1087       }
1088
1089       function drawLine(p, waypoints, attrs) {
1090         attrs = computeStyle(attrs, ['no-fill'], {
1091           stroke: 'black',
1092           strokeWidth: 2,
1093           fill: 'none'
1094         });
1095
1096         return createLine(waypoints, attrs).appendTo(p);
1097       }
1098
1099       function drawPath(p, d, attrs) {
1100
1101         attrs = computeStyle(attrs, ['no-fill'], {
1102           strokeWidth: 2,
1103           stroke: 'black'
1104         });
1105
1106         return p.path(d).attr(attrs);
1107       }
1108
1109       function as(type) {
1110         return function(p, element) {
1111           return handlers[type](p, element);
1112         };
1113       }
1114
1115       function renderer(type) {
1116         return handlers[type];
1117       }
1118
1119       function renderEventContent(element, p) {
1120
1121         var event = getSemantic(element);
1122         var isThrowing = isThrowEvent(event);
1123
1124         if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {
1125           return renderer('bpmn:MessageEventDefinition')(p, element, isThrowing);
1126         }
1127
1128         if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {
1129           return renderer('bpmn:TimerEventDefinition')(p, element, isThrowing);
1130         }
1131
1132         if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {
1133           return renderer('bpmn:ConditionalEventDefinition')(p, element);
1134         }
1135
1136         if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {
1137           return renderer('bpmn:SignalEventDefinition')(p, element, isThrowing);
1138         }
1139
1140         if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
1141           isTypedEvent(event, 'bpmn:TerminateEventDefinition', {
1142             parallelMultiple: false
1143           })) {
1144           return renderer('bpmn:MultipleEventDefinition')(p, element, isThrowing);
1145         }
1146
1147         if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
1148           isTypedEvent(event, 'bpmn:TerminateEventDefinition', {
1149             parallelMultiple: true
1150           })) {
1151           return renderer('bpmn:ParallelMultipleEventDefinition')(p, element, isThrowing);
1152         }
1153
1154         if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {
1155           return renderer('bpmn:EscalationEventDefinition')(p, element, isThrowing);
1156         }
1157
1158         if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {
1159           return renderer('bpmn:LinkEventDefinition')(p, element, isThrowing);
1160         }
1161
1162         if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {
1163           return renderer('bpmn:ErrorEventDefinition')(p, element, isThrowing);
1164         }
1165
1166         if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {
1167           return renderer('bpmn:CancelEventDefinition')(p, element, isThrowing);
1168         }
1169
1170         if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {
1171           return renderer('bpmn:CompensateEventDefinition')(p, element, isThrowing);
1172         }
1173
1174         if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {
1175           return renderer('bpmn:TerminateEventDefinition')(p, element, isThrowing);
1176         }
1177
1178         return null;
1179       }
1180
1181       function renderLabel(p, label, options) {
1182         return textUtil.createText(p, label || '', options).addClass('djs-label');
1183       }
1184
1185       function renderEmbeddedLabel(p, element, align) {
1186         var semantic = getSemantic(element);
1187         return renderLabel(p, semantic.name, {
1188           box: element,
1189           align: align,
1190           padding: 5
1191         });
1192       }
1193
1194       function renderExternalLabel(p, element, align) {
1195         var semantic = getSemantic(element);
1196
1197         if (!semantic.name) {
1198           element.hidden = true;
1199         }
1200
1201         return renderLabel(p, semantic.name, {
1202           box: element,
1203           align: align,
1204           style: {
1205             fontSize: '11px'
1206           }
1207         });
1208       }
1209
1210       function renderLaneLabel(p, text, element) {
1211         var textBox = renderLabel(p, text, {
1212           box: {
1213             height: 30,
1214             width: element.height
1215           },
1216           align: 'center-middle'
1217         });
1218
1219         var top = -1 * element.height;
1220         textBox.transform(
1221           'rotate(270) ' +
1222           'translate(' + top + ',' + 0 + ')'
1223         );
1224       }
1225
1226       function createPathFromConnection(connection) {
1227         var waypoints = connection.waypoints;
1228
1229         var pathData = 'm  ' + waypoints[0].x + ',' + waypoints[0].y;
1230         for (var i = 1; i < waypoints.length; i++) {
1231           pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';
1232         }
1233         return pathData;
1234       }
1235
1236       var handlers = {
1237         'bpmn:Event': function(p, element, attrs) {
1238           return drawCircle(p, element.width, element.height, attrs);
1239         },
1240         'bpmn:StartEvent': function(p, element) {
1241           var attrs = {};
1242           var semantic = getSemantic(element);
1243
1244           if (!semantic.isInterrupting) {
1245             attrs = {
1246               strokeDasharray: '6',
1247               strokeLinecap: 'round'
1248             };
1249           }
1250
1251           var circle = renderer('bpmn:Event')(p, element, attrs);
1252
1253           renderEventContent(element, p);
1254
1255           return circle;
1256         },
1257
1258         'bpmn:MultiBranchConnector': function(p, element) {
1259           var attrs = {};
1260           element.height = 80;
1261           element.width = 80;
1262           var semantic = getSemantic(element);
1263
1264           if (!semantic.isInterrupting) {
1265             attrs = {
1266               strokeDasharray: '6',
1267               strokeLinecap: 'round'
1268             };
1269           }
1270
1271           var circle = renderer('bpmn:Event')(p, element, attrs);
1272           var height = element.height / 2;
1273           var width = element.width / 2;
1274           var value = Math.round((height + width) / 4);
1275           drawLine(p, [{
1276             x: 0,
1277             y: Math.round(element.height / 2)
1278           }, {
1279             x: element.width,
1280             y: Math.round(element.height / 2)
1281           }]);
1282           drawLine(p, [{
1283             x: Math.round(element.width / 2),
1284             y: 0
1285           }, {
1286             x: Math.round(element.width / 2),
1287             y: element.height
1288           }]);
1289           renderEventContent(element, p);
1290
1291           return circle;
1292         },
1293         'bpmn:ParentReturn': function(p, element) {
1294           var attrs = {};
1295           var semantic = getSemantic(element);
1296
1297           if (!semantic.isInterrupting) {
1298             attrs = {
1299               strokeDasharray: '6',
1300               strokeLinecap: 'round'
1301             };
1302           }
1303
1304           // var circle = renderer('bpmn:Event')(p, element, attrs);
1305           drawLine(p, [{
1306             x: 0,
1307             y: 0
1308           }, {
1309             x: 0,
1310             y: element.height / 2
1311           }]);
1312           drawLine(p, [{
1313             x: 0,
1314             y: element.height / 2
1315           }, {
1316             x: element.width / 2,
1317             y: element.height
1318           }]);
1319           drawLine(p, [{
1320             x: 0,
1321             y: 0
1322           }, {
1323             x: element.width,
1324             y: 0
1325           }]);
1326           drawLine(p, [{
1327             x: element.width,
1328             y: 0
1329           }, {
1330             x: element.width,
1331             y: element.height / 2
1332           }]);
1333           drawLine(p, [
1334
1335             {
1336               x: element.width,
1337               y: element.height / 2
1338             }, {
1339               x: element.width / 2,
1340               y: element.height
1341             }
1342           ]);
1343           var text2 = getSemantic(element).name;
1344           renderLabel(p, text2, {
1345             box: element,
1346             align: 'center'
1347           });
1348           renderEventContent(element, p);
1349
1350           return p;
1351         },
1352         'bpmn:SubProcessCall': function(p, element) {
1353           var lane = renderer('bpmn:Lane')(p, element, {
1354             fill: 'White'
1355           });
1356
1357           var expandedPool = DiUtil.isExpanded(element);
1358
1359           if (expandedPool) {
1360             drawLine(p, [{
1361               x: 20,
1362               y: 0
1363             }, {
1364               x: 20,
1365               y: element.height
1366             }]);
1367
1368             drawLine(p, [{
1369               x: element.width - 20,
1370               y: 0
1371             }, {
1372               x: element.width - 20,
1373               y: element.height
1374             }]);
1375
1376             var text2 = getSemantic(element).name;
1377             renderLabel(p, text2, {
1378               box: element,
1379               align: 'center-middle'
1380             });
1381
1382             /*
1383              * var text = getSemantic(element).name; renderLaneLabel(p,
1384              * text, element);
1385              */
1386           } else {
1387             // Collapsed pool draw text inline
1388             var text2 = getSemantic(element).name;
1389             renderLabel(p, text2, {
1390               box: element,
1391               align: 'center-middle'
1392             });
1393           }
1394
1395           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1396
1397           if (participantMultiplicity) {
1398             renderer('ParticipantMultiplicityMarker')(p, element);
1399           }
1400
1401           return lane;
1402
1403
1404         },
1405         'bpmn:InitiateProcess': function(p, element) {
1406           var lane = renderer('bpmn:Lane')(p, element, {
1407             fill: 'White'
1408           });
1409
1410           var expandedPool = DiUtil.isExpanded(element);
1411           openDiagram(newDiagramXML);
1412           if (expandedPool) {
1413             drawLine(p, [{
1414               x: 0,
1415               y: 20
1416             }, {
1417               x: element.width,
1418               y: 20
1419             }]);
1420
1421             drawLine(p, [{
1422               x: 20,
1423               y: 0
1424             }, {
1425               x: 20,
1426               y: element.height
1427             }]);
1428             var text2 = getSemantic(element).name;
1429             renderLabel(p, text2, {
1430               box: element,
1431               align: 'center-middle'
1432             });
1433
1434           } else {
1435             // Collapsed pool draw text inline
1436             var text2 = getSemantic(element).name;
1437             renderLabel(p, text2, {
1438               box: element,
1439               align: 'center-middle'
1440             });
1441           }
1442
1443           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1444
1445           if (participantMultiplicity) {
1446             renderer('ParticipantMultiplicityMarker')(p, element);
1447           }
1448
1449           return lane;
1450
1451
1452         },
1453         'bpmn:VesCollector': function(p, element) {
1454           var lane = renderer('bpmn:Lane')(p, element, {
1455             fill: 'White'
1456           });
1457
1458           var expandedPool = DiUtil.isExpanded(element);
1459
1460           if (expandedPool) {
1461             drawLine(p, [{
1462               x: element.width,
1463               y: 80
1464             }, {
1465               x: element.width,
1466               y: 20
1467             }]);
1468
1469             drawLine(p, [{
1470               x: 20,
1471               y: 0
1472             }, {
1473               x: 20,
1474               y: element.height
1475             }]);
1476
1477             textUtil.createText(p, "V", {
1478               align: 'left-top',
1479               'padding': {
1480                 top: 0,
1481                 left: 5,
1482                 right: element.width - 20,
1483                 bottom: 0
1484               }
1485             });
1486             textUtil.createText(p, "E", {
1487               align: 'left-top',
1488               'padding': {
1489                 top: 12,
1490                 left: 5,
1491                 right: element.width - 20,
1492                 bottom: 0
1493               }
1494             });
1495             textUtil.createText(p, "S", {
1496               align: 'left-top',
1497               'padding': {
1498                 top: 24,
1499                 left: 5,
1500                 right: element.width - 20,
1501                 bottom: 0
1502               }
1503             });
1504
1505             var text2 = getSemantic(element).name;
1506             if (text2 == undefined) {
1507               text2 = 'VesCollector';
1508             }
1509
1510             renderLabel(p, text2, {
1511               box: element,
1512               align: 'center-middle'
1513             });
1514
1515           } else {
1516             // Collapsed pool draw text inline
1517             var text2 = getSemantic(element).name;
1518             renderLabel(p, text2, {
1519               box: element,
1520               align: 'center-middle'
1521             });
1522           }
1523
1524           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1525
1526           if (participantMultiplicity) {
1527             renderer('ParticipantMultiplicityMarker')(p, element);
1528           }
1529
1530           return lane;
1531         },
1532
1533         'bpmn:Holmes': function(p, element) {
1534           var lane = renderer('bpmn:Lane')(p, element, {
1535             fill: 'White'
1536           });
1537
1538           var expandedPool = DiUtil.isExpanded(element);
1539
1540           var instanceName = getSemantic(element).name;
1541           if (expandedPool) {
1542
1543             if (instanceName == undefined) {
1544               instanceName = 'Holmes';
1545             }
1546
1547             // add holmes 'icon'
1548             var attrs = computeStyle({}, {
1549               stroke: 'black',
1550               strokeWidth: 1,
1551               fill: 'white'
1552             });
1553             p.circle(15, 15, 10).attr(attrs)
1554             textUtil.createText(p, "H", {
1555               align: 'left-top',
1556               'padding': {
1557                 top: 6,
1558                 left: 11
1559               }
1560             });
1561           }
1562
1563           renderLabel(p, instanceName, {
1564             box: element,
1565             align: 'center-middle'
1566           });
1567
1568           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1569
1570           if (participantMultiplicity) {
1571             renderer('ParticipantMultiplicityMarker')(p, element);
1572           }
1573
1574           return lane;
1575         },
1576
1577         'bpmn:TCA': function(p, element) {
1578           var lane = renderer('bpmn:Lane')(p, element, {
1579             fill: 'White'
1580           });
1581
1582           var expandedPool = DiUtil.isExpanded(element);
1583
1584           if (expandedPool) {
1585
1586
1587             drawLine(p, [{
1588               x: 0,
1589               y: element.height - 20
1590             }, {
1591               x: element.width,
1592               y: element.height - 20
1593             }]);
1594             var text2 = getSemantic(element).name;
1595             if (text2 == undefined) {
1596               text2 = 'TCA';
1597             }
1598             renderLabel(p, text2, {
1599               box: element,
1600               align: 'center-middle'
1601             });
1602
1603           } else {
1604             // Collapsed pool draw text inline
1605             var text2 = getSemantic(element).name;
1606             renderLabel(p, text2, {
1607               box: element,
1608               align: 'center-middle'
1609             });
1610           }
1611
1612           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1613
1614           if (participantMultiplicity) {
1615             renderer('ParticipantMultiplicityMarker')(p, element);
1616           }
1617
1618           return lane;
1619
1620
1621         },
1622         'bpmn:GOC': function(p, element) {
1623           var lane = renderer('bpmn:Lane')(p, element, {
1624             fill: 'White'
1625           });
1626
1627           var expandedPool = DiUtil.isExpanded(element);
1628
1629           if (expandedPool) {
1630
1631
1632
1633             drawLine(p, [{
1634               x: element.width / 2,
1635               y: element.height
1636             }, {
1637               x: element.width,
1638               y: element.height / 2
1639             }]);
1640             var text2 = getSemantic(element).name;
1641             if (text2 == undefined) {
1642               text2 = 'GOC';
1643             }
1644             renderLabel(p, text2, {
1645               box: element,
1646               align: 'center-middle'
1647             });
1648
1649           } else {
1650             // Collapsed pool draw text inline
1651             var text2 = getSemantic(element).name;
1652             renderLabel(p, text2, {
1653               box: element,
1654               align: 'center-middle'
1655             });
1656           }
1657
1658           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1659
1660           if (participantMultiplicity) {
1661             renderer('ParticipantMultiplicityMarker')(p, element);
1662           }
1663
1664           return lane;
1665
1666
1667         },
1668         'bpmn:Policy': function(p, element) {
1669           var lane = renderer('bpmn:Lane')(p, element, {
1670             fill: 'White'
1671           });
1672
1673           var expandedPool = DiUtil.isExpanded(element);
1674
1675           if (expandedPool) {
1676
1677
1678
1679             drawLine(p, [{
1680               x: 0,
1681               y: element.height / 2
1682             }, {
1683               x: element.width / 2,
1684               y: 0
1685             }]);
1686             var text2 = getSemantic(element).name;
1687             if (text2 == undefined) {
1688               text2 = 'Policy';
1689             }
1690             renderLabel(p, text2, {
1691               box: element,
1692               align: 'center-middle'
1693             });
1694
1695           } else {
1696             // Collapsed pool draw text inline
1697             var text2 = getSemantic(element).name;
1698             renderLabel(p, text2, {
1699               box: element,
1700               align: 'center-middle'
1701             });
1702           }
1703
1704           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1705
1706           if (participantMultiplicity) {
1707             renderer('ParticipantMultiplicityMarker')(p, element);
1708           }
1709
1710           return lane;
1711
1712
1713         },
1714         'bpmn:MessageEventDefinition': function(p, element, isThrowing) {
1715           var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
1716             xScaleFactor: 0.9,
1717             yScaleFactor: 0.9,
1718             containerWidth: element.width,
1719             containerHeight: element.height,
1720             position: {
1721               mx: 0.235,
1722               my: 0.315
1723             }
1724           });
1725
1726           var fill = isThrowing ? 'black' : 'white';
1727           var stroke = isThrowing ? 'white' : 'black';
1728
1729           var messagePath = drawPath(p, pathData, {
1730             strokeWidth: 1,
1731             fill: fill,
1732             stroke: stroke
1733           });
1734
1735           return messagePath;
1736         },
1737         'bpmn:TimerEventDefinition': function(p, element) {
1738
1739           var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {
1740             strokeWidth: 2
1741           });
1742
1743           var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
1744             xScaleFactor: 0.75,
1745             yScaleFactor: 0.75,
1746             containerWidth: element.width,
1747             containerHeight: element.height,
1748             position: {
1749               mx: 0.5,
1750               my: 0.5
1751             }
1752           });
1753
1754           drawPath(p, pathData, {
1755             strokeWidth: 2,
1756             strokeLinecap: 'square'
1757           });
1758
1759           for (var i = 0; i < 12; i++) {
1760
1761             var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
1762               xScaleFactor: 0.75,
1763               yScaleFactor: 0.75,
1764               containerWidth: element.width,
1765               containerHeight: element.height,
1766               position: {
1767                 mx: 0.5,
1768                 my: 0.5
1769               }
1770             });
1771
1772             var width = element.width / 2;
1773             var height = element.height / 2;
1774
1775             drawPath(p, linePathData, {
1776               strokeWidth: 1,
1777               strokeLinecap: 'square',
1778               transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
1779             });
1780           }
1781
1782           return circle;
1783         },
1784         'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {
1785           var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
1786             xScaleFactor: 1,
1787             yScaleFactor: 1,
1788             containerWidth: event.width,
1789             containerHeight: event.height,
1790             position: {
1791               mx: 0.5,
1792               my: 0.555
1793             }
1794           });
1795
1796           var fill = isThrowing ? 'black' : 'none';
1797
1798           return drawPath(p, pathData, {
1799             strokeWidth: 1,
1800             fill: fill
1801           });
1802         },
1803         'bpmn:ConditionalEventDefinition': function(p, event) {
1804           var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
1805             xScaleFactor: 1,
1806             yScaleFactor: 1,
1807             containerWidth: event.width,
1808             containerHeight: event.height,
1809             position: {
1810               mx: 0.5,
1811               my: 0.222
1812             }
1813           });
1814
1815           return drawPath(p, pathData, {
1816             strokeWidth: 1
1817           });
1818         },
1819         'bpmn:LinkEventDefinition': function(p, event, isThrowing) {
1820           var pathData = pathMap.getScaledPath('EVENT_LINK', {
1821             xScaleFactor: 1,
1822             yScaleFactor: 1,
1823             containerWidth: event.width,
1824             containerHeight: event.height,
1825             position: {
1826               mx: 0.57,
1827               my: 0.263
1828             }
1829           });
1830
1831           var fill = isThrowing ? 'black' : 'none';
1832
1833           return drawPath(p, pathData, {
1834             strokeWidth: 1,
1835             fill: fill
1836           });
1837         },
1838         'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {
1839           var pathData = pathMap.getScaledPath('EVENT_ERROR', {
1840             xScaleFactor: 1.1,
1841             yScaleFactor: 1.1,
1842             containerWidth: event.width,
1843             containerHeight: event.height,
1844             position: {
1845               mx: 0.2,
1846               my: 0.722
1847             }
1848           });
1849
1850           var fill = isThrowing ? 'black' : 'none';
1851
1852           return drawPath(p, pathData, {
1853             strokeWidth: 1,
1854             fill: fill
1855           });
1856         },
1857         'bpmn:CancelEventDefinition': function(p, event, isThrowing) {
1858           var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
1859             xScaleFactor: 1.0,
1860             yScaleFactor: 1.0,
1861             containerWidth: event.width,
1862             containerHeight: event.height,
1863             position: {
1864               mx: 0.638,
1865               my: -0.055
1866             }
1867           });
1868
1869           var fill = isThrowing ? 'black' : 'none';
1870
1871           return drawPath(p, pathData, {
1872             strokeWidth: 1,
1873             fill: fill
1874           }).transform('rotate(45)');
1875         },
1876         'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {
1877           var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
1878             xScaleFactor: 1,
1879             yScaleFactor: 1,
1880             containerWidth: event.width,
1881             containerHeight: event.height,
1882             position: {
1883               mx: 0.201,
1884               my: 0.472
1885             }
1886           });
1887
1888           var fill = isThrowing ? 'black' : 'none';
1889
1890           return drawPath(p, pathData, {
1891             strokeWidth: 1,
1892             fill: fill
1893           });
1894         },
1895         'bpmn:SignalEventDefinition': function(p, event, isThrowing) {
1896           var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
1897             xScaleFactor: 0.9,
1898             yScaleFactor: 0.9,
1899             containerWidth: event.width,
1900             containerHeight: event.height,
1901             position: {
1902               mx: 0.5,
1903               my: 0.2
1904             }
1905           });
1906
1907           var fill = isThrowing ? 'black' : 'none';
1908
1909           return drawPath(p, pathData, {
1910             strokeWidth: 1,
1911             fill: fill
1912           });
1913         },
1914         'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {
1915           var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
1916             xScaleFactor: 1.1,
1917             yScaleFactor: 1.1,
1918             containerWidth: event.width,
1919             containerHeight: event.height,
1920             position: {
1921               mx: 0.222,
1922               my: 0.36
1923             }
1924           });
1925
1926           var fill = isThrowing ? 'black' : 'none';
1927
1928           return drawPath(p, pathData, {
1929             strokeWidth: 1,
1930             fill: fill
1931           });
1932         },
1933         'bpmn:ParallelMultipleEventDefinition': function(p, event) {
1934           var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
1935             xScaleFactor: 1.2,
1936             yScaleFactor: 1.2,
1937             containerWidth: event.width,
1938             containerHeight: event.height,
1939             position: {
1940               mx: 0.458,
1941               my: 0.194
1942             }
1943           });
1944
1945           return drawPath(p, pathData, {
1946             strokeWidth: 1
1947           });
1948         },
1949         'bpmn:EndEvent': function(p, element) {
1950           var circle = renderer('bpmn:Event')(p, element, {
1951             strokeWidth: 4
1952           });
1953
1954           renderEventContent(element, p, true);
1955
1956           return circle;
1957         },
1958         'bpmn:TerminateEventDefinition': function(p, element) {
1959           var circle = drawCircle(p, element.width, element.height, 8, {
1960             strokeWidth: 4,
1961             fill: 'black'
1962           });
1963
1964           return circle;
1965         },
1966         'bpmn:IntermediateEvent': function(p, element) {
1967           var outer = renderer('bpmn:Event')(p, element, {
1968             strokeWidth: 1
1969           });
1970           /* inner */
1971           drawCircle(p, element.width, element.height, INNER_OUTER_DIST, {
1972             strokeWidth: 1,
1973             fill: 'none'
1974           });
1975
1976           renderEventContent(element, p);
1977
1978           return outer;
1979         },
1980         'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
1981         'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
1982
1983         'bpmn:Activity': function(p, element, attrs) {
1984           return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);
1985         },
1986
1987         'bpmn:Task': function(p, element, attrs) {
1988           var rect = renderer('bpmn:Activity')(p, element, attrs);
1989           renderEmbeddedLabel(p, element, 'center-middle');
1990           attachTaskMarkers(p, element);
1991           return rect;
1992         },
1993         'bpmn:ServiceTask': function(p, element) {
1994           var task = renderer('bpmn:Task')(p, element);
1995
1996           var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
1997             abspos: {
1998               x: 12,
1999               y: 18
2000             }
2001           });
2002
2003           /* service bg */
2004           drawPath(p, pathDataBG, {
2005             strokeWidth: 1,
2006             fill: 'none'
2007           });
2008
2009           var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {
2010             abspos: {
2011               x: 17.2,
2012               y: 18
2013             }
2014           });
2015
2016           /* service fill */
2017           drawPath(p, fillPathData, {
2018             strokeWidth: 0,
2019             stroke: 'none',
2020             fill: 'white'
2021           });
2022
2023           var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
2024             abspos: {
2025               x: 17,
2026               y: 22
2027             }
2028           });
2029
2030           /* service */
2031           drawPath(p, pathData, {
2032             strokeWidth: 1,
2033             fill: 'white'
2034           });
2035
2036           return task;
2037         },
2038         'bpmn:UserTask': function(p, element) {
2039           var task = renderer('bpmn:Task')(p, element);
2040
2041           var x = 15;
2042           var y = 12;
2043
2044           var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {
2045             abspos: {
2046               x: x,
2047               y: y
2048             }
2049           });
2050
2051           /* user path */
2052           drawPath(p, pathData, {
2053             strokeWidth: 0.5,
2054             fill: 'none'
2055           });
2056
2057           var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
2058             abspos: {
2059               x: x,
2060               y: y
2061             }
2062           });
2063
2064           /* user2 path */
2065           drawPath(p, pathData2, {
2066             strokeWidth: 0.5,
2067             fill: 'none'
2068           });
2069
2070           var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
2071             abspos: {
2072               x: x,
2073               y: y
2074             }
2075           });
2076
2077           /* user3 path */
2078           drawPath(p, pathData3, {
2079             strokeWidth: 0.5,
2080             fill: 'black'
2081           });
2082
2083           return task;
2084         },
2085         'bpmn:ManualTask': function(p, element) {
2086           var task = renderer('bpmn:Task')(p, element);
2087
2088           var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
2089             abspos: {
2090               x: 17,
2091               y: 15
2092             }
2093           });
2094
2095           /* manual path */
2096           drawPath(p, pathData, {
2097             strokeWidth: 0.25,
2098             fill: 'white',
2099             stroke: 'black'
2100           });
2101
2102           return task;
2103         },
2104         'bpmn:SendTask': function(p, element) {
2105           var task = renderer('bpmn:Task')(p, element);
2106
2107           var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
2108             xScaleFactor: 1,
2109             yScaleFactor: 1,
2110             containerWidth: 21,
2111             containerHeight: 14,
2112             position: {
2113               mx: 0.285,
2114               my: 0.357
2115             }
2116           });
2117
2118           /* send path */
2119           drawPath(p, pathData, {
2120             strokeWidth: 1,
2121             fill: 'black',
2122             stroke: 'white'
2123           });
2124
2125           return task;
2126         },
2127         'bpmn:ReceiveTask': function(p, element) {
2128           var semantic = getSemantic(element);
2129
2130           var task = renderer('bpmn:Task')(p, element);
2131           var pathData;
2132
2133           if (semantic.instantiate) {
2134             drawCircle(p, 28, 28, 20 * 0.22, {
2135               strokeWidth: 1
2136             });
2137
2138             pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
2139               abspos: {
2140                 x: 7.77,
2141                 y: 9.52
2142               }
2143             });
2144           } else {
2145
2146             pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
2147               xScaleFactor: 0.9,
2148               yScaleFactor: 0.9,
2149               containerWidth: 21,
2150               containerHeight: 14,
2151               position: {
2152                 mx: 0.3,
2153                 my: 0.4
2154               }
2155             });
2156           }
2157
2158           /* receive path */
2159           drawPath(p, pathData, {
2160             strokeWidth: 1
2161           });
2162
2163           return task;
2164         },
2165         'bpmn:ScriptTask': function(p, element) {
2166           var task = renderer('bpmn:Task')(p, element);
2167
2168           var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
2169             abspos: {
2170               x: 15,
2171               y: 20
2172             }
2173           });
2174
2175           /* script path */
2176           drawPath(p, pathData, {
2177             strokeWidth: 1
2178           });
2179
2180           return task;
2181         },
2182         'bpmn:BusinessRuleTask': function(p, element) {
2183           var task = renderer('bpmn:Task')(p, element);
2184
2185           var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
2186             abspos: {
2187               x: 8,
2188               y: 8
2189             }
2190           });
2191
2192           var businessHeaderPath = drawPath(p, headerPathData);
2193           businessHeaderPath.attr({
2194             strokeWidth: 1,
2195             fill: 'AAA'
2196           });
2197
2198           var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
2199             abspos: {
2200               x: 8,
2201               y: 8
2202             }
2203           });
2204
2205           var businessPath = drawPath(p, headerData);
2206           businessPath.attr({
2207             strokeWidth: 1
2208           });
2209
2210           return task;
2211         },
2212         'bpmn:SubProcess': function(p, element, attrs) {
2213           var rect = renderer('bpmn:Activity')(p, element, attrs);
2214
2215           var semantic = getSemantic(element);
2216
2217           var expanded = DiUtil.isExpanded(semantic);
2218
2219           var isEventSubProcess = !!semantic.triggeredByEvent;
2220           if (isEventSubProcess) {
2221             rect.attr({
2222               strokeDasharray: '1,2'
2223             });
2224           }
2225
2226           renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');
2227
2228           if (expanded) {
2229             attachTaskMarkers(p, element);
2230           } else {
2231             attachTaskMarkers(p, element, ['SubProcessMarker']);
2232           }
2233
2234           return rect;
2235         },
2236         'bpmn:AdHocSubProcess': function(p, element) {
2237           return renderer('bpmn:SubProcess')(p, element);
2238         },
2239         'bpmn:Transaction': function(p, element) {
2240           var outer = renderer('bpmn:SubProcess')(p, element);
2241
2242           var innerAttrs = styles.style(['no-fill', 'no-events']);
2243
2244           /* inner path */
2245           drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);
2246
2247           return outer;
2248         },
2249         'bpmn:CallActivity': function(p, element) {
2250           return renderer('bpmn:Task')(p, element, {
2251             strokeWidth: 5
2252           });
2253         },
2254         'bpmn:Participant': function(p, element) {
2255
2256           var lane = renderer('bpmn:Lane')(p, element, {
2257             fill: 'White'
2258           });
2259
2260           var expandedPool = DiUtil.isExpanded(element);
2261
2262           if (expandedPool) {
2263             drawLine(p, [{
2264               x: 30,
2265               y: 0
2266             }, {
2267               x: 30,
2268               y: element.height
2269             }]);
2270             var text = getSemantic(element).name;
2271             renderLaneLabel(p, text, element);
2272           } else {
2273             // Collapsed pool draw text inline
2274             var text2 = getSemantic(element).name;
2275             renderLabel(p, text2, {
2276               box: element,
2277               align: 'center-middle'
2278             });
2279           }
2280
2281           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
2282
2283           if (participantMultiplicity) {
2284             renderer('ParticipantMultiplicityMarker')(p, element);
2285           }
2286
2287           return lane;
2288         },
2289         'bpmn:Lane': function(p, element, attrs) {
2290           var rect = drawRect(p, element.width, element.height, 0, attrs || {
2291             fill: 'none'
2292           });
2293
2294           var semantic = getSemantic(element);
2295
2296           if (semantic.$type === 'bpmn:Lane') {
2297             var text = semantic.name;
2298             renderLaneLabel(p, text, element);
2299           }
2300
2301           return rect;
2302         },
2303         'bpmn:InclusiveGateway': function(p, element) {
2304           var diamond = drawDiamond(p, element.width, element.height);
2305
2306           /* circle path */
2307           drawCircle(p, element.width, element.height, element.height * 0.24, {
2308             strokeWidth: 2.5,
2309             fill: 'none'
2310           });
2311
2312           return diamond;
2313         },
2314         'bpmn:ExclusiveGateway': function(p, element) {
2315           var diamond = drawDiamond(p, element.width, element.height);
2316           renderEmbeddedLabel(p, element, 'center-middle');
2317
2318           var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
2319             xScaleFactor: 0.4,
2320             yScaleFactor: 0.4,
2321             containerWidth: element.width,
2322             containerHeight: element.height,
2323             position: {
2324               mx: 0.32,
2325               my: 0.3
2326             }
2327           });
2328
2329           if (!!(getDi(element).isMarkerVisible)) {
2330             drawPath(p, pathData, {
2331               strokeWidth: 1,
2332               fill: 'black'
2333             });
2334           }
2335
2336           return diamond;
2337         },
2338         'bpmn:ComplexGateway': function(p, element) {
2339           var diamond = drawDiamond(p, element.width, element.height);
2340
2341           var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
2342             xScaleFactor: 0.5,
2343             yScaleFactor: 0.5,
2344             containerWidth: element.width,
2345             containerHeight: element.height,
2346             position: {
2347               mx: 0.46,
2348               my: 0.26
2349             }
2350           });
2351
2352           /* complex path */
2353           drawPath(p, pathData, {
2354             strokeWidth: 1,
2355             fill: 'black'
2356           });
2357
2358           return diamond;
2359         },
2360         'bpmn:ParallelGateway': function(p, element) {
2361           var diamond = drawDiamond(p, element.width, element.height);
2362
2363           var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
2364             xScaleFactor: 0.6,
2365             yScaleFactor: 0.6,
2366             containerWidth: element.width,
2367             containerHeight: element.height,
2368             position: {
2369               mx: 0.46,
2370               my: 0.2
2371             }
2372           });
2373
2374           /* parallel path */
2375           drawPath(p, pathData, {
2376             strokeWidth: 1,
2377             fill: 'black'
2378           });
2379
2380           return diamond;
2381         },
2382         'bpmn:EventBasedGateway': function(p, element) {
2383
2384           var semantic = getSemantic(element);
2385
2386           var diamond = drawDiamond(p, element.width, element.height);
2387
2388           /* outer circle path */
2389           drawCircle(p, element.width, element.height, element.height * 0.20, {
2390             strokeWidth: 1,
2391             fill: 'none'
2392           });
2393
2394           var type = semantic.eventGatewayType;
2395           var instantiate = !!semantic.instantiate;
2396
2397           function drawEvent() {
2398
2399             var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {
2400               xScaleFactor: 0.18,
2401               yScaleFactor: 0.18,
2402               containerWidth: element.width,
2403               containerHeight: element.height,
2404               position: {
2405                 mx: 0.36,
2406                 my: 0.44
2407               }
2408             });
2409
2410             /* event path */
2411             drawPath(p, pathData, {
2412               strokeWidth: 2,
2413               fill: 'none'
2414             });
2415           }
2416
2417           if (type === 'Parallel') {
2418
2419             var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
2420               xScaleFactor: 0.4,
2421               yScaleFactor: 0.4,
2422               containerWidth: element.width,
2423               containerHeight: element.height,
2424               position: {
2425                 mx: 0.474,
2426                 my: 0.296
2427               }
2428             });
2429
2430             var parallelPath = drawPath(p, pathData);
2431             parallelPath.attr({
2432               strokeWidth: 1,
2433               fill: 'none'
2434             });
2435           } else if (type === 'Exclusive') {
2436
2437             if (!instantiate) {
2438               var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);
2439               innerCircle.attr({
2440                 strokeWidth: 1,
2441                 fill: 'none'
2442               });
2443             }
2444
2445             drawEvent();
2446           }
2447
2448
2449           return diamond;
2450         },
2451         'bpmn:Gateway': function(p, element) {
2452           var diamond = drawDiamond(p, element.width, element.height);
2453           renderEmbeddedLabel(p, element, 'center-middle');
2454
2455           return diamond;
2456         },
2457         'bpmn:SequenceFlow': function(p, element) {
2458           var pathData = createPathFromConnection(element);
2459           var path = drawPath(p, pathData, {
2460             strokeLinejoin: 'round',
2461             markerEnd: marker('sequenceflow-end')
2462           });
2463
2464           var sequenceFlow = getSemantic(element);
2465           var source = element.source.businessObject;
2466
2467           // conditional flow marker
2468           if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {
2469             path.attr({
2470               markerStart: marker('conditional-flow-marker')
2471             });
2472           }
2473
2474           // default marker
2475           if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {
2476             path.attr({
2477               markerStart: marker('conditional-default-flow-marker')
2478             });
2479           }
2480
2481           return path;
2482         },
2483         'bpmn:Association': function(p, element, attrs) {
2484
2485           attrs = assign({
2486             strokeDasharray: '1,6',
2487             strokeLinecap: 'round',
2488             strokeLinejoin: 'round'
2489           }, attrs || {});
2490
2491           // TODO(nre): style according to directed state
2492           return drawLine(p, element.waypoints, attrs);
2493         },
2494         'bpmn:DataInputAssociation': function(p, element) {
2495           return renderer('bpmn:Association')(p, element, {
2496             markerEnd: marker('data-association-end')
2497           });
2498         },
2499         'bpmn:DataOutputAssociation': function(p, element) {
2500           return renderer('bpmn:Association')(p, element, {
2501             markerEnd: marker('data-association-end')
2502           });
2503         },
2504         'bpmn:MessageFlow': function(p, element) {
2505
2506           var semantic = getSemantic(element),
2507             di = getDi(element);
2508
2509           var pathData = createPathFromConnection(element);
2510           var path = drawPath(p, pathData, {
2511             markerEnd: marker('messageflow-end'),
2512             markerStart: marker('messageflow-start'),
2513             strokeDasharray: '10, 12',
2514             strokeLinecap: 'round',
2515             strokeLinejoin: 'round',
2516             strokeWidth: '1.5px'
2517           });
2518
2519           if (semantic.messageRef) {
2520             var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
2521
2522             var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
2523               abspos: {
2524                 x: midPoint.x,
2525                 y: midPoint.y
2526               }
2527             });
2528
2529             var messageAttrs = {
2530               strokeWidth: 1
2531             };
2532
2533             if (di.messageVisibleKind === 'initiating') {
2534               messageAttrs.fill = 'white';
2535               messageAttrs.stroke = 'black';
2536             } else {
2537               messageAttrs.fill = '#888';
2538               messageAttrs.stroke = 'white';
2539             }
2540
2541             drawPath(p, markerPathData, messageAttrs);
2542           }
2543
2544           return path;
2545         },
2546         'bpmn:DataObject': function(p, element) {
2547           var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
2548             xScaleFactor: 1,
2549             yScaleFactor: 1,
2550             containerWidth: element.width,
2551             containerHeight: element.height,
2552             position: {
2553               mx: 0.474,
2554               my: 0.296
2555             }
2556           });
2557
2558           var elementObject = drawPath(p, pathData, {
2559             fill: 'white'
2560           });
2561
2562           var semantic = getSemantic(element);
2563
2564           if (isCollection(semantic)) {
2565             renderDataItemCollection(p, element);
2566           }
2567
2568           return elementObject;
2569         },
2570         'bpmn:DataObjectReference': as('bpmn:DataObject'),
2571         'bpmn:DataInput': function(p, element) {
2572
2573           var arrowPathData = pathMap.getRawPath('DATA_ARROW');
2574
2575           // page
2576           var elementObject = renderer('bpmn:DataObject')(p, element);
2577
2578           /* input arrow path */
2579           drawPath(p, arrowPathData, {
2580             strokeWidth: 1
2581           });
2582
2583           return elementObject;
2584         },
2585         'bpmn:DataOutput': function(p, element) {
2586           var arrowPathData = pathMap.getRawPath('DATA_ARROW');
2587
2588           // page
2589           var elementObject = renderer('bpmn:DataObject')(p, element);
2590
2591           /* output arrow path */
2592           drawPath(p, arrowPathData, {
2593             strokeWidth: 1,
2594             fill: 'black'
2595           });
2596
2597           return elementObject;
2598         },
2599         'bpmn:DataStoreReference': function(p, element) {
2600           var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {
2601             xScaleFactor: 1,
2602             yScaleFactor: 1,
2603             containerWidth: element.width,
2604             containerHeight: element.height,
2605             position: {
2606               mx: 0,
2607               my: 0.133
2608             }
2609           });
2610
2611           var elementStore = drawPath(p, DATA_STORE_PATH, {
2612             strokeWidth: 2,
2613             fill: 'white'
2614           });
2615
2616           return elementStore;
2617         },
2618         'bpmn:BoundaryEvent': function(p, element) {
2619
2620           var semantic = getSemantic(element),
2621             cancel = semantic.cancelActivity;
2622
2623           var attrs = {
2624             strokeLinecap: 'round',
2625             strokeWidth: 1
2626           };
2627
2628           if (!cancel) {
2629             attrs.strokeDasharray = '6';
2630           }
2631
2632           var outer = renderer('bpmn:Event')(p, element, attrs);
2633           /* inner path */
2634           drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);
2635
2636           renderEventContent(element, p);
2637
2638           return outer;
2639         },
2640         'bpmn:Group': function(p, element) {
2641           return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {
2642             strokeWidth: 1,
2643             strokeDasharray: '8,3,1,3',
2644             fill: 'none',
2645             pointerEvents: 'none'
2646           });
2647         },
2648         'label': function(p, element) {
2649           return renderExternalLabel(p, element, '');
2650         },
2651         'bpmn:TextAnnotation': function(p, element) {
2652           var style = {
2653             'fill': 'none',
2654             'stroke': 'none'
2655           };
2656           var textElement = drawRect(p, element.width, element.height, 0, 0, style);
2657           var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
2658             xScaleFactor: 1,
2659             yScaleFactor: 1,
2660             containerWidth: element.width,
2661             containerHeight: element.height,
2662             position: {
2663               mx: 0.0,
2664               my: 0.0
2665             }
2666           });
2667           drawPath(p, textPathData);
2668
2669           var text = getSemantic(element).text || '';
2670           renderLabel(p, text, {
2671             box: element,
2672             align: 'left-middle',
2673             padding: 5
2674           });
2675
2676           return textElement;
2677         },
2678         'ParticipantMultiplicityMarker': function(p, element) {
2679           var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
2680             xScaleFactor: 1,
2681             yScaleFactor: 1,
2682             containerWidth: element.width,
2683             containerHeight: element.height,
2684             position: {
2685               mx: ((element.width / 2) / element.width),
2686               my: (element.height - 15) / element.height
2687             }
2688           });
2689
2690           drawPath(p, subProcessPath);
2691         },
2692         'SubProcessMarker': function(p, element) {
2693           var markerRect = drawRect(p, 14, 14, 0, {
2694             strokeWidth: 1
2695           });
2696
2697           // Process marker is placed in the middle of the box
2698           // therefore fixed values can be used here
2699           markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');
2700
2701           var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
2702             xScaleFactor: 1.5,
2703             yScaleFactor: 1.5,
2704             containerWidth: element.width,
2705             containerHeight: element.height,
2706             position: {
2707               mx: (element.width / 2 - 7.5) / element.width,
2708               my: (element.height - 20) / element.height
2709             }
2710           });
2711
2712           drawPath(p, subProcessPath);
2713         },
2714         'ParallelMarker': function(p, element, position) {
2715           var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
2716             xScaleFactor: 1,
2717             yScaleFactor: 1,
2718             containerWidth: element.width,
2719             containerHeight: element.height,
2720             position: {
2721               mx: ((element.width / 2 + position.parallel) / element.width),
2722               my: (element.height - 20) / element.height
2723             }
2724           });
2725           drawPath(p, subProcessPath);
2726         },
2727         'SequentialMarker': function(p, element, position) {
2728           var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
2729             xScaleFactor: 1,
2730             yScaleFactor: 1,
2731             containerWidth: element.width,
2732             containerHeight: element.height,
2733             position: {
2734               mx: ((element.width / 2 + position.seq) / element.width),
2735               my: (element.height - 19) / element.height
2736             }
2737           });
2738           drawPath(p, sequentialPath);
2739         },
2740         'CompensationMarker': function(p, element, position) {
2741           var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {
2742             xScaleFactor: 1,
2743             yScaleFactor: 1,
2744             containerWidth: element.width,
2745             containerHeight: element.height,
2746             position: {
2747               mx: ((element.width / 2 + position.compensation) / element.width),
2748               my: (element.height - 13) / element.height
2749             }
2750           });
2751           drawPath(p, compensationPath, {
2752             strokeWidth: 1
2753           });
2754         },
2755         'LoopMarker': function(p, element, position) {
2756           var loopPath = pathMap.getScaledPath('MARKER_LOOP', {
2757             xScaleFactor: 1,
2758             yScaleFactor: 1,
2759             containerWidth: element.width,
2760             containerHeight: element.height,
2761             position: {
2762               mx: ((element.width / 2 + position.loop) / element.width),
2763               my: (element.height - 7) / element.height
2764             }
2765           });
2766
2767           drawPath(p, loopPath, {
2768             strokeWidth: 1,
2769             fill: 'none',
2770             strokeLinecap: 'round',
2771             strokeMiterlimit: 0.5
2772           });
2773         },
2774         'AdhocMarker': function(p, element, position) {
2775           var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {
2776             xScaleFactor: 1,
2777             yScaleFactor: 1,
2778             containerWidth: element.width,
2779             containerHeight: element.height,
2780             position: {
2781               mx: ((element.width / 2 + position.adhoc) / element.width),
2782               my: (element.height - 15) / element.height
2783             }
2784           });
2785
2786           drawPath(p, loopPath, {
2787             strokeWidth: 1,
2788             fill: 'black'
2789           });
2790         }
2791       };
2792
2793       function attachTaskMarkers(p, element, taskMarkers) {
2794         var obj = getSemantic(element);
2795
2796         var subprocess = includes(taskMarkers, 'SubProcessMarker');
2797         var position;
2798
2799         if (subprocess) {
2800           position = {
2801             seq: -21,
2802             parallel: -22,
2803             compensation: -42,
2804             loop: -18,
2805             adhoc: 10
2806           };
2807         } else {
2808           position = {
2809             seq: -3,
2810             parallel: -6,
2811             compensation: -27,
2812             loop: 0,
2813             adhoc: 10
2814           };
2815         }
2816
2817         forEach(taskMarkers, function(marker) {
2818           renderer(marker)(p, element, position);
2819         });
2820
2821         if (obj.$type === 'bpmn:AdHocSubProcess') {
2822           renderer('AdhocMarker')(p, element, position);
2823         }
2824         if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {
2825           renderer('LoopMarker')(p, element, position);
2826           return;
2827         }
2828         if (obj.loopCharacteristics &&
2829           obj.loopCharacteristics.isSequential !== undefined &&
2830           !obj.loopCharacteristics.isSequential) {
2831           renderer('ParallelMarker')(p, element, position);
2832         }
2833         if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {
2834           renderer('SequentialMarker')(p, element, position);
2835         }
2836         if (!!obj.isForCompensation) {
2837           renderer('CompensationMarker')(p, element, position);
2838         }
2839       }
2840
2841       function drawShape(parent, element) {
2842         var type = element.type;
2843         var h = handlers[type];
2844
2845         /* jshint -W040 */
2846         if (!h) {
2847           return DefaultRenderer.prototype.drawShape.apply(this, [parent, element]);
2848         } else {
2849           return h(parent, element);
2850         }
2851       }
2852
2853       function drawConnection(parent, element) {
2854         var type = element.type;
2855         var h = handlers[type];
2856
2857         /* jshint -W040 */
2858         if (!h) {
2859           return DefaultRenderer.prototype.drawConnection.apply(this, [parent, element]);
2860         } else {
2861           return h(parent, element);
2862         }
2863       }
2864
2865       function renderDataItemCollection(p, element) {
2866
2867         var yPosition = (element.height - 16) / element.height;
2868
2869         var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
2870           xScaleFactor: 1,
2871           yScaleFactor: 1,
2872           containerWidth: element.width,
2873           containerHeight: element.height,
2874           position: {
2875             mx: 0.451,
2876             my: yPosition
2877           }
2878         });
2879
2880         /* collection path */
2881         drawPath(p, pathData, {
2882           strokeWidth: 2
2883         });
2884       }
2885
2886       function isCollection(element, filter) {
2887         return element.isCollection ||
2888           (element.elementObjectRef && element.elementObjectRef.isCollection);
2889       }
2890
2891       function getDi(element) {
2892         return element.businessObject.di;
2893       }
2894
2895       function getSemantic(element) {
2896         return element.businessObject;
2897       }
2898
2899       /**
2900        * Checks if eventDefinition of the given element matches with semantic
2901        * type.
2902        *
2903        * @return {boolean} true if element is of the given semantic type
2904        */
2905       function isTypedEvent(event, eventDefinitionType, filter) {
2906
2907         function matches(definition, filter) {
2908           return every(filter, function(val, key) {
2909
2910             // we want a == conversion here, to be able to catch
2911             // undefined == false and friends
2912             /* jshint -W116 */
2913             return definition[key] == val;
2914           });
2915         }
2916
2917         return some(event.eventDefinitions, function(definition) {
2918           return definition.$type === eventDefinitionType && matches(event, filter);
2919         });
2920       }
2921
2922       function isThrowEvent(event) {
2923         return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');
2924       }
2925
2926
2927       // ///// cropping path customizations /////////////////////////
2928
2929       function componentsToPath(elements) {
2930         return elements.join(',').replace(/,?([A-z]),?/g, '$1');
2931       }
2932
2933       function getCirclePath(shape) {
2934
2935         var cx = shape.x + shape.width / 2,
2936           cy = shape.y + shape.height / 2,
2937           radius = shape.width / 2;
2938
2939         var circlePath = [
2940           ['M', cx, cy],
2941           ['m', 0, -radius],
2942           ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
2943           ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
2944           ['z']
2945         ];
2946
2947         return componentsToPath(circlePath);
2948       }
2949
2950       function getRoundRectPath(shape) {
2951
2952         var radius = TASK_BORDER_RADIUS,
2953           x = shape.x,
2954           y = shape.y,
2955           width = shape.width,
2956           height = shape.height;
2957
2958         var roundRectPath = [
2959           ['M', x + radius, y],
2960           ['l', width - radius * 2, 0],
2961           ['a', radius, radius, 0, 0, 1, radius, radius],
2962           ['l', 0, height - radius * 2],
2963           ['a', radius, radius, 0, 0, 1, -radius, radius],
2964           ['l', radius * 2 - width, 0],
2965           ['a', radius, radius, 0, 0, 1, -radius, -radius],
2966           ['l', 0, radius * 2 - height],
2967           ['a', radius, radius, 0, 0, 1, radius, -radius],
2968           ['z']
2969         ];
2970
2971         return componentsToPath(roundRectPath);
2972       }
2973
2974       function getDiamondPath(shape) {
2975
2976         var width = shape.width,
2977           height = shape.height,
2978           x = shape.x,
2979           y = shape.y,
2980           halfWidth = width / 2,
2981           halfHeight = height / 2;
2982
2983         var diamondPath = [
2984           ['M', x + halfWidth, y],
2985           ['l', halfWidth, halfHeight],
2986           ['l', -halfWidth, halfHeight],
2987           ['l', -halfWidth, -halfHeight],
2988           ['z']
2989         ];
2990
2991         return componentsToPath(diamondPath);
2992       }
2993
2994       function getRectPath(shape) {
2995         var x = shape.x,
2996           y = shape.y,
2997           width = shape.width,
2998           height = shape.height;
2999
3000         var rectPath = [
3001           ['M', x, y],
3002           ['l', width, 0],
3003           ['l', 0, height],
3004           ['l', -width, 0],
3005           ['z']
3006         ];
3007
3008         return componentsToPath(rectPath);
3009       }
3010
3011       function getShapePath(element) {
3012         var obj = getSemantic(element);
3013
3014         if (obj.$instanceOf('bpmn:Event')) {
3015           return getCirclePath(element);
3016         }
3017
3018         if (obj.$instanceOf('bpmn:Activity')) {
3019           return getRoundRectPath(element);
3020         }
3021
3022         if (obj.$instanceOf('bpmn:Gateway')) {
3023           return getDiamondPath(element);
3024         }
3025
3026         return getRectPath(element);
3027       }
3028
3029
3030       // hook onto canvas init event to initialize
3031       // connection start/end markers on svg
3032       events.on('canvas.init', function(event) {
3033         initMarkers(event.svg);
3034       });
3035
3036       this.drawShape = drawShape;
3037       this.drawConnection = drawConnection;
3038
3039       this.getShapePath = getShapePath;
3040     }
3041
3042     inherits(BpmnRenderer, DefaultRenderer);
3043
3044
3045     BpmnRenderer.$inject = ['eventBus', 'styles', 'pathMap'];
3046
3047     module.exports = BpmnRenderer;
3048
3049   }, {
3050     "../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
3051     "diagram-js/lib/draw/Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
3052     "diagram-js/lib/util/Text": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Text.js",
3053     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
3054     "lodash/collection/every": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\every.js",
3055     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
3056     "lodash/collection/includes": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\includes.js",
3057     "lodash/collection/some": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\some.js",
3058     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
3059     "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
3060     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
3061   }],
3062   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\PathMap.js": [function(require, module, exports) {
3063     'use strict';
3064
3065     var Snap = require('diagram-js/vendor/snapsvg');
3066
3067     /**
3068      * Map containing SVG paths needed by BpmnRenderer.
3069      */
3070
3071     function PathMap() {
3072
3073       /**
3074        * Contains a map of path elements
3075        *
3076        * <h1>Path definition</h1>
3077        * A parameterized path is defined like this:
3078        *
3079        * <pre>
3080        * 'GATEWAY_PARALLEL': {
3081        *   d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
3082        *           '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
3083        *   height: 17.5,
3084        *   width:  17.5,
3085        *   heightElements: [2.5, 7.5],
3086        *   widthElements: [2.5, 7.5]
3087        * }
3088        * </pre>
3089        *
3090        * <p>
3091        * It's important to specify a correct <b>height and width</b> for the path
3092        * as the scaling is based on the ratio between the specified height and
3093        * width in this object and the height and width that is set as scale target
3094        * (Note x,y coordinates will be scaled with individual ratios).
3095        * </p>
3096        * <p>
3097        * The '<b>heightElements</b>' and '<b>widthElements</b>' array must
3098        * contain the values that will be scaled. The scaling is based on the
3099        * computed ratios. Coordinates on the y axis should be in the
3100        * <b>heightElement</b>'s array, they will be scaled using the computed
3101        * ratio coefficient. In the parameterized path the scaled values can be
3102        * accessed through the 'e' object in {} brackets.
3103        * <ul>
3104        * <li>The values for the y axis can be accessed in the path string using
3105        * {e.y0}, {e.y1}, ....</li>
3106        * <li>The values for the x axis can be accessed in the path string using
3107        * {e.x0}, {e.x1}, ....</li>
3108        * </ul>
3109        * The numbers x0, x1 respectively y0, y1, ... map to the corresponding
3110        * array index.
3111        * </p>
3112        */
3113       this.pathMap = {
3114         'EVENT_MESSAGE': {
3115           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}',
3116           height: 36,
3117           width: 36,
3118           heightElements: [6, 14],
3119           widthElements: [10.5, 21]
3120         },
3121         'EVENT_SIGNAL': {
3122           d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
3123           height: 36,
3124           width: 36,
3125           heightElements: [18],
3126           widthElements: [10, 20]
3127         },
3128         'EVENT_ESCALATION': {
3129           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} ' +
3130             '{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',
3131           height: 36,
3132           width: 36,
3133           heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],
3134           widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]
3135         },
3136         'EVENT_CONDITIONAL': {
3137           d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
3138             'M {e.x2},{e.y3} l {e.x0},0 ' +
3139             'M {e.x2},{e.y4} l {e.x0},0 ' +
3140             'M {e.x2},{e.y5} l {e.x0},0 ' +
3141             'M {e.x2},{e.y6} l {e.x0},0 ' +
3142             'M {e.x2},{e.y7} l {e.x0},0 ' +
3143             'M {e.x2},{e.y8} l {e.x0},0 ',
3144           height: 36,
3145           width: 36,
3146           heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
3147           widthElements: [10.5, 14.5, 12.5]
3148         },
3149         'EVENT_LINK': {
3150           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',
3151           height: 36,
3152           width: 36,
3153           heightElements: [4.4375, 6.75, 7.8125],
3154           widthElements: [9.84375, 13.5]
3155         },
3156         'EVENT_ERROR': {
3157           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',
3158           height: 36,
3159           width: 36,
3160           heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
3161           widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
3162         },
3163         'EVENT_CANCEL_45': {
3164           d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
3165             '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
3166           height: 36,
3167           width: 36,
3168           heightElements: [4.75, 8.5],
3169           widthElements: [4.75, 8.5]
3170         },
3171         'EVENT_COMPENSATION': {
3172           d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',
3173           height: 36,
3174           width: 36,
3175           heightElements: [5, 10],
3176           widthElements: [10]
3177         },
3178         'EVENT_TIMER_WH': {
3179           d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
3180           height: 36,
3181           width: 36,
3182           heightElements: [10, 2],
3183           widthElements: [3, 7]
3184         },
3185         'EVENT_TIMER_LINE': {
3186           d: 'M {mx},{my} ' +
3187             'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
3188           height: 36,
3189           width: 36,
3190           heightElements: [10, 3],
3191           widthElements: [0, 0]
3192         },
3193         'EVENT_MULTIPLE': {
3194           d: 'm {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
3195           height: 36,
3196           width: 36,
3197           heightElements: [6.28099, 12.56199],
3198           widthElements: [3.1405, 9.42149, 12.56198]
3199         },
3200         'EVENT_PARALLEL_MULTIPLE': {
3201           d: 'm {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
3202             '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
3203           height: 36,
3204           width: 36,
3205           heightElements: [2.56228, 7.68683],
3206           widthElements: [2.56228, 7.68683]
3207         },
3208         'GATEWAY_EXCLUSIVE': {
3209           d: 'm {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
3210             '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +
3211             '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
3212           height: 17.5,
3213           width: 17.5,
3214           heightElements: [8.5, 6.5312, -6.5312, -8.5],
3215           widthElements: [6.5, -6.5, 3, -3, 5, -5]
3216         },
3217         'GATEWAY_PARALLEL': {
3218           d: 'm {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
3219             '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
3220           height: 30,
3221           width: 30,
3222           heightElements: [5, 12.5],
3223           widthElements: [5, 12.5]
3224         },
3225         'GATEWAY_EVENT_BASED': {
3226           d: 'm {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
3227           height: 11,
3228           width: 11,
3229           heightElements: [-6, 6, 12, -12],
3230           widthElements: [9, -3, -12]
3231         },
3232         'GATEWAY_COMPLEX': {
3233           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} ' +
3234             '{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} ' +
3235             '{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} ' +
3236             '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
3237           height: 17.125,
3238           width: 17.125,
3239           heightElements: [4.875, 3.4375, 2.125, 3],
3240           widthElements: [3.4375, 2.125, 4.875, 3]
3241         },
3242         'DATA_OBJECT_PATH': {
3243           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',
3244           height: 61,
3245           width: 51,
3246           heightElements: [10, 50, 60],
3247           widthElements: [10, 40, 50, 60]
3248         },
3249         'DATA_OBJECT_COLLECTION_PATH': {
3250           d: 'm {mx}, {my} ' +
3251             'm  0 15  l 0 -15 ' +
3252             'm  4 15  l 0 -15 ' +
3253             'm  4 15  l 0 -15 ',
3254           height: 61,
3255           width: 51,
3256           heightElements: [12],
3257           widthElements: [1, 6, 12, 15]
3258         },
3259         'DATA_ARROW': {
3260           d: 'm 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
3261           height: 61,
3262           width: 51,
3263           heightElements: [],
3264           widthElements: []
3265         },
3266         'DATA_STORE': {
3267           d: 'm  {mx},{my} ' +
3268             'l  0,{e.y2} ' +
3269             'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +
3270             'l  0,-{e.y2} ' +
3271             'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
3272             'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +
3273             'm  -{e.x2},{e.y0}' +
3274             'c  {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +
3275             'm  -{e.x2},{e.y0}' +
3276             'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0',
3277           height: 61,
3278           width: 61,
3279           heightElements: [7, 10, 45],
3280           widthElements: [2, 58, 60]
3281         },
3282         'TEXT_ANNOTATION': {
3283           d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
3284           height: 30,
3285           width: 10,
3286           heightElements: [30],
3287           widthElements: [10]
3288         },
3289         'MARKER_SUB_PROCESS': {
3290           d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
3291           height: 10,
3292           width: 10,
3293           heightElements: [],
3294           widthElements: []
3295         },
3296         'MARKER_PARALLEL': {
3297           d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
3298           height: 10,
3299           width: 10,
3300           heightElements: [],
3301           widthElements: []
3302         },
3303         'MARKER_SEQUENTIAL': {
3304           d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
3305           height: 10,
3306           width: 10,
3307           heightElements: [],
3308           widthElements: []
3309         },
3310         'MARKER_COMPENSATION': {
3311           d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',
3312           height: 10,
3313           width: 21,
3314           heightElements: [],
3315           widthElements: []
3316         },
3317         'MARKER_LOOP': {
3318           d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +
3319             '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
3320             '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +
3321             'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
3322           height: 13.9,
3323           width: 13.7,
3324           heightElements: [],
3325           widthElements: []
3326         },
3327         'MARKER_ADHOC': {
3328           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 ' +
3329             '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
3330             '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 ' +
3331             '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
3332             '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',
3333           height: 4,
3334           width: 15,
3335           heightElements: [],
3336           widthElements: []
3337         },
3338         'TASK_TYPE_SEND': {
3339           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}',
3340           height: 14,
3341           width: 21,
3342           heightElements: [6, 14],
3343           widthElements: [10.5, 21]
3344         },
3345         'TASK_TYPE_SCRIPT': {
3346           d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
3347             'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
3348             'm -7,-12 l 5,0 ' +
3349             'm -4.5,3 l 4.5,0 ' +
3350             'm -3,3 l 5,0' +
3351             'm -4,3 l 5,0',
3352           height: 15,
3353           width: 12.6,
3354           heightElements: [6, 14],
3355           widthElements: [10.5, 21]
3356         },
3357         'TASK_TYPE_USER_1': {
3358           d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
3359             '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
3360             '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
3361             'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
3362             'm -8,6 l 0,5.5 m 11,0 l 0,-5'
3363         },
3364         'TASK_TYPE_USER_2': {
3365           d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
3366             '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
3367         },
3368         'TASK_TYPE_USER_3': {
3369           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 ' +
3370             '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
3371             '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
3372         },
3373         'TASK_TYPE_MANUAL': {
3374           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 ' +
3375             '-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 ' +
3376             '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 ' +
3377             '-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 ' +
3378             '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 ' +
3379             '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
3380             '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +
3381             '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
3382             '-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 ' +
3383             '-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 ' +
3384             '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 ' +
3385             '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
3386         },
3387         'TASK_TYPE_INSTANTIATING_SEND': {
3388           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'
3389         },
3390         'TASK_TYPE_SERVICE': {
3391           d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
3392             '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
3393             '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
3394             'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
3395             '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
3396             '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
3397             '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 ' +
3398             '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
3399             'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
3400             'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
3401             '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
3402             'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
3403             'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
3404             '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
3405             '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
3406         },
3407         'TASK_TYPE_SERVICE_FILL': {
3408           d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
3409             '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
3410             '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
3411         },
3412         'TASK_TYPE_BUSINESS_RULE_HEADER': {
3413           d: 'm {mx},{my} 0,4 20,0 0,-4 z'
3414         },
3415         'TASK_TYPE_BUSINESS_RULE_MAIN': {
3416           d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
3417             'm 0,8 l 20,0 ' +
3418             'm -13,-4 l 0,8'
3419         },
3420         'MESSAGE_FLOW_MARKER': {
3421           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'
3422         }
3423       };
3424
3425       this.getRawPath = function getRawPath(pathId) {
3426         return this.pathMap[pathId].d;
3427       };
3428
3429       /**
3430        * Scales the path to the given height and width.
3431        * <h1>Use case</h1>
3432        * <p>
3433        * Use case is to scale the content of elements (event, gateways) based on
3434        * the element bounding box's size.
3435        * </p>
3436        * <h1>Why not transform</h1>
3437        * <p>
3438        * Scaling a path with transform() will also scale the stroke and IE does
3439        * not support the option 'non-scaling-stroke' to prevent this. Also there
3440        * are use cases where only some parts of a path should be scaled.
3441        * </p>
3442        *
3443        * @param {String}
3444        *            pathId The ID of the path.
3445        * @param {Object}
3446        *            param
3447        *            <p>
3448        *            Example param object scales the path to 60% size of the
3449        *            container (data.width, data.height).
3450        *
3451        * <pre>
3452        * {
3453        *    xScaleFactor : 0.6,
3454        *    yScaleFactor : 0.6,
3455        *    containerWidth : data.width,
3456        *    containerHeight : data.height,
3457        *    position : {
3458        *      mx : 0.46,
3459        *      my : 0.2,
3460        *    }
3461        * }
3462        * </pre>
3463        *
3464        * <ul>
3465        *            <li>targetpathwidth = xScaleFactor * containerWidth</li>
3466        *            <li>targetpathheight = yScaleFactor * containerHeight</li>
3467        *            <li>Position is used to set the starting coordinate of the
3468        *            path. M is computed:
3469        *            <ul>
3470        *            <li>position.x * containerWidth</li>
3471        *            <li>position.y * containerHeight</li>
3472        *            </ul>
3473        *            Center of the container
3474        *
3475        * <pre>
3476        *  position: {
3477        *       mx: 0.5,
3478        *       my: 0.5,
3479        *     }
3480        * </pre>
3481        *
3482        * Upper left corner of the container
3483        *
3484        * <pre>
3485        *  position: {
3486        *       mx: 0.0,
3487        *       my: 0.0,
3488        *     }
3489        * </pre>
3490        *
3491        * </li>
3492        *            </ul>
3493        *            </p>
3494        *
3495        */
3496       this.getScaledPath = function getScaledPath(pathId, param) {
3497         var rawPath = this.pathMap[pathId];
3498
3499         // positioning
3500         // compute the start point of the path
3501         var mx, my;
3502
3503         if (!!param.abspos) {
3504           mx = param.abspos.x;
3505           my = param.abspos.y;
3506         } else {
3507           mx = param.containerWidth * param.position.mx;
3508           my = param.containerHeight * param.position.my;
3509         }
3510
3511         var coordinates = {}; // map for the scaled coordinates
3512         if (param.position) {
3513
3514           // path
3515           var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;
3516           var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;
3517
3518
3519           // Apply height ratio
3520           for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {
3521             coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;
3522           }
3523
3524           // Apply width ratio
3525           for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {
3526             coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
3527           }
3528         }
3529
3530         // Apply value to raw path
3531         var path = Snap.format(
3532           rawPath.d, {
3533             mx: mx,
3534             my: my,
3535             e: coordinates
3536           }
3537         );
3538         return path;
3539       };
3540     }
3541
3542     module.exports = PathMap;
3543
3544   }, {
3545     "diagram-js/vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js"
3546   }],
3547   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\index.js": [function(require, module, exports) {
3548     module.exports = {
3549       renderer: ['type', require('./BpmnRenderer')],
3550       pathMap: ['type', require('./PathMap')]
3551     };
3552   }, {
3553     "./BpmnRenderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\BpmnRenderer.js",
3554     "./PathMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\PathMap.js"
3555   }],
3556   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\ContextPadProvider.js": [function(require, module, exports) {
3557     'use strict';
3558
3559
3560     var assign = require('lodash/object/assign'),
3561       forEach = require('lodash/collection/forEach');
3562
3563
3564     /**
3565      * A provider for BPMN 2.0 elements context pad
3566      */
3567     function ContextPadProvider(contextPad, modeling, elementFactory,
3568       connect, create, bpmnReplace,
3569       canvas) {
3570
3571       contextPad.registerProvider(this);
3572
3573       this._contextPad = contextPad;
3574
3575       this._modeling = modeling;
3576
3577       this._elementFactory = elementFactory;
3578       this._connect = connect;
3579       this._create = create;
3580       this._bpmnReplace = bpmnReplace;
3581       this._canvas = canvas;
3582     }
3583
3584     ContextPadProvider.$inject = [
3585       'contextPad',
3586       'modeling',
3587       'elementFactory',
3588       'connect',
3589       'create',
3590       'bpmnReplace',
3591       'canvas'
3592     ];
3593
3594     ContextPadProvider.prototype.getContextPadEntries = function(element) {
3595
3596       var contextPad = this._contextPad,
3597         modeling = this._modeling,
3598
3599         elementFactory = this._elementFactory,
3600         connect = this._connect,
3601         create = this._create,
3602         bpmnReplace = this._bpmnReplace,
3603         canvas = this._canvas;
3604
3605       var actions = {};
3606
3607       if (element.type === 'label') {
3608         return actions;
3609       }
3610
3611       var bpmnElement = element.businessObject;
3612
3613       function startConnect(event, element, autoActivate) {
3614         connect.start(event, element, autoActivate);
3615       }
3616
3617       function removeElement(e) {
3618         console.log(e);
3619         if (element.waypoints) {
3620           modeling.removeConnection(element);
3621         } else {
3622           modeling.removeShape(element);
3623
3624         }
3625         if (element.id == selected_decison_element) {
3626
3627           invisiblepropertyExplorer();
3628         }
3629       }
3630
3631       function getReplaceMenuPosition(element) {
3632
3633         var Y_OFFSET = 5;
3634
3635         var diagramContainer = canvas.getContainer(),
3636           pad = contextPad.getPad(element).html;
3637
3638         var diagramRect = diagramContainer.getBoundingClientRect(),
3639           padRect = pad.getBoundingClientRect();
3640
3641         var top = padRect.top - diagramRect.top;
3642         var left = padRect.left - diagramRect.left;
3643
3644         var pos = {
3645           x: left,
3646           y: top + padRect.height + Y_OFFSET
3647         };
3648
3649         return pos;
3650       }
3651
3652
3653       var change_color = function(par1, par2) {
3654         if (isImportSchema == true) {
3655
3656           return par2 /*'define-schema'*/ ;
3657         } else {
3658           return par1 /*'define-modify-schema'*/ ;
3659         }
3660       }
3661
3662       function appendAction(type, className, options) {
3663
3664         function appendListener(event, element) {
3665
3666           var shape = elementFactory.createShape(assign({
3667             type: type
3668           }, options));
3669           create.start(event, shape, element);
3670         }
3671
3672         var shortType = type.replace(/^bpmn\:/, '');
3673
3674         return {
3675           group: 'model',
3676           className: className,
3677           title: 'Append ' + shortType,
3678           action: {
3679             dragstart: appendListener,
3680             click: appendListener
3681           }
3682         };
3683       }
3684
3685
3686       if (bpmnElement.$instanceOf('bpmn:Gateway') || bpmnElement.$instanceOf('bpmn:MultiBranchConnector')) {
3687         assign(actions, {
3688           'define-path': {
3689             group: 'DefinePath',
3690             className: 'define-path',
3691             title: 'Define/View Path',
3692             action: {
3693               click: function(event) {
3694
3695                 if (bpmnElement.name) {
3696                   var bpmnElementID = bpmnElement.id;
3697                   selected_decison_element = bpmnElementID;
3698                   var bpmnElementName = bpmnElement.name;
3699                   selected_element_name = bpmnElementName;
3700                   var pathIdentifiers = [];
3701
3702                   if (bpmnElement.outgoing) {
3703
3704                     var check_outgoing_names = true;
3705                     forEach(bpmnElement.outgoing, function(og) {
3706
3707                       if (og.name && og.name.length != 0) {
3708
3709                         pathIdentifiers.push(og.name);
3710
3711                       } else {
3712
3713                         errorProperty(bpmnElement.name + " out going path name was not entered");
3714                         check_outgoing_names = false;
3715                       }
3716
3717                     });
3718                     if (check_outgoing_names) {
3719
3720                       pathDetails(bpmnElementID, bpmnElementName, pathIdentifiers);
3721                     }
3722
3723
3724
3725                   } else {
3726                     errorProperty(bpmnElement.name + ' should atleast one output path was required');
3727                   }
3728
3729                 } else {
3730                   errorProperty('Enter Valid Decision Name');
3731                 }
3732               }
3733             }
3734           }
3735         });
3736       }
3737
3738
3739
3740       if (bpmnElement.$instanceOf('bpmn:InitiateProcess')) {}
3741
3742       if (bpmnElement.$instanceOf('bpmn:StartEvent')) {}
3743       if (bpmnElement.$instanceOf('bpmn:Holmes')) {
3744         assign(actions, {
3745           'Properties': {
3746             group: 'clds',
3747             label: 'Edit Properties',
3748             className: 'clds-edit-properties',
3749             title: 'Properties',
3750             action: {
3751               click: function(event) {
3752                 lastElementSelected = bpmnElement.id
3753                 HolmesWindow(bpmnElement);
3754               }
3755             }
3756           }
3757         });
3758       }
3759       if (bpmnElement.$instanceOf('bpmn:TCA')) {
3760         assign(actions, {
3761           'Properties': {
3762             group: 'clds',
3763             label: 'Edit Properties',
3764             className: 'clds-edit-properties',
3765             title: 'Properties',
3766             action: {
3767               click: function(event) {
3768                 console.log(event);
3769                 lastElementSelected = bpmnElement.id
3770               }
3771             }
3772           }
3773         });
3774       }
3775       if (bpmnElement.$instanceOf('bpmn:GOC')) {
3776         assign(actions, {
3777           'Properties': {
3778             group: 'clds',
3779             label: 'Edit Properties',
3780             className: 'clds-edit-properties',
3781             title: 'Properties',
3782             action: {
3783               click: function(event) {
3784                 lastElementSelected = bpmnElement.id
3785                 GOCWindow();
3786               }
3787             }
3788           }
3789         });
3790       }
3791       if (bpmnElement.$instanceOf('bpmn:Policy')) {
3792         assign(actions, {
3793           'Properties': {
3794             group: 'clds',
3795             label: 'Edit Properties',
3796             className: 'clds-edit-properties',
3797             title: 'Properties',
3798             action: {
3799               click: function(event) {
3800                 lastElementSelected = bpmnElement.id
3801                 PolicyWindow(bpmnElement);
3802               }
3803             }
3804           }
3805         });
3806       }
3807
3808       if (bpmnElement.$instanceOf('bpmn:FlowNode') ||
3809         bpmnElement.$instanceOf('bpmn:InteractionNode')) {
3810
3811         assign(actions, {
3812           'append.text-annotation': appendAction('bpmn:TextAnnotation', 'icon-text-annotation'),
3813
3814           'connect': {
3815             group: 'connect',
3816             className: 'icon-connection',
3817             title: 'Connector',
3818             action: {
3819               click: startConnect,
3820               dragstart: startConnect
3821             }
3822           }
3823         });
3824       }
3825
3826       // Delete Element Entry
3827       assign(actions, {
3828         'delete': {
3829           group: 'edits',
3830           className: 'icon-trash',
3831           title: 'Remove',
3832           action: {
3833             click: removeElement,
3834             dragstart: removeElement
3835           }
3836         }
3837
3838
3839
3840       });
3841
3842       return actions;
3843     };
3844
3845     function isEventType(eventBo, type, definition) {
3846
3847       var isType = eventBo.$instanceOf(type);
3848       var isDefinition = false;
3849
3850       var definitions = eventBo.eventDefinitions || [];
3851       forEach(definitions, function(def) {
3852         if (def.$type === definition) {
3853           isDefinition = true;
3854         }
3855       });
3856
3857       return isType && isDefinition;
3858     }
3859
3860
3861     module.exports = ContextPadProvider;
3862
3863   }, {
3864     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
3865     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
3866   }],
3867   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\index.js": [function(require, module, exports) {
3868     module.exports = {
3869       __depends__: [
3870         require('diagram-js-direct-editing'),
3871         require('diagram-js/lib/features/context-pad'),
3872         require('diagram-js/lib/features/selection'),
3873         require('diagram-js/lib/features/connect'),
3874         require('diagram-js/lib/features/create'),
3875         require('../replace')
3876       ],
3877       __init__: ['contextPadProvider'],
3878       contextPadProvider: ['type', require('./ContextPadProvider')]
3879     };
3880   }, {
3881     "../replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\index.js",
3882     "./ContextPadProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\ContextPadProvider.js",
3883     "diagram-js-direct-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js",
3884     "diagram-js/lib/features/connect": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\index.js",
3885     "diagram-js/lib/features/context-pad": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\index.js",
3886     "diagram-js/lib/features/create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js",
3887     "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js"
3888   }],
3889   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\BpmnKeyBindings.js": [function(require, module, exports) {
3890     'use strict';
3891
3892
3893     function BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) {
3894
3895       keyboard.addListener(function(key, modifiers) {
3896
3897         if (keyboard.hasModifier(modifiers)) {
3898           return;
3899         }
3900
3901         // S -> activate space tool
3902         if (key === 83) {
3903           spaceTool.activateSelection();
3904
3905           return true;
3906         }
3907
3908         // L -> activate lasso tool
3909         if (key === 108) {
3910           lassoTool.activateSelection();
3911
3912           return true;
3913         }
3914
3915         var currentSelection = selection.get();
3916
3917         // E -> activate direct editing
3918         if (key === 69) {
3919           if (currentSelection.length) {
3920             directEditing.activate(currentSelection[0]);
3921           }
3922
3923           return true;
3924         }
3925       });
3926     }
3927
3928     BpmnKeyBindings.$inject = ['keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection'];
3929
3930     module.exports = BpmnKeyBindings;
3931   }, {}],
3932   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\index.js": [function(require, module, exports) {
3933     module.exports = {
3934       __depends__: [
3935         require('diagram-js/lib/features/keyboard')
3936       ],
3937       __init__: ['bpmnKeyBindings'],
3938       bpmnKeyBindings: ['type', require('./BpmnKeyBindings')]
3939     };
3940   }, {
3941     "./BpmnKeyBindings": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\BpmnKeyBindings.js",
3942     "diagram-js/lib/features/keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\index.js"
3943   }],
3944   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelEditingProvider.js": [function(require, module, exports) {
3945     'use strict';
3946
3947     var UpdateLabelHandler = require('./cmd/UpdateLabelHandler');
3948
3949     var LabelUtil = require('./LabelUtil');
3950
3951     var is = require('../../util/ModelUtil').is,
3952       isExpanded = require('../../util/DiUtil').isExpanded;
3953
3954     var daOriginalLabel = '';
3955
3956     var MIN_BOUNDS = {
3957       width: 150,
3958       height: 50
3959     };
3960
3961
3962     function LabelEditingProvider(eventBus, canvas, directEditing, commandStack, injector) {
3963
3964       directEditing.registerProvider(this);
3965       commandStack.registerHandler('element.updateLabel', UpdateLabelHandler);
3966
3967       // listen to dblclick on non-root elements
3968       eventBus.on('element.dblclick', function(event) {
3969
3970         directEditing.activate(event.element);
3971       });
3972
3973
3974       // complete on followup canvas operation
3975       eventBus.on(['element.mousedown', 'drag.activate', 'canvas.viewbox.changed'], function(event) {
3976         directEditing.complete();
3977       });
3978
3979       // cancel on command stack changes
3980       eventBus.on(['commandStack.changed'], function() {
3981         directEditing.cancel();
3982       });
3983
3984
3985       // activate direct editing for activities and text annotations
3986
3987
3988       if ('ontouchstart' in document.documentElement) {
3989         // we deactivate automatic label editing on mobile devices
3990         // as it breaks the user interaction workflow
3991
3992         // TODO(nre): we should temporarily focus the edited element here
3993         // and release the focused viewport after the direct edit operation is
3994         // finished
3995       } else {
3996         eventBus.on('create.end', 500, function(e) {
3997
3998           var element = e.shape,
3999             canExecute = e.context.canExecute;
4000
4001           if (!canExecute) {
4002             return;
4003           }
4004
4005           if (is(element, 'bpmn:Task') || is(element, 'bpmn:TextAnnotation') ||
4006             (is(element, 'bpmn:SubProcess') && !isExpanded(element))) {
4007
4008             directEditing.activate(element);
4009           }
4010         });
4011       }
4012
4013       this._canvas = canvas;
4014       this._commandStack = commandStack;
4015     }
4016
4017     LabelEditingProvider.$inject = ['eventBus', 'canvas', 'directEditing', 'commandStack', 'injector'];
4018
4019     module.exports = LabelEditingProvider;
4020
4021
4022     LabelEditingProvider.prototype.activate = function(element) {
4023
4024       var text = LabelUtil.getLabel(element);
4025
4026       if (text === undefined) {
4027         return;
4028       }
4029
4030       daOriginalLabel = text;
4031
4032       var bbox = this.getEditingBBox(element);
4033
4034       // adjust for expanded pools AND lanes
4035       if ((is(element, 'bpmn:Participant') && isExpanded(element)) || is(element, 'bpmn:Lane')) {
4036
4037         bbox.width = MIN_BOUNDS.width;
4038         bbox.height = MIN_BOUNDS.height;
4039
4040         bbox.x = bbox.x + 10 - bbox.width / 2;
4041         bbox.y = bbox.mid.y - bbox.height / 2;
4042       }
4043
4044       // adjust for expanded sub processes
4045       if (is(element, 'bpmn:SubProcess') && isExpanded(element)) {
4046
4047         bbox.height = MIN_BOUNDS.height;
4048
4049         bbox.x = bbox.mid.x - bbox.width / 2;
4050         bbox.y = bbox.y + 10 - bbox.height / 2;
4051       }
4052
4053       return {
4054         bounds: bbox,
4055         text: text
4056       };
4057     };
4058
4059
4060     LabelEditingProvider.prototype.getEditingBBox = function(element, maxBounds) {
4061
4062       var target = element.label || element;
4063
4064       var bbox = this._canvas.getAbsoluteBBox(target);
4065
4066       var mid = {
4067         x: bbox.x + bbox.width / 2,
4068         y: bbox.y + bbox.height / 2
4069       };
4070
4071       // external label
4072       if (target.labelTarget) {
4073         bbox.width = Math.max(bbox.width, MIN_BOUNDS.width);
4074         bbox.height = Math.max(bbox.height, MIN_BOUNDS.height);
4075
4076         bbox.x = mid.x - bbox.width / 2;
4077       }
4078
4079       bbox.mid = mid;
4080
4081       return bbox;
4082     };
4083
4084
4085     LabelEditingProvider.prototype.update = function(element, newLabel) {
4086       //update conditional node
4087       if (is(element, 'bpmn:ExclusiveGateway') || is(element, 'bpmn:MultiBranchConnector')) {
4088         updateDecisionLabel(daOriginalLabel, newLabel);
4089       }
4090
4091       this._commandStack.execute('element.updateLabel', {
4092         element: element,
4093         newLabel: newLabel
4094       });
4095     };
4096   }, {
4097     "../../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
4098     "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
4099     "./LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js",
4100     "./cmd/UpdateLabelHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\cmd\\UpdateLabelHandler.js"
4101   }],
4102   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js": [function(require, module, exports) {
4103     'use strict';
4104
4105     function getLabelAttr(semantic) {
4106       if (semantic.$instanceOf('bpmn:FlowElement') ||
4107         semantic.$instanceOf('bpmn:Participant') ||
4108         semantic.$instanceOf('bpmn:Lane') ||
4109         semantic.$instanceOf('bpmn:SequenceFlow') ||
4110         semantic.$instanceOf('bpmn:MessageFlow')) {
4111         return 'name';
4112       }
4113
4114       if (semantic.$instanceOf('bpmn:TextAnnotation')) {
4115         return 'text';
4116       }
4117     }
4118
4119     module.exports.getLabel = function(element) {
4120       var semantic = element.businessObject,
4121         attr = getLabelAttr(semantic);
4122
4123       if (attr) {
4124         return semantic[attr] || '';
4125       }
4126     };
4127
4128
4129     module.exports.setLabel = function(element, text) {
4130       var semantic = element.businessObject,
4131         attr = getLabelAttr(semantic);
4132
4133       if (attr) {
4134         semantic[attr] = text;
4135       }
4136
4137       var label = element.label || element;
4138
4139       // show label
4140       label.hidden = false;
4141
4142       return label;
4143     };
4144   }, {}],
4145   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\cmd\\UpdateLabelHandler.js": [function(require, module, exports) {
4146     'use strict';
4147
4148     var LabelUtil = require('../LabelUtil');
4149
4150
4151     /**
4152      * A handler that updates the text of a BPMN element.
4153      *
4154      * @param {EventBus}
4155      *            eventBus
4156      */
4157     function UpdateTextHandler(eventBus) {
4158
4159       function setText(element, text) {
4160         var label = LabelUtil.setLabel(element, text);
4161
4162         eventBus.fire('element.changed', {
4163           element: label
4164         });
4165       }
4166
4167       function execute(ctx) {
4168         ctx.oldLabel = LabelUtil.getLabel(ctx.element);
4169         return setText(ctx.element, ctx.newLabel);
4170       }
4171
4172       function revert(ctx) {
4173         return setText(ctx.element, ctx.oldLabel);
4174       }
4175
4176
4177       function canExecute(ctx) {
4178         return true;
4179       }
4180
4181       // API
4182
4183       this.execute = execute;
4184       this.revert = revert;
4185
4186       this.canExecute = canExecute;
4187     }
4188
4189
4190     UpdateTextHandler.$inject = ['eventBus'];
4191
4192     module.exports = UpdateTextHandler;
4193   }, {
4194     "../LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js"
4195   }],
4196   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js": [function(require, module, exports) {
4197     module.exports = {
4198       __depends__: [
4199         require('diagram-js/lib/command'),
4200         require('diagram-js/lib/features/change-support'),
4201         require('diagram-js-direct-editing')
4202       ],
4203       __init__: ['labelEditingProvider'],
4204       labelEditingProvider: ['type', require('./LabelEditingProvider')]
4205     };
4206   }, {
4207     "./LabelEditingProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelEditingProvider.js",
4208     "diagram-js-direct-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js",
4209     "diagram-js/lib/command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
4210     "diagram-js/lib/features/change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js"
4211   }],
4212   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnFactory.js": [function(require, module, exports) {
4213     'use strict';
4214
4215     var map = require('lodash/collection/map'),
4216       assign = require('lodash/object/assign'),
4217       pick = require('lodash/object/pick');
4218
4219
4220     function BpmnFactory(moddle) {
4221       this._model = moddle;
4222     }
4223
4224     BpmnFactory.$inject = ['moddle'];
4225
4226
4227     BpmnFactory.prototype._needsId = function(element) {
4228       return element.$instanceOf('bpmn:RootElement') ||
4229         element.$instanceOf('bpmn:FlowElement') ||
4230         element.$instanceOf('bpmn:MessageFlow') ||
4231         element.$instanceOf('bpmn:Artifact') ||
4232         element.$instanceOf('bpmn:Participant') ||
4233         element.$instanceOf('bpmn:Process') ||
4234         element.$instanceOf('bpmn:Collaboration') ||
4235         element.$instanceOf('bpmndi:BPMNShape') ||
4236         element.$instanceOf('bpmndi:BPMNEdge') ||
4237         element.$instanceOf('bpmndi:BPMNDiagram') ||
4238         element.$instanceOf('bpmndi:BPMNPlane');
4239     };
4240
4241     BpmnFactory.prototype._ensureId = function(element) {
4242
4243       // generate semantic ids for elements
4244       // bpmn:SequenceFlow -> SequenceFlow_ID
4245       var prefix = (element.$type || '').replace(/^[^:]*:/g, '') + '_';
4246
4247       if (!element.id && this._needsId(element)) {
4248         element.id = this._model.ids.nextPrefixed(prefix, element);
4249       }
4250     };
4251
4252
4253     BpmnFactory.prototype.create = function(type, attrs) {
4254       var element = this._model.create(type, attrs || {});
4255
4256       this._ensureId(element);
4257
4258       return element;
4259     };
4260
4261
4262     BpmnFactory.prototype.createDiLabel = function() {
4263       return this.create('bpmndi:BPMNLabel', {
4264         bounds: this.createDiBounds()
4265       });
4266     };
4267
4268
4269     BpmnFactory.prototype.createDiShape = function(semantic, bounds, attrs) {
4270
4271       return this.create('bpmndi:BPMNShape', assign({
4272         bpmnElement: semantic,
4273         bounds: this.createDiBounds(bounds)
4274       }, attrs));
4275     };
4276
4277
4278     BpmnFactory.prototype.createDiBounds = function(bounds) {
4279       return this.create('dc:Bounds', bounds);
4280     };
4281
4282
4283     BpmnFactory.prototype.createDiWaypoints = function(waypoints) {
4284       return map(waypoints, function(pos) {
4285         return this.createDiWaypoint(pos);
4286       }, this);
4287     };
4288
4289     BpmnFactory.prototype.createDiWaypoint = function(point) {
4290       return this.create('dc:Point', pick(point, ['x', 'y']));
4291     };
4292
4293
4294     BpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {
4295       return this.create('bpmndi:BPMNEdge', assign({
4296         bpmnElement: semantic
4297       }, attrs));
4298     };
4299
4300     BpmnFactory.prototype.createDiPlane = function(semantic) {
4301       return this.create('bpmndi:BPMNPlane', {
4302         bpmnElement: semantic
4303       });
4304     };
4305
4306     module.exports = BpmnFactory;
4307
4308   }, {
4309     "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
4310     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
4311     "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
4312   }],
4313   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnLayouter.js": [function(require, module, exports) {
4314     'use strict';
4315
4316     var inherits = require('inherits');
4317
4318     var assign = require('lodash/object/assign');
4319
4320     var BaseLayouter = require('diagram-js/lib/layout/BaseLayouter'),
4321       LayoutUtil = require('diagram-js/lib/layout/LayoutUtil'),
4322       ManhattanLayout = require('diagram-js/lib/layout/ManhattanLayout');
4323
4324     var is = require('../../util/ModelUtil').is;
4325
4326
4327     function BpmnLayouter() {}
4328
4329     inherits(BpmnLayouter, BaseLayouter);
4330
4331     module.exports = BpmnLayouter;
4332
4333
4334     function getAttachment(waypoints, idx, shape) {
4335       var point = waypoints && waypoints[idx];
4336
4337       return point ? (point.original || point) : LayoutUtil.getMidPoint(shape);
4338     }
4339
4340
4341     BpmnLayouter.prototype.layoutConnection = function(connection, hints) {
4342       var source = connection.source,
4343         target = connection.target,
4344         waypoints = connection.waypoints,
4345         start,
4346         end;
4347
4348       var layoutManhattan,
4349         updatedWaypoints;
4350
4351       start = getAttachment(waypoints, 0, source);
4352       end = getAttachment(waypoints, waypoints && waypoints.length - 1, target);
4353
4354       // manhattan layout sequence / message flows
4355       if (is(connection, 'bpmn:MessageFlow')) {
4356         layoutManhattan = {
4357           preferStraight: true,
4358           preferVertical: true
4359         };
4360       }
4361
4362       if (is(connection, 'bpmn:SequenceFlow')) {
4363         layoutManhattan = {};
4364       }
4365
4366       if (layoutManhattan) {
4367
4368         layoutManhattan = assign(layoutManhattan, hints);
4369
4370         updatedWaypoints =
4371           ManhattanLayout.repairConnection(
4372             source, target, start, end,
4373             waypoints,
4374             layoutManhattan);
4375       }
4376
4377       return updatedWaypoints || [start, end];
4378     };
4379   }, {
4380     "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
4381     "diagram-js/lib/layout/BaseLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js",
4382     "diagram-js/lib/layout/LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
4383     "diagram-js/lib/layout/ManhattanLayout": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\ManhattanLayout.js",
4384     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4385     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4386   }],
4387   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnUpdater.js": [function(require, module, exports) {
4388     'use strict';
4389
4390     var assign = require('lodash/object/assign'),
4391       forEach = require('lodash/collection/forEach'),
4392       inherits = require('inherits');
4393
4394     var Collections = require('diagram-js/lib/util/Collections'),
4395       Model = require('diagram-js/lib/model');
4396
4397     var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
4398
4399
4400     /**
4401      * A handler responsible for updating the underlying BPMN 2.0 XML + DI once
4402      * changes on the diagram happen
4403      */
4404     function BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {
4405
4406       CommandInterceptor.call(this, eventBus);
4407
4408       this._bpmnFactory = bpmnFactory;
4409
4410       var self = this;
4411
4412
4413
4414       // //// connection cropping /////////////////////////
4415
4416       // crop connection ends during create/update
4417       function cropConnection(e) {
4418         var context = e.context,
4419           connection;
4420
4421         if (!context.cropped) {
4422           connection = context.connection;
4423           connection.waypoints = connectionDocking.getCroppedWaypoints(connection);
4424           context.cropped = true;
4425         }
4426       }
4427
4428       this.executed([
4429         'connection.layout',
4430         'connection.create',
4431         'connection.reconnectEnd',
4432         'connection.reconnectStart'
4433       ], cropConnection);
4434
4435       this.reverted(['connection.layout'], function(e) {
4436         delete e.context.cropped;
4437       });
4438
4439
4440
4441       // //// BPMN + DI update /////////////////////////
4442
4443
4444       // update parent
4445       function updateParent(e) {
4446         self.updateParent(e.context.shape || e.context.connection);
4447       }
4448
4449       this.executed(['shape.move',
4450         'shape.create',
4451         'shape.delete',
4452         'connection.create',
4453         'connection.move',
4454         'connection.delete'
4455       ], updateParent);
4456       this.reverted(['shape.move',
4457         'shape.create',
4458         'shape.delete',
4459         'connection.create',
4460         'connection.move',
4461         'connection.delete'
4462       ], updateParent);
4463
4464       /*
4465        * ## Updating Parent
4466        *
4467        * When morphing a Process into a Collaboration or vice-versa, make sure
4468        * that both the *semantic* and *di* parent of each element is updated.
4469        *
4470        */
4471       function updateRoot(event) {
4472         var context = event.context,
4473           oldRoot = context.oldRoot,
4474           children = oldRoot.children;
4475
4476         forEach(children, function(child) {
4477           self.updateParent(child);
4478         });
4479       }
4480
4481       this.executed(['canvas.updateRoot'], updateRoot);
4482       this.reverted(['canvas.updateRoot'], updateRoot);
4483
4484
4485       // update bounds
4486       function updateBounds(e) {
4487         self.updateBounds(e.context.shape);
4488       }
4489
4490       this.executed(['shape.move', 'shape.create', 'shape.resize'], updateBounds);
4491       this.reverted(['shape.move', 'shape.create', 'shape.resize'], updateBounds);
4492
4493
4494       // attach / detach connection
4495       function updateConnection(e) {
4496         self.updateConnection(e.context.connection);
4497       }
4498
4499       this.executed([
4500         'connection.create',
4501         'connection.move',
4502         'connection.delete',
4503         'connection.reconnectEnd',
4504         'connection.reconnectStart'
4505       ], updateConnection);
4506
4507       this.reverted([
4508         'connection.create',
4509         'connection.move',
4510         'connection.delete',
4511         'connection.reconnectEnd',
4512         'connection.reconnectStart'
4513       ], updateConnection);
4514
4515
4516       // update waypoints
4517       function updateConnectionWaypoints(e) {
4518         self.updateConnectionWaypoints(e.context.connection);
4519       }
4520
4521       this.executed([
4522         'connection.layout',
4523         'connection.move',
4524         'connection.updateWaypoints',
4525         'connection.reconnectEnd',
4526         'connection.reconnectStart'
4527       ], updateConnectionWaypoints);
4528
4529       this.reverted([
4530         'connection.layout',
4531         'connection.move',
4532         'connection.updateWaypoints',
4533         'connection.reconnectEnd',
4534         'connection.reconnectStart'
4535       ], updateConnectionWaypoints);
4536     }
4537
4538     inherits(BpmnUpdater, CommandInterceptor);
4539
4540     module.exports = BpmnUpdater;
4541
4542     BpmnUpdater.$inject = ['eventBus', 'bpmnFactory', 'connectionDocking'];
4543
4544
4545     // ///// implementation //////////////////////////////////
4546
4547
4548     BpmnUpdater.prototype.updateParent = function(element) {
4549
4550       // do not update BPMN 2.0 label parent
4551       if (element instanceof Model.Label) {
4552         return;
4553       }
4554
4555       var parentShape = element.parent;
4556
4557       var businessObject = element.businessObject,
4558         parentBusinessObject = parentShape && parentShape.businessObject,
4559         parentDi = parentBusinessObject && parentBusinessObject.di;
4560
4561       this.updateSemanticParent(businessObject, parentBusinessObject);
4562
4563       this.updateDiParent(businessObject.di, parentDi);
4564     };
4565
4566
4567     BpmnUpdater.prototype.updateBounds = function(shape) {
4568
4569       var di = shape.businessObject.di;
4570
4571       var bounds = (shape instanceof Model.Label) ? this._getLabel(di).bounds : di.bounds;
4572
4573       assign(bounds, {
4574         x: shape.x,
4575         y: shape.y,
4576         width: shape.width,
4577         height: shape.height
4578       });
4579     };
4580
4581
4582     BpmnUpdater.prototype.updateDiParent = function(di, parentDi) {
4583
4584       if (parentDi && !parentDi.$instanceOf('bpmndi:BPMNPlane')) {
4585         parentDi = parentDi.$parent;
4586       }
4587
4588       if (di.$parent === parentDi) {
4589         return;
4590       }
4591
4592       var planeElements = (parentDi || di.$parent).get('planeElement');
4593
4594       if (parentDi) {
4595         planeElements.push(di);
4596         di.$parent = parentDi;
4597       } else {
4598         Collections.remove(planeElements, di);
4599         di.$parent = null;
4600       }
4601     };
4602
4603     function getDefinitions(element) {
4604       while (element && !element.$instanceOf('bpmn:Definitions')) {
4605         element = element.$parent;
4606       }
4607
4608       return element;
4609     }
4610
4611     BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent) {
4612
4613       var containment;
4614
4615       if (businessObject.$parent === newParent) {
4616         return;
4617       }
4618
4619       if (businessObject.$instanceOf('bpmn:FlowElement')) {
4620
4621         if (newParent && newParent.$instanceOf('bpmn:Participant')) {
4622           newParent = newParent.processRef;
4623         }
4624
4625         containment = 'flowElements';
4626
4627       } else
4628
4629       if (businessObject.$instanceOf('bpmn:Artifact')) {
4630
4631         while (newParent &&
4632           !newParent.$instanceOf('bpmn:Process') &&
4633           !newParent.$instanceOf('bpmn:SubProcess') &&
4634           !newParent.$instanceOf('bpmn:Collaboration')) {
4635
4636           if (newParent.$instanceOf('bpmn:Participant')) {
4637             newParent = newParent.processRef;
4638             break;
4639           } else {
4640             newParent = newParent.$parent;
4641           }
4642         }
4643
4644         containment = 'artifacts';
4645       } else
4646
4647       if (businessObject.$instanceOf('bpmn:MessageFlow')) {
4648         containment = 'messageFlows';
4649
4650       } else
4651
4652       if (businessObject.$instanceOf('bpmn:Participant')) {
4653         containment = 'participants';
4654
4655         // make sure the participants process is properly attached / detached
4656         // from the XML document
4657
4658         var process = businessObject.processRef,
4659           definitions;
4660
4661         if (process) {
4662           definitions = getDefinitions(businessObject.$parent || newParent);
4663
4664           if (businessObject.$parent) {
4665             Collections.remove(definitions.get('rootElements'), process);
4666             process.$parent = null;
4667           }
4668
4669           if (newParent) {
4670             Collections.add(definitions.get('rootElements'), process);
4671             process.$parent = definitions;
4672           }
4673         }
4674       }
4675
4676       if (!containment) {
4677         throw new Error('no parent for ', businessObject, newParent);
4678       }
4679
4680       var children;
4681
4682       if (businessObject.$parent) {
4683         // remove from old parent
4684         children = businessObject.$parent.get(containment);
4685         Collections.remove(children, businessObject);
4686       }
4687
4688       if (!newParent) {
4689         businessObject.$parent = null;
4690       } else {
4691         // add to new parent
4692         children = newParent.get(containment);
4693         children.push(businessObject);
4694         businessObject.$parent = newParent;
4695       }
4696     };
4697
4698
4699     BpmnUpdater.prototype.updateConnectionWaypoints = function(connection) {
4700
4701       connection.businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
4702     };
4703
4704
4705     BpmnUpdater.prototype.updateConnection = function(connection) {
4706
4707       var businessObject = connection.businessObject,
4708         newSource = connection.source && connection.source.businessObject,
4709         newTarget = connection.target && connection.target.businessObject;
4710
4711       var inverseSet = businessObject.$instanceOf('bpmn:SequenceFlow');
4712
4713       if (businessObject.sourceRef !== newSource) {
4714         if (inverseSet) {
4715           Collections.remove(businessObject.sourceRef && businessObject.sourceRef.get('outgoing'), businessObject);
4716
4717           if (newSource) {
4718             newSource.get('outgoing').push(businessObject);
4719           }
4720         }
4721
4722         businessObject.sourceRef = newSource;
4723       }
4724       if (businessObject.targetRef !== newTarget) {
4725         if (inverseSet) {
4726           Collections.remove(businessObject.targetRef && businessObject.targetRef.get('incoming'), businessObject);
4727
4728           if (newTarget) {
4729             newTarget.get('incoming').push(businessObject);
4730           }
4731         }
4732
4733         businessObject.targetRef = newTarget;
4734       }
4735
4736       businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
4737     };
4738
4739
4740     // ///// helpers /////////////////////////////////////////
4741
4742     BpmnUpdater.prototype._getLabel = function(di) {
4743       if (!di.label) {
4744         di.label = this._bpmnFactory.createDiLabel();
4745       }
4746
4747       return di.label;
4748     };
4749   }, {
4750     "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
4751     "diagram-js/lib/model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js",
4752     "diagram-js/lib/util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
4753     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4754     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
4755     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4756   }],
4757   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ElementFactory.js": [function(require, module, exports) {
4758     'use strict';
4759
4760     var assign = require('lodash/object/assign'),
4761       inherits = require('inherits');
4762
4763     var BaseElementFactory = require('diagram-js/lib/core/ElementFactory'),
4764       LabelUtil = require('../../util/LabelUtil');
4765
4766
4767     /**
4768      * A bpmn-aware factory for diagram-js shapes
4769      */
4770     function ElementFactory(bpmnFactory, moddle) {
4771       BaseElementFactory.call(this);
4772
4773       this._bpmnFactory = bpmnFactory;
4774       this._moddle = moddle;
4775     }
4776
4777     inherits(ElementFactory, BaseElementFactory);
4778
4779
4780     ElementFactory.$inject = ['bpmnFactory', 'moddle'];
4781
4782     module.exports = ElementFactory;
4783
4784     ElementFactory.prototype.baseCreate = BaseElementFactory.prototype.create;
4785
4786     ElementFactory.prototype.create = function(elementType, attrs) {
4787
4788       // no special magic for labels,
4789       // we assume their businessObjects have already been created
4790       // and wired via attrs
4791       if (elementType === 'label') {
4792         return this.baseCreate(elementType, assign({
4793           type: 'label'
4794         }, LabelUtil.DEFAULT_LABEL_SIZE, attrs));
4795       }
4796
4797       attrs = attrs || {};
4798
4799       var businessObject = attrs.businessObject,
4800         size;
4801
4802       if (!businessObject) {
4803         if (!attrs.type) {
4804           throw new Error('no shape type specified');
4805         }
4806
4807         businessObject = this._bpmnFactory.create(attrs.type);
4808       }
4809
4810       if (!businessObject.di) {
4811         if (elementType === 'root') {
4812           businessObject.di = this._bpmnFactory.createDiPlane(businessObject, [], {
4813             id: businessObject.id + '_di'
4814           });
4815         } else
4816         if (elementType === 'connection') {
4817           businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {
4818             id: businessObject.id + '_di'
4819           });
4820         } else {
4821           businessObject.di = this._bpmnFactory.createDiShape(businessObject, {}, {
4822             id: businessObject.id + '_di'
4823           });
4824         }
4825       }
4826
4827       if (!!attrs.isExpanded) {
4828         businessObject.di.isExpanded = attrs.isExpanded;
4829       }
4830
4831       /*
4832        * if (businessObject.$instanceOf('bpmn:ExclusiveGateway')) {
4833        * businessObject.di.isMarkerVisible = true; }
4834        */
4835
4836       if (attrs._eventDefinitionType) {
4837         var eventDefinitions = businessObject.get('eventDefinitions') || [],
4838           newEventDefinition = this._moddle.create(attrs._eventDefinitionType);
4839
4840         eventDefinitions.push(newEventDefinition);
4841         businessObject.eventDefinitions = eventDefinitions;
4842       }
4843
4844       size = this._getDefaultSize(businessObject);
4845
4846       attrs = assign({
4847         businessObject: businessObject,
4848         id: businessObject.id
4849       }, size, attrs);
4850
4851       return this.baseCreate(elementType, attrs);
4852     };
4853
4854
4855     ElementFactory.prototype._getDefaultSize = function(semantic) {
4856
4857       if (semantic.$instanceOf('bpmn:SubProcess')) {
4858         var isExpanded = semantic.di.isExpanded === true;
4859
4860         if (isExpanded) {
4861           return {
4862             width: 350,
4863             height: 200
4864           };
4865         } else {
4866           return {
4867             width: 100,
4868             height: 80
4869           };
4870         }
4871       }
4872
4873       if (semantic.$instanceOf('bpmn:InitiateProcess')) {
4874         return {
4875           width: 120,
4876           height: 80
4877         };
4878       }
4879       if (semantic.$instanceOf('bpmn:VesCollector')) {
4880         return {
4881           width: 120,
4882           height: 80
4883         };
4884       }
4885       if (semantic.$instanceOf('bpmn:Holmes')) {
4886         return {
4887           width: 120,
4888           height: 80
4889         };
4890       }
4891       if (semantic.$instanceOf('bpmn:TCA')) {
4892         return {
4893           width: 120,
4894           height: 80
4895         };
4896       }
4897
4898       if (semantic.$instanceOf('bpmn:Policy')) {
4899         return {
4900           width: 120,
4901           height: 80
4902         };
4903       }
4904
4905       if (semantic.$instanceOf('bpmn:GOC')) {
4906         return {
4907           width: 120,
4908           height: 80
4909         };
4910       }
4911       if (semantic.$instanceOf('bpmn:ParentReturn')) {
4912         return {
4913           width: 100,
4914           height: 80
4915         };
4916       }
4917       if (semantic.$instanceOf('bpmn:SubProcessCall')) {
4918         return {
4919           width: 100,
4920           height: 80
4921         };
4922       }
4923
4924       if (semantic.$instanceOf('bpmn:ExclusiveGateway')) {
4925         return {
4926           width: 100,
4927           height: 80
4928         };
4929       }
4930
4931       if (semantic.$instanceOf('bpmn:Task')) {
4932         return {
4933           width: 100,
4934           height: 80
4935         };
4936       }
4937
4938       if (semantic.$instanceOf('bpmn:Gateway')) {
4939         return {
4940           width: 100,
4941           height: 100
4942         };
4943       }
4944
4945       if (semantic.$instanceOf('bpmn:Event')) {
4946         return {
4947           width: 36,
4948           height: 36
4949         };
4950       }
4951
4952       if (semantic.$instanceOf('bpmn:Participant')) {
4953         return {
4954           width: 100,
4955           height: 80
4956         };
4957       }
4958
4959       return {
4960         width: 100,
4961         height: 80
4962       };
4963     };
4964
4965
4966     ElementFactory.prototype.createParticipantShape = function(collapsed) {
4967       // alert("entering createParticipantShape");
4968       var participantShape = this.createShape({
4969         type: 'bpmn:Participant'
4970       });
4971
4972       if (!collapsed) {
4973         participantShape.businessObject.processRef = this._bpmnFactory.create('bpmn:Process');
4974       }
4975
4976       return participantShape;
4977     };
4978   }, {
4979     "../../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
4980     "diagram-js/lib/core/ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js",
4981     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4982     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4983   }],
4984   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\LabelSupport.js": [function(require, module, exports) {
4985     'use strict';
4986
4987     var assign = require('lodash/object/assign'),
4988       forEach = require('lodash/collection/forEach');
4989
4990     var LabelUtil = require('../../util/LabelUtil');
4991
4992     var hasExternalLabel = LabelUtil.hasExternalLabel,
4993       getExternalLabelMid = LabelUtil.getExternalLabelMid;
4994
4995
4996     function LabelSupport(eventBus, modeling, bpmnFactory) {
4997
4998       // create external labels on shape creation
4999
5000       eventBus.on([
5001         'commandStack.shape.create.postExecute',
5002         'commandStack.connection.create.postExecute'
5003       ], function(e) {
5004         var context = e.context;
5005
5006         var element = context.shape || context.connection,
5007           businessObject = element.businessObject;
5008
5009         var position;
5010
5011         if (hasExternalLabel(businessObject)) {
5012           position = getExternalLabelMid(element);
5013           modeling.createLabel(element, position, {
5014             id: businessObject.id + '_label',
5015             businessObject: businessObject
5016           });
5017         }
5018       });
5019
5020
5021       //move label when connection/shape is being moved
5022       //if shape is being moved, get connection as element
5023
5024       eventBus.on(['commandStack.connection.create.postExecute',
5025         'commandStack.connection.move.postExecute',
5026         //'commandStack.connection.delete.postExecute',
5027         'commandStack.connection.reconnectEnd.postExecute',
5028         'commandStack.connection.reconnectStart.postExecute',
5029         'commandStack.connection.updateWaypoints.postExecute',
5030         'shape.move.end'
5031       ], function(e) {
5032
5033         var context = e.context;
5034         var element;
5035
5036         if (context.allDraggedElements != null) {
5037           if (context.allDraggedElements.length > 0) {
5038             element = context.allDraggedElements[1];
5039           }
5040         } else {
5041           element = context.connection;
5042         }
5043
5044         if (element == null) {
5045           return;
5046         }
5047
5048         var businessObject = element.businessObject;
5049
5050         if (businessObject.$type != 'bpmn:SequenceFlow') {
5051           return;
5052         }
5053
5054         var position;
5055
5056         if (hasExternalLabel(businessObject)) {
5057           position = getExternalLabelMid(element);
5058           modeling.removeShape(element.label);
5059           modeling.createLabel(element, position, {
5060             id: businessObject.id + '_label',
5061             businessObject: businessObject
5062           });
5063         }
5064
5065       });
5066
5067
5068       // indicate label is dragged during move
5069
5070       // we need to add labels to the list of selected
5071       // shapes before the visuals get drawn.
5072       //
5073       // Hence this awesome magic number.
5074       //
5075       eventBus.on('shape.move.start', function(e) {
5076
5077         var context = e.context,
5078           shapes = context.shapes;
5079
5080         var labels = [];
5081
5082         forEach(shapes, function(element) {
5083           var label = element.label;
5084
5085           if (label && !label.hidden && context.shapes.indexOf(label) === -1) {
5086             labels.push(label);
5087           }
5088         });
5089
5090         forEach(labels, function(label) {
5091           shapes.push(label);
5092         });
5093       });
5094
5095
5096       // move labels with shapes
5097
5098       eventBus.on([
5099         'commandStack.shapes.move.postExecute'
5100       ], function(e) {
5101
5102         var context = e.context,
5103           closure = context.closure,
5104           enclosedElements = closure.enclosedElements;
5105
5106         // ensure we move all labels with their respective elements
5107         // if they have not been moved already
5108
5109         forEach(enclosedElements, function(e) {
5110           if (e.label && !enclosedElements[e.label.id]) {
5111             modeling.moveShape(e.label, context.delta, e.parent);
5112           }
5113         });
5114       });
5115
5116
5117       // update di information on label movement and creation
5118
5119       eventBus.on([
5120         'commandStack.label.create.executed',
5121         'commandStack.shape.moved.executed'
5122       ], function(e) {
5123
5124         var element = e.context.shape,
5125           businessObject = element.businessObject,
5126           di = businessObject.di;
5127
5128         // we want to trigger on real labels only
5129         if (!element.labelTarget) {
5130           return;
5131         }
5132
5133         if (!di.label) {
5134           di.label = bpmnFactory.create('bpmndi:BPMNLabel', {
5135             bounds: bpmnFactory.create('dc:Bounds')
5136           });
5137         }
5138
5139         assign(di.label.bounds, {
5140           x: element.x,
5141           y: element.y,
5142           width: element.width,
5143           height: element.height
5144         });
5145       });
5146     }
5147
5148     LabelSupport.$inject = ['eventBus', 'modeling', 'bpmnFactory'];
5149
5150     module.exports = LabelSupport;
5151
5152   }, {
5153     "../../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
5154     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
5155     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
5156   }],
5157   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\Modeling.js": [function(require, module, exports) {
5158     'use strict';
5159
5160     var inherits = require('inherits');
5161
5162     var BaseModeling = require('diagram-js/lib/features/modeling/Modeling');
5163
5164     var UpdatePropertiesHandler = require('./cmd/UpdatePropertiesHandler'),
5165       UpdateCanvasRootHandler = require('./cmd/UpdateCanvasRootHandler');
5166
5167
5168     /**
5169      * BPMN 2.0 modeling features activator
5170      *
5171      * @param {EventBus}
5172      *            eventBus
5173      * @param {ElementFactory}
5174      *            elementFactory
5175      * @param {CommandStack}
5176      *            commandStack
5177      * @param {BpmnRules}
5178      *            bpmnRules
5179      */
5180     function Modeling(eventBus, elementFactory, commandStack, bpmnRules) {
5181       BaseModeling.call(this, eventBus, elementFactory, commandStack);
5182
5183       this._bpmnRules = bpmnRules;
5184     }
5185
5186     inherits(Modeling, BaseModeling);
5187
5188     Modeling.$inject = ['eventBus', 'elementFactory', 'commandStack', 'bpmnRules'];
5189
5190     module.exports = Modeling;
5191
5192
5193     Modeling.prototype.getHandlers = function() {
5194       var handlers = BaseModeling.prototype.getHandlers.call(this);
5195
5196       handlers['element.updateProperties'] = UpdatePropertiesHandler;
5197       handlers['canvas.updateRoot'] = UpdateCanvasRootHandler;
5198
5199       return handlers;
5200     };
5201
5202
5203     Modeling.prototype.updateLabel = function(element, newLabel) {
5204       this._commandStack.execute('element.updateLabel', {
5205         element: element,
5206         newLabel: newLabel
5207       });
5208     };
5209
5210
5211     var getSharedParent = require('./ModelingUtil').getSharedParent;
5212
5213     Modeling.prototype.connect = function(source, target, attrs) {
5214
5215       var bpmnRules = this._bpmnRules;
5216
5217       if (!attrs) {
5218         if (bpmnRules.canConnectMessageFlow(source, target)) {
5219           attrs = {
5220             type: 'bpmn:MessageFlow'
5221           };
5222         } else
5223         if (bpmnRules.canConnectSequenceFlow(source, target)) {
5224           attrs = {
5225             type: 'bpmn:SequenceFlow'
5226           };
5227         } else {
5228           attrs = {
5229             type: 'bpmn:Association'
5230           };
5231         }
5232       }
5233
5234       return this.createConnection(source, target, attrs, getSharedParent(source, target));
5235     };
5236
5237
5238     Modeling.prototype.updateProperties = function(element, properties) {
5239       this._commandStack.execute('element.updateProperties', {
5240         element: element,
5241         properties: properties
5242       });
5243     };
5244
5245
5246     /**
5247      * Transform the current diagram into a collaboration.
5248      *
5249      * @return {djs.model.Root} the new root element
5250      */
5251     Modeling.prototype.makeCollaboration = function() {
5252
5253       var collaborationElement = this._create('root', {
5254         type: 'bpmn:Collaboration'
5255       });
5256
5257       var context = {
5258         newRoot: collaborationElement
5259       };
5260
5261       this._commandStack.execute('canvas.updateRoot', context);
5262
5263       return collaborationElement;
5264     };
5265
5266     /**
5267      * Transform the current diagram into a process.
5268      *
5269      * @return {djs.model.Root} the new root element
5270      */
5271     Modeling.prototype.makeProcess = function() {
5272
5273       var processElement = this._create('root', {
5274         type: 'bpmn:Process'
5275       });
5276
5277       var context = {
5278         newRoot: processElement
5279       };
5280
5281       this._commandStack.execute('canvas.updateRoot', context);
5282     };
5283   }, {
5284     "./ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
5285     "./cmd/UpdateCanvasRootHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdateCanvasRootHandler.js",
5286     "./cmd/UpdatePropertiesHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdatePropertiesHandler.js",
5287     "diagram-js/lib/features/modeling/Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js",
5288     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5289   }],
5290   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js": [function(require, module, exports) {
5291     'use strict';
5292
5293     var find = require('lodash/collection/find');
5294
5295
5296     function getParents(element) {
5297
5298       var parents = [];
5299
5300       while (element) {
5301         element = element.parent;
5302
5303         if (element) {
5304           parents.push(element);
5305         }
5306       }
5307
5308       return parents;
5309     }
5310
5311     module.exports.getParents = getParents;
5312
5313
5314     function getSharedParent(a, b) {
5315
5316       var parentsA = getParents(a),
5317         parentsB = getParents(b);
5318
5319       return find(parentsA, function(parent) {
5320         return parentsB.indexOf(parent) !== -1;
5321       });
5322     }
5323
5324     module.exports.getSharedParent = getSharedParent;
5325   }, {
5326     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js"
5327   }],
5328   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\AppendBehavior.js": [function(require, module, exports) {
5329     'use strict';
5330
5331     var inherits = require('inherits');
5332
5333     var is = require('../../../util/ModelUtil').is;
5334
5335     var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5336
5337
5338     function AppendBehavior(eventBus, elementFactory, bpmnRules) {
5339
5340       CommandInterceptor.call(this, eventBus);
5341
5342       // assign correct shape position unless already set
5343
5344       this.preExecute('shape.append', function(context) {
5345
5346         var source = context.source,
5347           shape = context.shape;
5348
5349         if (!context.position) {
5350
5351           if (is(shape, 'bpmn:TextAnnotation')) {
5352             context.position = {
5353               x: source.x + source.width / 2 + 75,
5354               y: source.y - (50) - shape.height / 2
5355             };
5356           } else {
5357             context.position = {
5358               x: source.x + source.width + 80 + shape.width / 2,
5359               y: source.y + source.height / 2
5360             };
5361           }
5362         }
5363       }, true);
5364     }
5365
5366
5367     AppendBehavior.$inject = ['eventBus', 'elementFactory', 'bpmnRules'];
5368
5369     inherits(AppendBehavior, CommandInterceptor);
5370
5371     module.exports = AppendBehavior;
5372   }, {
5373     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5374     "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5375     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5376   }],
5377   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\CreateBehavior.js": [function(require, module, exports) {
5378     'use strict';
5379
5380     var inherits = require('inherits');
5381
5382     var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5383
5384     var is = require('../../../util/ModelUtil').is;
5385
5386     /**
5387      * BPMN specific create behavior
5388      */
5389     function CreateBehavior(eventBus, modeling) {
5390
5391       CommandInterceptor.call(this, eventBus);
5392
5393
5394       /**
5395        * morph process into collaboration before adding participant onto
5396        * collaboration
5397        */
5398
5399       this.preExecute('shape.create', function(context) {
5400
5401         var parent = context.parent,
5402           shape = context.shape,
5403           position = context.position;
5404
5405         if (is(parent, 'bpmn:Process') && is(shape, 'bpmn:Participant')) {
5406
5407           // this is going to detach the process root
5408           // and set the returned collaboration element
5409           // as the new root element
5410           var collaborationElement = modeling.makeCollaboration();
5411
5412           // monkey patch the create context
5413           // so that the participant is being dropped
5414           // onto the new collaboration root instead
5415           context.position = position;
5416           context.parent = collaborationElement;
5417
5418           context.processRoot = parent;
5419         }
5420       }, true);
5421
5422       this.execute('shape.create', function(context) {
5423
5424         var processRoot = context.processRoot,
5425           shape = context.shape;
5426
5427         if (processRoot) {
5428           context.oldProcessRef = shape.businessObject.processRef;
5429
5430           // assign the participant processRef
5431           shape.businessObject.processRef = processRoot.businessObject;
5432         }
5433       }, true);
5434
5435       this.revert('shape.create', function(context) {
5436         var processRoot = context.processRoot,
5437           shape = context.shape;
5438
5439         if (processRoot) {
5440           // assign the participant processRef
5441           shape.businessObject.processRef = context.oldProcessRef;
5442         }
5443       }, true);
5444
5445       this.postExecute('shape.create', function(context) {
5446
5447         var processRoot = context.processRoot,
5448           shape = context.shape;
5449
5450         if (processRoot) {
5451           // process root is already detached at this point
5452           var processChildren = processRoot.children.slice();
5453           modeling.moveShapes(processChildren, {
5454             x: 0,
5455             y: 0
5456           }, shape);
5457         }
5458         //console.log(context.shape.id);
5459         //newElementProcessor(context.shape.id);
5460         //console.log(context)
5461       }, true);
5462
5463     }
5464
5465     CreateBehavior.$inject = ['eventBus', 'modeling'];
5466
5467     inherits(CreateBehavior, CommandInterceptor);
5468
5469     module.exports = CreateBehavior;
5470   }, {
5471     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5472     "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5473     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5474   }],
5475   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\DropBehavior.js": [function(require, module, exports) {
5476     'use strict';
5477
5478     var forEach = require('lodash/collection/forEach'),
5479       inherits = require('inherits');
5480
5481     var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5482
5483     var is = require('../../../util/ModelUtil').is,
5484       getSharedParent = require('../ModelingUtil').getSharedParent;
5485
5486
5487     function DropBehavior(eventBus, modeling, bpmnRules) {
5488
5489       CommandInterceptor.call(this, eventBus);
5490
5491       // remove sequence flows that should not be allowed
5492       // after a move operation
5493
5494       this.postExecute('shapes.move', function(context) {
5495
5496         var closure = context.closure,
5497           allConnections = closure.allConnections;
5498
5499         forEach(allConnections, function(c) {
5500
5501           var source = c.source,
5502             target = c.target;
5503
5504           var replacementType,
5505             remove;
5506
5507           /**
5508            * Check if incoming or outgoing connections can stay or could be
5509            * substituted with an appropriate replacement.
5510            *
5511            * This holds true for SequenceFlow <> MessageFlow.
5512            */
5513
5514           if (is(c, 'bpmn:SequenceFlow')) {
5515             if (!bpmnRules.canConnectSequenceFlow(source, target)) {
5516               remove = true;
5517             }
5518
5519             if (bpmnRules.canConnectMessageFlow(source, target)) {
5520               replacementType = 'bpmn:MessageFlow';
5521             }
5522           }
5523
5524           // transform message flows into sequence flows, if possible
5525
5526           if (is(c, 'bpmn:MessageFlow')) {
5527
5528             if (!bpmnRules.canConnectMessageFlow(source, target)) {
5529               remove = true;
5530             }
5531
5532             if (bpmnRules.canConnectSequenceFlow(source, target)) {
5533               replacementType = 'bpmn:SequenceFlow';
5534             }
5535           }
5536
5537           if (is(c, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) {
5538             remove = true;
5539           }
5540
5541
5542           // remove invalid connection
5543           if (remove) {
5544             modeling.removeConnection(c);
5545           }
5546
5547           // replace SequenceFlow <> MessageFlow
5548
5549           if (replacementType) {
5550             modeling.createConnection(source, target, {
5551               type: replacementType,
5552               waypoints: c.waypoints.slice()
5553             }, getSharedParent(source, target));
5554           }
5555         });
5556       }, true);
5557     }
5558
5559     inherits(DropBehavior, CommandInterceptor);
5560
5561     DropBehavior.$inject = ['eventBus', 'modeling', 'bpmnRules'];
5562
5563     module.exports = DropBehavior;
5564   }, {
5565     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5566     "../ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
5567     "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5568     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
5569     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
5570   }],
5571   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\ModelingFeedback.js": [function(require, module, exports) {
5572     'use strict';
5573
5574     var is = require('../../../util/ModelUtil').is;
5575
5576
5577     function ModelingFeedback(eventBus, tooltips) {
5578
5579       function showError(position, message) {
5580         tooltips.add({
5581           position: {
5582             x: position.x + 5,
5583             y: position.y + 5
5584           },
5585           type: 'error',
5586           timeout: 2000,
5587           html: '<div>' + message + '</div>'
5588         });
5589       }
5590
5591       eventBus.on(['shape.move.rejected', 'create.rejected'], function(event) {
5592
5593         var context = event.context,
5594           shape = context.shape,
5595           target = context.target;
5596
5597         if (is(target, 'bpmn:Collaboration') && is(shape, 'bpmn:FlowNode')) {
5598           showError(event, 'flow elements must be children of pools/participants');
5599         }
5600       });
5601
5602     }
5603
5604
5605     ModelingFeedback.$inject = ['eventBus', 'tooltips'];
5606
5607     module.exports = ModelingFeedback;
5608   }, {
5609     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js"
5610   }],
5611   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\RemoveBehavior.js": [function(require, module, exports) {
5612     'use strict';
5613
5614     var inherits = require('inherits');
5615
5616     var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5617
5618     var is = require('../../../util/ModelUtil').is;
5619
5620
5621     /**
5622      * BPMN specific remove behavior
5623      */
5624     function RemoveBehavior(eventBus, modeling) {
5625
5626       CommandInterceptor.call(this, eventBus);
5627
5628
5629       /**
5630        * morph collaboration diagram into process diagram after the last
5631        * participant has been removed
5632        */
5633
5634       this.preExecute('shape.delete', function(context) {
5635         //delete elementMap[context.shape.id];
5636         //console.log(context.shape.id);
5637         var shape = context.shape,
5638           parent = shape.parent;
5639
5640         // activate the behavior if the shape to be removed
5641         // is a participant
5642         if (is(shape, 'bpmn:Participant')) {
5643           context.collaborationRoot = parent;
5644         }
5645       }, true);
5646
5647       this.postExecute('shape.delete', function(context) {
5648
5649         var collaborationRoot = context.collaborationRoot;
5650
5651         if (collaborationRoot && !collaborationRoot.businessObject.participants.length) {
5652           // replace empty collaboration with process diagram
5653           modeling.makeProcess();
5654         }
5655       }, true);
5656
5657     }
5658
5659     RemoveBehavior.$inject = ['eventBus', 'modeling'];
5660
5661     inherits(RemoveBehavior, CommandInterceptor);
5662
5663     module.exports = RemoveBehavior;
5664   }, {
5665     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5666     "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5667     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5668   }],
5669   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\index.js": [function(require, module, exports) {
5670     module.exports = {
5671       __init__: [
5672         'appendBehavior',
5673         'createBehavior',
5674         'dropBehavior',
5675         'removeBehavior',
5676         'modelingFeedback'
5677       ],
5678       appendBehavior: ['type', require('./AppendBehavior')],
5679       dropBehavior: ['type', require('./DropBehavior')],
5680       createBehavior: ['type', require('./CreateBehavior')],
5681       removeBehavior: ['type', require('./RemoveBehavior')],
5682       modelingFeedback: ['type', require('./ModelingFeedback')]
5683     };
5684   }, {
5685     "./AppendBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\AppendBehavior.js",
5686     "./CreateBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\CreateBehavior.js",
5687     "./DropBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\DropBehavior.js",
5688     "./ModelingFeedback": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\ModelingFeedback.js",
5689     "./RemoveBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\RemoveBehavior.js"
5690   }],
5691   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdateCanvasRootHandler.js": [function(require, module, exports) {
5692     'use strict';
5693
5694     var Collections = require('diagram-js/lib/util/Collections');
5695
5696
5697     function UpdateCanvasRootHandler(canvas, modeling) {
5698       this._canvas = canvas;
5699       this._modeling = modeling;
5700     }
5701
5702     UpdateCanvasRootHandler.$inject = ['canvas', 'modeling'];
5703
5704     module.exports = UpdateCanvasRootHandler;
5705
5706
5707     UpdateCanvasRootHandler.prototype.execute = function(context) {
5708
5709       var canvas = this._canvas;
5710
5711       var newRoot = context.newRoot,
5712         newRootBusinessObject = newRoot.businessObject,
5713         oldRoot = canvas.getRootElement(),
5714         oldRootBusinessObject = oldRoot.businessObject,
5715         bpmnDefinitions = oldRootBusinessObject.$parent,
5716         diPlane = oldRootBusinessObject.di;
5717
5718       // (1) replace process old <> new root
5719       canvas.setRootElement(newRoot, true);
5720
5721       // (2) update root elements
5722       Collections.add(bpmnDefinitions.rootElements, newRootBusinessObject);
5723       newRootBusinessObject.$parent = bpmnDefinitions;
5724
5725       Collections.remove(bpmnDefinitions.rootElements, oldRootBusinessObject);
5726       oldRootBusinessObject.$parent = null;
5727
5728       // (3) wire di
5729       oldRootBusinessObject.di = null;
5730
5731       diPlane.bpmnElement = newRootBusinessObject;
5732       newRootBusinessObject.di = diPlane;
5733
5734       context.oldRoot = oldRoot;
5735     };
5736
5737
5738     UpdateCanvasRootHandler.prototype.revert = function(context) {
5739
5740       var canvas = this._canvas;
5741
5742       var newRoot = context.newRoot,
5743         newRootBusinessObject = newRoot.businessObject,
5744         oldRoot = context.oldRoot,
5745         oldRootBusinessObject = oldRoot.businessObject,
5746         bpmnDefinitions = newRootBusinessObject.$parent,
5747         diPlane = newRootBusinessObject.di;
5748
5749       // (1) replace process old <> new root
5750       canvas.setRootElement(oldRoot, true);
5751
5752       // (2) update root elements
5753       Collections.remove(bpmnDefinitions.rootElements, newRootBusinessObject);
5754       newRootBusinessObject.$parent = null;
5755
5756       Collections.add(bpmnDefinitions.rootElements, oldRootBusinessObject);
5757       oldRootBusinessObject.$parent = bpmnDefinitions;
5758
5759       // (3) wire di
5760       newRootBusinessObject.di = null;
5761
5762       diPlane.bpmnElement = oldRootBusinessObject;
5763       oldRootBusinessObject.di = diPlane;
5764     };
5765   }, {
5766     "diagram-js/lib/util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
5767   }],
5768   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdatePropertiesHandler.js": [function(require, module, exports) {
5769     'use strict';
5770
5771     var assign = require('lodash/object/assign'),
5772       pick = require('lodash/object/pick'),
5773       keys = require('lodash/object/keys');
5774
5775     var DEFAULT_FLOW = 'default',
5776       NAME = 'name',
5777       ID = 'id';
5778
5779
5780     /**
5781      * A handler that implements a BPMN 2.0 property update.
5782      *
5783      * This should be used to set simple properties on elements with an underlying
5784      * BPMN business object.
5785      *
5786      * Use respective diagram-js provided handlers if you would like to perform
5787      * automated modeling.
5788      */
5789     function UpdatePropertiesHandler(elementRegistry) {
5790       this._elementRegistry = elementRegistry;
5791     }
5792
5793     UpdatePropertiesHandler.$inject = ['elementRegistry'];
5794
5795     module.exports = UpdatePropertiesHandler;
5796
5797
5798     // //// api /////////////////////////////////////////////
5799
5800     /**
5801      * Updates a BPMN element with a list of new properties
5802      *
5803      * @param {Object}
5804      *            context
5805      * @param {djs.model.Base}
5806      *            context.element the element to update
5807      * @param {Object}
5808      *            context.properties a list of properties to set on the element's
5809      *            businessObject (the BPMN model element)
5810      *
5811      * @return {Array<djs.mode.Base>} the updated element
5812      */
5813     UpdatePropertiesHandler.prototype.execute = function(context) {
5814
5815       var element = context.element,
5816         changed = [element];
5817
5818       if (!element) {
5819         throw new Error('element required');
5820       }
5821
5822       var elementRegistry = this._elementRegistry;
5823
5824       var businessObject = element.businessObject,
5825         properties = context.properties,
5826         oldProperties = context.oldProperties || pick(businessObject, keys(properties));
5827
5828       if (ID in properties) {
5829         elementRegistry.updateId(element, properties[ID]);
5830       }
5831
5832       // correctly indicate visual changes on default flow updates
5833       if (DEFAULT_FLOW in properties) {
5834
5835         if (properties[DEFAULT_FLOW]) {
5836           changed.push(elementRegistry.get(properties[DEFAULT_FLOW].id));
5837         }
5838
5839         if (businessObject[DEFAULT_FLOW]) {
5840           changed.push(elementRegistry.get(businessObject[DEFAULT_FLOW].id));
5841         }
5842       }
5843
5844       if (NAME in properties && element.label) {
5845         changed.push(element.label);
5846       }
5847
5848       // update properties
5849       assign(businessObject, properties);
5850
5851
5852       // store old values
5853       context.oldProperties = oldProperties;
5854       context.changed = changed;
5855
5856       // indicate changed on objects affected by the update
5857       return changed;
5858     };
5859
5860     /**
5861      * Reverts the update on a BPMN elements properties.
5862      *
5863      * @param {Object}
5864      *            context
5865      *
5866      * @return {djs.mode.Base} the updated element
5867      */
5868     UpdatePropertiesHandler.prototype.revert = function(context) {
5869
5870       var element = context.element,
5871         oldProperties = context.oldProperties,
5872         businessObject = element.businessObject,
5873         elementRegistry = this._elementRegistry;
5874
5875       assign(businessObject, context.oldProperties);
5876
5877       if (ID in oldProperties) {
5878         elementRegistry.updateId(element, oldProperties[ID]);
5879       }
5880
5881       return context.changed;
5882     };
5883   }, {
5884     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
5885     "lodash/object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
5886     "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
5887   }],
5888   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\index.js": [function(require, module, exports) {
5889     module.exports = {
5890       __init__: ['modeling', 'bpmnUpdater', 'labelSupport'],
5891       __depends__: [
5892         require('../label-editing'),
5893         require('./rules'),
5894         require('./behavior'),
5895         require('diagram-js/lib/command'),
5896         require('diagram-js/lib/features/tooltips'),
5897         require('diagram-js/lib/features/change-support')
5898       ],
5899       bpmnFactory: ['type', require('./BpmnFactory')],
5900       bpmnUpdater: ['type', require('./BpmnUpdater')],
5901       elementFactory: ['type', require('./ElementFactory')],
5902       modeling: ['type', require('./Modeling')],
5903       labelSupport: ['type', require('./LabelSupport')],
5904       layouter: ['type', require('./BpmnLayouter')],
5905       connectionDocking: ['type', require('diagram-js/lib/layout/CroppingConnectionDocking')]
5906     };
5907
5908   }, {
5909     "../label-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js",
5910     "./BpmnFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnFactory.js",
5911     "./BpmnLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnLayouter.js",
5912     "./BpmnUpdater": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnUpdater.js",
5913     "./ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ElementFactory.js",
5914     "./LabelSupport": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\LabelSupport.js",
5915     "./Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\Modeling.js",
5916     "./behavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\index.js",
5917     "./rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\index.js",
5918     "diagram-js/lib/command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
5919     "diagram-js/lib/features/change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js",
5920     "diagram-js/lib/features/tooltips": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\index.js",
5921     "diagram-js/lib/layout/CroppingConnectionDocking": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\CroppingConnectionDocking.js"
5922   }],
5923   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\BpmnRules.js": [function(require, module, exports) {
5924     'use strict';
5925
5926     var groupBy = require('lodash/collection/groupBy'),
5927       size = require('lodash/collection/size'),
5928       find = require('lodash/collection/find'),
5929       inherits = require('inherits');
5930
5931     var getParents = require('../ModelingUtil').getParents,
5932       is = require('../../../util/ModelUtil').is,
5933       getBusinessObject = require('../../../util/ModelUtil').getBusinessObject,
5934       isExpanded = require('../../../util/DiUtil').isExpanded;
5935
5936
5937     var RuleProvider = require('diagram-js/lib/features/rules/RuleProvider');
5938
5939     /**
5940      * BPMN specific modeling rule
5941      */
5942     function BpmnRules(eventBus) {
5943       RuleProvider.call(this, eventBus);
5944     }
5945
5946     inherits(BpmnRules, RuleProvider);
5947
5948     BpmnRules.$inject = ['eventBus'];
5949
5950     module.exports = BpmnRules;
5951
5952     BpmnRules.prototype.init = function() {
5953
5954       this.addRule('connection.create', function(context) {
5955         var source = context.source,
5956           target = context.target;
5957
5958         return canConnect(source, target);
5959       });
5960
5961       this.addRule('connection.reconnectStart', function(context) {
5962
5963         var connection = context.connection,
5964           source = context.hover || context.source,
5965           target = connection.target;
5966
5967         return canConnect(source, target, connection);
5968       });
5969
5970       this.addRule('connection.reconnectEnd', function(context) {
5971
5972         var connection = context.connection,
5973           source = connection.source,
5974           target = context.hover || context.target;
5975
5976         return canConnect(source, target, connection);
5977       });
5978
5979       this.addRule('connection.updateWaypoints', function(context) {
5980         // OK! but visually ignore
5981         return null;
5982       });
5983
5984       this.addRule('shape.resize', function(context) {
5985
5986         var shape = context.shape,
5987           newBounds = context.newBounds;
5988
5989         return canResize(shape, newBounds);
5990       });
5991
5992       this.addRule('shapes.move', function(context) {
5993
5994         var target = context.newParent,
5995           shapes = context.shapes;
5996
5997         return canMove(shapes, target);
5998       });
5999
6000       this.addRule(['shape.create', 'shape.append'], function(context) {
6001         var target = context.parent,
6002           shape = context.shape,
6003           source = context.source;
6004
6005         return canCreate(shape, target, source);
6006       });
6007
6008     };
6009
6010     BpmnRules.prototype.canConnectMessageFlow = canConnectMessageFlow;
6011
6012     BpmnRules.prototype.canConnectSequenceFlow = canConnectSequenceFlow;
6013
6014     BpmnRules.prototype.canConnectAssociation = canConnectAssociation;
6015
6016     BpmnRules.prototype.canMove = canMove;
6017
6018     BpmnRules.prototype.canDrop = canDrop;
6019
6020     BpmnRules.prototype.canCreate = canCreate;
6021
6022     BpmnRules.prototype.canConnect = canConnect;
6023
6024     BpmnRules.prototype.canResize = canResize;
6025
6026     /**
6027      * Utility functions for rule checking
6028      */
6029
6030     function nonExistantOrLabel(element) {
6031       return !element || isLabel(element);
6032     }
6033
6034     function isSame(a, b) {
6035       return a === b;
6036     }
6037
6038     function getOrganizationalParent(element) {
6039
6040       var bo = getBusinessObject(element);
6041
6042       while (bo && !is(bo, 'bpmn:Process')) {
6043         if (is(bo, 'bpmn:Participant')) {
6044           return bo.processRef || bo;
6045         }
6046
6047         bo = bo.$parent;
6048       }
6049
6050       return bo;
6051     }
6052
6053     function isSameOrganization(a, b) {
6054       var parentA = getOrganizationalParent(a),
6055         parentB = getOrganizationalParent(b);
6056
6057       return parentA === parentB;
6058     }
6059
6060     function isMessageFlowSource(element) {
6061       return is(element, 'bpmn:InteractionNode') && (!is(element, 'bpmn:Event') || (
6062         is(element, 'bpmn:ThrowEvent') &&
6063         hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
6064       ));
6065     }
6066
6067     function isMessageFlowTarget(element) {
6068       return is(element, 'bpmn:InteractionNode') && (!is(element, 'bpmn:Event') || (
6069         is(element, 'bpmn:CatchEvent') &&
6070         hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
6071       ));
6072     }
6073
6074     function getScopeParent(element) {
6075
6076       var bo = getBusinessObject(element);
6077
6078       if (is(bo, 'bpmn:Participant')) {
6079         return null;
6080       }
6081
6082       while (bo) {
6083         bo = bo.$parent;
6084
6085         if (is(bo, 'bpmn:FlowElementsContainer')) {
6086           return bo;
6087         }
6088       }
6089
6090       return bo;
6091     }
6092
6093     function isSameScope(a, b) {
6094       var scopeParentA = getScopeParent(a),
6095         scopeParentB = getScopeParent(b);
6096
6097       return scopeParentA && (scopeParentA === scopeParentB);
6098     }
6099
6100     function hasEventDefinition(element, eventDefinition) {
6101       var bo = getBusinessObject(element);
6102
6103       return !!find(bo.eventDefinitions || [], function(definition) {
6104         return is(definition, eventDefinition);
6105       });
6106     }
6107
6108     function hasEventDefinitionOrNone(element, eventDefinition) {
6109       var bo = getBusinessObject(element);
6110
6111       return (bo.eventDefinitions || []).every(function(definition) {
6112         return is(definition, eventDefinition);
6113       });
6114     }
6115
6116     function isSequenceFlowSource(element) {
6117       return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:EndEvent') && !(
6118         is(element, 'bpmn:IntermediateThrowEvent') &&
6119         hasEventDefinition(element, 'bpmn:LinkEventDefinition')
6120       );
6121     }
6122
6123     function isSequenceFlowTarget(element) {
6124       return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:StartEvent') && !(
6125         is(element, 'bpmn:IntermediateCatchEvent') &&
6126         hasEventDefinition(element, 'bpmn:LinkEventDefinition')
6127       );
6128     }
6129
6130     function isEventBasedTarget(element) {
6131       return is(element, 'bpmn:ReceiveTask') || (
6132         is(element, 'bpmn:IntermediateCatchEvent') && (
6133           hasEventDefinition(element, 'bpmn:MessageEventDefinition') ||
6134           hasEventDefinition(element, 'bpmn:TimerEventDefinition') ||
6135           hasEventDefinition(element, 'bpmn:ConditionalEventDefinition') ||
6136           hasEventDefinition(element, 'bpmn:SignalEventDefinition')
6137         )
6138       );
6139     }
6140
6141     function isLabel(element) {
6142       return element.labelTarget;
6143     }
6144
6145     function isConnection(element) {
6146       return element.waypoints;
6147     }
6148
6149     function isParent(possibleParent, element) {
6150       var allParents = getParents(element);
6151       return allParents.indexOf(possibleParent) !== -1;
6152     }
6153
6154     function canConnect(source, target, connection) {
6155
6156       if (nonExistantOrLabel(source) || nonExistantOrLabel(target)) {
6157         return null;
6158       }
6159
6160       // See https://github.com/bpmn-io/bpmn-js/issues/178
6161       // as a workround we disallow connections with same
6162       // target and source element.
6163       // This rule must be removed if a auto layout for this
6164       // connections is implemented.
6165       if (isSame(source, target)) {
6166         return false;
6167       }
6168
6169       if (canConnectMessageFlow(source, target) ||
6170         canConnectSequenceFlow(source, target)) {
6171
6172         return true;
6173       }
6174
6175       if (is(connection, 'bpmn:Association')) {
6176         return canConnectAssociation(source, target);
6177       }
6178
6179       return false;
6180     }
6181
6182     /**
6183      * Can an element be dropped into the target element
6184      *
6185      * @return {Boolean}
6186      */
6187     function canDrop(element, target) {
6188
6189       // can move labels everywhere
6190       if (isLabel(element) && !isConnection(target)) {
6191         return true;
6192       }
6193
6194       // allow to create new participants on
6195       // on existing collaboration and process diagrams
6196       if (is(element, 'bpmn:Participant')) {
6197         return is(target, 'bpmn:Process') || is(target, 'bpmn:Collaboration');
6198       }
6199
6200       // drop flow elements onto flow element containers
6201       // and participants
6202       if (is(element, 'bpmn:FlowElement')) {
6203         if (is(target, 'bpmn:FlowElementsContainer')) {
6204           return isExpanded(target) !== false;
6205         }
6206
6207         return is(target, 'bpmn:Participant');
6208       }
6209
6210       if (is(element, 'bpmn:Artifact')) {
6211         return is(target, 'bpmn:Collaboration') ||
6212           is(target, 'bpmn:Participant') ||
6213           is(target, 'bpmn:Process');
6214       }
6215
6216       if (is(element, 'bpmn:MessageFlow')) {
6217         return is(target, 'bpmn:Collaboration');
6218       }
6219
6220       return false;
6221     }
6222
6223     function canMove(elements, target) {
6224
6225       // only move if they have the same parent
6226       var sameParent = size(groupBy(elements, function(s) {
6227         return s.parent && s.parent.id;
6228       })) === 1;
6229
6230       if (!sameParent) {
6231         return false;
6232       }
6233
6234       if (!target) {
6235         return true;
6236       }
6237
6238       return elements.every(function(element) {
6239         return canDrop(element, target);
6240       });
6241     }
6242
6243     function canCreate(shape, target, source) {
6244
6245       if (!target) {
6246         return false;
6247       }
6248
6249       if (isLabel(target)) {
6250         return null;
6251       }
6252
6253       if (isSame(source, target)) {
6254         return false;
6255       }
6256
6257       // ensure we do not drop the element
6258       // into source
6259       if (source && isParent(source, target)) {
6260         return false;
6261       }
6262
6263       return canDrop(shape, target);
6264     }
6265
6266     function canResize(shape, newBounds) {
6267       if (is(shape, 'bpmn:SubProcess')) {
6268         return isExpanded(shape) && (!newBounds || (newBounds.width >= 100 && newBounds.height >= 80));
6269       }
6270
6271       if (is(shape, 'bpmn:Participant')) {
6272         return !newBounds || (newBounds.width >= 100 && newBounds.height >= 80);
6273       }
6274
6275       if (is(shape, 'bpmn:TextAnnotation')) {
6276         return true;
6277       }
6278       if (is(shape, 'bpmn:MultiBranchConnector')) {
6279         return false;
6280       }
6281
6282       return true;
6283     }
6284
6285     function canConnectAssociation(source, target) {
6286
6287       // do not connect connections
6288       if (isConnection(source) || isConnection(target)) {
6289         return false;
6290       }
6291
6292       // connect if different parent
6293       return !isParent(target, source) &&
6294         !isParent(source, target);
6295     }
6296
6297     function canConnectMessageFlow(source, target) {
6298
6299       return isMessageFlowSource(source) &&
6300         isMessageFlowTarget(target) &&
6301         !isSameOrganization(source, target);
6302     }
6303
6304     function canConnectSequenceFlow(source, target) {
6305
6306       return isSequenceFlowSource(source) &&
6307         isSequenceFlowTarget(target) &&
6308         isSameScope(source, target) &&
6309         !(is(source, 'bpmn:EventBasedGateway') && !isEventBasedTarget(target));
6310     }
6311   }, {
6312     "../../../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
6313     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
6314     "../ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
6315     "diagram-js/lib/features/rules/RuleProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\RuleProvider.js",
6316     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
6317     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
6318     "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
6319     "lodash/collection/size": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\size.js"
6320   }],
6321   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\index.js": [function(require, module, exports) {
6322     module.exports = {
6323       __depends__: [
6324         require('diagram-js/lib/features/rules')
6325       ],
6326       __init__: ['bpmnRules'],
6327       bpmnRules: ['type', require('./BpmnRules')]
6328     };
6329
6330   }, {
6331     "./BpmnRules": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\BpmnRules.js",
6332     "diagram-js/lib/features/rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js"
6333   }],
6334   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\PaletteProvider.js": [function(require, module, exports) {
6335     'use strict';
6336
6337     var assign = require('lodash/object/assign');
6338
6339     /**
6340      * A palette provider for BPMN 2.0 elements.
6341      */
6342     function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) {
6343
6344       this._create = create;
6345       this._elementFactory = elementFactory;
6346       this._spaceTool = spaceTool;
6347       this._lassoTool = lassoTool;
6348
6349       palette.registerProvider(this);
6350     }
6351
6352     module.exports = PaletteProvider;
6353
6354     PaletteProvider.$inject = ['palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool'];
6355
6356
6357     PaletteProvider.prototype.getPaletteEntries = function(element) {
6358
6359       var actions = {},
6360         create = this._create,
6361         elementFactory = this._elementFactory,
6362         spaceTool = this._spaceTool,
6363         lassoTool = this._lassoTool;
6364
6365
6366       function createAction(type, group, className, title, options) {
6367         function createListener(event) {
6368           var shape = elementFactory.createShape(assign({
6369             type: type
6370           }, options));
6371
6372           if (options) {
6373             shape.businessObject.di.isExpanded = options.isExpanded;
6374           }
6375
6376           create.start(event, shape);
6377         }
6378
6379         var shortType = type.replace(/^bpmn\:/, '');
6380
6381         return {
6382           group: group,
6383           className: className,
6384           title: title || 'Create ' + shortType,
6385           action: {
6386             dragstart: createListener,
6387             click: createListener
6388           }
6389         };
6390       }
6391
6392       function createParticipant(event, collapsed) {
6393         create.start(event, elementFactory.createParticipantShape(collapsed));
6394       }
6395
6396       assign(actions, {
6397         'create.start-event': createAction(
6398           'bpmn:StartEvent', 'event', 'icon-start-event-none', "Start"
6399         ),
6400         'create.ves-collector': createAction(
6401           'bpmn:VesCollector', 'event', 'icon-ves-collector-node', 'Ves Collector'
6402         ),
6403         'create.holmes': createAction(
6404           'bpmn:Holmes', 'event', 'icon-holmes-node', 'Holmes'
6405         ),
6406
6407
6408         'create.TCA': createAction(
6409           'bpmn:TCA', 'event', 'icon-tca-node', 'TCA'
6410         ),
6411         'create.Aand-AI': createAction(
6412           'bpmn:Policy', 'event', 'icon-policy-node', 'Policy'
6413         ),
6414         'create.end-event': createAction(
6415           'bpmn:EndEvent', 'event', 'icon-end-event-none', "End"
6416         )
6417       });
6418
6419       return actions;
6420     };
6421
6422   }, {
6423     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
6424   }],
6425   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\index.js": [function(require, module, exports) {
6426     module.exports = {
6427       __depends__: [
6428         require('diagram-js/lib/features/palette'),
6429         require('diagram-js/lib/features/create')
6430       ],
6431       __init__: ['paletteProvider'],
6432       paletteProvider: ['type', require('./PaletteProvider')]
6433     };
6434
6435   }, {
6436     "./PaletteProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\PaletteProvider.js",
6437     "diagram-js/lib/features/create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js",
6438     "diagram-js/lib/features/palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\index.js"
6439   }],
6440   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\BpmnReplace.js": [function(require, module, exports) {
6441     'use strict';
6442
6443     var forEach = require('lodash/collection/forEach'),
6444       filter = require('lodash/collection/filter');
6445
6446     var REPLACE_OPTIONS = require('./ReplaceOptions');
6447
6448     var startEventReplace = REPLACE_OPTIONS.START_EVENT,
6449       intermediateEventReplace = REPLACE_OPTIONS.INTERMEDIATE_EVENT,
6450       endEventReplace = REPLACE_OPTIONS.END_EVENT,
6451       gatewayReplace = REPLACE_OPTIONS.GATEWAY,
6452       taskReplace = REPLACE_OPTIONS.TASK;
6453
6454
6455     /**
6456      * A replace menu provider that gives users the controls to choose and replace
6457      * BPMN elements with each other.
6458      *
6459      * @param {BpmnFactory}
6460      *            bpmnFactory
6461      * @param {Moddle}
6462      *            moddle
6463      * @param {PopupMenu}
6464      *            popupMenu
6465      * @param {Replace}
6466      *            replace
6467      */
6468     function BpmnReplace(bpmnFactory, moddle, popupMenu, replace, selection) {
6469
6470       /**
6471        * Prepares a new business object for the replacement element and triggers
6472        * the replace operation.
6473        *
6474        * @param {djs.model.Base}
6475        *            element
6476        * @param {Object}
6477        *            target
6478        * @return {djs.model.Base} the newly created element
6479        */
6480       function replaceElement(element, target) {
6481
6482         var type = target.type,
6483           oldBusinessObject = element.businessObject,
6484           businessObject = bpmnFactory.create(type);
6485
6486         var newElement = {
6487           type: type,
6488           businessObject: businessObject
6489         };
6490
6491         // initialize custom BPMN extensions
6492
6493         if (target.eventDefinition) {
6494           var eventDefinitions = businessObject.get('eventDefinitions'),
6495             eventDefinition = moddle.create(target.eventDefinition);
6496
6497           eventDefinitions.push(eventDefinition);
6498         }
6499
6500         if (target.instantiate !== undefined) {
6501           businessObject.instantiate = target.instantiate;
6502         }
6503
6504         if (target.eventGatewayType !== undefined) {
6505           businessObject.eventGatewayType = target.eventGatewayType;
6506         }
6507
6508         // copy size (for activities only)
6509         if (oldBusinessObject.$instanceOf('bpmn:Activity')) {
6510
6511           // TODO: need also to respect min/max Size
6512
6513           newElement.width = element.width;
6514           newElement.height = element.height;
6515         }
6516
6517         // TODO: copy other elligable properties from old business object
6518         businessObject.name = oldBusinessObject.name;
6519
6520         newElement = replace.replaceElement(element, newElement);
6521
6522         selection.select(newElement);
6523
6524         return newElement;
6525       }
6526
6527
6528       function getReplaceOptions(element) {
6529
6530         var menuEntries = [];
6531         var businessObject = element.businessObject;
6532
6533         if (businessObject.$instanceOf('bpmn:StartEvent')) {
6534           addEntries(startEventReplace, filterEvents);
6535         } else
6536
6537         if (businessObject.$instanceOf('bpmn:IntermediateCatchEvent') ||
6538           businessObject.$instanceOf('bpmn:IntermediateThrowEvent')) {
6539
6540           addEntries(intermediateEventReplace, filterEvents);
6541         } else
6542
6543         if (businessObject.$instanceOf('bpmn:EndEvent')) {
6544
6545           addEntries(endEventReplace, filterEvents);
6546         } else
6547
6548         if (businessObject.$instanceOf('bpmn:Gateway')) {
6549
6550           addEntries(gatewayReplace, function(entry) {
6551
6552             return entry.target.type !== businessObject.$type;
6553           });
6554         } else
6555
6556         if (businessObject.$instanceOf('bpmn:FlowNode')) {
6557           addEntries(taskReplace, function(entry) {
6558             return entry.target.type !== businessObject.$type;
6559           });
6560         }
6561
6562         function filterEvents(entry) {
6563
6564           var target = entry.target;
6565
6566           var eventDefinition = businessObject.eventDefinitions && businessObject.eventDefinitions[0].$type;
6567           var isEventDefinitionEqual = target.eventDefinition == eventDefinition;
6568           var isEventTypeEqual = businessObject.$type == target.type;
6569
6570           return ((!isEventDefinitionEqual && isEventTypeEqual) ||
6571               !isEventTypeEqual) ||
6572             !(isEventDefinitionEqual && isEventTypeEqual);
6573         }
6574
6575         function addEntries(entries, filterFun) {
6576           // Filter selected type from the array
6577           var filteredEntries = filter(entries, filterFun);
6578
6579           // Add entries to replace menu
6580           forEach(filteredEntries, function(definition) {
6581
6582             var entry = addMenuEntry(definition);
6583             menuEntries.push(entry);
6584           });
6585         }
6586
6587         function addMenuEntry(definition) {
6588
6589           return {
6590             label: definition.label,
6591             className: definition.className,
6592             action: {
6593               name: definition.actionName,
6594               handler: function() {
6595                 replaceElement(element, definition.target);
6596               }
6597             }
6598           };
6599         }
6600
6601         return menuEntries;
6602       }
6603
6604
6605       // API
6606
6607       this.openChooser = function(position, element) {
6608         var entries = this.getReplaceOptions(element);
6609
6610         popupMenu.open('replace-menu', position, entries);
6611       };
6612
6613       this.getReplaceOptions = getReplaceOptions;
6614
6615       this.replaceElement = replaceElement;
6616     }
6617
6618     BpmnReplace.$inject = ['bpmnFactory', 'moddle', 'popupMenu', 'replace', 'selection'];
6619
6620     module.exports = BpmnReplace;
6621   }, {
6622     "./ReplaceOptions": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\ReplaceOptions.js",
6623     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
6624     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
6625   }],
6626   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\ReplaceOptions.js": [function(require, module, exports) {
6627     'use strict';
6628
6629     module.exports.START_EVENT = [{
6630       label: 'Start Event',
6631       actionName: 'replace-with-none-start',
6632       className: 'icon-start-event-none',
6633       target: {
6634         type: 'bpmn:StartEvent'
6635       }
6636     }, {
6637       label: 'Intermediate Throw Event',
6638       actionName: 'replace-with-intermediate-throwing',
6639       className: 'icon-intermediate-event-none',
6640       target: {
6641         type: 'bpmn:IntermediateThrowEvent'
6642       }
6643     }, {
6644       label: 'End Event',
6645       actionName: 'replace-with-message-end',
6646       className: 'icon-end-event-none',
6647       target: {
6648         type: 'bpmn:EndEvent'
6649       }
6650     }, {
6651       label: 'Message Start Event',
6652       actionName: 'replace-with-message-start',
6653       className: 'icon-start-event-message',
6654       target: {
6655         type: 'bpmn:StartEvent',
6656         eventDefinition: 'bpmn:MessageEventDefinition'
6657       }
6658     }, {
6659       label: 'Timer Start Event',
6660       actionName: 'replace-with-timer-start',
6661       className: 'icon-start-event-timer',
6662       target: {
6663         type: 'bpmn:StartEvent',
6664         eventDefinition: 'bpmn:TimerEventDefinition'
6665       }
6666     }, {
6667       label: 'Conditional Start Event',
6668       actionName: 'replace-with-conditional-start',
6669       className: 'icon-start-event-condition',
6670       target: {
6671         type: 'bpmn:StartEvent',
6672         eventDefinition: 'bpmn:ConditionalEventDefinition'
6673       }
6674     }, {
6675       label: 'Signal Start Event',
6676       actionName: 'replace-with-signal-start',
6677       className: 'icon-start-event-signal',
6678       target: {
6679         type: 'bpmn:StartEvent',
6680         eventDefinition: 'bpmn:SignalEventDefinition'
6681       }
6682     }];
6683
6684     module.exports.INTERMEDIATE_EVENT = [{
6685       label: 'Start Event',
6686       actionName: 'replace-with-none-start',
6687       className: 'icon-start-event-none',
6688       target: {
6689         type: 'bpmn:StartEvent'
6690       }
6691     }, {
6692       label: 'Intermediate Throw Event',
6693       actionName: 'replace-with-message-intermediate-throw',
6694       className: 'icon-intermediate-event-none',
6695       target: {
6696         type: 'bpmn:IntermediateThrowEvent'
6697       }
6698     }, {
6699       label: 'End Event',
6700       actionName: 'replace-with-message-end',
6701       className: 'icon-end-event-none',
6702       target: {
6703         type: 'bpmn:EndEvent'
6704       }
6705     }, {
6706       label: 'Message Intermediate Catch Event',
6707       actionName: 'replace-with-intermediate-catch',
6708       className: 'icon-intermediate-event-catch-message',
6709       target: {
6710         type: 'bpmn:IntermediateCatchEvent',
6711         eventDefinition: 'bpmn:MessageEventDefinition'
6712       }
6713     }, {
6714       label: 'Message Intermediate Throw Event',
6715       actionName: 'replace-with-intermediate-throw',
6716       className: 'icon-intermediate-event-throw-message',
6717       target: {
6718         type: 'bpmn:IntermediateThrowEvent',
6719         eventDefinition: 'bpmn:MessageEventDefinition'
6720       }
6721     }, {
6722       label: 'Timer Intermediate Catch Event',
6723       actionName: 'replace-with-timer-intermediate-catch',
6724       className: 'icon-intermediate-event-catch-timer',
6725       target: {
6726         type: 'bpmn:IntermediateCatchEvent',
6727         eventDefinition: 'bpmn:TimerEventDefinition'
6728       }
6729     }, {
6730       label: 'Escalation Intermediate Catch Event',
6731       actionName: 'replace-with-escalation-catch',
6732       className: 'icon-intermediate-event-catch-escalation',
6733       target: {
6734         type: 'bpmn:IntermediateCatchEvent',
6735         eventDefinition: 'bpmn:EscalationEventDefinition'
6736       }
6737     }, {
6738       label: 'Conditional Intermediate Catch Event',
6739       actionName: 'replace-with-conditional-intermediate-catch',
6740       className: 'icon-intermediate-event-catch-condition',
6741       target: {
6742         type: 'bpmn:IntermediateCatchEvent',
6743         eventDefinition: 'bpmn:ConditionalEventDefinition'
6744       }
6745     }, {
6746       label: 'Link Intermediate Catch Event',
6747       actionName: 'replace-with-link-intermediate-catch',
6748       className: 'icon-intermediate-event-catch-link',
6749       target: {
6750         type: 'bpmn:IntermediateCatchEvent',
6751         eventDefinition: 'bpmn:LinkEventDefinition'
6752       }
6753     }, {
6754       label: 'Link Intermediate Throw Event',
6755       actionName: 'replace-with-link-intermediate-throw',
6756       className: 'icon-intermediate-event-throw-link',
6757       target: {
6758         type: 'bpmn:IntermediateThrowEvent',
6759         eventDefinition: 'bpmn:LinkEventDefinition'
6760       }
6761     }, {
6762       label: 'Compensation Intermediate Throw Event',
6763       actionName: 'replace-with-compensation-intermediate-throw',
6764       className: 'icon-intermediate-event-throw-compensation',
6765       target: {
6766         type: 'bpmn:IntermediateThrowEvent',
6767         eventDefinition: 'bpmn:CompensateEventDefinition'
6768       }
6769     }, {
6770       label: 'Signal Throw Catch Event',
6771       actionName: 'replace-with-throw-intermediate-catch',
6772       className: 'icon-intermediate-event-catch-signal',
6773       target: {
6774         type: 'bpmn:IntermediateCatchEvent',
6775         eventDefinition: 'bpmn:SignalEventDefinition'
6776       }
6777     }, {
6778       label: 'Signal Intermediate Throw Event',
6779       actionName: 'replace-with-signal-intermediate-throw',
6780       className: 'icon-intermediate-event-throw-signal',
6781       target: {
6782         type: 'bpmn:IntermediateThrowEvent',
6783         eventDefinition: 'bpmn:SignalEventDefinition'
6784       }
6785     }];
6786
6787     module.exports.END_EVENT = [{
6788       label: 'Start Event',
6789       actionName: 'replace-with-none-start',
6790       className: 'icon-start-event-none',
6791       target: {
6792         type: 'bpmn:StartEvent'
6793       }
6794     }, {
6795       label: 'Intermediate Throw Event',
6796       actionName: 'replace-with-message-intermediate-throw',
6797       className: 'icon-intermediate-event-none',
6798       target: {
6799         type: 'bpmn:IntermediateThrowEvent'
6800       }
6801     }, {
6802       label: 'End Event',
6803       actionName: 'replace-with-none-end',
6804       className: 'icon-end-event-none',
6805       target: {
6806         type: 'bpmn:EndEvent'
6807       }
6808     }, {
6809       label: 'Message End Event',
6810       actionName: 'replace-with-message-end',
6811       className: 'icon-end-event-message',
6812       target: {
6813         type: 'bpmn:EndEvent',
6814         eventDefinition: 'bpmn:MessageEventDefinition'
6815       }
6816     }, {
6817       label: 'Escalation End Event',
6818       actionName: 'replace-with-escalation-end',
6819       className: 'icon-end-event-escalation',
6820       target: {
6821         type: 'bpmn:EndEvent',
6822         eventDefinition: 'bpmn:EscalationEventDefinition'
6823       }
6824     }, {
6825       label: 'Error End Event',
6826       actionName: 'replace-with-error-end',
6827       className: 'icon-end-event-error',
6828       target: {
6829         type: 'bpmn:EndEvent',
6830         eventDefinition: 'bpmn:ErrorEventDefinition'
6831       }
6832     }, {
6833       label: 'Cancel End Event',
6834       actionName: 'replace-with-cancel-end',
6835       className: 'icon-end-event-cancel',
6836       target: {
6837         type: 'bpmn:EndEvent',
6838         eventDefinition: 'bpmn:CancelEventDefinition'
6839       }
6840     }, {
6841       label: 'Compensation End Event',
6842       actionName: 'replace-with-compensation-end',
6843       className: 'icon-end-event-compensation',
6844       target: {
6845         type: 'bpmn:EndEvent',
6846         eventDefinition: 'bpmn:CompensateEventDefinition'
6847       }
6848     }, {
6849       label: 'Signal End Event',
6850       actionName: 'replace-with-signal-end',
6851       className: 'icon-end-event-signal',
6852       target: {
6853         type: 'bpmn:EndEvent',
6854         eventDefinition: 'bpmn:SignalEventDefinition'
6855       }
6856     }, {
6857       label: 'Terminate End Event',
6858       actionName: 'replace-with-terminate-end',
6859       className: 'icon-end-event-terminate',
6860       target: {
6861         type: 'bpmn:EndEvent',
6862         eventDefinition: 'bpmn:TerminateEventDefinition'
6863       }
6864     }];
6865
6866     module.exports.GATEWAY = [{
6867         label: 'Exclusive Gateway',
6868         actionName: 'replace-with-exclusive-gateway',
6869         className: 'icon-gateway-xor',
6870         target: {
6871           type: 'bpmn:ExclusiveGateway'
6872         }
6873       }, {
6874         label: 'Parallel Gateway',
6875         actionName: 'replace-with-parallel-gateway',
6876         className: 'icon-gateway-parallel',
6877         target: {
6878           type: 'bpmn:ParallelGateway'
6879         }
6880       }, {
6881         label: 'Inclusive Gateway',
6882         actionName: 'replace-with-inclusive-gateway',
6883         className: 'icon-gateway-or',
6884         target: {
6885           type: 'bpmn:InclusiveGateway'
6886         }
6887       }, {
6888         label: 'Complex Gateway',
6889         actionName: 'replace-with-complex-gateway',
6890         className: 'icon-gateway-complex',
6891         target: {
6892           type: 'bpmn:ComplexGateway'
6893         }
6894       }, {
6895         label: 'Event based Gateway',
6896         actionName: 'replace-with-event-based-gateway',
6897         className: 'icon-gateway-eventbased',
6898         target: {
6899           type: 'bpmn:EventBasedGateway',
6900           instantiate: false,
6901           eventGatewayType: 'Exclusive'
6902         }
6903       }
6904       // Gateways deactivated until https://github.com/bpmn-io/bpmn-js/issues/194
6905       // {
6906       // label: 'Event based instantiating Gateway',
6907       // actionName: 'replace-with-exclusive-event-based-gateway',
6908       // className: 'icon-exclusive-event-based',
6909       // target: {
6910       // type: 'bpmn:EventBasedGateway'
6911       // },
6912       // options: {
6913       // businessObject: { instantiate: true, eventGatewayType: 'Exclusive' }
6914       // }
6915       // },
6916       // {
6917       // label: 'Parallel Event based instantiating Gateway',
6918       // actionName: 'replace-with-parallel-event-based-instantiate-gateway',
6919       // className: 'icon-parallel-event-based-instantiate-gateway',
6920       // target: {
6921       // type: 'bpmn:EventBasedGateway'
6922       // },
6923       // options: {
6924       // businessObject: { instantiate: true, eventGatewayType: 'Parallel' }
6925       // }
6926       // }
6927     ];
6928
6929
6930     module.exports.TASK = [{
6931       label: 'Task',
6932       actionName: 'replace-with-task',
6933       className: 'icon-task',
6934       target: {
6935         type: 'bpmn:Task'
6936       }
6937     }, {
6938       label: 'Send Task',
6939       actionName: 'replace-with-send-task',
6940       className: 'icon-send',
6941       target: {
6942         type: 'bpmn:SendTask'
6943       }
6944     }, {
6945       label: 'Receive Task',
6946       actionName: 'replace-with-receive-task',
6947       className: 'icon-receive',
6948       target: {
6949         type: 'bpmn:ReceiveTask'
6950       }
6951     }, {
6952       label: 'User Task',
6953       actionName: 'replace-with-user-task',
6954       className: 'icon-user',
6955       target: {
6956         type: 'bpmn:UserTask'
6957       }
6958     }, {
6959       label: 'Manual Task',
6960       actionName: 'replace-with-manual-task',
6961       className: 'icon-manual',
6962       target: {
6963         type: 'bpmn:ManualTask'
6964       }
6965     }, {
6966       label: 'Business Rule Task',
6967       actionName: 'replace-with-rule-task',
6968       className: 'icon-business-rule',
6969       target: {
6970         type: 'bpmn:BusinessRuleTask'
6971       }
6972     }, {
6973       label: 'Service Task',
6974       actionName: 'replace-with-service-task',
6975       className: 'icon-service',
6976       target: {
6977         type: 'bpmn:ServiceTask'
6978       }
6979     }, {
6980       label: 'Script Task',
6981       actionName: 'replace-with-script-task',
6982       className: 'icon-script',
6983       target: {
6984         type: 'bpmn:ScriptTask'
6985       }
6986     }];
6987   }, {}],
6988   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\index.js": [function(require, module, exports) {
6989     module.exports = {
6990       __depends__: [
6991         require('diagram-js/lib/features/popup-menu'),
6992         require('diagram-js/lib/features/replace'),
6993         require('diagram-js/lib/features/selection')
6994       ],
6995       bpmnReplace: ['type', require('./BpmnReplace')]
6996     };
6997   }, {
6998     "./BpmnReplace": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\BpmnReplace.js",
6999     "diagram-js/lib/features/popup-menu": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\index.js",
7000     "diagram-js/lib/features/replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\index.js",
7001     "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js"
7002   }],
7003   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\BpmnSnapping.js": [function(require, module, exports) {
7004     'use strict';
7005
7006     var inherits = require('inherits');
7007
7008     var forEach = require('lodash/collection/forEach');
7009
7010     var getBoundingBox = require('diagram-js/lib/util/Elements').getBBox;
7011     var is = require('../modeling/ModelingUtil').is;
7012
7013     var Snapping = require('diagram-js/lib/features/snapping/Snapping'),
7014       SnapUtil = require('diagram-js/lib/features/snapping/SnapUtil');
7015
7016     var is = require('../../util/ModelUtil').is;
7017
7018     var mid = SnapUtil.mid,
7019       topLeft = SnapUtil.topLeft,
7020       bottomRight = SnapUtil.bottomRight;
7021
7022     var round = Math.round;
7023
7024
7025     /**
7026      * BPMN specific snapping functionality
7027      *  * snap on process elements if a pool is created inside a process diagram
7028      *
7029      * @param {EventBus}
7030      *            eventBus
7031      * @param {Canvas}
7032      *            canvas
7033      */
7034     function BpmnSnapping(eventBus, canvas) {
7035
7036       // instantiate super
7037       Snapping.call(this, eventBus, canvas);
7038
7039
7040       /**
7041        * Drop participant on process <> process elements snapping
7042        */
7043
7044       function initParticipantSnapping(context, shape, elements) {
7045
7046         if (!elements.length) {
7047           return;
7048         }
7049
7050         var snapBox = getBoundingBox(elements.filter(function(e) {
7051           return !e.labelTarget && !e.waypoints;
7052         }));
7053
7054         snapBox.x -= 50;
7055         snapBox.y -= 20;
7056         snapBox.width += 70;
7057         snapBox.height += 40;
7058
7059         // adjust shape height to include bounding box
7060         shape.width = Math.max(shape.width, snapBox.width);
7061         shape.height = Math.max(shape.height, snapBox.height);
7062
7063         context.participantSnapBox = snapBox;
7064       }
7065
7066       function snapParticipant(snapBox, shape, event) {
7067
7068         var shapeHalfWidth = shape.width / 2 - 30,
7069           shapeHalfHeight = shape.height / 2;
7070
7071         var currentTopLeft = {
7072           x: event.x - shapeHalfWidth - 30,
7073           y: event.y - shapeHalfHeight
7074         };
7075
7076         var currentBottomRight = {
7077           x: event.x + shapeHalfWidth + 30,
7078           y: event.y + shapeHalfHeight
7079         };
7080
7081         var snapTopLeft = snapBox,
7082           snapBottomRight = bottomRight(snapBox);
7083
7084         if (currentTopLeft.x >= snapTopLeft.x) {
7085           event.x = snapTopLeft.x + 30 + shapeHalfWidth;
7086           event.snapped = true;
7087         } else
7088         if (currentBottomRight.x <= snapBottomRight.x) {
7089           event.x = snapBottomRight.x - 30 - shapeHalfWidth;
7090           event.snapped = true;
7091         }
7092
7093         if (currentTopLeft.y >= snapTopLeft.y) {
7094           event.y = snapTopLeft.y + shapeHalfHeight;
7095           event.snapped = true;
7096         } else
7097         if (currentBottomRight.y <= snapBottomRight.y) {
7098           event.y = snapBottomRight.y - shapeHalfHeight;
7099           event.snapped = true;
7100         }
7101       }
7102
7103       eventBus.on('create.start', function(event) {
7104
7105         var context = event.context,
7106           shape = context.shape,
7107           rootElement = canvas.getRootElement();
7108
7109         // snap participant around existing elements (if any)
7110         if (is(shape, 'bpmn:Participant') && is(rootElement, 'bpmn:Process')) {
7111
7112           initParticipantSnapping(context, shape, rootElement.children);
7113         }
7114       });
7115
7116       eventBus.on(['create.move', 'create.end'], 1500, function(event) {
7117
7118         var context = event.context,
7119           shape = context.shape,
7120           participantSnapBox = context.participantSnapBox;
7121
7122         if (!event.snapped && participantSnapBox) {
7123           snapParticipant(participantSnapBox, shape, event);
7124         }
7125       });
7126
7127       eventBus.on('resize.start', 1500, function(event) {
7128         var context = event.context,
7129           shape = context.shape;
7130
7131         if (is(shape, 'bpmn:SubProcess')) {
7132           context.minDimensions = {
7133             width: 140,
7134             height: 120
7135           };
7136         }
7137
7138         if (is(shape, 'bpmn:Participant')) {
7139           context.minDimensions = {
7140             width: 400,
7141             height: 200
7142           };
7143         }
7144
7145         if (is(shape, 'bpmn:TextAnnotation')) {
7146           context.minDimensions = {
7147             width: 50,
7148             height: 50
7149           };
7150         }
7151       });
7152
7153     }
7154
7155     inherits(BpmnSnapping, Snapping);
7156
7157     BpmnSnapping.$inject = ['eventBus', 'canvas'];
7158
7159     module.exports = BpmnSnapping;
7160
7161
7162     BpmnSnapping.prototype.initSnap = function(event) {
7163
7164       var context = event.context,
7165         shape = context.shape,
7166         shapeMid,
7167         shapeBounds,
7168         shapeTopLeft,
7169         shapeBottomRight,
7170         snapContext;
7171
7172
7173       snapContext = Snapping.prototype.initSnap.call(this, event);
7174
7175       if (is(shape, 'bpmn:Participant')) {
7176         // assign higher priority for outer snaps on participants
7177         snapContext.setSnapLocations(['top-left', 'bottom-right', 'mid']);
7178       }
7179
7180
7181       if (shape) {
7182
7183         shapeMid = mid(shape, event);
7184
7185         shapeBounds = {
7186           width: shape.width,
7187           height: shape.height,
7188           x: isNaN(shape.x) ? round(shapeMid.x - shape.width / 2) : shape.x,
7189           y: isNaN(shape.y) ? round(shapeMid.y - shape.height / 2) : shape.y,
7190         };
7191
7192         shapeTopLeft = topLeft(shapeBounds);
7193         shapeBottomRight = bottomRight(shapeBounds);
7194
7195         snapContext.setSnapOrigin('top-left', {
7196           x: shapeTopLeft.x - event.x,
7197           y: shapeTopLeft.y - event.y
7198         });
7199
7200         snapContext.setSnapOrigin('bottom-right', {
7201           x: shapeBottomRight.x - event.x,
7202           y: shapeBottomRight.y - event.y
7203         });
7204
7205
7206         forEach(shape.outgoing, function(c) {
7207           var docking = c.waypoints[0];
7208
7209           docking = docking.original || docking;
7210
7211           snapContext.setSnapOrigin(c.id + '-docking', {
7212             x: docking.x - event.x,
7213             y: docking.y - event.y
7214           });
7215         });
7216
7217         forEach(shape.incoming, function(c) {
7218           var docking = c.waypoints[c.waypoints.length - 1];
7219
7220           docking = docking.original || docking;
7221
7222           snapContext.setSnapOrigin(c.id + '-docking', {
7223             x: docking.x - event.x,
7224             y: docking.y - event.y
7225           });
7226         });
7227
7228       }
7229
7230       var source = context.source;
7231
7232       if (source) {
7233         snapContext.addDefaultSnap('mid', mid(source));
7234       }
7235     };
7236
7237
7238     BpmnSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
7239
7240       var siblings = this.getSiblings(shape, target);
7241
7242
7243       forEach(siblings, function(s) {
7244         snapPoints.add('mid', mid(s));
7245
7246         if (is(s, 'bpmn:Participant')) {
7247           snapPoints.add('top-left', topLeft(s));
7248           snapPoints.add('bottom-right', bottomRight(s));
7249         }
7250       });
7251
7252       forEach(shape.incoming, function(c) {
7253
7254         if (siblings.indexOf(c.source) === -1) {
7255           snapPoints.add('mid', mid(c.source));
7256
7257           var docking = c.waypoints[0];
7258           snapPoints.add(c.id + '-docking', docking.original || docking);
7259         }
7260       });
7261
7262
7263       forEach(shape.outgoing, function(c) {
7264
7265         if (siblings.indexOf(c.target) === -1) {
7266           snapPoints.add('mid', mid(c.target));
7267
7268           var docking = c.waypoints[c.waypoints.length - 1];
7269           snapPoints.add(c.id + '-docking', docking.original || docking);
7270         }
7271       });
7272
7273     };
7274   }, {
7275     "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
7276     "../modeling/ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
7277     "diagram-js/lib/features/snapping/SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
7278     "diagram-js/lib/features/snapping/Snapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\Snapping.js",
7279     "diagram-js/lib/util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
7280     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
7281     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
7282   }],
7283   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\index.js": [function(require, module, exports) {
7284     module.exports = {
7285       __init__: ['snapping'],
7286       snapping: ['type', require('./BpmnSnapping')]
7287     };
7288   }, {
7289     "./BpmnSnapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\BpmnSnapping.js"
7290   }],
7291   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnImporter.js": [function(require, module, exports) {
7292     'use strict';
7293
7294     var assign = require('lodash/object/assign'),
7295       map = require('lodash/collection/map');
7296
7297     var LabelUtil = require('../util/LabelUtil');
7298
7299     var hasExternalLabel = LabelUtil.hasExternalLabel,
7300       getExternalLabelBounds = LabelUtil.getExternalLabelBounds,
7301       isExpanded = require('../util/DiUtil').isExpanded,
7302       elementToString = require('./Util').elementToString;
7303
7304
7305     function elementData(semantic, attrs) {
7306       return assign({
7307         id: semantic.id,
7308         type: semantic.$type,
7309         businessObject: semantic
7310       }, attrs);
7311     }
7312
7313     function collectWaypoints(waypoints) {
7314       return map(waypoints, function(p) {
7315         return {
7316           x: p.x,
7317           y: p.y
7318         };
7319       });
7320     }
7321
7322
7323     /**
7324      * An importer that adds bpmn elements to the canvas
7325      *
7326      * @param {EventBus}
7327      *            eventBus
7328      * @param {Canvas}
7329      *            canvas
7330      * @param {ElementFactory}
7331      *            elementFactory
7332      * @param {ElementRegistry}
7333      *            elementRegistry
7334      */
7335     function BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {
7336       this._eventBus = eventBus;
7337       this._canvas = canvas;
7338
7339       this._elementFactory = elementFactory;
7340       this._elementRegistry = elementRegistry;
7341     }
7342
7343     BpmnImporter.$inject = ['eventBus', 'canvas', 'elementFactory', 'elementRegistry'];
7344
7345     module.exports = BpmnImporter;
7346
7347
7348     /**
7349      * Add bpmn element (semantic) to the canvas onto the specified parent shape.
7350      */
7351     BpmnImporter.prototype.add = function(semantic, parentElement) {
7352
7353       var di = semantic.di,
7354         element;
7355
7356       // ROOT ELEMENT
7357       // handle the special case that we deal with a
7358       // invisible root element (process or collaboration)
7359       if (di.$instanceOf('bpmndi:BPMNPlane')) {
7360
7361         // add a virtual element (not being drawn)
7362         element = this._elementFactory.createRoot(elementData(semantic));
7363
7364         this._canvas.setRootElement(element);
7365       }
7366
7367       // SHAPE
7368       else if (di.$instanceOf('bpmndi:BPMNShape')) {
7369
7370         var collapsed = !isExpanded(semantic);
7371         var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);
7372
7373         var bounds = semantic.di.bounds;
7374
7375         element = this._elementFactory.createShape(elementData(semantic, {
7376           collapsed: collapsed,
7377           hidden: hidden,
7378           x: Math.round(bounds.x),
7379           y: Math.round(bounds.y),
7380           width: Math.round(bounds.width),
7381           height: Math.round(bounds.height)
7382         }));
7383
7384         this._canvas.addShape(element, parentElement);
7385       }
7386
7387       // CONNECTION
7388       else if (di.$instanceOf('bpmndi:BPMNEdge')) {
7389
7390         var source = this._getSource(semantic),
7391           target = this._getTarget(semantic);
7392
7393         element = this._elementFactory.createConnection(elementData(semantic, {
7394           source: source,
7395           target: target,
7396           waypoints: collectWaypoints(semantic.di.waypoint)
7397         }));
7398
7399         this._canvas.addConnection(element, parentElement);
7400       } else {
7401         throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));
7402       }
7403
7404       // (optional) LABEL
7405       if (hasExternalLabel(semantic)) {
7406         this.addLabel(semantic, element);
7407       }
7408
7409
7410       this._eventBus.fire('bpmnElement.added', {
7411         element: element
7412       });
7413
7414       return element;
7415     };
7416
7417
7418     /**
7419      * add label for an element
7420      */
7421     BpmnImporter.prototype.addLabel = function(semantic, element) {
7422       var bounds = getExternalLabelBounds(semantic, element);
7423
7424       var label = this._elementFactory.createLabel(elementData(semantic, {
7425         id: semantic.id + '_label',
7426         labelTarget: element,
7427         type: 'label',
7428         hidden: element.hidden,
7429         x: Math.round(bounds.x),
7430         y: Math.round(bounds.y),
7431         width: Math.round(bounds.width),
7432         height: Math.round(bounds.height)
7433       }));
7434
7435       return this._canvas.addShape(label, element.parent);
7436     };
7437
7438     /**
7439      * Return the drawn connection end based on the given side.
7440      *
7441      * @throws {Error}
7442      *             if the end is not yet drawn
7443      */
7444     BpmnImporter.prototype._getEnd = function(semantic, side) {
7445
7446       var element,
7447         refSemantic,
7448         type = semantic.$type;
7449
7450       refSemantic = semantic[side + 'Ref'];
7451
7452       // handle mysterious isMany DataAssociation#sourceRef
7453       if (side === 'source' && type === 'bpmn:DataInputAssociation') {
7454         refSemantic = refSemantic && refSemantic[0];
7455       }
7456
7457       // fix source / target for DataInputAssociation / DataOutputAssociation
7458       if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||
7459         side === 'target' && type === 'bpmn:DataInputAssociation') {
7460
7461         refSemantic = semantic.$parent;
7462       }
7463
7464       element = refSemantic && this._getElement(refSemantic);
7465
7466       if (element) {
7467         return element;
7468       }
7469
7470       if (refSemantic) {
7471         throw new Error(
7472           'element ' + elementToString(refSemantic) + ' referenced by ' +
7473           elementToString(semantic) + '#' + side + 'Ref not yet drawn');
7474       } else {
7475         throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');
7476       }
7477     };
7478
7479     BpmnImporter.prototype._getSource = function(semantic) {
7480       return this._getEnd(semantic, 'source');
7481     };
7482
7483     BpmnImporter.prototype._getTarget = function(semantic) {
7484       return this._getEnd(semantic, 'target');
7485     };
7486
7487
7488     BpmnImporter.prototype._getElement = function(semantic) {
7489       return this._elementRegistry.get(semantic.id);
7490     };
7491
7492   }, {
7493     "../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
7494     "../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
7495     "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js",
7496     "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
7497     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
7498   }],
7499   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnTreeWalker.js": [function(require, module, exports) {
7500     'use strict';
7501
7502     var filter = require('lodash/collection/filter'),
7503       find = require('lodash/collection/find'),
7504       forEach = require('lodash/collection/forEach');
7505
7506     var Refs = require('object-refs');
7507
7508     var elementToString = require('./Util').elementToString;
7509
7510     var diRefs = new Refs({
7511       name: 'bpmnElement',
7512       enumerable: true
7513     }, {
7514       name: 'di'
7515     });
7516
7517     /**
7518      * Returns true if an element has the given meta-model type
7519      *
7520      * @param {ModdleElement}
7521      *            element
7522      * @param {String}
7523      *            type
7524      *
7525      * @return {Boolean}
7526      */
7527     function is(element, type) {
7528       return element.$instanceOf(type);
7529     }
7530
7531
7532     /**
7533      * Find a suitable display candidate for definitions where the DI does not
7534      * correctly specify one.
7535      */
7536     function findDisplayCandidate(definitions) {
7537       return find(definitions.rootElements, function(e) {
7538         return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
7539       });
7540     }
7541
7542
7543     function BpmnTreeWalker(handler) {
7544
7545       // list of containers already walked
7546       var handledProcesses = [];
7547
7548       // list of elements to handle deferred to ensure
7549       // prerequisites are drawn
7550       var deferred = [];
7551
7552       // /// Helpers /////////////////////////////////
7553
7554       function contextual(fn, ctx) {
7555         return function(e) {
7556           fn(e, ctx);
7557         };
7558       }
7559
7560       function visit(element, ctx) {
7561
7562         var gfx = element.gfx;
7563
7564         // avoid multiple rendering of elements
7565         if (gfx) {
7566           throw new Error('already rendered ' + elementToString(element));
7567         }
7568
7569         // call handler
7570         return handler.element(element, ctx);
7571       }
7572
7573       function visitRoot(element, diagram) {
7574         return handler.root(element, diagram);
7575       }
7576
7577       function visitIfDi(element, ctx) {
7578         try {
7579           return element.di && visit(element, ctx);
7580         } catch (e) {
7581           logError(e.message, {
7582             element: element,
7583             error: e
7584           });
7585
7586           console.error('failed to import ' + elementToString(element));
7587           console.error(e);
7588         }
7589       }
7590
7591       function logError(message, context) {
7592         handler.error(message, context);
7593       }
7594
7595       // //// DI handling ////////////////////////////
7596
7597       function registerDi(di) {
7598         var bpmnElement = di.bpmnElement;
7599
7600         if (bpmnElement) {
7601           if (bpmnElement.di) {
7602             logError('multiple DI elements defined for ' + elementToString(bpmnElement), {
7603               element: bpmnElement
7604             });
7605           } else {
7606             diRefs.bind(bpmnElement, 'di');
7607             bpmnElement.di = di;
7608           }
7609         } else {
7610           logError('no bpmnElement referenced in ' + elementToString(di), {
7611             element: di
7612           });
7613         }
7614       }
7615
7616       function handleDiagram(diagram) {
7617         handlePlane(diagram.plane);
7618       }
7619
7620       function handlePlane(plane) {
7621         registerDi(plane);
7622
7623         forEach(plane.planeElement, handlePlaneElement);
7624       }
7625
7626       function handlePlaneElement(planeElement) {
7627         registerDi(planeElement);
7628       }
7629
7630
7631       // //// Semantic handling //////////////////////
7632
7633       function handleDefinitions(definitions, diagram) {
7634         // make sure we walk the correct bpmnElement
7635
7636         var diagrams = definitions.diagrams;
7637
7638         if (diagram && diagrams.indexOf(diagram) === -1) {
7639           throw new Error('diagram not part of bpmn:Definitions');
7640         }
7641
7642         if (!diagram && diagrams && diagrams.length) {
7643           diagram = diagrams[0];
7644         }
7645
7646         // no diagram -> nothing to import
7647         if (!diagram) {
7648           return;
7649         }
7650
7651         // load DI from selected diagram only
7652         handleDiagram(diagram);
7653
7654
7655         var plane = diagram.plane;
7656
7657         if (!plane) {
7658           throw new Error('no plane for ' + elementToString(diagram));
7659         }
7660
7661
7662         var rootElement = plane.bpmnElement;
7663
7664         // ensure we default to a suitable display candidate (process or
7665         // collaboration),
7666         // even if non is specified in DI
7667         if (!rootElement) {
7668           rootElement = findDisplayCandidate(definitions);
7669
7670           if (!rootElement) {
7671             return logError('no process or collaboration present to display');
7672           } else {
7673
7674             logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));
7675
7676             // correct DI on the fly
7677             plane.bpmnElement = rootElement;
7678             registerDi(plane);
7679           }
7680         }
7681
7682
7683         var ctx = visitRoot(rootElement, plane);
7684
7685         if (is(rootElement, 'bpmn:Process')) {
7686           handleProcess(rootElement, ctx);
7687         } else if (is(rootElement, 'bpmn:Collaboration')) {
7688           handleCollaboration(rootElement, ctx);
7689
7690           // force drawing of everything not yet drawn that is part of the target
7691           // DI
7692           handleUnhandledProcesses(definitions.rootElements, ctx);
7693         } else {
7694           throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));
7695         }
7696
7697         // handle all deferred elements
7698         handleDeferred(deferred);
7699       }
7700
7701       function handleDeferred(deferred) {
7702         forEach(deferred, function(d) {
7703           d();
7704         });
7705       }
7706
7707       function handleProcess(process, context) {
7708         handleFlowElementsContainer(process, context);
7709         handleIoSpecification(process.ioSpecification, context);
7710
7711         handleArtifacts(process.artifacts, context);
7712
7713         // log process handled
7714         handledProcesses.push(process);
7715       }
7716
7717       function handleUnhandledProcesses(rootElements) {
7718
7719         // walk through all processes that have not yet been drawn and draw them
7720         // if they contain lanes with DI information.
7721         // we do this to pass the free-floating lane test cases in the MIWG test
7722         // suite
7723         var processes = filter(rootElements, function(e) {
7724           return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;
7725         });
7726
7727         processes.forEach(contextual(handleProcess));
7728       }
7729
7730       function handleMessageFlow(messageFlow, context) {
7731         visitIfDi(messageFlow, context);
7732       }
7733
7734       function handleMessageFlows(messageFlows, context) {
7735         forEach(messageFlows, contextual(handleMessageFlow, context));
7736       }
7737
7738       function handleDataAssociation(association, context) {
7739         visitIfDi(association, context);
7740       }
7741
7742       function handleDataInput(dataInput, context) {
7743         visitIfDi(dataInput, context);
7744       }
7745
7746       function handleDataOutput(dataOutput, context) {
7747         visitIfDi(dataOutput, context);
7748       }
7749
7750       function handleArtifact(artifact, context) {
7751
7752         // bpmn:TextAnnotation
7753         // bpmn:Group
7754         // bpmn:Association
7755
7756         visitIfDi(artifact, context);
7757       }
7758
7759       function handleArtifacts(artifacts, context) {
7760
7761         forEach(artifacts, function(e) {
7762           if (is(e, 'bpmn:Association')) {
7763             deferred.push(function() {
7764               handleArtifact(e, context);
7765             });
7766           } else {
7767             handleArtifact(e, context);
7768           }
7769         });
7770       }
7771
7772       function handleIoSpecification(ioSpecification, context) {
7773
7774         if (!ioSpecification) {
7775           return;
7776         }
7777
7778         forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));
7779         forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
7780       }
7781
7782       function handleSubProcess(subProcess, context) {
7783         handleFlowElementsContainer(subProcess, context);
7784         handleArtifacts(subProcess.artifacts, context);
7785       }
7786
7787       function handleFlowNode(flowNode, context) {
7788         var childCtx = visitIfDi(flowNode, context);
7789
7790         if (is(flowNode, 'bpmn:SubProcess')) {
7791           handleSubProcess(flowNode, childCtx || context);
7792         }
7793       }
7794
7795       function handleSequenceFlow(sequenceFlow, context) {
7796         visitIfDi(sequenceFlow, context);
7797       }
7798
7799       function handleDataElement(dataObject, context) {
7800         visitIfDi(dataObject, context);
7801       }
7802
7803       function handleBoundaryEvent(dataObject, context) {
7804         visitIfDi(dataObject, context);
7805       }
7806
7807       function handleLane(lane, context) {
7808         var newContext = visitIfDi(lane, context);
7809
7810         if (lane.childLaneSet) {
7811           handleLaneSet(lane.childLaneSet, newContext || context);
7812         } else {
7813           var filterList = filter(lane.flowNodeRef, function(e) {
7814             return e.$type !== 'bpmn:BoundaryEvent';
7815           });
7816           handleFlowElements(filterList, newContext || context);
7817         }
7818       }
7819
7820       function handleLaneSet(laneSet, context) {
7821         forEach(laneSet.lanes, contextual(handleLane, context));
7822       }
7823
7824       function handleLaneSets(laneSets, context) {
7825         forEach(laneSets, contextual(handleLaneSet, context));
7826       }
7827
7828       function handleFlowElementsContainer(container, context) {
7829
7830         if (container.laneSets) {
7831           handleLaneSets(container.laneSets, context);
7832           handleNonFlowNodes(container.flowElements);
7833         } else {
7834           handleFlowElements(container.flowElements, context);
7835         }
7836       }
7837
7838       function handleNonFlowNodes(flowElements, context) {
7839         forEach(flowElements, function(e) {
7840           if (is(e, 'bpmn:SequenceFlow')) {
7841             deferred.push(function() {
7842               handleSequenceFlow(e, context);
7843             });
7844           } else if (is(e, 'bpmn:BoundaryEvent')) {
7845             deferred.unshift(function() {
7846               handleBoundaryEvent(e, context);
7847             });
7848           } else if (is(e, 'bpmn:DataObject')) {
7849             // SKIP (assume correct referencing via DataObjectReference)
7850           } else if (is(e, 'bpmn:DataStoreReference')) {
7851             handleDataElement(e, context);
7852           } else if (is(e, 'bpmn:DataObjectReference')) {
7853             handleDataElement(e, context);
7854           }
7855         });
7856       }
7857
7858       function handleFlowElements(flowElements, context) {
7859         forEach(flowElements, function(e) {
7860           if (is(e, 'bpmn:SequenceFlow')) {
7861             deferred.push(function() {
7862               handleSequenceFlow(e, context);
7863             });
7864           } else if (is(e, 'bpmn:BoundaryEvent')) {
7865             deferred.unshift(function() {
7866               handleBoundaryEvent(e, context);
7867             });
7868           } else if (is(e, 'bpmn:FlowNode')) {
7869             handleFlowNode(e, context);
7870
7871             if (is(e, 'bpmn:Activity')) {
7872
7873               handleIoSpecification(e.ioSpecification, context);
7874
7875               // defer handling of associations
7876               deferred.push(function() {
7877                 forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));
7878                 forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));
7879               });
7880             }
7881           } else if (is(e, 'bpmn:DataObject')) {
7882             // SKIP (assume correct referencing via DataObjectReference)
7883           } else if (is(e, 'bpmn:DataStoreReference')) {
7884             handleDataElement(e, context);
7885           } else if (is(e, 'bpmn:DataObjectReference')) {
7886             handleDataElement(e, context);
7887           } else {
7888             logError(
7889               'unrecognized flowElement ' + elementToString(e) + ' in context ' +
7890               (context ? elementToString(context.businessObject) : null), {
7891                 element: e,
7892                 context: context
7893               });
7894           }
7895         });
7896       }
7897
7898       function handleParticipant(participant, context) {
7899         var newCtx = visitIfDi(participant, context);
7900
7901         var process = participant.processRef;
7902         if (process) {
7903           handleProcess(process, newCtx || context);
7904         }
7905       }
7906
7907       function handleCollaboration(collaboration) {
7908
7909         forEach(collaboration.participants, contextual(handleParticipant));
7910
7911         handleArtifacts(collaboration.artifacts);
7912
7913         // handle message flows latest in the process
7914         deferred.push(function() {
7915           handleMessageFlows(collaboration.messageFlows);
7916         });
7917       }
7918
7919
7920       // /// API ////////////////////////////////
7921
7922       return {
7923         handleDefinitions: handleDefinitions
7924       };
7925     }
7926
7927     module.exports = BpmnTreeWalker;
7928   }, {
7929     "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js",
7930     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
7931     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
7932     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
7933     "object-refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js"
7934   }],
7935   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Importer.js": [function(require, module, exports) {
7936     'use strict';
7937
7938     var BpmnTreeWalker = require('./BpmnTreeWalker');
7939
7940
7941     /**
7942      * Import the definitions into a diagram.
7943      *
7944      * Errors and warnings are reported through the specified callback.
7945      *
7946      * @param {Diagram}
7947      *            diagram
7948      * @param {ModdleElement}
7949      *            definitions
7950      * @param {Function}
7951      *            done the callback, invoked with (err, [ warning ]) once the import
7952      *            is done
7953      */
7954     function importBpmnDiagram(diagram, definitions, done) {
7955
7956       var importer = diagram.get('bpmnImporter'),
7957         eventBus = diagram.get('eventBus');
7958
7959       var error,
7960         warnings = [];
7961
7962       function parse(definitions) {
7963
7964         var visitor = {
7965
7966           root: function(element) {
7967             return importer.add(element);
7968           },
7969
7970           element: function(element, parentShape) {
7971             return importer.add(element, parentShape);
7972           },
7973
7974           error: function(message, context) {
7975             warnings.push({
7976               message: message,
7977               context: context
7978             });
7979           }
7980         };
7981
7982         var walker = new BpmnTreeWalker(visitor);
7983
7984         // import
7985         walker.handleDefinitions(definitions);
7986       }
7987
7988       eventBus.fire('import.start');
7989
7990       try {
7991         parse(definitions);
7992       } catch (e) {
7993         error = e;
7994       }
7995
7996       eventBus.fire(error ? 'import.error' : 'import.success', {
7997         error: error,
7998         warnings: warnings
7999       });
8000       done(error, warnings);
8001     }
8002
8003     module.exports.importBpmnDiagram = importBpmnDiagram;
8004   }, {
8005     "./BpmnTreeWalker": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnTreeWalker.js"
8006   }],
8007   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js": [function(require, module, exports) {
8008     'use strict';
8009
8010     module.exports.elementToString = function(e) {
8011       if (!e) {
8012         return '<null>';
8013       }
8014
8015       return '<' + e.$type + (e.id ? ' id="' + e.id : '') + '" />';
8016     };
8017   }, {}],
8018   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\index.js": [function(require, module, exports) {
8019     module.exports = {
8020       bpmnImporter: ['type', require('./BpmnImporter')]
8021     };
8022   }, {
8023     "./BpmnImporter": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnImporter.js"
8024   }],
8025   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js": [function(require, module, exports) {
8026     'use strict';
8027
8028     var is = require('./ModelUtil').is,
8029       getBusinessObject = require('./ModelUtil').getBusinessObject;
8030
8031     module.exports.isExpanded = function(element) {
8032
8033       if (is(element, 'bpmn:CallActivity')) {
8034         return false;
8035       }
8036
8037       if (is(element, 'bpmn:SubProcess')) {
8038         return getBusinessObject(element).di.isExpanded;
8039       }
8040
8041       if (is(element, 'bpmn:Participant')) {
8042         return !!getBusinessObject(element).processRef;
8043       }
8044
8045       return true;
8046     };
8047
8048   }, {
8049     "./ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js"
8050   }],
8051   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js": [function(require, module, exports) {
8052     'use strict';
8053
8054     var assign = require('lodash/object/assign');
8055
8056
8057     var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {
8058       width: 90,
8059       height: 20
8060     };
8061
8062
8063     /**
8064      * Returns true if the given semantic has an external label
8065      *
8066      * @param {BpmnElement}
8067      *            semantic
8068      * @return {Boolean} true if has label
8069      */
8070     module.exports.hasExternalLabel = function(semantic) {
8071
8072       return semantic.$instanceOf('bpmn:Event') ||
8073         // semantic.$instanceOf('bpmn:Gateway') ||
8074         semantic.$instanceOf('bpmn:DataStoreReference') ||
8075         semantic.$instanceOf('bpmn:DataObjectReference') ||
8076         semantic.$instanceOf('bpmn:SequenceFlow') ||
8077         semantic.$instanceOf('bpmn:MessageFlow');
8078     };
8079
8080
8081     /**
8082      * Get the middle of a number of waypoints
8083      *
8084      * @param {Array
8085      *            <Point>} waypoints
8086      * @return {Point} the mid point
8087      */
8088     var getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {
8089
8090       var mid = waypoints.length / 2 - 1;
8091
8092       var first = waypoints[Math.floor(mid)];
8093       var second = waypoints[Math.ceil(mid + 0.01)];
8094
8095       return {
8096         x: first.x + (second.x - first.x) / 2,
8097         y: first.y + (second.y - first.y) / 2
8098       };
8099     };
8100
8101
8102     var getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {
8103
8104       if (element.waypoints) {
8105         return getWaypointsMid(element.waypoints);
8106       } else {
8107         return {
8108           x: element.x + element.width / 2,
8109           y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2
8110         };
8111       }
8112     };
8113
8114     /**
8115      * Returns the bounds of an elements label, parsed from the elements DI or
8116      * generated from its bounds.
8117      *
8118      * @param {BpmnElement}
8119      *            semantic
8120      * @param {djs.model.Base}
8121      *            element
8122      */
8123     module.exports.getExternalLabelBounds = function(semantic, element) {
8124
8125       var mid,
8126         size,
8127         bounds,
8128         di = semantic.di,
8129         label = di.label;
8130
8131       if (label && label.bounds) {
8132         bounds = label.bounds;
8133
8134         size = {
8135           width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),
8136           height: bounds.height
8137         };
8138
8139         mid = {
8140           x: bounds.x + bounds.width / 2,
8141           y: bounds.y + bounds.height / 2
8142         };
8143       } else {
8144
8145         mid = getExternalLabelMid(element);
8146
8147         size = DEFAULT_LABEL_SIZE;
8148       }
8149
8150       return assign({
8151         x: mid.x - size.width / 2,
8152         y: mid.y - size.height / 2
8153       }, size);
8154     };
8155   }, {
8156     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
8157   }],
8158   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js": [function(require, module, exports) {
8159     'use strict';
8160
8161     /**
8162      * Is an element of the given BPMN type?
8163      *
8164      * @param {djs.model.Base|ModdleElement}
8165      *            element
8166      * @param {String}
8167      *            type
8168      *
8169      * @return {Boolean}
8170      */
8171     function is(element, type) {
8172       var bo = getBusinessObject(element);
8173
8174       return bo && bo.$instanceOf(type);
8175     }
8176
8177     module.exports.is = is;
8178
8179
8180     /**
8181      * Return the business object for a given element.
8182      *
8183      * @param {djs.model.Base|ModdleElement}
8184      *            element
8185      *
8186      * @return {ModdleElement}
8187      */
8188     function getBusinessObject(element) {
8189       return (element && element.businessObject) || element;
8190     }
8191
8192     module.exports.getBusinessObject = getBusinessObject;
8193
8194   }, {}],
8195   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\index.js": [function(require, module, exports) {
8196     module.exports = require('./lib/simple');
8197   }, {
8198     "./lib/simple": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\simple.js"
8199   }],
8200   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\bpmn-moddle.js": [function(require, module, exports) {
8201     'use strict';
8202
8203     var isString = require('lodash/lang/isString'),
8204       isFunction = require('lodash/lang/isFunction'),
8205       assign = require('lodash/object/assign');
8206
8207     var Moddle = require('moddle'),
8208       XmlReader = require('moddle-xml/lib/reader'),
8209       XmlWriter = require('moddle-xml/lib/writer');
8210
8211     /**
8212      * A sub class of {@link Moddle} with support for import and export of BPMN 2.0
8213      * xml files.
8214      *
8215      * @class BpmnModdle
8216      * @extends Moddle
8217      *
8218      * @param {Object|Array}
8219      *            packages to use for instantiating the model
8220      * @param {Object}
8221      *            [options] additional options to pass over
8222      */
8223     function BpmnModdle(packages, options) {
8224       Moddle.call(this, packages, options);
8225     }
8226
8227     BpmnModdle.prototype = Object.create(Moddle.prototype);
8228
8229     module.exports = BpmnModdle;
8230
8231
8232     /**
8233      * Instantiates a BPMN model tree from a given xml string.
8234      *
8235      * @param {String}
8236      *            xmlStr
8237      * @param {String}
8238      *            [typeName='bpmn:Definitions'] name of the root element
8239      * @param {Object}
8240      *            [options] options to pass to the underlying reader
8241      * @param {Function}
8242      *            done callback that is invoked with (err, result, parseContext)
8243      *            once the import completes
8244      */
8245     BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {
8246
8247       if (!isString(typeName)) {
8248         done = options;
8249         options = typeName;
8250         typeName = 'bpmn:Definitions';
8251       }
8252
8253       if (isFunction(options)) {
8254         done = options;
8255         options = {};
8256       }
8257
8258       var reader = new XmlReader(assign({
8259         model: this,
8260         lax: true
8261       }, options));
8262       var rootHandler = reader.handler(typeName);
8263
8264       reader.fromXML(xmlStr, rootHandler, done);
8265     };
8266
8267
8268     /**
8269      * Serializes a BPMN 2.0 object tree to XML.
8270      *
8271      * @param {String}
8272      *            element the root element, typically an instance of
8273      *            `bpmn:Definitions`
8274      * @param {Object}
8275      *            [options] to pass to the underlying writer
8276      * @param {Function}
8277      *            done callback invoked with (err, xmlStr) once the import completes
8278      */
8279
8280
8281
8282
8283     BpmnModdle.prototype.toXML = function(element, options, done) {
8284
8285       if (isFunction(options)) {
8286         done = options;
8287         options = {};
8288       }
8289
8290       var writer = new XmlWriter(options);
8291       try {
8292         var result = writer.toXML(element);
8293         modelXML = result;
8294         list_models[selected_model] = result;
8295         done(null, result);
8296       } catch (e) {
8297         done(e);
8298       }
8299     };
8300
8301   }, {
8302     "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
8303     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
8304     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
8305     "moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js",
8306     "moddle-xml/lib/reader": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\reader.js",
8307     "moddle-xml/lib/writer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\writer.js"
8308   }],
8309   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\id-support.js": [function(require, module, exports) {
8310     'use strict';
8311
8312     var ID_PATTERN = /^(.*:)?id$/;
8313
8314     /**
8315      * Extends the bpmn instance with id support.
8316      *
8317      * @example
8318      *
8319      * var moddle, ids;
8320      *
8321      * require('id-support').extend(moddle, ids);
8322      *
8323      * moddle.ids.next(); // create a next id moddle.ids; // ids instance
8324      *  // claims id as used moddle.create('foo:Bar', { id: 'fooobar1' });
8325      *
8326      *
8327      * @param {Moddle}
8328      *            model
8329      * @param {Ids}
8330      *            ids
8331      *
8332      * @return {Moddle} the extended moddle instance
8333      */
8334     module.exports.extend = function(model, ids) {
8335
8336       var set = model.properties.set;
8337
8338       // do not reinitialize setter
8339       // unless it is already initialized
8340       if (!model.ids) {
8341
8342         model.properties.set = function(target, property, value) {
8343
8344           // ensure we log used ids once they are assigned
8345           // to model elements
8346           if (ID_PATTERN.test(property)) {
8347
8348             var assigned = model.ids.assigned(value);
8349             if (assigned && assigned !== target) {
8350               throw new Error('id <' + value + '> already used');
8351             }
8352
8353             model.ids.claim(value, target);
8354           }
8355
8356           set.call(this, target, property, value);
8357         };
8358       }
8359
8360       model.ids = ids;
8361
8362       return model;
8363     };
8364   }, {}],
8365   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\simple.js": [function(require, module, exports) {
8366     'use strict';
8367
8368     var assign = require('lodash/object/assign');
8369
8370     var BpmnModdle = require('./bpmn-moddle');
8371
8372     var packages = {
8373       bpmn: require('../resources/bpmn/json/bpmn.json'),
8374       bpmndi: require('../resources/bpmn/json/bpmndi.json'),
8375       dc: require('../resources/bpmn/json/dc.json'),
8376       di: require('../resources/bpmn/json/di.json')
8377     };
8378
8379     module.exports = function(additionalPackages, options) {
8380       return new BpmnModdle(assign({}, packages, additionalPackages), options);
8381     };
8382   }, {
8383     "../resources/bpmn/json/bpmn.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmn.json",
8384     "../resources/bpmn/json/bpmndi.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmndi.json",
8385     "../resources/bpmn/json/dc.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\dc.json",
8386     "../resources/bpmn/json/di.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\di.json",
8387     "./bpmn-moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\bpmn-moddle.js",
8388     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
8389   }],
8390   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js": [function(require, module, exports) {
8391     'use strict';
8392
8393     function capitalize(string) {
8394       return string.charAt(0).toUpperCase() + string.slice(1);
8395     }
8396
8397     function lower(string) {
8398       return string.charAt(0).toLowerCase() + string.slice(1);
8399     }
8400
8401     function hasLowerCaseAlias(pkg) {
8402       return pkg.xml && pkg.xml.tagAlias === 'lowerCase';
8403     }
8404
8405
8406     module.exports.aliasToName = function(alias, pkg) {
8407       if (hasLowerCaseAlias(pkg)) {
8408         return capitalize(alias);
8409       } else {
8410         return alias;
8411       }
8412     };
8413
8414     module.exports.nameToAlias = function(name, pkg) {
8415       if (hasLowerCaseAlias(pkg)) {
8416         return lower(name);
8417       } else {
8418         return name;
8419       }
8420     };
8421
8422     module.exports.DEFAULT_NS_MAP = {
8423       'xsi': 'http://www.w3.org/2001/XMLSchema-instance'
8424     };
8425
8426     module.exports.XSI_TYPE = 'xsi:type';
8427   }, {}],
8428   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\reader.js": [function(require, module, exports) {
8429     'use strict';
8430
8431     var reduce = require('lodash/collection/reduce'),
8432       forEach = require('lodash/collection/forEach'),
8433       find = require('lodash/collection/find'),
8434       assign = require('lodash/object/assign'),
8435       defer = require('lodash/function/defer');
8436
8437     var Stack = require('tiny-stack'),
8438       SaxParser = require('sax').parser,
8439       Moddle = require('moddle'),
8440       parseNameNs = require('moddle/lib/ns').parseName,
8441       Types = require('moddle/lib/types'),
8442       coerceType = Types.coerceType,
8443       isSimpleType = Types.isSimple,
8444       common = require('./common'),
8445       XSI_TYPE = common.XSI_TYPE,
8446       XSI_URI = common.DEFAULT_NS_MAP.xsi,
8447       aliasToName = common.aliasToName;
8448
8449     function parseNodeAttributes(node) {
8450       var nodeAttrs = node.attributes;
8451
8452       return reduce(nodeAttrs, function(result, v, k) {
8453         var name, ns;
8454
8455         if (!v.local) {
8456           name = v.prefix;
8457         } else {
8458           ns = parseNameNs(v.name, v.prefix);
8459           name = ns.name;
8460         }
8461
8462         result[name] = v.value;
8463         return result;
8464       }, {});
8465     }
8466
8467     function normalizeType(node, attr, model) {
8468       var nameNs = parseNameNs(attr.value);
8469
8470       var uri = node.ns[nameNs.prefix || ''],
8471         localName = nameNs.localName,
8472         pkg = uri && model.getPackage(uri),
8473         typePrefix;
8474
8475       if (pkg) {
8476         typePrefix = pkg.xml && pkg.xml.typePrefix;
8477
8478         if (typePrefix && localName.indexOf(typePrefix) === 0) {
8479           localName = localName.slice(typePrefix.length);
8480         }
8481
8482         attr.value = pkg.prefix + ':' + localName;
8483       }
8484     }
8485
8486     /**
8487      * Normalizes namespaces for a node given an optional default namespace and a
8488      * number of mappings from uris to default prefixes.
8489      *
8490      * @param {XmlNode}
8491      *            node
8492      * @param {Model}
8493      *            model the model containing all registered namespaces
8494      * @param {Uri}
8495      *            defaultNsUri
8496      */
8497     function normalizeNamespaces(node, model, defaultNsUri) {
8498       var uri, prefix;
8499
8500       uri = node.uri || defaultNsUri;
8501
8502       if (uri) {
8503         var pkg = model.getPackage(uri);
8504
8505         if (pkg) {
8506           prefix = pkg.prefix;
8507         } else {
8508           prefix = node.prefix;
8509         }
8510
8511         node.prefix = prefix;
8512         node.uri = uri;
8513       }
8514
8515       forEach(node.attributes, function(attr) {
8516
8517         // normalize xsi:type attributes because the
8518         // assigned type may or may not be namespace prefixed
8519         if (attr.uri === XSI_URI && attr.local === 'type') {
8520           normalizeType(node, attr, model);
8521         }
8522
8523         normalizeNamespaces(attr, model, null);
8524       });
8525     }
8526
8527
8528     /**
8529      * A parse context.
8530      *
8531      * @class
8532      *
8533      * @param {Object}
8534      *            options
8535      * @param {ElementHandler}
8536      *            options.parseRoot the root handler for parsing a document
8537      * @param {boolean}
8538      *            [options.lax=false] whether or not to ignore invalid elements
8539      */
8540     function Context(options) {
8541
8542       /**
8543        * @property {ElementHandler} parseRoot
8544        */
8545
8546       /**
8547        * @property {Boolean} lax
8548        */
8549
8550       assign(this, options);
8551
8552       var elementsById = this.elementsById = {};
8553       var references = this.references = [];
8554       var warnings = this.warnings = [];
8555
8556       this.addReference = function(reference) {
8557         references.push(reference);
8558       };
8559
8560       this.addElement = function(id, element) {
8561
8562         if (!id || !element) {
8563           throw new Error('[xml-reader] id or ctx must not be null');
8564         }
8565
8566         elementsById[id] = element;
8567       };
8568
8569       this.addWarning = function(w) {
8570         warnings.push(w);
8571       };
8572     }
8573
8574     function BaseHandler() {}
8575
8576     BaseHandler.prototype.handleEnd = function() {};
8577     BaseHandler.prototype.handleText = function() {};
8578     BaseHandler.prototype.handleNode = function() {};
8579
8580
8581     /**
8582      * A simple pass through handler that does nothing except for ignoring all input
8583      * it receives.
8584      *
8585      * This is used to ignore unknown elements and attributes.
8586      */
8587     function NoopHandler() {}
8588
8589     NoopHandler.prototype = new BaseHandler();
8590
8591     NoopHandler.prototype.handleNode = function() {
8592       return this;
8593     };
8594
8595     function BodyHandler() {}
8596
8597     BodyHandler.prototype = new BaseHandler();
8598
8599     BodyHandler.prototype.handleText = function(text) {
8600       this.body = (this.body || '') + text;
8601     };
8602
8603     function ReferenceHandler(property, context) {
8604       this.property = property;
8605       this.context = context;
8606     }
8607
8608     ReferenceHandler.prototype = new BodyHandler();
8609
8610     ReferenceHandler.prototype.handleNode = function(node) {
8611
8612       if (this.element) {
8613         throw new Error('expected no sub nodes');
8614       } else {
8615         this.element = this.createReference(node);
8616       }
8617
8618       return this;
8619     };
8620
8621     ReferenceHandler.prototype.handleEnd = function() {
8622       this.element.id = this.body;
8623     };
8624
8625     ReferenceHandler.prototype.createReference = function() {
8626       return {
8627         property: this.property.ns.name,
8628         id: ''
8629       };
8630     };
8631
8632     function ValueHandler(propertyDesc, element) {
8633       this.element = element;
8634       this.propertyDesc = propertyDesc;
8635     }
8636
8637     ValueHandler.prototype = new BodyHandler();
8638
8639     ValueHandler.prototype.handleEnd = function() {
8640
8641       var value = this.body,
8642         element = this.element,
8643         propertyDesc = this.propertyDesc;
8644
8645       value = coerceType(propertyDesc.type, value);
8646
8647       if (propertyDesc.isMany) {
8648         element.get(propertyDesc.name).push(value);
8649       } else {
8650         element.set(propertyDesc.name, value);
8651       }
8652     };
8653
8654
8655     function BaseElementHandler() {}
8656
8657     BaseElementHandler.prototype = Object.create(BodyHandler.prototype);
8658
8659     BaseElementHandler.prototype.handleNode = function(node) {
8660       var parser = this,
8661         element = this.element,
8662         id;
8663
8664       if (!element) {
8665         element = this.element = this.createElement(node);
8666         id = element.id;
8667
8668         if (id) {
8669           this.context.addElement(id, element);
8670         }
8671       } else {
8672         parser = this.handleChild(node);
8673       }
8674
8675       return parser;
8676     };
8677
8678     /**
8679      * @class XMLReader.ElementHandler
8680      *
8681      */
8682     function ElementHandler(model, type, context) {
8683       this.model = model;
8684       this.type = model.getType(type);
8685       this.context = context;
8686     }
8687
8688     ElementHandler.prototype = new BaseElementHandler();
8689
8690     ElementHandler.prototype.addReference = function(reference) {
8691       this.context.addReference(reference);
8692     };
8693
8694     ElementHandler.prototype.handleEnd = function() {
8695
8696       var value = this.body,
8697         element = this.element,
8698         descriptor = element.$descriptor,
8699         bodyProperty = descriptor.bodyProperty;
8700
8701       if (bodyProperty && value !== undefined) {
8702         value = coerceType(bodyProperty.type, value);
8703         element.set(bodyProperty.name, value);
8704       }
8705     };
8706
8707     /**
8708      * Create an instance of the model from the given node.
8709      *
8710      * @param {Element}
8711      *            node the xml node
8712      */
8713     ElementHandler.prototype.createElement = function(node) {
8714       var attributes = parseNodeAttributes(node),
8715         Type = this.type,
8716         descriptor = Type.$descriptor,
8717         context = this.context,
8718         instance = new Type({});
8719
8720       forEach(attributes, function(value, name) {
8721
8722         var prop = descriptor.propertiesByName[name];
8723
8724         if (prop && prop.isReference) {
8725           context.addReference({
8726             element: instance,
8727             property: prop.ns.name,
8728             id: value
8729           });
8730         } else {
8731           if (prop) {
8732             value = coerceType(prop.type, value);
8733           }
8734
8735           instance.set(name, value);
8736         }
8737       });
8738
8739       return instance;
8740     };
8741
8742     ElementHandler.prototype.getPropertyForNode = function(node) {
8743
8744       var nameNs = parseNameNs(node.local, node.prefix);
8745
8746       var type = this.type,
8747         model = this.model,
8748         descriptor = type.$descriptor;
8749
8750       var propertyName = nameNs.name,
8751         property = descriptor.propertiesByName[propertyName],
8752         elementTypeName,
8753         elementType,
8754         typeAnnotation;
8755
8756       // search for properties by name first
8757
8758       if (property) {
8759
8760         if (property.serialize === XSI_TYPE) {
8761           typeAnnotation = node.attributes[XSI_TYPE];
8762
8763           // xsi type is optional, if it does not exists the
8764           // default type is assumed
8765           if (typeAnnotation) {
8766
8767             elementTypeName = typeAnnotation.value;
8768
8769             // TODO: extract real name from attribute
8770             elementType = model.getType(elementTypeName);
8771
8772             return assign({}, property, {
8773               effectiveType: elementType.$descriptor.name
8774             });
8775           }
8776         }
8777
8778         // search for properties by name first
8779         return property;
8780       }
8781
8782
8783       var pkg = model.getPackage(nameNs.prefix);
8784
8785       if (pkg) {
8786         elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);
8787         elementType = model.getType(elementTypeName);
8788
8789         // search for collection members later
8790         property = find(descriptor.properties, function(p) {
8791           return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);
8792         });
8793
8794         if (property) {
8795           return assign({}, property, {
8796             effectiveType: elementType.$descriptor.name
8797           });
8798         }
8799       } else {
8800         // parse unknown element (maybe extension)
8801         property = find(descriptor.properties, function(p) {
8802           return !p.isReference && !p.isAttribute && p.type === 'Element';
8803         });
8804
8805         if (property) {
8806           return property;
8807         }
8808       }
8809
8810       throw new Error('unrecognized element <' + nameNs.name + '>');
8811     };
8812
8813     ElementHandler.prototype.toString = function() {
8814       return 'ElementDescriptor[' + this.type.$descriptor.name + ']';
8815     };
8816
8817     ElementHandler.prototype.valueHandler = function(propertyDesc, element) {
8818       return new ValueHandler(propertyDesc, element);
8819     };
8820
8821     ElementHandler.prototype.referenceHandler = function(propertyDesc) {
8822       return new ReferenceHandler(propertyDesc, this.context);
8823     };
8824
8825     ElementHandler.prototype.handler = function(type) {
8826       if (type === 'Element') {
8827         return new GenericElementHandler(this.model, type, this.context);
8828       } else {
8829         return new ElementHandler(this.model, type, this.context);
8830       }
8831     };
8832
8833     /**
8834      * Handle the child element parsing
8835      *
8836      * @param {Element}
8837      *            node the xml node
8838      */
8839     ElementHandler.prototype.handleChild = function(node) {
8840       var propertyDesc, type, element, childHandler;
8841
8842       propertyDesc = this.getPropertyForNode(node);
8843       element = this.element;
8844
8845       type = propertyDesc.effectiveType || propertyDesc.type;
8846
8847       if (isSimpleType(type)) {
8848         return this.valueHandler(propertyDesc, element);
8849       }
8850
8851       if (propertyDesc.isReference) {
8852         childHandler = this.referenceHandler(propertyDesc).handleNode(node);
8853       } else {
8854         childHandler = this.handler(type).handleNode(node);
8855       }
8856
8857       var newElement = childHandler.element;
8858
8859       // child handles may decide to skip elements
8860       // by not returning anything
8861       if (newElement !== undefined) {
8862
8863         if (propertyDesc.isMany) {
8864           element.get(propertyDesc.name).push(newElement);
8865         } else {
8866           element.set(propertyDesc.name, newElement);
8867         }
8868
8869         if (propertyDesc.isReference) {
8870           assign(newElement, {
8871             element: element
8872           });
8873
8874           this.context.addReference(newElement);
8875         } else {
8876           // establish child -> parent relationship
8877           newElement.$parent = element;
8878         }
8879       }
8880
8881       return childHandler;
8882     };
8883
8884
8885     function GenericElementHandler(model, type, context) {
8886       this.model = model;
8887       this.context = context;
8888     }
8889
8890     GenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);
8891
8892     GenericElementHandler.prototype.createElement = function(node) {
8893
8894       var name = node.name,
8895         prefix = node.prefix,
8896         uri = node.ns[prefix],
8897         attributes = node.attributes;
8898
8899       return this.model.createAny(name, uri, attributes);
8900     };
8901
8902     GenericElementHandler.prototype.handleChild = function(node) {
8903
8904       var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),
8905         element = this.element;
8906
8907       var newElement = handler.element,
8908         children;
8909
8910       if (newElement !== undefined) {
8911         children = element.$children = element.$children || [];
8912         children.push(newElement);
8913
8914         // establish child -> parent relationship
8915         newElement.$parent = element;
8916       }
8917
8918       return handler;
8919     };
8920
8921     GenericElementHandler.prototype.handleText = function(text) {
8922       this.body = this.body || '' + text;
8923     };
8924
8925     GenericElementHandler.prototype.handleEnd = function() {
8926       if (this.body) {
8927         this.element.$body = this.body;
8928       }
8929     };
8930
8931     /**
8932      * A reader for a meta-model
8933      *
8934      * @param {Object}
8935      *            options
8936      * @param {Model}
8937      *            options.model used to read xml files
8938      * @param {Boolean}
8939      *            options.lax whether to make parse errors warnings
8940      */
8941     function XMLReader(options) {
8942
8943       if (options instanceof Moddle) {
8944         options = {
8945           model: options
8946         };
8947       }
8948
8949       assign(this, {
8950         lax: false
8951       }, options);
8952     }
8953
8954
8955     XMLReader.prototype.fromXML = function(xml, rootHandler, done) {
8956
8957       var model = this.model,
8958         lax = this.lax,
8959         context = new Context({
8960           parseRoot: rootHandler
8961         });
8962
8963       var parser = new SaxParser(true, {
8964           xmlns: true,
8965           trim: true
8966         }),
8967         stack = new Stack();
8968
8969       rootHandler.context = context;
8970
8971       // push root handler
8972       stack.push(rootHandler);
8973
8974
8975       function resolveReferences() {
8976
8977         var elementsById = context.elementsById;
8978         var references = context.references;
8979
8980         var i, r;
8981
8982         for (i = 0; !!(r = references[i]); i++) {
8983           var element = r.element;
8984           var reference = elementsById[r.id];
8985           var property = element.$descriptor.propertiesByName[r.property];
8986
8987           if (!reference) {
8988             context.addWarning({
8989               message: 'unresolved reference <' + r.id + '>',
8990               element: r.element,
8991               property: r.property,
8992               value: r.id
8993             });
8994           }
8995
8996           if (property.isMany) {
8997             var collection = element.get(property.name),
8998               idx = collection.indexOf(r);
8999
9000             if (!reference) {
9001               // remove unresolvable reference
9002               collection.splice(idx, 1);
9003             } else {
9004               // update reference
9005               collection[idx] = reference;
9006             }
9007           } else {
9008             element.set(property.name, reference);
9009           }
9010         }
9011       }
9012
9013       function handleClose(tagName) {
9014         stack.pop().handleEnd();
9015       }
9016
9017       function handleOpen(node) {
9018         var handler = stack.peek();
9019
9020         normalizeNamespaces(node, model);
9021
9022         try {
9023           stack.push(handler.handleNode(node));
9024         } catch (e) {
9025
9026           var line = this.line,
9027             column = this.column;
9028
9029           var message =
9030             'unparsable content <' + node.name + '> detected\n\t' +
9031             'line: ' + line + '\n\t' +
9032             'column: ' + column + '\n\t' +
9033             'nested error: ' + e.message;
9034
9035           if (lax) {
9036             context.addWarning({
9037               message: message,
9038               error: e
9039             });
9040
9041             console.warn('could not parse node');
9042             console.warn(e);
9043
9044             stack.push(new NoopHandler());
9045           } else {
9046             console.error('could not parse document');
9047             console.error(e);
9048
9049             throw new Error(message);
9050           }
9051         }
9052       }
9053
9054       function handleText(text) {
9055         stack.peek().handleText(text);
9056       }
9057
9058       parser.onopentag = handleOpen;
9059       parser.oncdata = parser.ontext = handleText;
9060       parser.onclosetag = handleClose;
9061       parser.onend = resolveReferences;
9062
9063       // deferred parse XML to make loading really ascnchronous
9064       // this ensures the execution environment (node or browser)
9065       // is kept responsive and that certain optimization strategies
9066       // can kick in
9067       defer(function() {
9068         var error;
9069
9070         try {
9071           parser.write(xml).close();
9072         } catch (e) {
9073           error = e;
9074         }
9075
9076         done(error, error ? undefined : rootHandler.element, context);
9077       });
9078     };
9079
9080     XMLReader.prototype.handler = function(name) {
9081       return new ElementHandler(this.model, name);
9082     };
9083
9084     module.exports = XMLReader;
9085     module.exports.ElementHandler = ElementHandler;
9086   }, {
9087     "./common": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js",
9088     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
9089     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
9090     "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
9091     "lodash/function/defer": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\defer.js",
9092     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
9093     "moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js",
9094     "moddle/lib/ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
9095     "moddle/lib/types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js",
9096     "sax": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\sax\\lib\\sax.js",
9097     "tiny-stack": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\tiny-stack\\lib\\tiny-stack.js"
9098   }],
9099   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\writer.js": [function(require, module, exports) {
9100     'use strict';
9101
9102     var map = require('lodash/collection/map'),
9103       forEach = require('lodash/collection/forEach'),
9104       isString = require('lodash/lang/isString'),
9105       filter = require('lodash/collection/filter'),
9106       assign = require('lodash/object/assign');
9107
9108     var Types = require('moddle/lib/types'),
9109       parseNameNs = require('moddle/lib/ns').parseName,
9110       common = require('./common'),
9111       nameToAlias = common.nameToAlias;
9112
9113     var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
9114       ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
9115       DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
9116       XSI_TYPE = common.XSI_TYPE;
9117
9118
9119     function nsName(ns) {
9120       if (isString(ns)) {
9121         return ns;
9122       } else {
9123         return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;
9124       }
9125     }
9126
9127     function getElementNs(ns, descriptor) {
9128       if (descriptor.isGeneric) {
9129         return descriptor.name;
9130       } else {
9131         return assign({
9132           localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg)
9133         }, ns);
9134       }
9135     }
9136
9137     function getPropertyNs(ns, descriptor) {
9138       return assign({
9139         localName: descriptor.ns.localName
9140       }, ns);
9141     }
9142
9143     function getSerializableProperties(element) {
9144       var descriptor = element.$descriptor;
9145
9146       return filter(descriptor.properties, function(p) {
9147         var name = p.name;
9148
9149         // do not serialize defaults
9150         if (!element.hasOwnProperty(name)) {
9151           return false;
9152         }
9153
9154         var value = element[name];
9155
9156         // do not serialize default equals
9157         if (value === p.default) {
9158           return false;
9159         }
9160
9161         return p.isMany ? value.length : true;
9162       });
9163     }
9164
9165     var ESCAPE_MAP = {
9166       '\n': '10',
9167       '\n\r': '10',
9168       '"': '34',
9169       '\'': '39',
9170       '<': '60',
9171       '>': '62',
9172       '&': '38'
9173     };
9174
9175     /**
9176      * Escape a string attribute to not contain any bad values (line breaks, '"',
9177      * ...)
9178      *
9179      * @param {String}
9180      *            str the string to escape
9181      * @return {String} the escaped string
9182      */
9183     function escapeAttr(str) {
9184
9185       // ensure we are handling strings here
9186       str = isString(str) ? str : '' + str;
9187
9188       return str.replace(ESCAPE_CHARS, function(str) {
9189         return '&#' + ESCAPE_MAP[str] + ';';
9190       });
9191     }
9192
9193     function filterAttributes(props) {
9194       return filter(props, function(p) {
9195         return p.isAttr;
9196       });
9197     }
9198
9199     function filterContained(props) {
9200       return filter(props, function(p) {
9201         return !p.isAttr;
9202       });
9203     }
9204
9205
9206     function ReferenceSerializer(parent, ns) {
9207       this.ns = ns;
9208     }
9209
9210     ReferenceSerializer.prototype.build = function(element) {
9211       this.element = element;
9212       return this;
9213     };
9214
9215     ReferenceSerializer.prototype.serializeTo = function(writer) {
9216       writer
9217         .appendIndent()
9218         .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')
9219         .appendNewLine();
9220     };
9221
9222     function BodySerializer() {}
9223
9224     BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
9225       var escape = this.escape;
9226
9227       if (escape) {
9228         writer.append('<![CDATA[');
9229       }
9230
9231       writer.append(this.value);
9232
9233       if (escape) {
9234         writer.append(']]>');
9235       }
9236     };
9237
9238     BodySerializer.prototype.build = function(prop, value) {
9239       this.value = value;
9240
9241       if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {
9242         this.escape = true;
9243       }
9244
9245       return this;
9246     };
9247
9248     function ValueSerializer(ns) {
9249       this.ns = ns;
9250     }
9251
9252     ValueSerializer.prototype = new BodySerializer();
9253
9254     ValueSerializer.prototype.serializeTo = function(writer) {
9255
9256       writer
9257         .appendIndent()
9258         .append('<' + nsName(this.ns) + '>');
9259
9260       this.serializeValue(writer);
9261
9262       writer
9263         .append('</' + nsName(this.ns) + '>')
9264         .appendNewLine();
9265     };
9266
9267     function ElementSerializer(parent, ns) {
9268       this.body = [];
9269       this.attrs = [];
9270
9271       this.parent = parent;
9272       this.ns = ns;
9273     }
9274
9275     ElementSerializer.prototype.build = function(element) {
9276       this.element = element;
9277
9278       var otherAttrs = this.parseNsAttributes(element);
9279
9280       if (!this.ns) {
9281         this.ns = this.nsTagName(element.$descriptor);
9282       }
9283
9284       if (element.$descriptor.isGeneric) {
9285         this.parseGeneric(element);
9286       } else {
9287         var properties = getSerializableProperties(element);
9288
9289         this.parseAttributes(filterAttributes(properties));
9290         this.parseContainments(filterContained(properties));
9291
9292         this.parseGenericAttributes(element, otherAttrs);
9293       }
9294
9295       return this;
9296     };
9297
9298     ElementSerializer.prototype.nsTagName = function(descriptor) {
9299       var effectiveNs = this.logNamespaceUsed(descriptor.ns);
9300       return getElementNs(effectiveNs, descriptor);
9301     };
9302
9303     ElementSerializer.prototype.nsPropertyTagName = function(descriptor) {
9304       var effectiveNs = this.logNamespaceUsed(descriptor.ns);
9305       return getPropertyNs(effectiveNs, descriptor);
9306     };
9307
9308     ElementSerializer.prototype.isLocalNs = function(ns) {
9309       return ns.uri === this.ns.uri;
9310     };
9311
9312     ElementSerializer.prototype.nsAttributeName = function(element) {
9313
9314       var ns;
9315
9316       if (isString(element)) {
9317         ns = parseNameNs(element);
9318       } else
9319       if (element.ns) {
9320         ns = element.ns;
9321       }
9322
9323       var effectiveNs = this.logNamespaceUsed(ns);
9324
9325       // strip prefix if same namespace like parent
9326       if (this.isLocalNs(effectiveNs)) {
9327         return {
9328           localName: ns.localName
9329         };
9330       } else {
9331         return assign({
9332           localName: ns.localName
9333         }, effectiveNs);
9334       }
9335     };
9336
9337     ElementSerializer.prototype.parseGeneric = function(element) {
9338
9339       var self = this,
9340         body = this.body,
9341         attrs = this.attrs;
9342
9343       forEach(element, function(val, key) {
9344
9345         if (key === '$body') {
9346           body.push(new BodySerializer().build({
9347             type: 'String'
9348           }, val));
9349         } else
9350         if (key === '$children') {
9351           forEach(val, function(child) {
9352             body.push(new ElementSerializer(self).build(child));
9353           });
9354         } else
9355         if (key.indexOf('$') !== 0) {
9356           attrs.push({
9357             name: key,
9358             value: escapeAttr(val)
9359           });
9360         }
9361       });
9362     };
9363
9364     /**
9365      * Parse namespaces and return a list of left over generic attributes
9366      *
9367      * @param {Object}
9368      *            element
9369      * @return {Array<Object>}
9370      */
9371     ElementSerializer.prototype.parseNsAttributes = function(element) {
9372       var self = this;
9373
9374       var genericAttrs = element.$attrs;
9375
9376       var attributes = [];
9377
9378       // parse namespace attributes first
9379       // and log them. push non namespace attributes to a list
9380       // and process them later
9381       forEach(genericAttrs, function(value, name) {
9382         var nameNs = parseNameNs(name);
9383
9384         if (nameNs.prefix === 'xmlns') {
9385           self.logNamespace({
9386             prefix: nameNs.localName,
9387             uri: value
9388           });
9389         } else
9390         if (!nameNs.prefix && nameNs.localName === 'xmlns') {
9391           self.logNamespace({
9392             uri: value
9393           });
9394         } else {
9395           attributes.push({
9396             name: name,
9397             value: value
9398           });
9399         }
9400       });
9401
9402       return attributes;
9403     };
9404
9405     ElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {
9406
9407       var self = this;
9408
9409       forEach(attributes, function(attr) {
9410
9411         // do not serialize xsi:type attribute
9412         // it is set manually based on the actual implementation type
9413         if (attr.name === XSI_TYPE) {
9414           return;
9415         }
9416
9417         try {
9418           self.addAttribute(self.nsAttributeName(attr.name), attr.value);
9419         } catch (e) {
9420           console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);
9421         }
9422       });
9423     };
9424
9425     ElementSerializer.prototype.parseContainments = function(properties) {
9426
9427       var self = this,
9428         body = this.body,
9429         element = this.element;
9430
9431       forEach(properties, function(p) {
9432         var value = element.get(p.name),
9433           isReference = p.isReference,
9434           isMany = p.isMany;
9435
9436         var ns = self.nsPropertyTagName(p);
9437
9438         if (!isMany) {
9439           value = [value];
9440         }
9441
9442         if (p.isBody) {
9443           body.push(new BodySerializer().build(p, value[0]));
9444         } else
9445         if (Types.isSimple(p.type)) {
9446           forEach(value, function(v) {
9447             body.push(new ValueSerializer(ns).build(p, v));
9448           });
9449         } else
9450         if (isReference) {
9451           forEach(value, function(v) {
9452             body.push(new ReferenceSerializer(self, ns).build(v));
9453           });
9454         } else {
9455           // allow serialization via type
9456           // rather than element name
9457           var asType = p.serialize === XSI_TYPE;
9458
9459           forEach(value, function(v) {
9460             var serializer;
9461
9462             if (asType) {
9463               serializer = new TypeSerializer(self, ns);
9464             } else {
9465               serializer = new ElementSerializer(self);
9466             }
9467
9468             body.push(serializer.build(v));
9469           });
9470         }
9471       });
9472     };
9473
9474     ElementSerializer.prototype.getNamespaces = function() {
9475       if (!this.parent) {
9476         if (!this.namespaces) {
9477           this.namespaces = {
9478             prefixMap: {},
9479             uriMap: {},
9480             used: {}
9481           };
9482         }
9483       } else {
9484         this.namespaces = this.parent.getNamespaces();
9485       }
9486
9487       return this.namespaces;
9488     };
9489
9490     ElementSerializer.prototype.logNamespace = function(ns) {
9491       var namespaces = this.getNamespaces();
9492
9493       var existing = namespaces.uriMap[ns.uri];
9494
9495       if (!existing) {
9496         namespaces.uriMap[ns.uri] = ns;
9497       }
9498
9499       namespaces.prefixMap[ns.prefix] = ns.uri;
9500
9501       return ns;
9502     };
9503
9504     ElementSerializer.prototype.logNamespaceUsed = function(ns) {
9505       var element = this.element,
9506         model = element.$model,
9507         namespaces = this.getNamespaces();
9508
9509       // ns may be
9510       //
9511       // * prefix only
9512       // * prefix:uri
9513
9514       var prefix = ns.prefix;
9515       var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||
9516         namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);
9517
9518       if (!uri) {
9519         throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');
9520       }
9521
9522       ns = namespaces.uriMap[uri];
9523
9524       if (!ns) {
9525         ns = this.logNamespace({
9526           prefix: prefix,
9527           uri: uri
9528         });
9529       }
9530
9531       if (!namespaces.used[ns.uri]) {
9532         namespaces.used[ns.uri] = ns;
9533       }
9534
9535       return ns;
9536     };
9537
9538     ElementSerializer.prototype.parseAttributes = function(properties) {
9539       var self = this,
9540         element = this.element;
9541
9542       forEach(properties, function(p) {
9543         self.logNamespaceUsed(p.ns);
9544
9545         var value = element.get(p.name);
9546
9547         if (p.isReference) {
9548           value = value.id;
9549         }
9550
9551         self.addAttribute(self.nsAttributeName(p), value);
9552       });
9553     };
9554
9555     ElementSerializer.prototype.addAttribute = function(name, value) {
9556       var attrs = this.attrs;
9557
9558       if (isString(value)) {
9559         value = escapeAttr(value);
9560       }
9561
9562       attrs.push({
9563         name: name,
9564         value: value
9565       });
9566     };
9567
9568     ElementSerializer.prototype.serializeAttributes = function(writer) {
9569       var attrs = this.attrs,
9570         root = !this.parent,
9571         namespaces = this.namespaces;
9572
9573       function collectNsAttrs() {
9574         return map(namespaces.used, function(ns) {
9575           var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');
9576           return {
9577             name: name,
9578             value: ns.uri
9579           };
9580         });
9581       }
9582
9583       if (root) {
9584         attrs = collectNsAttrs().concat(attrs);
9585       }
9586
9587       forEach(attrs, function(a) {
9588         writer
9589           .append(' ')
9590           .append(nsName(a.name)).append('="').append(a.value).append('"');
9591       });
9592     };
9593
9594     ElementSerializer.prototype.serializeTo = function(writer) {
9595       var hasBody = this.body.length,
9596         indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);
9597
9598       writer
9599         .appendIndent()
9600         .append('<' + nsName(this.ns));
9601
9602       this.serializeAttributes(writer);
9603
9604       writer.append(hasBody ? '>' : ' />');
9605
9606       if (hasBody) {
9607
9608         if (indent) {
9609           writer
9610             .appendNewLine()
9611             .indent();
9612         }
9613
9614         forEach(this.body, function(b) {
9615           b.serializeTo(writer);
9616         });
9617
9618         if (indent) {
9619           writer
9620             .unindent()
9621             .appendIndent();
9622         }
9623
9624         writer.append('</' + nsName(this.ns) + '>');
9625       }
9626
9627       writer.appendNewLine();
9628     };
9629
9630     /**
9631      * A serializer for types that handles serialization of data types
9632      */
9633     function TypeSerializer(parent, ns) {
9634       ElementSerializer.call(this, parent, ns);
9635     }
9636
9637     TypeSerializer.prototype = new ElementSerializer();
9638
9639     TypeSerializer.prototype.build = function(element) {
9640       var descriptor = element.$descriptor;
9641
9642       this.element = element;
9643
9644       this.typeNs = this.nsTagName(descriptor);
9645
9646       // add xsi:type attribute to represent the elements
9647       // actual type
9648
9649       var typeNs = this.typeNs,
9650         pkg = element.$model.getPackage(typeNs.uri),
9651         typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';
9652
9653       this.addAttribute(this.nsAttributeName(XSI_TYPE), (typeNs.prefix ? typeNs.prefix + ':' : '') +
9654         typePrefix + descriptor.ns.localName);
9655
9656       // do the usual stuff
9657       return ElementSerializer.prototype.build.call(this, element);
9658     };
9659
9660     TypeSerializer.prototype.isLocalNs = function(ns) {
9661       return ns.uri === this.typeNs.uri;
9662     };
9663
9664     function SavingWriter() {
9665       this.value = '';
9666
9667       this.write = function(str) {
9668         this.value += str;
9669       };
9670     }
9671
9672     function FormatingWriter(out, format) {
9673
9674       var indent = [''];
9675
9676       this.append = function(str) {
9677         out.write(str);
9678
9679         return this;
9680       };
9681
9682       this.appendNewLine = function() {
9683         if (format) {
9684           out.write('\n');
9685         }
9686
9687         return this;
9688       };
9689
9690       this.appendIndent = function() {
9691         if (format) {
9692           out.write(indent.join('  '));
9693         }
9694
9695         return this;
9696       };
9697
9698       this.indent = function() {
9699         indent.push('');
9700         return this;
9701       };
9702
9703       this.unindent = function() {
9704         indent.pop();
9705         return this;
9706       };
9707     }
9708
9709     /**
9710      * A writer for meta-model backed document trees
9711      *
9712      * @param {Object}
9713      *            options output options to pass into the writer
9714      */
9715     function XMLWriter(options) {
9716
9717       options = assign({
9718         format: false,
9719         preamble: true
9720       }, options || {});
9721
9722       function toXML(tree, writer) {
9723         var internalWriter = writer || new SavingWriter();
9724         var formatingWriter = new FormatingWriter(internalWriter, options.format);
9725
9726         if (options.preamble) {
9727           formatingWriter.append(XML_PREAMBLE);
9728         }
9729
9730         new ElementSerializer().build(tree).serializeTo(formatingWriter);
9731
9732         if (!writer) {
9733           return internalWriter.value;
9734         }
9735       }
9736
9737       return {
9738         toXML: toXML
9739       };
9740     }
9741
9742     module.exports = XMLWriter;
9743   }, {
9744     "./common": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js",
9745     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
9746     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
9747     "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
9748     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
9749     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
9750     "moddle/lib/ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
9751     "moddle/lib/types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js"
9752   }],
9753   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\sax\\lib\\sax.js": [function(require, module, exports) {
9754     (function(Buffer) {
9755       // wrapper for non-node envs
9756       ;
9757       (function(sax) {
9758
9759         sax.parser = function(strict, opt) {
9760           return new SAXParser(strict, opt)
9761         }
9762         sax.SAXParser = SAXParser
9763         sax.SAXStream = SAXStream
9764         sax.createStream = createStream
9765
9766         // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer
9767         // overruns.
9768         // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer
9769         // lengths)),
9770         // since that's the earliest that a buffer overrun could occur. This way, checks
9771         // are
9772         // as rare as required, but as often as necessary to ensure never crossing this
9773         // bound.
9774         // Furthermore, buffers are only tested at most once per write(), so passing a
9775         // very
9776         // large string into write() might have undesirable effects, but this is
9777         // manageable by
9778         // the caller, so it is assumed to be safe. Thus, a call to write() may, in the
9779         // extreme
9780         // edge case, result in creating at most one complete copy of the string passed
9781         // in.
9782         // Set to Infinity to have unlimited buffers.
9783         sax.MAX_BUFFER_LENGTH = 64 * 1024
9784
9785         var buffers = [
9786           "comment", "sgmlDecl", "textNode", "tagName", "doctype",
9787           "procInstName", "procInstBody", "entity", "attribName",
9788           "attribValue", "cdata", "script"
9789         ]
9790
9791         sax.EVENTS = // for discoverability.
9792           ["text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace"]
9793
9794         function SAXParser(strict, opt) {
9795           if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)
9796
9797           var parser = this
9798           clearBuffers(parser)
9799           parser.q = parser.c = ""
9800           parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
9801           parser.opt = opt || {}
9802           parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
9803           parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"
9804           parser.tags = []
9805           parser.closed = parser.closedRoot = parser.sawRoot = false
9806           parser.tag = parser.error = null
9807           parser.strict = !!strict
9808           parser.noscript = !!(strict || parser.opt.noscript)
9809           parser.state = S.BEGIN
9810           parser.ENTITIES = Object.create(sax.ENTITIES)
9811           parser.attribList = []
9812
9813           // namespaces form a prototype chain.
9814           // it always points at the current tag,
9815           // which protos to its parent tag.
9816           if (parser.opt.xmlns) parser.ns = Object.create(rootNS)
9817
9818           // mostly just for error reporting
9819           parser.trackPosition = parser.opt.position !== false
9820           if (parser.trackPosition) {
9821             parser.position = parser.line = parser.column = 0
9822           }
9823           emit(parser, "onready")
9824         }
9825
9826         if (!Object.create) Object.create = function(o) {
9827           function f() {
9828             this.__proto__ = o
9829           }
9830           f.prototype = o
9831           return new f
9832         }
9833
9834         if (!Object.getPrototypeOf) Object.getPrototypeOf = function(o) {
9835           return o.__proto__
9836         }
9837
9838         if (!Object.keys) Object.keys = function(o) {
9839           var a = []
9840           for (var i in o)
9841             if (o.hasOwnProperty(i)) a.push(i)
9842           return a
9843         }
9844
9845         function checkBufferLength(parser) {
9846           var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10),
9847             maxActual = 0
9848           for (var i = 0, l = buffers.length; i < l; i++) {
9849             var len = parser[buffers[i]].length
9850             if (len > maxAllowed) {
9851               // Text/cdata nodes can get big, and since they're buffered,
9852               // we can get here under normal conditions.
9853               // Avoid issues by emitting the text node now,
9854               // so at least it won't get any bigger.
9855               switch (buffers[i]) {
9856                 case "textNode":
9857                   closeText(parser)
9858                   break
9859
9860                 case "cdata":
9861                   emitNode(parser, "oncdata", parser.cdata)
9862                   parser.cdata = ""
9863                   break
9864
9865                 case "script":
9866                   emitNode(parser, "onscript", parser.script)
9867                   parser.script = ""
9868                   break
9869
9870                 default:
9871                   error(parser, "Max buffer length exceeded: " + buffers[i])
9872               }
9873             }
9874             maxActual = Math.max(maxActual, len)
9875           }
9876           // schedule the next check for the earliest possible buffer overrun.
9877           parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual) + parser.position
9878         }
9879
9880         function clearBuffers(parser) {
9881           for (var i = 0, l = buffers.length; i < l; i++) {
9882             parser[buffers[i]] = ""
9883           }
9884         }
9885
9886         function flushBuffers(parser) {
9887           closeText(parser)
9888           if (parser.cdata !== "") {
9889             emitNode(parser, "oncdata", parser.cdata)
9890             parser.cdata = ""
9891           }
9892           if (parser.script !== "") {
9893             emitNode(parser, "onscript", parser.script)
9894             parser.script = ""
9895           }
9896         }
9897
9898         SAXParser.prototype = {
9899           end: function() {
9900             end(this)
9901           },
9902           write: write,
9903           resume: function() {
9904             this.error = null;
9905             return this
9906           },
9907           close: function() {
9908             return this.write(null)
9909           },
9910           flush: function() {
9911             flushBuffers(this)
9912           }
9913         }
9914
9915         try {
9916           var Stream = require("stream").Stream
9917         } catch (ex) {
9918           var Stream = function() {}
9919         }
9920
9921
9922         var streamWraps = sax.EVENTS.filter(function(ev) {
9923           return ev !== "error" && ev !== "end"
9924         })
9925
9926         function createStream(strict, opt) {
9927           return new SAXStream(strict, opt)
9928         }
9929
9930         function SAXStream(strict, opt) {
9931           if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)
9932
9933           Stream.apply(this)
9934
9935           this._parser = new SAXParser(strict, opt)
9936           this.writable = true
9937           this.readable = true
9938
9939
9940           var me = this
9941
9942           this._parser.onend = function() {
9943             me.emit("end")
9944           }
9945
9946           this._parser.onerror = function(er) {
9947             me.emit("error", er)
9948
9949             // if didn't throw, then means error was handled.
9950             // go ahead and clear error, so we can write again.
9951             me._parser.error = null
9952           }
9953
9954           this._decoder = null;
9955
9956           streamWraps.forEach(function(ev) {
9957             Object.defineProperty(me, "on" + ev, {
9958               get: function() {
9959                 return me._parser["on" + ev]
9960               },
9961               set: function(h) {
9962                 if (!h) {
9963                   me.removeAllListeners(ev)
9964                   return me._parser["on" + ev] = h
9965                 }
9966                 me.on(ev, h)
9967               },
9968               enumerable: true,
9969               configurable: false
9970             })
9971           })
9972         }
9973
9974         SAXStream.prototype = Object.create(Stream.prototype, {
9975           constructor: {
9976             value: SAXStream
9977           }
9978         })
9979
9980         SAXStream.prototype.write = function(data) {
9981           if (typeof Buffer === 'function' &&
9982             typeof Buffer.isBuffer === 'function' &&
9983             Buffer.isBuffer(data)) {
9984             if (!this._decoder) {
9985               var SD = require('string_decoder').StringDecoder
9986               this._decoder = new SD('utf8')
9987             }
9988             data = this._decoder.write(data);
9989           }
9990
9991           this._parser.write(data.toString())
9992           this.emit("data", data)
9993           return true
9994         }
9995
9996         SAXStream.prototype.end = function(chunk) {
9997           if (chunk && chunk.length) this.write(chunk)
9998           this._parser.end()
9999           return true
10000         }
10001
10002         SAXStream.prototype.on = function(ev, handler) {
10003           var me = this
10004           if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
10005             me._parser["on" + ev] = function() {
10006               var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
10007               args.splice(0, 0, ev)
10008               me.emit.apply(me, args)
10009             }
10010           }
10011
10012           return Stream.prototype.on.call(me, ev, handler)
10013         }
10014
10015
10016
10017         // character classes and tokens
10018         var whitespace = "\r\n\t "
10019           // this really needs to be replaced with character classes.
10020           // XML allows all manner of ridiculous numbers and digits.
10021           ,
10022           number = "0124356789",
10023           letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
10024           // (Letter | "_" | ":")
10025           ,
10026           quote = "'\"",
10027           entity = number + letter + "#",
10028           attribEnd = whitespace + ">",
10029           CDATA = "[CDATA[",
10030           DOCTYPE = "DOCTYPE",
10031           XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace",
10032           XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/",
10033           rootNS = {
10034             xml: XML_NAMESPACE,
10035             xmlns: XMLNS_NAMESPACE
10036           }
10037
10038         // turn all the string character sets into character class objects.
10039         whitespace = charClass(whitespace)
10040         number = charClass(number)
10041         letter = charClass(letter)
10042
10043         // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
10044         // This implementation works on strings, a single character at a time
10045         // as such, it cannot ever support astral-plane characters (10000-EFFFF)
10046         // without a significant breaking change to either this parser, or the
10047         // JavaScript language. Implementation of an emoji-capable xml parser
10048         // is left as an exercise for the reader.
10049         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]/
10050
10051         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-]/
10052
10053         quote = charClass(quote)
10054         entity = charClass(entity)
10055         attribEnd = charClass(attribEnd)
10056
10057         function charClass(str) {
10058           return str.split("").reduce(function(s, c) {
10059             s[c] = true
10060             return s
10061           }, {})
10062         }
10063
10064         function isRegExp(c) {
10065           return Object.prototype.toString.call(c) === '[object RegExp]'
10066         }
10067
10068         function is(charclass, c) {
10069           return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]
10070         }
10071
10072         function not(charclass, c) {
10073           return !is(charclass, c)
10074         }
10075
10076         var S = 0
10077         sax.STATE = {
10078           BEGIN: S++,
10079           TEXT: S++ // general stuff
10080             ,
10081           TEXT_ENTITY: S++ // &amp and such.
10082             ,
10083           OPEN_WAKA: S++ // <
10084             ,
10085           SGML_DECL: S++ // <!BLARG
10086             ,
10087           SGML_DECL_QUOTED: S++ // <!BLARG foo "bar
10088             ,
10089           DOCTYPE: S++ // <!DOCTYPE
10090             ,
10091           DOCTYPE_QUOTED: S++ // <!DOCTYPE "//blah
10092             ,
10093           DOCTYPE_DTD: S++ // <!DOCTYPE "//blah" [ ...
10094             ,
10095           DOCTYPE_DTD_QUOTED: S++ // <!DOCTYPE "//blah" [ "foo
10096             ,
10097           COMMENT_STARTING: S++ // <!-
10098             ,
10099           COMMENT: S++ // <!--
10100             ,
10101           COMMENT_ENDING: S++ // <!-- blah -
10102             ,
10103           COMMENT_ENDED: S++ // <!-- blah --
10104             ,
10105           CDATA: S++ // <![CDATA[ something
10106             ,
10107           CDATA_ENDING: S++ // ]
10108             ,
10109           CDATA_ENDING_2: S++ // ]]
10110             ,
10111           PROC_INST: S++ // <?hi
10112             ,
10113           PROC_INST_BODY: S++ // <?hi there
10114             ,
10115           PROC_INST_ENDING: S++ // <?hi "there" ?
10116             ,
10117           OPEN_TAG: S++ // <strong
10118             ,
10119           OPEN_TAG_SLASH: S++ // <strong /
10120             ,
10121           ATTRIB: S++ // <a
10122             ,
10123           ATTRIB_NAME: S++ // <a foo
10124             ,
10125           ATTRIB_NAME_SAW_WHITE: S++ // <a foo _
10126             ,
10127           ATTRIB_VALUE: S++ // <a foo=
10128             ,
10129           ATTRIB_VALUE_QUOTED: S++ // <a foo="bar
10130             ,
10131           ATTRIB_VALUE_CLOSED: S++ // <a foo="bar"
10132             ,
10133           ATTRIB_VALUE_UNQUOTED: S++ // <a foo=bar
10134             ,
10135           ATTRIB_VALUE_ENTITY_Q: S++ // <foo bar="&quot;"
10136             ,
10137           ATTRIB_VALUE_ENTITY_U: S++ // <foo bar=&quot;
10138             ,
10139           CLOSE_TAG: S++ // </a
10140             ,
10141           CLOSE_TAG_SAW_WHITE: S++ // </a >
10142             ,
10143           SCRIPT: S++ // <script> ...
10144             ,
10145           SCRIPT_ENDING: S++ // <script> ... <
10146         }
10147
10148         sax.ENTITIES = {
10149           "amp": "&",
10150           "gt": ">",
10151           "lt": "<",
10152           "quot": "\"",
10153           "apos": "'",
10154           "AElig": 198,
10155           "Aacute": 193,
10156           "Acirc": 194,
10157           "Agrave": 192,
10158           "Aring": 197,
10159           "Atilde": 195,
10160           "Auml": 196,
10161           "Ccedil": 199,
10162           "ETH": 208,
10163           "Eacute": 201,
10164           "Ecirc": 202,
10165           "Egrave": 200,
10166           "Euml": 203,
10167           "Iacute": 205,
10168           "Icirc": 206,
10169           "Igrave": 204,
10170           "Iuml": 207,
10171           "Ntilde": 209,
10172           "Oacute": 211,
10173           "Ocirc": 212,
10174           "Ograve": 210,
10175           "Oslash": 216,
10176           "Otilde": 213,
10177           "Ouml": 214,
10178           "THORN": 222,
10179           "Uacute": 218,
10180           "Ucirc": 219,
10181           "Ugrave": 217,
10182           "Uuml": 220,
10183           "Yacute": 221,
10184           "aacute": 225,
10185           "acirc": 226,
10186           "aelig": 230,
10187           "agrave": 224,
10188           "aring": 229,
10189           "atilde": 227,
10190           "auml": 228,
10191           "ccedil": 231,
10192           "eacute": 233,
10193           "ecirc": 234,
10194           "egrave": 232,
10195           "eth": 240,
10196           "euml": 235,
10197           "iacute": 237,
10198           "icirc": 238,
10199           "igrave": 236,
10200           "iuml": 239,
10201           "ntilde": 241,
10202           "oacute": 243,
10203           "ocirc": 244,
10204           "ograve": 242,
10205           "oslash": 248,
10206           "otilde": 245,
10207           "ouml": 246,
10208           "szlig": 223,
10209           "thorn": 254,
10210           "uacute": 250,
10211           "ucirc": 251,
10212           "ugrave": 249,
10213           "uuml": 252,
10214           "yacute": 253,
10215           "yuml": 255,
10216           "copy": 169,
10217           "reg": 174,
10218           "nbsp": 160,
10219           "iexcl": 161,
10220           "cent": 162,
10221           "pound": 163,
10222           "curren": 164,
10223           "yen": 165,
10224           "brvbar": 166,
10225           "sect": 167,
10226           "uml": 168,
10227           "ordf": 170,
10228           "laquo": 171,
10229           "not": 172,
10230           "shy": 173,
10231           "macr": 175,
10232           "deg": 176,
10233           "plusmn": 177,
10234           "sup1": 185,
10235           "sup2": 178,
10236           "sup3": 179,
10237           "acute": 180,
10238           "micro": 181,
10239           "para": 182,
10240           "middot": 183,
10241           "cedil": 184,
10242           "ordm": 186,
10243           "raquo": 187,
10244           "frac14": 188,
10245           "frac12": 189,
10246           "frac34": 190,
10247           "iquest": 191,
10248           "times": 215,
10249           "divide": 247,
10250           "OElig": 338,
10251           "oelig": 339,
10252           "Scaron": 352,
10253           "scaron": 353,
10254           "Yuml": 376,
10255           "fnof": 402,
10256           "circ": 710,
10257           "tilde": 732,
10258           "Alpha": 913,
10259           "Beta": 914,
10260           "Gamma": 915,
10261           "Delta": 916,
10262           "Epsilon": 917,
10263           "Zeta": 918,
10264           "Eta": 919,
10265           "Theta": 920,
10266           "Iota": 921,
10267           "Kappa": 922,
10268           "Lambda": 923,
10269           "Mu": 924,
10270           "Nu": 925,
10271           "Xi": 926,
10272           "Omicron": 927,
10273           "Pi": 928,
10274           "Rho": 929,
10275           "Sigma": 931,
10276           "Tau": 932,
10277           "Upsilon": 933,
10278           "Phi": 934,
10279           "Chi": 935,
10280           "Psi": 936,
10281           "Omega": 937,
10282           "alpha": 945,
10283           "beta": 946,
10284           "gamma": 947,
10285           "delta": 948,
10286           "epsilon": 949,
10287           "zeta": 950,
10288           "eta": 951,
10289           "theta": 952,
10290           "iota": 953,
10291           "kappa": 954,
10292           "lambda": 955,
10293           "mu": 956,
10294           "nu": 957,
10295           "xi": 958,
10296           "omicron": 959,
10297           "pi": 960,
10298           "rho": 961,
10299           "sigmaf": 962,
10300           "sigma": 963,
10301           "tau": 964,
10302           "upsilon": 965,
10303           "phi": 966,
10304           "chi": 967,
10305           "psi": 968,
10306           "omega": 969,
10307           "thetasym": 977,
10308           "upsih": 978,
10309           "piv": 982,
10310           "ensp": 8194,
10311           "emsp": 8195,
10312           "thinsp": 8201,
10313           "zwnj": 8204,
10314           "zwj": 8205,
10315           "lrm": 8206,
10316           "rlm": 8207,
10317           "ndash": 8211,
10318           "mdash": 8212,
10319           "lsquo": 8216,
10320           "rsquo": 8217,
10321           "sbquo": 8218,
10322           "ldquo": 8220,
10323           "rdquo": 8221,
10324           "bdquo": 8222,
10325           "dagger": 8224,
10326           "Dagger": 8225,
10327           "bull": 8226,
10328           "hellip": 8230,
10329           "permil": 8240,
10330           "prime": 8242,
10331           "Prime": 8243,
10332           "lsaquo": 8249,
10333           "rsaquo": 8250,
10334           "oline": 8254,
10335           "frasl": 8260,
10336           "euro": 8364,
10337           "image": 8465,
10338           "weierp": 8472,
10339           "real": 8476,
10340           "trade": 8482,
10341           "alefsym": 8501,
10342           "larr": 8592,
10343           "uarr": 8593,
10344           "rarr": 8594,
10345           "darr": 8595,
10346           "harr": 8596,
10347           "crarr": 8629,
10348           "lArr": 8656,
10349           "uArr": 8657,
10350           "rArr": 8658,
10351           "dArr": 8659,
10352           "hArr": 8660,
10353           "forall": 8704,
10354           "part": 8706,
10355           "exist": 8707,
10356           "empty": 8709,
10357           "nabla": 8711,
10358           "isin": 8712,
10359           "notin": 8713,
10360           "ni": 8715,
10361           "prod": 8719,
10362           "sum": 8721,
10363           "minus": 8722,
10364           "lowast": 8727,
10365           "radic": 8730,
10366           "prop": 8733,
10367           "infin": 8734,
10368           "ang": 8736,
10369           "and": 8743,
10370           "or": 8744,
10371           "cap": 8745,
10372           "cup": 8746,
10373           "int": 8747,
10374           "there4": 8756,
10375           "sim": 8764,
10376           "cong": 8773,
10377           "asymp": 8776,
10378           "ne": 8800,
10379           "equiv": 8801,
10380           "le": 8804,
10381           "ge": 8805,
10382           "sub": 8834,
10383           "sup": 8835,
10384           "nsub": 8836,
10385           "sube": 8838,
10386           "supe": 8839,
10387           "oplus": 8853,
10388           "otimes": 8855,
10389           "perp": 8869,
10390           "sdot": 8901,
10391           "lceil": 8968,
10392           "rceil": 8969,
10393           "lfloor": 8970,
10394           "rfloor": 8971,
10395           "lang": 9001,
10396           "rang": 9002,
10397           "loz": 9674,
10398           "spades": 9824,
10399           "clubs": 9827,
10400           "hearts": 9829,
10401           "diams": 9830
10402         }
10403
10404         Object.keys(sax.ENTITIES).forEach(function(key) {
10405           var e = sax.ENTITIES[key]
10406           var s = typeof e === 'number' ? String.fromCharCode(e) : e
10407           sax.ENTITIES[key] = s
10408         })
10409
10410         for (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S
10411
10412         // shorthand
10413         S = sax.STATE
10414
10415         function emit(parser, event, data) {
10416           parser[event] && parser[event](data)
10417         }
10418
10419         function emitNode(parser, nodeType, data) {
10420           if (parser.textNode) closeText(parser)
10421           emit(parser, nodeType, data)
10422         }
10423
10424         function closeText(parser) {
10425           parser.textNode = textopts(parser.opt, parser.textNode)
10426           if (parser.textNode) emit(parser, "ontext", parser.textNode)
10427           parser.textNode = ""
10428         }
10429
10430         function textopts(opt, text) {
10431           if (opt.trim) text = text.trim()
10432           if (opt.normalize) text = text.replace(/\s+/g, " ")
10433           return text
10434         }
10435
10436         function error(parser, er) {
10437           closeText(parser)
10438           if (parser.trackPosition) {
10439             er += "\nLine: " + parser.line +
10440               "\nColumn: " + parser.column +
10441               "\nChar: " + parser.c
10442           }
10443           er = new Error(er)
10444           parser.error = er
10445           emit(parser, "onerror", er)
10446           return parser
10447         }
10448
10449         function end(parser) {
10450           if (!parser.closedRoot) strictFail(parser, "Unclosed root tag")
10451           if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, "Unexpected end")
10452           closeText(parser)
10453           parser.c = ""
10454           parser.closed = true
10455           emit(parser, "onend")
10456           SAXParser.call(parser, parser.strict, parser.opt)
10457           return parser
10458         }
10459
10460         function strictFail(parser, message) {
10461           if (typeof parser !== 'object' || !(parser instanceof SAXParser))
10462             throw new Error('bad call to strictFail');
10463           if (parser.strict) error(parser, message)
10464         }
10465
10466         function newTag(parser) {
10467           if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
10468           var parent = parser.tags[parser.tags.length - 1] || parser,
10469             tag = parser.tag = {
10470               name: parser.tagName,
10471               attributes: {}
10472             }
10473
10474           // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
10475           if (parser.opt.xmlns) tag.ns = parent.ns
10476           parser.attribList.length = 0
10477         }
10478
10479         function qname(name, attribute) {
10480           var i = name.indexOf(":"),
10481             qualName = i < 0 ? ["", name] : name.split(":"),
10482             prefix = qualName[0],
10483             local = qualName[1]
10484
10485           // <x "xmlns"="http://foo">
10486           if (attribute && name === "xmlns") {
10487             prefix = "xmlns"
10488             local = ""
10489           }
10490
10491           return {
10492             prefix: prefix,
10493             local: local
10494           }
10495         }
10496
10497         function attrib(parser) {
10498           if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()
10499
10500           if (parser.attribList.indexOf(parser.attribName) !== -1 ||
10501             parser.tag.attributes.hasOwnProperty(parser.attribName)) {
10502             return parser.attribName = parser.attribValue = ""
10503           }
10504
10505           if (parser.opt.xmlns) {
10506             var qn = qname(parser.attribName, true),
10507               prefix = qn.prefix,
10508               local = qn.local
10509
10510             if (prefix === "xmlns") {
10511               // namespace binding attribute; push the binding into scope
10512               if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
10513                 strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\n" + "Actual: " + parser.attribValue)
10514               } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
10515                 strictFail(parser, "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n" + "Actual: " + parser.attribValue)
10516               } else {
10517                 var tag = parser.tag,
10518                   parent = parser.tags[parser.tags.length - 1] || parser
10519                 if (tag.ns === parent.ns) {
10520                   tag.ns = Object.create(parent.ns)
10521                 }
10522                 tag.ns[local] = parser.attribValue
10523               }
10524             }
10525
10526             // defer onattribute events until all attributes have been seen
10527             // so any new bindings can take effect; preserve attribute order
10528             // so deferred events can be emitted in document order
10529             parser.attribList.push([parser.attribName, parser.attribValue])
10530           } else {
10531             // in non-xmlns mode, we can emit the event right away
10532             parser.tag.attributes[parser.attribName] = parser.attribValue
10533             emitNode(parser, "onattribute", {
10534               name: parser.attribName,
10535               value: parser.attribValue
10536             })
10537           }
10538
10539           parser.attribName = parser.attribValue = ""
10540         }
10541
10542         function openTag(parser, selfClosing) {
10543           if (parser.opt.xmlns) {
10544             // emit namespace binding events
10545             var tag = parser.tag
10546
10547             // add namespace info to tag
10548             var qn = qname(parser.tagName)
10549             tag.prefix = qn.prefix
10550             tag.local = qn.local
10551             tag.uri = tag.ns[qn.prefix] || ""
10552
10553             if (tag.prefix && !tag.uri) {
10554               strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName))
10555               tag.uri = qn.prefix
10556             }
10557
10558             var parent = parser.tags[parser.tags.length - 1] || parser
10559             if (tag.ns && parent.ns !== tag.ns) {
10560               Object.keys(tag.ns).forEach(function(p) {
10561                 emitNode(parser, "onopennamespace", {
10562                   prefix: p,
10563                   uri: tag.ns[p]
10564                 })
10565               })
10566             }
10567
10568             // handle deferred onattribute events
10569             // Note: do not apply default ns to attributes:
10570             // http://www.w3.org/TR/REC-xml-names/#defaulting
10571             for (var i = 0, l = parser.attribList.length; i < l; i++) {
10572               var nv = parser.attribList[i]
10573               var name = nv[0],
10574                 value = nv[1],
10575                 qualName = qname(name, true),
10576                 prefix = qualName.prefix,
10577                 local = qualName.local,
10578                 uri = prefix == "" ? "" : (tag.ns[prefix] || ""),
10579                 a = {
10580                   name: name,
10581                   value: value,
10582                   prefix: prefix,
10583                   local: local,
10584                   uri: uri
10585                 }
10586
10587               // if there's any attributes with an undefined namespace,
10588               // then fail on them now.
10589               if (prefix && prefix != "xmlns" && !uri) {
10590                 strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix))
10591                 a.uri = prefix
10592               }
10593               parser.tag.attributes[name] = a
10594               emitNode(parser, "onattribute", a)
10595             }
10596             parser.attribList.length = 0
10597           }
10598
10599           parser.tag.isSelfClosing = !!selfClosing
10600
10601           // process the tag
10602           parser.sawRoot = true
10603           parser.tags.push(parser.tag)
10604           emitNode(parser, "onopentag", parser.tag)
10605           if (!selfClosing) {
10606             // special case for <script> in non-strict mode.
10607             if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
10608               parser.state = S.SCRIPT
10609             } else {
10610               parser.state = S.TEXT
10611             }
10612             parser.tag = null
10613             parser.tagName = ""
10614           }
10615           parser.attribName = parser.attribValue = ""
10616           parser.attribList.length = 0
10617         }
10618
10619         function closeTag(parser) {
10620           if (!parser.tagName) {
10621             strictFail(parser, "Weird empty close tag.")
10622             parser.textNode += "</>"
10623             parser.state = S.TEXT
10624             return
10625           }
10626
10627           if (parser.script) {
10628             if (parser.tagName !== "script") {
10629               parser.script += "</" + parser.tagName + ">"
10630               parser.tagName = ""
10631               parser.state = S.SCRIPT
10632               return
10633             }
10634             emitNode(parser, "onscript", parser.script)
10635             parser.script = ""
10636           }
10637
10638           // first make sure that the closing tag actually exists.
10639           // <a><b></c></b></a> will close everything, otherwise.
10640           var t = parser.tags.length
10641           var tagName = parser.tagName
10642           if (!parser.strict) tagName = tagName[parser.looseCase]()
10643           var closeTo = tagName
10644           while (t--) {
10645             var close = parser.tags[t]
10646             if (close.name !== closeTo) {
10647               // fail the first time in strict mode
10648               strictFail(parser, "Unexpected close tag")
10649             } else break
10650           }
10651
10652           // didn't find it. we already failed for strict, so just abort.
10653           if (t < 0) {
10654             strictFail(parser, "Unmatched closing tag: " + parser.tagName)
10655             parser.textNode += "</" + parser.tagName + ">"
10656             parser.state = S.TEXT
10657             return
10658           }
10659           parser.tagName = tagName
10660           var s = parser.tags.length
10661           while (s-- > t) {
10662             var tag = parser.tag = parser.tags.pop()
10663             parser.tagName = parser.tag.name
10664             emitNode(parser, "onclosetag", parser.tagName)
10665
10666             var x = {}
10667             for (var i in tag.ns) x[i] = tag.ns[i]
10668
10669             var parent = parser.tags[parser.tags.length - 1] || parser
10670             if (parser.opt.xmlns && tag.ns !== parent.ns) {
10671               // remove namespace bindings introduced by tag
10672               Object.keys(tag.ns).forEach(function(p) {
10673                 var n = tag.ns[p]
10674                 emitNode(parser, "onclosenamespace", {
10675                   prefix: p,
10676                   uri: n
10677                 })
10678               })
10679             }
10680           }
10681           if (t === 0) parser.closedRoot = true
10682           parser.tagName = parser.attribValue = parser.attribName = ""
10683           parser.attribList.length = 0
10684           parser.state = S.TEXT
10685         }
10686
10687         function parseEntity(parser) {
10688           var entity = parser.entity,
10689             entityLC = entity.toLowerCase(),
10690             num, numStr = ""
10691           if (parser.ENTITIES[entity])
10692             return parser.ENTITIES[entity]
10693           if (parser.ENTITIES[entityLC])
10694             return parser.ENTITIES[entityLC]
10695           entity = entityLC
10696           if (entity.charAt(0) === "#") {
10697             if (entity.charAt(1) === "x") {
10698               entity = entity.slice(2)
10699               num = parseInt(entity, 16)
10700               numStr = num.toString(16)
10701             } else {
10702               entity = entity.slice(1)
10703               num = parseInt(entity, 10)
10704               numStr = num.toString(10)
10705             }
10706           }
10707           entity = entity.replace(/^0+/, "")
10708           if (numStr.toLowerCase() !== entity) {
10709             strictFail(parser, "Invalid character entity")
10710             return "&" + parser.entity + ";"
10711           }
10712
10713           return String.fromCodePoint(num)
10714         }
10715
10716         function write(chunk) {
10717           var parser = this
10718           if (this.error) throw this.error
10719           if (parser.closed) return error(parser,
10720             "Cannot write after close. Assign an onready handler.")
10721           if (chunk === null) return end(parser)
10722           var i = 0,
10723             c = ""
10724           while (parser.c = c = chunk.charAt(i++)) {
10725             if (parser.trackPosition) {
10726               parser.position++
10727                 if (c === "\n") {
10728                   parser.line++
10729                     parser.column = 0
10730                 } else parser.column++
10731             }
10732             switch (parser.state) {
10733
10734               case S.BEGIN:
10735                 if (c === "<") {
10736                   parser.state = S.OPEN_WAKA
10737                   parser.startTagPosition = parser.position
10738                 } else if (not(whitespace, c)) {
10739                   // have to process this as a text node.
10740                   // weird, but happens.
10741                   strictFail(parser, "Non-whitespace before first tag.")
10742                   parser.textNode = c
10743                   parser.state = S.TEXT
10744                 }
10745                 continue
10746
10747               case S.TEXT:
10748                 if (parser.sawRoot && !parser.closedRoot) {
10749                   var starti = i - 1
10750                   while (c && c !== "<" && c !== "&") {
10751                     c = chunk.charAt(i++)
10752                     if (c && parser.trackPosition) {
10753                       parser.position++
10754                         if (c === "\n") {
10755                           parser.line++
10756                             parser.column = 0
10757                         } else parser.column++
10758                     }
10759                   }
10760                   parser.textNode += chunk.substring(starti, i - 1)
10761                 }
10762                 if (c === "<") {
10763                   parser.state = S.OPEN_WAKA
10764                   parser.startTagPosition = parser.position
10765                 } else {
10766                   if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))
10767                     strictFail(parser, "Text data outside of root node.")
10768                   if (c === "&") parser.state = S.TEXT_ENTITY
10769                   else parser.textNode += c
10770                 }
10771                 continue
10772
10773               case S.SCRIPT:
10774                 // only non-strict
10775                 if (c === "<") {
10776                   parser.state = S.SCRIPT_ENDING
10777                 } else parser.script += c
10778                 continue
10779
10780               case S.SCRIPT_ENDING:
10781                 if (c === "/") {
10782                   parser.state = S.CLOSE_TAG
10783                 } else {
10784                   parser.script += "<" + c
10785                   parser.state = S.SCRIPT
10786                 }
10787                 continue
10788
10789               case S.OPEN_WAKA:
10790                 // either a /, ?, !, or text is coming next.
10791                 if (c === "!") {
10792                   parser.state = S.SGML_DECL
10793                   parser.sgmlDecl = ""
10794                 } else if (is(whitespace, c)) {
10795                   // wait for it...
10796                 } else if (is(nameStart, c)) {
10797                   parser.state = S.OPEN_TAG
10798                   parser.tagName = c
10799                 } else if (c === "/") {
10800                   parser.state = S.CLOSE_TAG
10801                   parser.tagName = ""
10802                 } else if (c === "?") {
10803                   parser.state = S.PROC_INST
10804                   parser.procInstName = parser.procInstBody = ""
10805                 } else {
10806                   strictFail(parser, "Unencoded <")
10807                   // if there was some whitespace, then add that in.
10808                   if (parser.startTagPosition + 1 < parser.position) {
10809                     var pad = parser.position - parser.startTagPosition
10810                     c = new Array(pad).join(" ") + c
10811                   }
10812                   parser.textNode += "<" + c
10813                   parser.state = S.TEXT
10814                 }
10815                 continue
10816
10817               case S.SGML_DECL:
10818                 if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
10819                   emitNode(parser, "onopencdata")
10820                   parser.state = S.CDATA
10821                   parser.sgmlDecl = ""
10822                   parser.cdata = ""
10823                 } else if (parser.sgmlDecl + c === "--") {
10824                   parser.state = S.COMMENT
10825                   parser.comment = ""
10826                   parser.sgmlDecl = ""
10827                 } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
10828                   parser.state = S.DOCTYPE
10829                   if (parser.doctype || parser.sawRoot) strictFail(parser,
10830                     "Inappropriately located doctype declaration")
10831                   parser.doctype = ""
10832                   parser.sgmlDecl = ""
10833                 } else if (c === ">") {
10834                   emitNode(parser, "onsgmldeclaration", parser.sgmlDecl)
10835                   parser.sgmlDecl = ""
10836                   parser.state = S.TEXT
10837                 } else if (is(quote, c)) {
10838                   parser.state = S.SGML_DECL_QUOTED
10839                   parser.sgmlDecl += c
10840                 } else parser.sgmlDecl += c
10841                 continue
10842
10843               case S.SGML_DECL_QUOTED:
10844                 if (c === parser.q) {
10845                   parser.state = S.SGML_DECL
10846                   parser.q = ""
10847                 }
10848                 parser.sgmlDecl += c
10849                 continue
10850
10851               case S.DOCTYPE:
10852                 if (c === ">") {
10853                   parser.state = S.TEXT
10854                   emitNode(parser, "ondoctype", parser.doctype)
10855                   parser.doctype = true // just remember that we saw it.
10856                 } else {
10857                   parser.doctype += c
10858                   if (c === "[") parser.state = S.DOCTYPE_DTD
10859                   else if (is(quote, c)) {
10860                     parser.state = S.DOCTYPE_QUOTED
10861                     parser.q = c
10862                   }
10863                 }
10864                 continue
10865
10866               case S.DOCTYPE_QUOTED:
10867                 parser.doctype += c
10868                 if (c === parser.q) {
10869                   parser.q = ""
10870                   parser.state = S.DOCTYPE
10871                 }
10872                 continue
10873
10874               case S.DOCTYPE_DTD:
10875                 parser.doctype += c
10876                 if (c === "]") parser.state = S.DOCTYPE
10877                 else if (is(quote, c)) {
10878                   parser.state = S.DOCTYPE_DTD_QUOTED
10879                   parser.q = c
10880                 }
10881                 continue
10882
10883               case S.DOCTYPE_DTD_QUOTED:
10884                 parser.doctype += c
10885                 if (c === parser.q) {
10886                   parser.state = S.DOCTYPE_DTD
10887                   parser.q = ""
10888                 }
10889                 continue
10890
10891               case S.COMMENT:
10892                 if (c === "-") parser.state = S.COMMENT_ENDING
10893                 else parser.comment += c
10894                 continue
10895
10896               case S.COMMENT_ENDING:
10897                 if (c === "-") {
10898                   parser.state = S.COMMENT_ENDED
10899                   parser.comment = textopts(parser.opt, parser.comment)
10900                   if (parser.comment) emitNode(parser, "oncomment", parser.comment)
10901                   parser.comment = ""
10902                 } else {
10903                   parser.comment += "-" + c
10904                   parser.state = S.COMMENT
10905                 }
10906                 continue
10907
10908               case S.COMMENT_ENDED:
10909                 if (c !== ">") {
10910                   strictFail(parser, "Malformed comment")
10911                   // allow <!-- blah -- bloo --> in non-strict mode,
10912                   // which is a comment of " blah -- bloo "
10913                   parser.comment += "--" + c
10914                   parser.state = S.COMMENT
10915                 } else parser.state = S.TEXT
10916                 continue
10917
10918               case S.CDATA:
10919                 if (c === "]") parser.state = S.CDATA_ENDING
10920                 else parser.cdata += c
10921                 continue
10922
10923               case S.CDATA_ENDING:
10924                 if (c === "]") parser.state = S.CDATA_ENDING_2
10925                 else {
10926                   parser.cdata += "]" + c
10927                   parser.state = S.CDATA
10928                 }
10929                 continue
10930
10931               case S.CDATA_ENDING_2:
10932                 if (c === ">") {
10933                   if (parser.cdata) emitNode(parser, "oncdata", parser.cdata)
10934                   emitNode(parser, "onclosecdata")
10935                   parser.cdata = ""
10936                   parser.state = S.TEXT
10937                 } else if (c === "]") {
10938                   parser.cdata += "]"
10939                 } else {
10940                   parser.cdata += "]]" + c
10941                   parser.state = S.CDATA
10942                 }
10943                 continue
10944
10945               case S.PROC_INST:
10946                 if (c === "?") parser.state = S.PROC_INST_ENDING
10947                 else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY
10948                 else parser.procInstName += c
10949                 continue
10950
10951               case S.PROC_INST_BODY:
10952                 if (!parser.procInstBody && is(whitespace, c)) continue
10953                 else if (c === "?") parser.state = S.PROC_INST_ENDING
10954                 else parser.procInstBody += c
10955                 continue
10956
10957               case S.PROC_INST_ENDING:
10958                 if (c === ">") {
10959                   emitNode(parser, "onprocessinginstruction", {
10960                     name: parser.procInstName,
10961                     body: parser.procInstBody
10962                   })
10963                   parser.procInstName = parser.procInstBody = ""
10964                   parser.state = S.TEXT
10965                 } else {
10966                   parser.procInstBody += "?" + c
10967                   parser.state = S.PROC_INST_BODY
10968                 }
10969                 continue
10970
10971               case S.OPEN_TAG:
10972                 if (is(nameBody, c)) parser.tagName += c
10973                 else {
10974                   newTag(parser)
10975                   if (c === ">") openTag(parser)
10976                   else if (c === "/") parser.state = S.OPEN_TAG_SLASH
10977                   else {
10978                     if (not(whitespace, c)) strictFail(
10979                       parser, "Invalid character in tag name")
10980                     parser.state = S.ATTRIB
10981                   }
10982                 }
10983                 continue
10984
10985               case S.OPEN_TAG_SLASH:
10986                 if (c === ">") {
10987                   openTag(parser, true)
10988                   closeTag(parser)
10989                 } else {
10990                   strictFail(parser, "Forward-slash in opening tag not followed by >")
10991                   parser.state = S.ATTRIB
10992                 }
10993                 continue
10994
10995               case S.ATTRIB:
10996                 // haven't read the attribute name yet.
10997                 if (is(whitespace, c)) continue
10998                 else if (c === ">") openTag(parser)
10999                 else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11000                 else if (is(nameStart, c)) {
11001                   parser.attribName = c
11002                   parser.attribValue = ""
11003                   parser.state = S.ATTRIB_NAME
11004                 } else strictFail(parser, "Invalid attribute name")
11005                 continue
11006
11007               case S.ATTRIB_NAME:
11008                 if (c === "=") parser.state = S.ATTRIB_VALUE
11009                 else if (c === ">") {
11010                   strictFail(parser, "Attribute without value")
11011                   parser.attribValue = parser.attribName
11012                   attrib(parser)
11013                   openTag(parser)
11014                 } else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE
11015                 else if (is(nameBody, c)) parser.attribName += c
11016                 else strictFail(parser, "Invalid attribute name")
11017                 continue
11018
11019               case S.ATTRIB_NAME_SAW_WHITE:
11020                 if (c === "=") parser.state = S.ATTRIB_VALUE
11021                 else if (is(whitespace, c)) continue
11022                 else {
11023                   strictFail(parser, "Attribute without value")
11024                   parser.tag.attributes[parser.attribName] = ""
11025                   parser.attribValue = ""
11026                   emitNode(parser, "onattribute", {
11027                     name: parser.attribName,
11028                     value: ""
11029                   })
11030                   parser.attribName = ""
11031                   if (c === ">") openTag(parser)
11032                   else if (is(nameStart, c)) {
11033                     parser.attribName = c
11034                     parser.state = S.ATTRIB_NAME
11035                   } else {
11036                     strictFail(parser, "Invalid attribute name")
11037                     parser.state = S.ATTRIB
11038                   }
11039                 }
11040                 continue
11041
11042               case S.ATTRIB_VALUE:
11043                 if (is(whitespace, c)) continue
11044                 else if (is(quote, c)) {
11045                   parser.q = c
11046                   parser.state = S.ATTRIB_VALUE_QUOTED
11047                 } else {
11048                   strictFail(parser, "Unquoted attribute value")
11049                   parser.state = S.ATTRIB_VALUE_UNQUOTED
11050                   parser.attribValue = c
11051                 }
11052                 continue
11053
11054               case S.ATTRIB_VALUE_QUOTED:
11055                 if (c !== parser.q) {
11056                   if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q
11057                   else parser.attribValue += c
11058                   continue
11059                 }
11060                 attrib(parser)
11061                 parser.q = ""
11062                 parser.state = S.ATTRIB_VALUE_CLOSED
11063                 continue
11064
11065               case S.ATTRIB_VALUE_CLOSED:
11066                 if (is(whitespace, c)) {
11067                   parser.state = S.ATTRIB
11068                 } else if (c === ">") openTag(parser)
11069                 else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11070                 else if (is(nameStart, c)) {
11071                   strictFail(parser, "No whitespace between attributes")
11072                   parser.attribName = c
11073                   parser.attribValue = ""
11074                   parser.state = S.ATTRIB_NAME
11075                 } else strictFail(parser, "Invalid attribute name")
11076                 continue
11077
11078               case S.ATTRIB_VALUE_UNQUOTED:
11079                 if (not(attribEnd, c)) {
11080                   if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U
11081                   else parser.attribValue += c
11082                   continue
11083                 }
11084                 attrib(parser)
11085                 if (c === ">") openTag(parser)
11086                 else parser.state = S.ATTRIB
11087                 continue
11088
11089               case S.CLOSE_TAG:
11090                 if (!parser.tagName) {
11091                   if (is(whitespace, c)) continue
11092                   else if (not(nameStart, c)) {
11093                     if (parser.script) {
11094                       parser.script += "</" + c
11095                       parser.state = S.SCRIPT
11096                     } else {
11097                       strictFail(parser, "Invalid tagname in closing tag.")
11098                     }
11099                   } else parser.tagName = c
11100                 } else if (c === ">") closeTag(parser)
11101                 else if (is(nameBody, c)) parser.tagName += c
11102                 else if (parser.script) {
11103                   parser.script += "</" + parser.tagName
11104                   parser.tagName = ""
11105                   parser.state = S.SCRIPT
11106                 } else {
11107                   if (not(whitespace, c)) strictFail(parser,
11108                     "Invalid tagname in closing tag")
11109                   parser.state = S.CLOSE_TAG_SAW_WHITE
11110                 }
11111                 continue
11112
11113               case S.CLOSE_TAG_SAW_WHITE:
11114                 if (is(whitespace, c)) continue
11115                 if (c === ">") closeTag(parser)
11116                 else strictFail(parser, "Invalid characters in closing tag")
11117                 continue
11118
11119               case S.TEXT_ENTITY:
11120               case S.ATTRIB_VALUE_ENTITY_Q:
11121               case S.ATTRIB_VALUE_ENTITY_U:
11122                 switch (parser.state) {
11123                   case S.TEXT_ENTITY:
11124                     var returnState = S.TEXT,
11125                       buffer = "textNode"
11126                     break
11127
11128                   case S.ATTRIB_VALUE_ENTITY_Q:
11129                     var returnState = S.ATTRIB_VALUE_QUOTED,
11130                       buffer = "attribValue"
11131                     break
11132
11133                   case S.ATTRIB_VALUE_ENTITY_U:
11134                     var returnState = S.ATTRIB_VALUE_UNQUOTED,
11135                       buffer = "attribValue"
11136                     break
11137                 }
11138                 if (c === ";") {
11139                   parser[buffer] += parseEntity(parser)
11140                   parser.entity = ""
11141                   parser.state = returnState
11142                 } else if (is(entity, c)) parser.entity += c
11143                 else {
11144                   strictFail(parser, "Invalid character entity")
11145                   parser[buffer] += "&" + parser.entity + c
11146                   parser.entity = ""
11147                   parser.state = returnState
11148                 }
11149                 continue
11150
11151               default:
11152                 throw new Error(parser, "Unknown state: " + parser.state)
11153             }
11154           } // while
11155           // cdata blocks can get very big under normal conditions. emit and move on.
11156           // if (parser.state === S.CDATA && parser.cdata) {
11157           // emitNode(parser, "oncdata", parser.cdata)
11158           // parser.cdata = ""
11159           // }
11160           if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)
11161           return parser
11162         }
11163
11164         /* ! http://mths.be/fromcodepoint v0.1.0 by @mathias */
11165         if (!String.fromCodePoint) {
11166           (function() {
11167             var stringFromCharCode = String.fromCharCode;
11168             var floor = Math.floor;
11169             var fromCodePoint = function() {
11170               var MAX_SIZE = 0x4000;
11171               var codeUnits = [];
11172               var highSurrogate;
11173               var lowSurrogate;
11174               var index = -1;
11175               var length = arguments.length;
11176               if (!length) {
11177                 return '';
11178               }
11179               var result = '';
11180               while (++index < length) {
11181                 var codePoint = Number(arguments[index]);
11182                 if (!isFinite(codePoint) || // `NaN`,
11183                   // `+Infinity`,
11184                   // or
11185                   // `-Infinity`
11186                   codePoint < 0 || // not a valid
11187                   // Unicode code
11188                   // point
11189                   codePoint > 0x10FFFF || // not a valid
11190                   // Unicode code
11191                   // point
11192                   floor(codePoint) != codePoint // not
11193                   // an
11194                   // integer
11195                 ) {
11196                   throw RangeError('Invalid code point: ' + codePoint);
11197                 }
11198                 if (codePoint <= 0xFFFF) { // BMP code point
11199                   codeUnits.push(codePoint);
11200                 } else { // Astral code point; split in
11201                   // surrogate halves
11202                   // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
11203                   codePoint -= 0x10000;
11204                   highSurrogate = (codePoint >> 10) + 0xD800;
11205                   lowSurrogate = (codePoint % 0x400) + 0xDC00;
11206                   codeUnits.push(highSurrogate, lowSurrogate);
11207                 }
11208                 if (index + 1 == length || codeUnits.length > MAX_SIZE) {
11209                   result += stringFromCharCode.apply(null, codeUnits);
11210                   codeUnits.length = 0;
11211                 }
11212               }
11213               return result;
11214             };
11215             if (Object.defineProperty) {
11216               Object.defineProperty(String, 'fromCodePoint', {
11217                 'value': fromCodePoint,
11218                 'configurable': true,
11219                 'writable': true
11220               });
11221             } else {
11222               String.fromCodePoint = fromCodePoint;
11223             }
11224           }());
11225         }
11226
11227       })(typeof exports === "undefined" ? sax = {} : exports);
11228
11229     }).call(this, undefined)
11230   }, {
11231     "stream": false,
11232     "string_decoder": false
11233   }],
11234   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\tiny-stack\\lib\\tiny-stack.js": [function(require, module, exports) {
11235     /**
11236      * Tiny stack for browser or server
11237      *
11238      * @author Jason Mulligan <jason.mulligan@avoidwork.com>
11239      * @copyright 2014 Jason Mulligan
11240      * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>
11241      * @link http://avoidwork.github.io/tiny-stack
11242      * @module tiny-stack
11243      * @version 0.1.0
11244      */
11245
11246     (function(global) {
11247
11248       "use strict";
11249
11250       /**
11251        * TinyStack
11252        *
11253        * @constructor
11254        */
11255       function TinyStack() {
11256         this.data = [null];
11257         this.top = 0;
11258       }
11259
11260       /**
11261        * Clears the stack
11262        *
11263        * @method clear
11264        * @memberOf TinyStack
11265        * @return {Object} {@link TinyStack}
11266        */
11267       TinyStack.prototype.clear = function clear() {
11268         this.data = [null];
11269         this.top = 0;
11270
11271         return this;
11272       };
11273
11274       /**
11275        * Gets the size of the stack
11276        *
11277        * @method length
11278        * @memberOf TinyStack
11279        * @return {Number} Size of stack
11280        */
11281       TinyStack.prototype.length = function length() {
11282         return this.top;
11283       };
11284
11285       /**
11286        * Gets the item at the top of the stack
11287        *
11288        * @method peek
11289        * @memberOf TinyStack
11290        * @return {Mixed} Item at the top of the stack
11291        */
11292       TinyStack.prototype.peek = function peek() {
11293         return this.data[this.top];
11294       };
11295
11296       /**
11297        * Gets & removes the item at the top of the stack
11298        *
11299        * @method pop
11300        * @memberOf TinyStack
11301        * @return {Mixed} Item at the top of the stack
11302        */
11303       TinyStack.prototype.pop = function pop() {
11304         if (this.top > 0) {
11305           this.top--;
11306
11307           return this.data.pop();
11308         } else {
11309           return undefined;
11310         }
11311       };
11312
11313       /**
11314        * Pushes an item onto the stack
11315        *
11316        * @method push
11317        * @memberOf TinyStack
11318        * @return {Object} {@link TinyStack}
11319        */
11320       TinyStack.prototype.push = function push(arg) {
11321         this.data[++this.top] = arg;
11322
11323         return this;
11324       };
11325
11326       /**
11327        * TinyStack factory
11328        *
11329        * @method factory
11330        * @return {Object} {@link TinyStack}
11331        */
11332       function factory() {
11333         return new TinyStack();
11334       }
11335
11336       // Node, AMD & window supported
11337       if (typeof exports != "undefined") {
11338         module.exports = factory;
11339       } else if (typeof define == "function") {
11340         define(function() {
11341           return factory;
11342         });
11343       } else {
11344         global.stack = factory;
11345       }
11346     })(this);
11347
11348   }, {}],
11349   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js": [function(require, module, exports) {
11350     module.exports = require('./lib/moddle');
11351   }, {
11352     "./lib/moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\moddle.js"
11353   }],
11354   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\base.js": [function(require, module, exports) {
11355     'use strict';
11356
11357     function Base() {}
11358
11359     Base.prototype.get = function(name) {
11360       return this.$model.properties.get(this, name);
11361     };
11362
11363     Base.prototype.set = function(name, value) {
11364       this.$model.properties.set(this, name, value);
11365     };
11366
11367
11368     module.exports = Base;
11369   }, {}],
11370   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\descriptor-builder.js": [function(require, module, exports) {
11371     'use strict';
11372
11373     var pick = require('lodash/object/pick'),
11374       assign = require('lodash/object/assign'),
11375       forEach = require('lodash/collection/forEach');
11376
11377     var parseNameNs = require('./ns').parseName;
11378
11379
11380     function DescriptorBuilder(nameNs) {
11381       this.ns = nameNs;
11382       this.name = nameNs.name;
11383       this.allTypes = [];
11384       this.properties = [];
11385       this.propertiesByName = {};
11386     }
11387
11388     module.exports = DescriptorBuilder;
11389
11390
11391     DescriptorBuilder.prototype.build = function() {
11392       return pick(this, ['ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty']);
11393     };
11394
11395     DescriptorBuilder.prototype.addProperty = function(p, idx) {
11396       this.addNamedProperty(p, true);
11397
11398       var properties = this.properties;
11399
11400       if (idx !== undefined) {
11401         properties.splice(idx, 0, p);
11402       } else {
11403         properties.push(p);
11404       }
11405     };
11406
11407
11408     DescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {
11409       var oldNameNs = oldProperty.ns;
11410
11411       var props = this.properties,
11412         propertiesByName = this.propertiesByName,
11413         rename = oldProperty.name !== newProperty.name;
11414
11415       if (oldProperty.isBody) {
11416
11417         if (!newProperty.isBody) {
11418           throw new Error(
11419             'property <' + newProperty.ns.name + '> must be body property ' +
11420             'to refine <' + oldProperty.ns.name + '>');
11421         }
11422
11423         // TODO: Check compatibility
11424         this.setBodyProperty(newProperty, false);
11425       }
11426
11427       // replacing the named property is intentional
11428       // thus, validate only if this is a "rename" operation
11429       this.addNamedProperty(newProperty, rename);
11430
11431       // replace old property at index with new one
11432       var idx = props.indexOf(oldProperty);
11433       if (idx === -1) {
11434         throw new Error('property <' + oldNameNs.name + '> not found in property list');
11435       }
11436
11437       props[idx] = newProperty;
11438
11439       // replace propertiesByName entry with new property
11440       propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;
11441     };
11442
11443
11444     DescriptorBuilder.prototype.redefineProperty = function(p) {
11445
11446       var nsPrefix = p.ns.prefix;
11447       var parts = p.redefines.split('#');
11448
11449       var name = parseNameNs(parts[0], nsPrefix);
11450       var attrName = parseNameNs(parts[1], name.prefix).name;
11451
11452       var redefinedProperty = this.propertiesByName[attrName];
11453       if (!redefinedProperty) {
11454         throw new Error('refined property <' + attrName + '> not found');
11455       } else {
11456         this.replaceProperty(redefinedProperty, p);
11457       }
11458
11459       delete p.redefines;
11460     };
11461
11462     DescriptorBuilder.prototype.addNamedProperty = function(p, validate) {
11463       var ns = p.ns,
11464         propsByName = this.propertiesByName;
11465
11466       if (validate) {
11467         this.assertNotDefined(p, ns.name);
11468         this.assertNotDefined(p, ns.localName);
11469       }
11470
11471       propsByName[ns.name] = propsByName[ns.localName] = p;
11472     };
11473
11474     DescriptorBuilder.prototype.removeNamedProperty = function(p) {
11475       var ns = p.ns,
11476         propsByName = this.propertiesByName;
11477
11478       delete propsByName[ns.name];
11479       delete propsByName[ns.localName];
11480     };
11481
11482     DescriptorBuilder.prototype.setBodyProperty = function(p, validate) {
11483
11484       if (validate && this.bodyProperty) {
11485         throw new Error(
11486           'body property defined multiple times ' +
11487           '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');
11488       }
11489
11490       this.bodyProperty = p;
11491     };
11492
11493     DescriptorBuilder.prototype.addIdProperty = function(name) {
11494       var nameNs = parseNameNs(name, this.ns.prefix);
11495
11496       var p = {
11497         name: nameNs.localName,
11498         type: 'String',
11499         isAttr: true,
11500         ns: nameNs
11501       };
11502
11503       // ensure that id is always the first attribute (if present)
11504       this.addProperty(p, 0);
11505     };
11506
11507     DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
11508       var propertyName = p.name,
11509         definedProperty = this.propertiesByName[propertyName];
11510
11511       if (definedProperty) {
11512         throw new Error(
11513           'property <' + propertyName + '> already defined; ' +
11514           'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +
11515           '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');
11516       }
11517     };
11518
11519     DescriptorBuilder.prototype.hasProperty = function(name) {
11520       return this.propertiesByName[name];
11521     };
11522
11523     DescriptorBuilder.prototype.addTrait = function(t) {
11524
11525       var allTypes = this.allTypes;
11526
11527       if (allTypes.indexOf(t) !== -1) {
11528         return;
11529       }
11530
11531       forEach(t.properties, function(p) {
11532
11533         // clone property to allow extensions
11534         p = assign({}, p, {
11535           name: p.ns.localName
11536         });
11537
11538         Object.defineProperty(p, 'definedBy', {
11539           value: t
11540         });
11541
11542         // add redefine support
11543         if (p.redefines) {
11544           this.redefineProperty(p);
11545         } else {
11546           if (p.isBody) {
11547             this.setBodyProperty(p);
11548           }
11549           this.addProperty(p);
11550         }
11551       }, this);
11552
11553       allTypes.push(t);
11554     };
11555
11556   }, {
11557     "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
11558     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
11559     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
11560     "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
11561   }],
11562   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\factory.js": [function(require, module, exports) {
11563     'use strict';
11564
11565     var forEach = require('lodash/collection/forEach');
11566
11567     var Base = require('./base');
11568
11569
11570     function Factory(model, properties) {
11571       this.model = model;
11572       this.properties = properties;
11573     }
11574
11575     module.exports = Factory;
11576
11577
11578     Factory.prototype.createType = function(descriptor) {
11579
11580       var model = this.model;
11581
11582       var props = this.properties,
11583         prototype = Object.create(Base.prototype);
11584
11585       // initialize default values
11586       forEach(descriptor.properties, function(p) {
11587         if (!p.isMany && p.default !== undefined) {
11588           prototype[p.name] = p.default;
11589         }
11590       });
11591
11592       props.defineModel(prototype, model);
11593       props.defineDescriptor(prototype, descriptor);
11594
11595       var name = descriptor.ns.name;
11596
11597       /**
11598        * The new type constructor
11599        */
11600       function ModdleElement(attrs) {
11601         props.define(this, '$type', {
11602           value: name,
11603           enumerable: true
11604         });
11605         props.define(this, '$attrs', {
11606           value: {}
11607         });
11608         props.define(this, '$parent', {
11609           writable: true
11610         });
11611
11612         forEach(attrs, function(val, key) {
11613           this.set(key, val);
11614         }, this);
11615       }
11616
11617       ModdleElement.prototype = prototype;
11618
11619       ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;
11620
11621       // static links
11622       props.defineModel(ModdleElement, model);
11623       props.defineDescriptor(ModdleElement, descriptor);
11624
11625       return ModdleElement;
11626     };
11627   }, {
11628     "./base": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\base.js",
11629     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
11630   }],
11631   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\moddle.js": [function(require, module, exports) {
11632     'use strict';
11633
11634     var isString = require('lodash/lang/isString'),
11635       isObject = require('lodash/lang/isObject'),
11636       forEach = require('lodash/collection/forEach'),
11637       find = require('lodash/collection/find');
11638
11639
11640     var Factory = require('./factory'),
11641       Registry = require('./registry'),
11642       Properties = require('./properties');
11643
11644     var parseNameNs = require('./ns').parseName;
11645
11646
11647     // // Moddle implementation /////////////////////////////////////////////////
11648
11649     /**
11650      * @class Moddle
11651      *
11652      * A model that can be used to create elements of a specific type.
11653      *
11654      * @example
11655      *
11656      * var Moddle = require('moddle');
11657      *
11658      * var pkg = { name: 'mypackage', prefix: 'my', types: [ { name: 'Root' } ] };
11659      *
11660      * var moddle = new Moddle([pkg]);
11661      *
11662      * @param {Array
11663      *            <Package>} packages the packages to contain
11664      * @param {Object}
11665      *            options additional options to pass to the model
11666      */
11667     function Moddle(packages, options) {
11668
11669       options = options || {};
11670
11671       this.properties = new Properties(this);
11672
11673       this.factory = new Factory(this, this.properties);
11674       this.registry = new Registry(packages, this.properties, options);
11675
11676       this.typeCache = {};
11677     }
11678
11679     module.exports = Moddle;
11680
11681
11682     /**
11683      * Create an instance of the specified type.
11684      *
11685      * @method Moddle#create
11686      *
11687      * @example
11688      *
11689      * var foo = moddle.create('my:Foo'); var bar = moddle.create('my:Bar', { id:
11690      * 'BAR_1' });
11691      *
11692      * @param {String|Object}
11693      *            descriptor the type descriptor or name know to the model
11694      * @param {Object}
11695      *            attrs a number of attributes to initialize the model instance with
11696      * @return {Object} model instance
11697      */
11698     Moddle.prototype.create = function(descriptor, attrs) {
11699       var Type = this.getType(descriptor);
11700
11701       if (!Type) {
11702         throw new Error('unknown type <' + descriptor + '>');
11703       }
11704
11705       return new Type(attrs);
11706     };
11707
11708
11709     /**
11710      * Returns the type representing a given descriptor
11711      *
11712      * @method Moddle#getType
11713      *
11714      * @example
11715      *
11716      * var Foo = moddle.getType('my:Foo'); var foo = new Foo({ 'id' : 'FOO_1' });
11717      *
11718      * @param {String|Object}
11719      *            descriptor the type descriptor or name know to the model
11720      * @return {Object} the type representing the descriptor
11721      */
11722     Moddle.prototype.getType = function(descriptor) {
11723
11724       var cache = this.typeCache;
11725
11726       var name = isString(descriptor) ? descriptor : descriptor.ns.name;
11727
11728       var type = cache[name];
11729
11730       if (!type) {
11731         descriptor = this.registry.getEffectiveDescriptor(name);
11732         type = cache[name] = this.factory.createType(descriptor);
11733       }
11734
11735       return type;
11736     };
11737
11738
11739     /**
11740      * Creates an any-element type to be used within model instances.
11741      *
11742      * This can be used to create custom elements that lie outside the meta-model.
11743      * The created element contains all the meta-data required to serialize it as
11744      * part of meta-model elements.
11745      *
11746      * @method Moddle#createAny
11747      *
11748      * @example
11749      *
11750      * var foo = moddle.createAny('vendor:Foo', 'http://vendor', { value: 'bar' });
11751      *
11752      * var container = moddle.create('my:Container', 'http://my', { any: [ foo ] });
11753      *  // go ahead and serialize the stuff
11754      *
11755      *
11756      * @param {String}
11757      *            name the name of the element
11758      * @param {String}
11759      *            nsUri the namespace uri of the element
11760      * @param {Object}
11761      *            [properties] a map of properties to initialize the instance with
11762      * @return {Object} the any type instance
11763      */
11764     Moddle.prototype.createAny = function(name, nsUri, properties) {
11765
11766       var nameNs = parseNameNs(name);
11767
11768       var element = {
11769         $type: name
11770       };
11771
11772       var descriptor = {
11773         name: name,
11774         isGeneric: true,
11775         ns: {
11776           prefix: nameNs.prefix,
11777           localName: nameNs.localName,
11778           uri: nsUri
11779         }
11780       };
11781
11782       this.properties.defineDescriptor(element, descriptor);
11783       this.properties.defineModel(element, this);
11784       this.properties.define(element, '$parent', {
11785         enumerable: false,
11786         writable: true
11787       });
11788
11789       forEach(properties, function(a, key) {
11790         if (isObject(a) && a.value !== undefined) {
11791           element[a.name] = a.value;
11792         } else {
11793           element[key] = a;
11794         }
11795       });
11796
11797       return element;
11798     };
11799
11800     /**
11801      * Returns a registered package by uri or prefix
11802      *
11803      * @return {Object} the package
11804      */
11805     Moddle.prototype.getPackage = function(uriOrPrefix) {
11806       return this.registry.getPackage(uriOrPrefix);
11807     };
11808
11809     /**
11810      * Returns a snapshot of all known packages
11811      *
11812      * @return {Object} the package
11813      */
11814     Moddle.prototype.getPackages = function() {
11815       return this.registry.getPackages();
11816     };
11817
11818     /**
11819      * Returns the descriptor for an element
11820      */
11821     Moddle.prototype.getElementDescriptor = function(element) {
11822       return element.$descriptor;
11823     };
11824
11825     /**
11826      * Returns true if the given descriptor or instance represents the given type.
11827      *
11828      * May be applied to this, if element is omitted.
11829      */
11830     Moddle.prototype.hasType = function(element, type) {
11831       if (type === undefined) {
11832         type = element;
11833         element = this;
11834       }
11835
11836       var descriptor = element.$model.getElementDescriptor(element);
11837
11838       return !!find(descriptor.allTypes, function(t) {
11839         return t.name === type;
11840       });
11841     };
11842
11843
11844     /**
11845      * Returns the descriptor of an elements named property
11846      */
11847     Moddle.prototype.getPropertyDescriptor = function(element, property) {
11848       return this.getElementDescriptor(element).propertiesByName[property];
11849     };
11850
11851   }, {
11852     "./factory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\factory.js",
11853     "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
11854     "./properties": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\properties.js",
11855     "./registry": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\registry.js",
11856     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
11857     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
11858     "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
11859     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js"
11860   }],
11861   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js": [function(require, module, exports) {
11862     'use strict';
11863
11864     /**
11865      * Parses a namespaced attribute name of the form (ns:)localName to an object,
11866      * given a default prefix to assume in case no explicit namespace is given.
11867      *
11868      * @param {String}
11869      *            name
11870      * @param {String}
11871      *            [defaultPrefix] the default prefix to take, if none is present.
11872      *
11873      * @return {Object} the parsed name
11874      */
11875     module.exports.parseName = function(name, defaultPrefix) {
11876       var parts = name.split(/:/),
11877         localName, prefix;
11878
11879       // no prefix (i.e. only local name)
11880       if (parts.length === 1) {
11881         localName = name;
11882         prefix = defaultPrefix;
11883       } else
11884         // prefix + local name
11885         if (parts.length === 2) {
11886           localName = parts[1];
11887           prefix = parts[0];
11888         } else {
11889           throw new Error('expected <prefix:localName> or <localName>, got ' + name);
11890         }
11891
11892       name = (prefix ? prefix + ':' : '') + localName;
11893
11894       return {
11895         name: name,
11896         prefix: prefix,
11897         localName: localName
11898       };
11899     };
11900   }, {}],
11901   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\properties.js": [function(require, module, exports) {
11902     'use strict';
11903
11904
11905     /**
11906      * A utility that gets and sets properties of model elements.
11907      *
11908      * @param {Model}
11909      *            model
11910      */
11911     function Properties(model) {
11912       this.model = model;
11913     }
11914
11915     module.exports = Properties;
11916
11917
11918     /**
11919      * Sets a named property on the target element
11920      *
11921      * @param {Object}
11922      *            target
11923      * @param {String}
11924      *            name
11925      * @param {Object}
11926      *            value
11927      */
11928     Properties.prototype.set = function(target, name, value) {
11929
11930       var property = this.model.getPropertyDescriptor(target, name);
11931
11932       if (!property) {
11933         target.$attrs[name] = value;
11934       } else {
11935         Object.defineProperty(target, property.name, {
11936           enumerable: !property.isReference,
11937           writable: true,
11938           value: value
11939         });
11940       }
11941     };
11942
11943     /**
11944      * Returns the named property of the given element
11945      *
11946      * @param {Object}
11947      *            target
11948      * @param {String}
11949      *            name
11950      *
11951      * @return {Object}
11952      */
11953     Properties.prototype.get = function(target, name) {
11954
11955       var property = this.model.getPropertyDescriptor(target, name);
11956
11957       if (!property) {
11958         return target.$attrs[name];
11959       }
11960
11961       var propertyName = property.name;
11962
11963       // check if access to collection property and lazily initialize it
11964       if (!target[propertyName] && property.isMany) {
11965         Object.defineProperty(target, propertyName, {
11966           enumerable: !property.isReference,
11967           writable: true,
11968           value: []
11969         });
11970       }
11971
11972       return target[propertyName];
11973     };
11974
11975
11976     /**
11977      * Define a property on the target element
11978      *
11979      * @param {Object}
11980      *            target
11981      * @param {String}
11982      *            name
11983      * @param {Object}
11984      *            options
11985      */
11986     Properties.prototype.define = function(target, name, options) {
11987       Object.defineProperty(target, name, options);
11988     };
11989
11990
11991     /**
11992      * Define the descriptor for an element
11993      */
11994     Properties.prototype.defineDescriptor = function(target, descriptor) {
11995       this.define(target, '$descriptor', {
11996         value: descriptor
11997       });
11998     };
11999
12000     /**
12001      * Define the model for an element
12002      */
12003     Properties.prototype.defineModel = function(target, model) {
12004       this.define(target, '$model', {
12005         value: model
12006       });
12007     };
12008   }, {}],
12009   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\registry.js": [function(require, module, exports) {
12010     'use strict';
12011
12012     var assign = require('lodash/object/assign'),
12013       forEach = require('lodash/collection/forEach');
12014
12015     var Types = require('./types'),
12016       DescriptorBuilder = require('./descriptor-builder');
12017
12018     var parseNameNs = require('./ns').parseName,
12019       isBuiltInType = Types.isBuiltIn;
12020
12021
12022     function Registry(packages, properties, options) {
12023
12024       this.options = assign({
12025         generateId: 'id'
12026       }, options || {});
12027
12028       this.packageMap = {};
12029       this.typeMap = {};
12030
12031       this.packages = [];
12032
12033       this.properties = properties;
12034
12035       forEach(packages, this.registerPackage, this);
12036     }
12037
12038     module.exports = Registry;
12039
12040
12041     Registry.prototype.getPackage = function(uriOrPrefix) {
12042       return this.packageMap[uriOrPrefix];
12043     };
12044
12045     Registry.prototype.getPackages = function() {
12046       return this.packages;
12047     };
12048
12049
12050     Registry.prototype.registerPackage = function(pkg) {
12051       // alert("pkg :: " + pkg);
12052       // copy package
12053       pkg = assign({}, pkg);
12054
12055       // register types
12056       forEach(pkg.types, function(descriptor) {
12057         this.registerType(descriptor, pkg);
12058       }, this);
12059
12060       this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;
12061       this.packages.push(pkg);
12062     };
12063
12064
12065     /**
12066      * Register a type from a specific package with us
12067      */
12068     Registry.prototype.registerType = function(type, pkg) {
12069
12070       type = assign({}, type, {
12071         superClass: (type.superClass || []).slice(),
12072         extends: (type.extends || []).slice(),
12073         properties: (type.properties || []).slice()
12074       });
12075
12076       var ns = parseNameNs(type.name, pkg.prefix),
12077         name = ns.name,
12078         propertiesByName = {};
12079
12080       // parse properties
12081       forEach(type.properties, function(p) {
12082
12083         // namespace property names
12084         var propertyNs = parseNameNs(p.name, ns.prefix),
12085           propertyName = propertyNs.name;
12086
12087         // namespace property types
12088         if (!isBuiltInType(p.type)) {
12089           p.type = parseNameNs(p.type, propertyNs.prefix).name;
12090         }
12091
12092         assign(p, {
12093           ns: propertyNs,
12094           name: propertyName
12095         });
12096
12097         propertiesByName[propertyName] = p;
12098       });
12099
12100       // update ns + name
12101       assign(type, {
12102         ns: ns,
12103         name: name,
12104         propertiesByName: propertiesByName
12105       });
12106
12107       forEach(type.extends, function(extendsName) {
12108         var extended = this.typeMap[extendsName];
12109
12110         extended.traits = extended.traits || [];
12111         extended.traits.push(name);
12112       }, this);
12113
12114       // link to package
12115       this.definePackage(type, pkg);
12116
12117       // register
12118       this.typeMap[name] = type;
12119     };
12120
12121
12122     /**
12123      * Traverse the type hierarchy from bottom to top.
12124      */
12125     Registry.prototype.mapTypes = function(nsName, iterator) {
12126
12127       // alert("nsName :: " + nsName.name);
12128       var type = isBuiltInType(nsName.name) ? {
12129         name: nsName.name
12130       } : this.typeMap[nsName.name];
12131       // alert("Type :: " + type);
12132
12133       var self = this;
12134
12135       /**
12136        * Traverse the selected super type or trait
12137        *
12138        * @param {String}
12139        *            cls
12140        */
12141       function traverseSuper(cls) {
12142         var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);
12143         self.mapTypes(parentNs, iterator);
12144       }
12145
12146       if (!type) {
12147         throw new Error('unknown type <' + nsName.name + '>');
12148       }
12149
12150       forEach(type.superClass, traverseSuper);
12151
12152       iterator(type);
12153
12154       forEach(type.traits, traverseSuper);
12155     };
12156
12157
12158     /**
12159      * Returns the effective descriptor for a type.
12160      *
12161      * @param {String}
12162      *            type the namespaced name (ns:localName) of the type
12163      *
12164      * @return {Descriptor} the resulting effective descriptor
12165      */
12166     Registry.prototype.getEffectiveDescriptor = function(name) {
12167
12168       var nsName = parseNameNs(name);
12169
12170       var builder = new DescriptorBuilder(nsName);
12171
12172       this.mapTypes(nsName, function(type) {
12173         builder.addTrait(type);
12174       });
12175
12176       // check we have an id assigned
12177       var id = this.options.generateId;
12178       if (id && !builder.hasProperty(id)) {
12179         builder.addIdProperty(id);
12180       }
12181
12182       var descriptor = builder.build();
12183
12184       // define package link
12185       this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);
12186
12187       return descriptor;
12188     };
12189
12190
12191     Registry.prototype.definePackage = function(target, pkg) {
12192       this.properties.define(target, '$pkg', {
12193         value: pkg
12194       });
12195     };
12196   }, {
12197     "./descriptor-builder": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\descriptor-builder.js",
12198     "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
12199     "./types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js",
12200     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
12201     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
12202   }],
12203   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js": [function(require, module, exports) {
12204     'use strict';
12205
12206     /**
12207      * Built-in moddle types
12208      */
12209     var BUILTINS = {
12210       String: true,
12211       Boolean: true,
12212       Integer: true,
12213       Real: true,
12214       Element: true
12215     };
12216
12217     /**
12218      * Converters for built in types from string representations
12219      */
12220     var TYPE_CONVERTERS = {
12221       String: function(s) {
12222         return s;
12223       },
12224       Boolean: function(s) {
12225         return s === 'true';
12226       },
12227       Integer: function(s) {
12228         return parseInt(s, 10);
12229       },
12230       Real: function(s) {
12231         return parseFloat(s, 10);
12232       }
12233     };
12234
12235     /**
12236      * Convert a type to its real representation
12237      */
12238     module.exports.coerceType = function(type, value) {
12239
12240       var converter = TYPE_CONVERTERS[type];
12241
12242       if (converter) {
12243         return converter(value);
12244       } else {
12245         return value;
12246       }
12247     };
12248
12249     /**
12250      * Return whether the given type is built-in
12251      */
12252     module.exports.isBuiltIn = function(type) {
12253       return !!BUILTINS[type];
12254     };
12255
12256     /**
12257      * Return whether the given type is simple
12258      */
12259     module.exports.isSimple = function(type) {
12260       return !!TYPE_CONVERTERS[type];
12261     };
12262   }, {}],
12263   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmn.json": [function(require, module, exports) {
12264     module.exports = {
12265       "name": "BPMN20",
12266       "uri": "http://www.omg.org/spec/BPMN/20100524/MODEL",
12267       "associations": [],
12268       "types": [{
12269           "name": "Interface",
12270           "superClass": [
12271             "RootElement"
12272           ],
12273           "properties": [{
12274             "name": "name",
12275             "isAttr": true,
12276             "type": "String"
12277           }, {
12278             "name": "operations",
12279             "type": "Operation",
12280             "isMany": true
12281           }, {
12282             "name": "implementationRef",
12283             "type": "String",
12284             "isAttr": true
12285           }]
12286         }, {
12287           "name": "Operation",
12288           "superClass": [
12289             "BaseElement"
12290           ],
12291           "properties": [{
12292             "name": "name",
12293             "isAttr": true,
12294             "type": "String"
12295           }, {
12296             "name": "inMessageRef",
12297             "type": "Message",
12298             "isAttr": true,
12299             "isReference": true
12300           }, {
12301             "name": "outMessageRef",
12302             "type": "Message",
12303             "isAttr": true,
12304             "isReference": true
12305           }, {
12306             "name": "errorRefs",
12307             "type": "Error",
12308             "isMany": true,
12309             "isReference": true
12310           }, {
12311             "name": "implementationRef",
12312             "type": "String",
12313             "isAttr": true
12314           }]
12315         }, {
12316           "name": "EndPoint",
12317           "superClass": [
12318             "RootElement"
12319           ]
12320         }, {
12321           "name": "Auditing",
12322           "superClass": [
12323             "BaseElement"
12324           ]
12325         }, {
12326           "name": "GlobalTask",
12327           "superClass": [
12328             "CallableElement"
12329           ],
12330           "properties": [{
12331             "name": "resources",
12332             "type": "ResourceRole",
12333             "isMany": true
12334           }]
12335         }, {
12336           "name": "Monitoring",
12337           "superClass": [
12338             "BaseElement"
12339           ]
12340         }, {
12341           "name": "Performer",
12342           "superClass": [
12343             "ResourceRole"
12344           ]
12345         }, {
12346           "name": "Process",
12347           "superClass": [
12348             "FlowElementsContainer",
12349             "CallableElement"
12350           ],
12351           "properties": [{
12352             "name": "processType",
12353             "type": "ProcessType",
12354             "isAttr": true
12355           }, {
12356             "name": "isClosed",
12357             "isAttr": true,
12358             "type": "Boolean"
12359           }, {
12360             "name": "auditing",
12361             "type": "Auditing"
12362           }, {
12363             "name": "monitoring",
12364             "type": "Monitoring"
12365           }, {
12366             "name": "properties",
12367             "type": "Property",
12368             "isMany": true
12369           }, {
12370             "name": "supports",
12371             "type": "Process",
12372             "isMany": true,
12373             "isReference": true
12374           }, {
12375             "name": "definitionalCollaborationRef",
12376             "type": "Collaboration",
12377             "isAttr": true,
12378             "isReference": true
12379           }, {
12380             "name": "isExecutable",
12381             "isAttr": true,
12382             "type": "Boolean"
12383           }, {
12384             "name": "resources",
12385             "type": "ResourceRole",
12386             "isMany": true
12387           }, {
12388             "name": "artifacts",
12389             "type": "Artifact",
12390             "isMany": true
12391           }, {
12392             "name": "correlationSubscriptions",
12393             "type": "CorrelationSubscription",
12394             "isMany": true
12395           }]
12396         }, {
12397           "name": "LaneSet",
12398           "superClass": [
12399             "BaseElement"
12400           ],
12401           "properties": [{
12402             "name": "lanes",
12403             "type": "Lane",
12404             "isMany": true
12405           }, {
12406             "name": "name",
12407             "isAttr": true,
12408             "type": "String"
12409           }]
12410         }, {
12411           "name": "Lane",
12412           "superClass": [
12413             "BaseElement"
12414           ],
12415           "properties": [{
12416             "name": "name",
12417             "isAttr": true,
12418             "type": "String"
12419           }, {
12420             "name": "childLaneSet",
12421             "type": "LaneSet",
12422             "serialize": "xsi:type"
12423           }, {
12424             "name": "partitionElementRef",
12425             "type": "BaseElement",
12426             "isAttr": true,
12427             "isReference": true
12428           }, {
12429             "name": "flowNodeRef",
12430             "type": "FlowNode",
12431             "isMany": true,
12432             "isReference": true
12433           }, {
12434             "name": "partitionElement",
12435             "type": "BaseElement"
12436           }]
12437         }, {
12438           "name": "GlobalManualTask",
12439           "superClass": [
12440             "GlobalTask"
12441           ]
12442         }, {
12443           "name": "ManualTask",
12444           "superClass": [
12445             "Task"
12446           ]
12447         }, {
12448           "name": "UserTask",
12449           "superClass": [
12450             "Task"
12451           ],
12452           "properties": [{
12453             "name": "renderings",
12454             "type": "Rendering",
12455             "isMany": true
12456           }, {
12457             "name": "implementation",
12458             "isAttr": true,
12459             "type": "String"
12460           }]
12461         }, {
12462           "name": "Rendering",
12463           "superClass": [
12464             "BaseElement"
12465           ]
12466         }, {
12467           "name": "HumanPerformer",
12468           "superClass": [
12469             "Performer"
12470           ]
12471         }, {
12472           "name": "PotentialOwner",
12473           "superClass": [
12474             "HumanPerformer"
12475           ]
12476         }, {
12477           "name": "GlobalUserTask",
12478           "superClass": [
12479             "GlobalTask"
12480           ],
12481           "properties": [{
12482             "name": "implementation",
12483             "isAttr": true,
12484             "type": "String"
12485           }, {
12486             "name": "renderings",
12487             "type": "Rendering",
12488             "isMany": true
12489           }]
12490         }, {
12491           "name": "Gateway",
12492           "isAbstract": true,
12493           "superClass": [
12494             "FlowNode"
12495           ],
12496           "properties": [{
12497             "name": "gatewayDirection",
12498             "type": "GatewayDirection",
12499             "default": "Unspecified",
12500             "isAttr": true
12501           }]
12502         }, {
12503           "name": "EventBasedGateway",
12504           "superClass": [
12505             "Gateway"
12506           ],
12507           "properties": [{
12508             "name": "instantiate",
12509             "default": false,
12510             "isAttr": true,
12511             "type": "Boolean"
12512           }, {
12513             "name": "eventGatewayType",
12514             "type": "EventBasedGatewayType",
12515             "isAttr": true,
12516             "default": "Exclusive"
12517           }]
12518         }, {
12519           "name": "ComplexGateway",
12520           "superClass": [
12521             "Gateway"
12522           ],
12523           "properties": [{
12524             "name": "activationCondition",
12525             "type": "Expression",
12526             "serialize": "xsi:type"
12527           }, {
12528             "name": "default",
12529             "type": "SequenceFlow",
12530             "isAttr": true,
12531             "isReference": true
12532           }]
12533         }, {
12534           "name": "ExclusiveGateway",
12535           "superClass": [
12536             "Gateway"
12537           ],
12538           "properties": [{
12539             "name": "default",
12540             "type": "SequenceFlow",
12541             "isAttr": true,
12542             "isReference": true
12543           }]
12544         }, {
12545           "name": "InclusiveGateway",
12546           "superClass": [
12547             "Gateway"
12548           ],
12549           "properties": [{
12550             "name": "default",
12551             "type": "SequenceFlow",
12552             "isAttr": true,
12553             "isReference": true
12554           }]
12555         }, {
12556           "name": "ParallelGateway",
12557           "superClass": [
12558             "Gateway"
12559           ]
12560         }, {
12561           "name": "RootElement",
12562           "isAbstract": true,
12563           "superClass": [
12564             "BaseElement"
12565           ]
12566         }, {
12567           "name": "Relationship",
12568           "superClass": [
12569             "BaseElement"
12570           ],
12571           "properties": [{
12572             "name": "type",
12573             "isAttr": true,
12574             "type": "String"
12575           }, {
12576             "name": "direction",
12577             "type": "RelationshipDirection",
12578             "isAttr": true
12579           }, {
12580             "name": "source",
12581             "isMany": true,
12582             "isReference": true,
12583             "type": "Element"
12584           }, {
12585             "name": "target",
12586             "isMany": true,
12587             "isReference": true,
12588             "type": "Element"
12589           }]
12590         }, {
12591           "name": "BaseElement",
12592           "isAbstract": true,
12593           "properties": [{
12594             "name": "id",
12595             "isAttr": true,
12596             "type": "String"
12597           }, {
12598             "name": "documentation",
12599             "type": "Documentation",
12600             "isMany": true
12601           }, {
12602             "name": "extensionDefinitions",
12603             "type": "ExtensionDefinition",
12604             "isMany": true,
12605             "isReference": true
12606           }, {
12607             "name": "extensionElements",
12608             "type": "ExtensionElements"
12609           }]
12610         }, {
12611           "name": "Extension",
12612           "properties": [{
12613             "name": "mustUnderstand",
12614             "default": false,
12615             "isAttr": true,
12616             "type": "Boolean"
12617           }, {
12618             "name": "definition",
12619             "type": "ExtensionDefinition"
12620           }]
12621         }, {
12622           "name": "ExtensionDefinition",
12623           "properties": [{
12624             "name": "name",
12625             "isAttr": true,
12626             "type": "String"
12627           }, {
12628             "name": "extensionAttributeDefinitions",
12629             "type": "ExtensionAttributeDefinition",
12630             "isMany": true
12631           }]
12632         }, {
12633           "name": "ExtensionAttributeDefinition",
12634           "properties": [{
12635             "name": "name",
12636             "isAttr": true,
12637             "type": "String"
12638           }, {
12639             "name": "type",
12640             "isAttr": true,
12641             "type": "String"
12642           }, {
12643             "name": "isReference",
12644             "default": false,
12645             "isAttr": true,
12646             "type": "Boolean"
12647           }, {
12648             "name": "extensionDefinition",
12649             "type": "ExtensionDefinition",
12650             "isAttr": true,
12651             "isReference": true
12652           }]
12653         }, {
12654           "name": "ExtensionElements",
12655           "properties": [{
12656             "name": "valueRef",
12657             "isAttr": true,
12658             "isReference": true,
12659             "type": "Element"
12660           }, {
12661             "name": "values",
12662             "type": "Element",
12663             "isMany": true
12664           }, {
12665             "name": "extensionAttributeDefinition",
12666             "type": "ExtensionAttributeDefinition",
12667             "isAttr": true,
12668             "isReference": true
12669           }]
12670         }, {
12671           "name": "Documentation",
12672           "superClass": [
12673             "BaseElement"
12674           ],
12675           "properties": [{
12676             "name": "text",
12677             "type": "String",
12678             "isBody": true
12679           }, {
12680             "name": "textFormat",
12681             "default": "text/plain",
12682             "isAttr": true,
12683             "type": "String"
12684           }]
12685         }, {
12686           "name": "Event",
12687           "isAbstract": true,
12688           "superClass": [
12689             "FlowNode",
12690             "InteractionNode"
12691           ],
12692           "properties": [{
12693             "name": "properties",
12694             "type": "Property",
12695             "isMany": true
12696           }]
12697         }, {
12698           "name": "IntermediateCatchEvent",
12699           "superClass": [
12700             "CatchEvent"
12701           ]
12702         }, {
12703           "name": "IntermediateThrowEvent",
12704           "superClass": [
12705             "ThrowEvent"
12706           ]
12707         }, {
12708           "name": "EndEvent",
12709           "superClass": [
12710             "ThrowEvent"
12711           ]
12712         }, {
12713           "name": "StartEvent",
12714           "superClass": [
12715             "CatchEvent"
12716           ],
12717           "properties": [{
12718             "name": "isInterrupting",
12719             "default": true,
12720             "isAttr": true,
12721             "type": "Boolean"
12722           }]
12723         }, {
12724           "name": "MultiBranchConnector",
12725           "superClass": [
12726             "CatchEvent"
12727           ],
12728           "properties": [{
12729             "name": "isInterrupting",
12730             "default": true,
12731             "isAttr": true,
12732             "type": "Boolean"
12733           }]
12734         }, {
12735           "name": "ParentReturn",
12736           "superClass": [
12737             "Activity",
12738             "InteractionNode"
12739           ]
12740         }, {
12741           "name": "SubProcessCall",
12742           "superClass": [
12743             "Activity",
12744             "InteractionNode"
12745           ]
12746         }, {
12747           "name": "ThrowEvent",
12748           "isAbstract": true,
12749           "superClass": [
12750             "Event"
12751           ],
12752           "properties": [{
12753             "name": "inputSet",
12754             "type": "InputSet"
12755           }, {
12756             "name": "eventDefinitionRefs",
12757             "type": "EventDefinition",
12758             "isMany": true,
12759             "isReference": true
12760           }, {
12761             "name": "dataInputAssociation",
12762             "type": "DataInputAssociation",
12763             "isMany": true
12764           }, {
12765             "name": "dataInputs",
12766             "type": "DataInput",
12767             "isMany": true
12768           }, {
12769             "name": "eventDefinitions",
12770             "type": "EventDefinition",
12771             "isMany": true
12772           }]
12773         }, {
12774           "name": "CatchEvent",
12775           "isAbstract": true,
12776           "superClass": [
12777             "Event"
12778           ],
12779           "properties": [{
12780             "name": "parallelMultiple",
12781             "isAttr": true,
12782             "type": "Boolean",
12783             "default": false
12784           }, {
12785             "name": "outputSet",
12786             "type": "OutputSet"
12787           }, {
12788             "name": "eventDefinitionRefs",
12789             "type": "EventDefinition",
12790             "isMany": true,
12791             "isReference": true
12792           }, {
12793             "name": "dataOutputAssociation",
12794             "type": "DataOutputAssociation",
12795             "isMany": true
12796           }, {
12797             "name": "dataOutputs",
12798             "type": "DataOutput",
12799             "isMany": true
12800           }, {
12801             "name": "eventDefinitions",
12802             "type": "EventDefinition",
12803             "isMany": true
12804           }]
12805         }, {
12806           "name": "BoundaryEvent",
12807           "superClass": [
12808             "CatchEvent"
12809           ],
12810           "properties": [{
12811             "name": "cancelActivity",
12812             "default": true,
12813             "isAttr": true,
12814             "type": "Boolean"
12815           }, {
12816             "name": "attachedToRef",
12817             "type": "Activity",
12818             "isAttr": true,
12819             "isReference": true
12820           }]
12821         }, {
12822           "name": "EventDefinition",
12823           "isAbstract": true,
12824           "superClass": [
12825             "RootElement"
12826           ]
12827         }, {
12828           "name": "CancelEventDefinition",
12829           "superClass": [
12830             "EventDefinition"
12831           ]
12832         }, {
12833           "name": "ErrorEventDefinition",
12834           "superClass": [
12835             "EventDefinition"
12836           ],
12837           "properties": [{
12838             "name": "errorRef",
12839             "type": "Error",
12840             "isAttr": true,
12841             "isReference": true
12842           }]
12843         }, {
12844           "name": "TerminateEventDefinition",
12845           "superClass": [
12846             "EventDefinition"
12847           ]
12848         }, {
12849           "name": "EscalationEventDefinition",
12850           "superClass": [
12851             "EventDefinition"
12852           ],
12853           "properties": [{
12854             "name": "escalationRef",
12855             "type": "Escalation",
12856             "isAttr": true,
12857             "isReference": true
12858           }]
12859         }, {
12860           "name": "Escalation",
12861           "properties": [{
12862             "name": "structureRef",
12863             "type": "ItemDefinition",
12864             "isAttr": true,
12865             "isReference": true
12866           }, {
12867             "name": "name",
12868             "isAttr": true,
12869             "type": "String"
12870           }, {
12871             "name": "escalationCode",
12872             "isAttr": true,
12873             "type": "String"
12874           }],
12875           "superClass": [
12876             "RootElement"
12877           ]
12878         }, {
12879           "name": "CompensateEventDefinition",
12880           "superClass": [
12881             "EventDefinition"
12882           ],
12883           "properties": [{
12884             "name": "waitForCompletion",
12885             "isAttr": true,
12886             "type": "Boolean"
12887           }, {
12888             "name": "activityRef",
12889             "type": "Activity",
12890             "isAttr": true,
12891             "isReference": true
12892           }]
12893         }, {
12894           "name": "TimerEventDefinition",
12895           "superClass": [
12896             "EventDefinition"
12897           ],
12898           "properties": [{
12899             "name": "timeDate",
12900             "type": "Expression",
12901             "serialize": "xsi:type"
12902           }, {
12903             "name": "timeCycle",
12904             "type": "Expression",
12905             "serialize": "xsi:type"
12906           }, {
12907             "name": "timeDuration",
12908             "type": "Expression",
12909             "serialize": "xsi:type"
12910           }]
12911         }, {
12912           "name": "LinkEventDefinition",
12913           "superClass": [
12914             "EventDefinition"
12915           ],
12916           "properties": [{
12917             "name": "name",
12918             "isAttr": true,
12919             "type": "String"
12920           }, {
12921             "name": "target",
12922             "type": "LinkEventDefinition",
12923             "isAttr": true,
12924             "isReference": true
12925           }, {
12926             "name": "source",
12927             "type": "LinkEventDefinition",
12928             "isMany": true,
12929             "isReference": true
12930           }]
12931         }, {
12932           "name": "MessageEventDefinition",
12933           "superClass": [
12934             "EventDefinition"
12935           ],
12936           "properties": [{
12937             "name": "messageRef",
12938             "type": "Message",
12939             "isAttr": true,
12940             "isReference": true
12941           }, {
12942             "name": "operationRef",
12943             "type": "Operation",
12944             "isAttr": true,
12945             "isReference": true
12946           }]
12947         }, {
12948           "name": "ConditionalEventDefinition",
12949           "superClass": [
12950             "EventDefinition"
12951           ],
12952           "properties": [{
12953             "name": "condition",
12954             "type": "Expression",
12955             "serialize": "xsi:type"
12956           }]
12957         }, {
12958           "name": "SignalEventDefinition",
12959           "superClass": [
12960             "EventDefinition"
12961           ],
12962           "properties": [{
12963             "name": "signalRef",
12964             "type": "Signal",
12965             "isAttr": true,
12966             "isReference": true
12967           }]
12968         }, {
12969           "name": "Signal",
12970           "superClass": [
12971             "RootElement"
12972           ],
12973           "properties": [{
12974             "name": "structureRef",
12975             "type": "ItemDefinition",
12976             "isAttr": true,
12977             "isReference": true
12978           }, {
12979             "name": "name",
12980             "isAttr": true,
12981             "type": "String"
12982           }]
12983         }, {
12984           "name": "ImplicitThrowEvent",
12985           "superClass": [
12986             "ThrowEvent"
12987           ]
12988         }, {
12989           "name": "DataState",
12990           "superClass": [
12991             "BaseElement"
12992           ],
12993           "properties": [{
12994             "name": "name",
12995             "isAttr": true,
12996             "type": "String"
12997           }]
12998         }, {
12999           "name": "ItemAwareElement",
13000           "superClass": [
13001             "BaseElement"
13002           ],
13003           "properties": [{
13004             "name": "itemSubjectRef",
13005             "type": "ItemDefinition",
13006             "isAttr": true,
13007             "isReference": true
13008           }, {
13009             "name": "dataState",
13010             "type": "DataState"
13011           }]
13012         }, {
13013           "name": "DataAssociation",
13014           "superClass": [
13015             "BaseElement"
13016           ],
13017           "properties": [{
13018             "name": "transformation",
13019             "type": "FormalExpression"
13020           }, {
13021             "name": "assignment",
13022             "type": "Assignment",
13023             "isMany": true
13024           }, {
13025             "name": "sourceRef",
13026             "type": "ItemAwareElement",
13027             "isMany": true,
13028             "isReference": true
13029           }, {
13030             "name": "targetRef",
13031             "type": "ItemAwareElement",
13032             "isReference": true
13033           }]
13034         }, {
13035           "name": "DataInput",
13036           "superClass": [
13037             "ItemAwareElement"
13038           ],
13039           "properties": [{
13040             "name": "name",
13041             "isAttr": true,
13042             "type": "String"
13043           }, {
13044             "name": "isCollection",
13045             "default": false,
13046             "isAttr": true,
13047             "type": "Boolean"
13048           }, {
13049             "name": "inputSetRefs",
13050             "type": "InputSet",
13051             "isVirtual": true,
13052             "isMany": true,
13053             "isReference": true
13054           }, {
13055             "name": "inputSetWithOptional",
13056             "type": "InputSet",
13057             "isVirtual": true,
13058             "isMany": true,
13059             "isReference": true
13060           }, {
13061             "name": "inputSetWithWhileExecuting",
13062             "type": "InputSet",
13063             "isVirtual": true,
13064             "isMany": true,
13065             "isReference": true
13066           }]
13067         }, {
13068           "name": "DataOutput",
13069           "superClass": [
13070             "ItemAwareElement"
13071           ],
13072           "properties": [{
13073             "name": "name",
13074             "isAttr": true,
13075             "type": "String"
13076           }, {
13077             "name": "isCollection",
13078             "default": false,
13079             "isAttr": true,
13080             "type": "Boolean"
13081           }, {
13082             "name": "outputSetRefs",
13083             "type": "OutputSet",
13084             "isVirtual": true,
13085             "isMany": true,
13086             "isReference": true
13087           }, {
13088             "name": "outputSetWithOptional",
13089             "type": "OutputSet",
13090             "isVirtual": true,
13091             "isMany": true,
13092             "isReference": true
13093           }, {
13094             "name": "outputSetWithWhileExecuting",
13095             "type": "OutputSet",
13096             "isVirtual": true,
13097             "isMany": true,
13098             "isReference": true
13099           }]
13100         }, {
13101           "name": "InputSet",
13102           "superClass": [
13103             "BaseElement"
13104           ],
13105           "properties": [{
13106             "name": "name",
13107             "isAttr": true,
13108             "type": "String"
13109           }, {
13110             "name": "dataInputRefs",
13111             "type": "DataInput",
13112             "isMany": true,
13113             "isReference": true
13114           }, {
13115             "name": "optionalInputRefs",
13116             "type": "DataInput",
13117             "isMany": true,
13118             "isReference": true
13119           }, {
13120             "name": "whileExecutingInputRefs",
13121             "type": "DataInput",
13122             "isMany": true,
13123             "isReference": true
13124           }, {
13125             "name": "outputSetRefs",
13126             "type": "OutputSet",
13127             "isMany": true,
13128             "isReference": true
13129           }]
13130         }, {
13131           "name": "OutputSet",
13132           "superClass": [
13133             "BaseElement"
13134           ],
13135           "properties": [{
13136             "name": "dataOutputRefs",
13137             "type": "DataOutput",
13138             "isMany": true,
13139             "isReference": true
13140           }, {
13141             "name": "name",
13142             "isAttr": true,
13143             "type": "String"
13144           }, {
13145             "name": "inputSetRefs",
13146             "type": "InputSet",
13147             "isMany": true,
13148             "isReference": true
13149           }, {
13150             "name": "optionalOutputRefs",
13151             "type": "DataOutput",
13152             "isMany": true,
13153             "isReference": true
13154           }, {
13155             "name": "whileExecutingOutputRefs",
13156             "type": "DataOutput",
13157             "isMany": true,
13158             "isReference": true
13159           }]
13160         }, {
13161           "name": "Property",
13162           "superClass": [
13163             "ItemAwareElement"
13164           ],
13165           "properties": [{
13166             "name": "name",
13167             "isAttr": true,
13168             "type": "String"
13169           }]
13170         }, {
13171           "name": "DataInputAssociation",
13172           "superClass": [
13173             "DataAssociation"
13174           ]
13175         }, {
13176           "name": "DataOutputAssociation",
13177           "superClass": [
13178             "DataAssociation"
13179           ]
13180         }, {
13181           "name": "InputOutputSpecification",
13182           "superClass": [
13183             "BaseElement"
13184           ],
13185           "properties": [{
13186             "name": "inputSets",
13187             "type": "InputSet",
13188             "isMany": true
13189           }, {
13190             "name": "outputSets",
13191             "type": "OutputSet",
13192             "isMany": true
13193           }, {
13194             "name": "dataInputs",
13195             "type": "DataInput",
13196             "isMany": true
13197           }, {
13198             "name": "dataOutputs",
13199             "type": "DataOutput",
13200             "isMany": true
13201           }]
13202         }, {
13203           "name": "DataObject",
13204           "superClass": [
13205             "FlowElement",
13206             "ItemAwareElement"
13207           ],
13208           "properties": [{
13209             "name": "isCollection",
13210             "default": false,
13211             "isAttr": true,
13212             "type": "Boolean"
13213           }]
13214         }, {
13215           "name": "InputOutputBinding",
13216           "properties": [{
13217             "name": "inputDataRef",
13218             "type": "InputSet",
13219             "isAttr": true,
13220             "isReference": true
13221           }, {
13222             "name": "outputDataRef",
13223             "type": "OutputSet",
13224             "isAttr": true,
13225             "isReference": true
13226           }, {
13227             "name": "operationRef",
13228             "type": "Operation",
13229             "isAttr": true,
13230             "isReference": true
13231           }]
13232         }, {
13233           "name": "Assignment",
13234           "superClass": [
13235             "BaseElement"
13236           ],
13237           "properties": [{
13238             "name": "from",
13239             "type": "Expression",
13240             "serialize": "xsi:type"
13241           }, {
13242             "name": "to",
13243             "type": "Expression",
13244             "serialize": "xsi:type"
13245           }]
13246         }, {
13247           "name": "DataStore",
13248           "superClass": [
13249             "RootElement",
13250             "ItemAwareElement"
13251           ],
13252           "properties": [{
13253             "name": "name",
13254             "isAttr": true,
13255             "type": "String"
13256           }, {
13257             "name": "capacity",
13258             "isAttr": true,
13259             "type": "Integer"
13260           }, {
13261             "name": "isUnlimited",
13262             "default": true,
13263             "isAttr": true,
13264             "type": "Boolean"
13265           }]
13266         }, {
13267           "name": "DataStoreReference",
13268           "superClass": [
13269             "ItemAwareElement",
13270             "FlowElement"
13271           ],
13272           "properties": [{
13273             "name": "dataStoreRef",
13274             "type": "DataStore",
13275             "isAttr": true,
13276             "isReference": true
13277           }]
13278         }, {
13279           "name": "DataObjectReference",
13280           "superClass": [
13281             "ItemAwareElement",
13282             "FlowElement"
13283           ],
13284           "properties": [{
13285             "name": "dataObjectRef",
13286             "type": "DataObject",
13287             "isAttr": true,
13288             "isReference": true
13289           }]
13290         }, {
13291           "name": "ConversationLink",
13292           "superClass": [
13293             "BaseElement"
13294           ],
13295           "properties": [{
13296             "name": "sourceRef",
13297             "type": "InteractionNode",
13298             "isAttr": true,
13299             "isReference": true
13300           }, {
13301             "name": "targetRef",
13302             "type": "InteractionNode",
13303             "isAttr": true,
13304             "isReference": true
13305           }, {
13306             "name": "name",
13307             "isAttr": true,
13308             "type": "String"
13309           }]
13310         }, {
13311           "name": "ConversationAssociation",
13312           "superClass": [
13313             "BaseElement"
13314           ],
13315           "properties": [{
13316             "name": "innerConversationNodeRef",
13317             "type": "ConversationNode",
13318             "isAttr": true,
13319             "isReference": true
13320           }, {
13321             "name": "outerConversationNodeRef",
13322             "type": "ConversationNode",
13323             "isAttr": true,
13324             "isReference": true
13325           }]
13326         }, {
13327           "name": "CallConversation",
13328           "superClass": [
13329             "ConversationNode"
13330           ],
13331           "properties": [{
13332             "name": "calledCollaborationRef",
13333             "type": "Collaboration",
13334             "isAttr": true,
13335             "isReference": true
13336           }, {
13337             "name": "participantAssociations",
13338             "type": "ParticipantAssociation",
13339             "isMany": true
13340           }]
13341         }, {
13342           "name": "Conversation",
13343           "superClass": [
13344             "ConversationNode"
13345           ]
13346         }, {
13347           "name": "SubConversation",
13348           "superClass": [
13349             "ConversationNode"
13350           ],
13351           "properties": [{
13352             "name": "conversationNodes",
13353             "type": "ConversationNode",
13354             "isMany": true
13355           }]
13356         }, {
13357           "name": "ConversationNode",
13358           "isAbstract": true,
13359           "superClass": [
13360             "InteractionNode",
13361             "BaseElement"
13362           ],
13363           "properties": [{
13364             "name": "name",
13365             "isAttr": true,
13366             "type": "String"
13367           }, {
13368             "name": "participantRefs",
13369             "type": "Participant",
13370             "isMany": true,
13371             "isReference": true
13372           }, {
13373             "name": "messageFlowRefs",
13374             "type": "MessageFlow",
13375             "isMany": true,
13376             "isReference": true
13377           }, {
13378             "name": "correlationKeys",
13379             "type": "CorrelationKey",
13380             "isMany": true
13381           }]
13382         }, {
13383           "name": "GlobalConversation",
13384           "superClass": [
13385             "Collaboration"
13386           ]
13387         }, {
13388           "name": "PartnerEntity",
13389           "superClass": [
13390             "RootElement"
13391           ],
13392           "properties": [{
13393             "name": "name",
13394             "isAttr": true,
13395             "type": "String"
13396           }, {
13397             "name": "participantRef",
13398             "type": "Participant",
13399             "isMany": true,
13400             "isReference": true
13401           }]
13402         }, {
13403           "name": "PartnerRole",
13404           "superClass": [
13405             "RootElement"
13406           ],
13407           "properties": [{
13408             "name": "name",
13409             "isAttr": true,
13410             "type": "String"
13411           }, {
13412             "name": "participantRef",
13413             "type": "Participant",
13414             "isMany": true,
13415             "isReference": true
13416           }]
13417         }, {
13418           "name": "CorrelationProperty",
13419           "superClass": [
13420             "RootElement"
13421           ],
13422           "properties": [{
13423             "name": "correlationPropertyRetrievalExpression",
13424             "type": "CorrelationPropertyRetrievalExpression",
13425             "isMany": true
13426           }, {
13427             "name": "name",
13428             "isAttr": true,
13429             "type": "String"
13430           }, {
13431             "name": "type",
13432             "type": "ItemDefinition",
13433             "isAttr": true,
13434             "isReference": true
13435           }]
13436         }, {
13437           "name": "Error",
13438           "superClass": [
13439             "RootElement"
13440           ],
13441           "properties": [{
13442             "name": "structureRef",
13443             "type": "ItemDefinition",
13444             "isAttr": true,
13445             "isReference": true
13446           }, {
13447             "name": "name",
13448             "isAttr": true,
13449             "type": "String"
13450           }, {
13451             "name": "errorCode",
13452             "isAttr": true,
13453             "type": "String"
13454           }]
13455         }, {
13456           "name": "CorrelationKey",
13457           "superClass": [
13458             "BaseElement"
13459           ],
13460           "properties": [{
13461             "name": "correlationPropertyRef",
13462             "type": "CorrelationProperty",
13463             "isMany": true,
13464             "isReference": true
13465           }, {
13466             "name": "name",
13467             "isAttr": true,
13468             "type": "String"
13469           }]
13470         }, {
13471           "name": "Expression",
13472           "superClass": [
13473             "BaseElement"
13474           ],
13475           "isAbstract": true
13476         }, {
13477           "name": "FormalExpression",
13478           "superClass": [
13479             "Expression"
13480           ],
13481           "properties": [{
13482             "name": "language",
13483             "isAttr": true,
13484             "type": "String"
13485           }, {
13486             "name": "body",
13487             "type": "String",
13488             "isBody": true
13489           }, {
13490             "name": "evaluatesToTypeRef",
13491             "type": "ItemDefinition",
13492             "isAttr": true,
13493             "isReference": true
13494           }]
13495         }, {
13496           "name": "Message",
13497           "superClass": [
13498             "RootElement"
13499           ],
13500           "properties": [{
13501             "name": "name",
13502             "isAttr": true,
13503             "type": "String"
13504           }, {
13505             "name": "itemRef",
13506             "type": "ItemDefinition",
13507             "isAttr": true,
13508             "isReference": true
13509           }]
13510         }, {
13511           "name": "ItemDefinition",
13512           "superClass": [
13513             "RootElement"
13514           ],
13515           "properties": [{
13516             "name": "itemKind",
13517             "type": "ItemKind",
13518             "isAttr": true
13519           }, {
13520             "name": "structureRef",
13521             "type": "String",
13522             "isAttr": true
13523           }, {
13524             "name": "isCollection",
13525             "default": false,
13526             "isAttr": true,
13527             "type": "Boolean"
13528           }, {
13529             "name": "import",
13530             "type": "Import",
13531             "isAttr": true,
13532             "isReference": true
13533           }]
13534         }, {
13535           "name": "FlowElement",
13536           "isAbstract": true,
13537           "superClass": [
13538             "BaseElement"
13539           ],
13540           "properties": [{
13541             "name": "name",
13542             "isAttr": true,
13543             "type": "String"
13544           }, {
13545             "name": "auditing",
13546             "type": "Auditing"
13547           }, {
13548             "name": "monitoring",
13549             "type": "Monitoring"
13550           }, {
13551             "name": "categoryValueRef",
13552             "type": "CategoryValue",
13553             "isMany": true,
13554             "isReference": true
13555           }]
13556         }, {
13557           "name": "SequenceFlow",
13558           "superClass": [
13559             "FlowElement"
13560           ],
13561           "properties": [{
13562             "name": "isImmediate",
13563             "isAttr": true,
13564             "type": "Boolean"
13565           }, {
13566             "name": "conditionExpression",
13567             "type": "Expression",
13568             "serialize": "xsi:type"
13569           }, {
13570             "name": "sourceRef",
13571             "type": "FlowNode",
13572             "isAttr": true,
13573             "isReference": true
13574           }, {
13575             "name": "targetRef",
13576             "type": "FlowNode",
13577             "isAttr": true,
13578             "isReference": true
13579           }]
13580         }, {
13581           "name": "FlowElementsContainer",
13582           "isAbstract": true,
13583           "superClass": [
13584             "BaseElement"
13585           ],
13586           "properties": [{
13587             "name": "laneSets",
13588             "type": "LaneSet",
13589             "isMany": true
13590           }, {
13591             "name": "flowElements",
13592             "type": "FlowElement",
13593             "isMany": true
13594           }]
13595         }, {
13596           "name": "CallableElement",
13597           "isAbstract": true,
13598           "superClass": [
13599             "RootElement"
13600           ],
13601           "properties": [{
13602             "name": "name",
13603             "isAttr": true,
13604             "type": "String"
13605           }, {
13606             "name": "ioSpecification",
13607             "type": "InputOutputSpecification"
13608           }, {
13609             "name": "supportedInterfaceRefs",
13610             "type": "Interface",
13611             "isMany": true,
13612             "isReference": true
13613           }, {
13614             "name": "ioBinding",
13615             "type": "InputOutputBinding",
13616             "isMany": true
13617           }]
13618         }, {
13619           "name": "FlowNode",
13620           "isAbstract": true,
13621           "superClass": [
13622             "FlowElement"
13623           ],
13624           "properties": [{
13625             "name": "incoming",
13626             "type": "SequenceFlow",
13627             "isMany": true,
13628             "isReference": true
13629           }, {
13630             "name": "outgoing",
13631             "type": "SequenceFlow",
13632             "isMany": true,
13633             "isReference": true
13634           }, {
13635             "name": "lanes",
13636             "type": "Lane",
13637             "isVirtual": true,
13638             "isMany": true,
13639             "isReference": true
13640           }]
13641         }, {
13642           "name": "CorrelationPropertyRetrievalExpression",
13643           "superClass": [
13644             "BaseElement"
13645           ],
13646           "properties": [{
13647             "name": "messagePath",
13648             "type": "FormalExpression"
13649           }, {
13650             "name": "messageRef",
13651             "type": "Message",
13652             "isAttr": true,
13653             "isReference": true
13654           }]
13655         }, {
13656           "name": "CorrelationPropertyBinding",
13657           "superClass": [
13658             "BaseElement"
13659           ],
13660           "properties": [{
13661             "name": "dataPath",
13662             "type": "FormalExpression"
13663           }, {
13664             "name": "correlationPropertyRef",
13665             "type": "CorrelationProperty",
13666             "isAttr": true,
13667             "isReference": true
13668           }]
13669         }, {
13670           "name": "Resource",
13671           "superClass": [
13672             "RootElement"
13673           ],
13674           "properties": [{
13675             "name": "name",
13676             "isAttr": true,
13677             "type": "String"
13678           }, {
13679             "name": "resourceParameters",
13680             "type": "ResourceParameter",
13681             "isMany": true
13682           }]
13683         }, {
13684           "name": "ResourceParameter",
13685           "superClass": [
13686             "BaseElement"
13687           ],
13688           "properties": [{
13689             "name": "name",
13690             "isAttr": true,
13691             "type": "String"
13692           }, {
13693             "name": "isRequired",
13694             "isAttr": true,
13695             "type": "Boolean"
13696           }, {
13697             "name": "type",
13698             "type": "ItemDefinition",
13699             "isAttr": true,
13700             "isReference": true
13701           }]
13702         }, {
13703           "name": "CorrelationSubscription",
13704           "superClass": [
13705             "BaseElement"
13706           ],
13707           "properties": [{
13708             "name": "correlationKeyRef",
13709             "type": "CorrelationKey",
13710             "isAttr": true,
13711             "isReference": true
13712           }, {
13713             "name": "correlationPropertyBinding",
13714             "type": "CorrelationPropertyBinding",
13715             "isMany": true
13716           }]
13717         }, {
13718           "name": "MessageFlow",
13719           "superClass": [
13720             "BaseElement"
13721           ],
13722           "properties": [{
13723             "name": "name",
13724             "isAttr": true,
13725             "type": "String"
13726           }, {
13727             "name": "sourceRef",
13728             "type": "InteractionNode",
13729             "isAttr": true,
13730             "isReference": true
13731           }, {
13732             "name": "targetRef",
13733             "type": "InteractionNode",
13734             "isAttr": true,
13735             "isReference": true
13736           }, {
13737             "name": "messageRef",
13738             "type": "Message",
13739             "isAttr": true,
13740             "isReference": true
13741           }]
13742         }, {
13743           "name": "MessageFlowAssociation",
13744           "superClass": [
13745             "BaseElement"
13746           ],
13747           "properties": [{
13748             "name": "innerMessageFlowRef",
13749             "type": "MessageFlow",
13750             "isAttr": true,
13751             "isReference": true
13752           }, {
13753             "name": "outerMessageFlowRef",
13754             "type": "MessageFlow",
13755             "isAttr": true,
13756             "isReference": true
13757           }]
13758         }, {
13759           "name": "InteractionNode",
13760           "isAbstract": true,
13761           "properties": [{
13762             "name": "incomingConversationLinks",
13763             "type": "ConversationLink",
13764             "isVirtual": true,
13765             "isMany": true,
13766             "isReference": true
13767           }, {
13768             "name": "outgoingConversationLinks",
13769             "type": "ConversationLink",
13770             "isVirtual": true,
13771             "isMany": true,
13772             "isReference": true
13773           }]
13774         }, {
13775           "name": "Participant",
13776           "superClass": [
13777             "InteractionNode",
13778             "BaseElement"
13779           ],
13780           "properties": [{
13781             "name": "name",
13782             "isAttr": true,
13783             "type": "String"
13784           }, {
13785             "name": "interfaceRefs",
13786             "type": "Interface",
13787             "isMany": true,
13788             "isReference": true
13789           }, {
13790             "name": "participantMultiplicity",
13791             "type": "ParticipantMultiplicity"
13792           }, {
13793             "name": "endPointRefs",
13794             "type": "EndPoint",
13795             "isMany": true,
13796             "isReference": true
13797           }, {
13798             "name": "processRef",
13799             "type": "Process",
13800             "isAttr": true,
13801             "isReference": true
13802           }]
13803         }, {
13804           "name": "ParticipantAssociation",
13805           "superClass": [
13806             "BaseElement"
13807           ],
13808           "properties": [{
13809             "name": "innerParticipantRef",
13810             "type": "Participant",
13811             "isAttr": true,
13812             "isReference": true
13813           }, {
13814             "name": "outerParticipantRef",
13815             "type": "Participant",
13816             "isAttr": true,
13817             "isReference": true
13818           }]
13819         }, {
13820           "name": "ParticipantMultiplicity",
13821           "properties": [{
13822             "name": "minimum",
13823             "default": 0,
13824             "isAttr": true,
13825             "type": "Integer"
13826           }, {
13827             "name": "maximum",
13828             "default": 1,
13829             "isAttr": true,
13830             "type": "Integer"
13831           }]
13832         }, {
13833           "name": "Collaboration",
13834           "superClass": [
13835             "RootElement"
13836           ],
13837           "properties": [{
13838             "name": "name",
13839             "isAttr": true,
13840             "type": "String"
13841           }, {
13842             "name": "isClosed",
13843             "isAttr": true,
13844             "type": "Boolean"
13845           }, {
13846             "name": "choreographyRef",
13847             "type": "Choreography",
13848             "isMany": true,
13849             "isReference": true
13850           }, {
13851             "name": "artifacts",
13852             "type": "Artifact",
13853             "isMany": true
13854           }, {
13855             "name": "participantAssociations",
13856             "type": "ParticipantAssociation",
13857             "isMany": true
13858           }, {
13859             "name": "messageFlowAssociations",
13860             "type": "MessageFlowAssociation",
13861             "isMany": true
13862           }, {
13863             "name": "conversationAssociations",
13864             "type": "ConversationAssociation"
13865           }, {
13866             "name": "participants",
13867             "type": "Participant",
13868             "isMany": true
13869           }, {
13870             "name": "messageFlows",
13871             "type": "MessageFlow",
13872             "isMany": true
13873           }, {
13874             "name": "correlationKeys",
13875             "type": "CorrelationKey",
13876             "isMany": true
13877           }, {
13878             "name": "conversations",
13879             "type": "ConversationNode",
13880             "isMany": true
13881           }, {
13882             "name": "conversationLinks",
13883             "type": "ConversationLink",
13884             "isMany": true
13885           }]
13886         }, {
13887           "name": "ChoreographyActivity",
13888           "isAbstract": true,
13889           "superClass": [
13890             "FlowNode"
13891           ],
13892           "properties": [{
13893             "name": "participantRefs",
13894             "type": "Participant",
13895             "isMany": true,
13896             "isReference": true
13897           }, {
13898             "name": "initiatingParticipantRef",
13899             "type": "Participant",
13900             "isAttr": true,
13901             "isReference": true
13902           }, {
13903             "name": "correlationKeys",
13904             "type": "CorrelationKey",
13905             "isMany": true
13906           }, {
13907             "name": "loopType",
13908             "type": "ChoreographyLoopType",
13909             "default": "None",
13910             "isAttr": true
13911           }]
13912         }, {
13913           "name": "CallChoreography",
13914           "superClass": [
13915             "ChoreographyActivity"
13916           ],
13917           "properties": [{
13918             "name": "calledChoreographyRef",
13919             "type": "Choreography",
13920             "isAttr": true,
13921             "isReference": true
13922           }, {
13923             "name": "participantAssociations",
13924             "type": "ParticipantAssociation",
13925             "isMany": true
13926           }]
13927         }, {
13928           "name": "SubChoreography",
13929           "superClass": [
13930             "ChoreographyActivity",
13931             "FlowElementsContainer"
13932           ],
13933           "properties": [{
13934             "name": "artifacts",
13935             "type": "Artifact",
13936             "isMany": true
13937           }]
13938         }, {
13939           "name": "ChoreographyTask",
13940           "superClass": [
13941             "ChoreographyActivity"
13942           ],
13943           "properties": [{
13944             "name": "messageFlowRef",
13945             "type": "MessageFlow",
13946             "isMany": true,
13947             "isReference": true
13948           }]
13949         }, {
13950           "name": "Choreography",
13951           "superClass": [
13952             "FlowElementsContainer",
13953             "Collaboration"
13954           ]
13955         }, {
13956           "name": "GlobalChoreographyTask",
13957           "superClass": [
13958             "Choreography"
13959           ],
13960           "properties": [{
13961             "name": "initiatingParticipantRef",
13962             "type": "Participant",
13963             "isAttr": true,
13964             "isReference": true
13965           }]
13966         }, {
13967           "name": "TextAnnotation",
13968           "superClass": [
13969             "Artifact"
13970           ],
13971           "properties": [{
13972             "name": "text",
13973             "type": "String"
13974           }, {
13975             "name": "textFormat",
13976             "default": "text/plain",
13977             "isAttr": true,
13978             "type": "String"
13979           }]
13980         }, {
13981           "name": "Group",
13982           "superClass": [
13983             "Artifact"
13984           ],
13985           "properties": [{
13986             "name": "categoryValueRef",
13987             "type": "CategoryValue",
13988             "isAttr": true,
13989             "isReference": true
13990           }]
13991         }, {
13992           "name": "Association",
13993           "superClass": [
13994             "Artifact"
13995           ],
13996           "properties": [{
13997             "name": "associationDirection",
13998             "type": "AssociationDirection",
13999             "isAttr": true
14000           }, {
14001             "name": "sourceRef",
14002             "type": "BaseElement",
14003             "isAttr": true,
14004             "isReference": true
14005           }, {
14006             "name": "targetRef",
14007             "type": "BaseElement",
14008             "isAttr": true,
14009             "isReference": true
14010           }]
14011         }, {
14012           "name": "Category",
14013           "superClass": [
14014             "RootElement"
14015           ],
14016           "properties": [{
14017             "name": "categoryValue",
14018             "type": "CategoryValue",
14019             "isMany": true
14020           }, {
14021             "name": "name",
14022             "isAttr": true,
14023             "type": "String"
14024           }]
14025         }, {
14026           "name": "Artifact",
14027           "isAbstract": true,
14028           "superClass": [
14029             "BaseElement"
14030           ]
14031         }, {
14032           "name": "CategoryValue",
14033           "superClass": [
14034             "BaseElement"
14035           ],
14036           "properties": [{
14037             "name": "categorizedFlowElements",
14038             "type": "FlowElement",
14039             "isVirtual": true,
14040             "isMany": true,
14041             "isReference": true
14042           }, {
14043             "name": "value",
14044             "isAttr": true,
14045             "type": "String"
14046           }]
14047         }, {
14048           "name": "Activity",
14049           "isAbstract": true,
14050           "superClass": [
14051             "FlowNode"
14052           ],
14053           "properties": [{
14054             "name": "isForCompensation",
14055             "default": false,
14056             "isAttr": true,
14057             "type": "Boolean"
14058           }, {
14059             "name": "loopCharacteristics",
14060             "type": "LoopCharacteristics"
14061           }, {
14062             "name": "resources",
14063             "type": "ResourceRole",
14064             "isMany": true
14065           }, {
14066             "name": "default",
14067             "type": "SequenceFlow",
14068             "isAttr": true,
14069             "isReference": true
14070           }, {
14071             "name": "properties",
14072             "type": "Property",
14073             "isMany": true
14074           }, {
14075             "name": "ioSpecification",
14076             "type": "InputOutputSpecification"
14077           }, {
14078             "name": "boundaryEventRefs",
14079             "type": "BoundaryEvent",
14080             "isMany": true,
14081             "isReference": true
14082           }, {
14083             "name": "dataInputAssociations",
14084             "type": "DataInputAssociation",
14085             "isMany": true
14086           }, {
14087             "name": "dataOutputAssociations",
14088             "type": "DataOutputAssociation",
14089             "isMany": true
14090           }, {
14091             "name": "startQuantity",
14092             "default": 1,
14093             "isAttr": true,
14094             "type": "Integer"
14095           }, {
14096             "name": "completionQuantity",
14097             "default": 1,
14098             "isAttr": true,
14099             "type": "Integer"
14100           }]
14101         }, {
14102           "name": "ServiceTask",
14103           "superClass": [
14104             "Task"
14105           ],
14106           "properties": [{
14107             "name": "implementation",
14108             "isAttr": true,
14109             "type": "String"
14110           }, {
14111             "name": "operationRef",
14112             "type": "Operation",
14113             "isAttr": true,
14114             "isReference": true
14115           }]
14116         }, {
14117           "name": "SubProcess",
14118           "superClass": [
14119             "Activity",
14120             "FlowElementsContainer",
14121             "InteractionNode"
14122           ],
14123           "properties": [{
14124             "name": "triggeredByEvent",
14125             "default": false,
14126             "isAttr": true,
14127             "type": "Boolean"
14128           }, {
14129             "name": "artifacts",
14130             "type": "Artifact",
14131             "isMany": true
14132           }]
14133         }, {
14134           "name": "LoopCharacteristics",
14135           "isAbstract": true,
14136           "superClass": [
14137             "BaseElement"
14138           ]
14139         }, {
14140           "name": "MultiInstanceLoopCharacteristics",
14141           "superClass": [
14142             "LoopCharacteristics"
14143           ],
14144           "properties": [{
14145             "name": "isSequential",
14146             "default": false,
14147             "isAttr": true,
14148             "type": "Boolean"
14149           }, {
14150             "name": "behavior",
14151             "type": "MultiInstanceBehavior",
14152             "default": "All",
14153             "isAttr": true
14154           }, {
14155             "name": "loopCardinality",
14156             "type": "Expression",
14157             "serialize": "xsi:type"
14158           }, {
14159             "name": "loopDataInputRef",
14160             "type": "ItemAwareElement",
14161             "isAttr": true,
14162             "isReference": true
14163           }, {
14164             "name": "loopDataOutputRef",
14165             "type": "ItemAwareElement",
14166             "isAttr": true,
14167             "isReference": true
14168           }, {
14169             "name": "inputDataItem",
14170             "type": "DataInput"
14171           }, {
14172             "name": "outputDataItem",
14173             "type": "DataOutput"
14174           }, {
14175             "name": "completionCondition",
14176             "type": "Expression",
14177             "serialize": "xsi:type"
14178           }, {
14179             "name": "complexBehaviorDefinition",
14180             "type": "ComplexBehaviorDefinition",
14181             "isMany": true
14182           }, {
14183             "name": "oneBehaviorEventRef",
14184             "type": "EventDefinition",
14185             "isAttr": true,
14186             "isReference": true
14187           }, {
14188             "name": "noneBehaviorEventRef",
14189             "type": "EventDefinition",
14190             "isAttr": true,
14191             "isReference": true
14192           }]
14193         }, {
14194           "name": "StandardLoopCharacteristics",
14195           "superClass": [
14196             "LoopCharacteristics"
14197           ],
14198           "properties": [{
14199             "name": "testBefore",
14200             "default": false,
14201             "isAttr": true,
14202             "type": "Boolean"
14203           }, {
14204             "name": "loopCondition",
14205             "type": "Expression",
14206             "serialize": "xsi:type"
14207           }, {
14208             "name": "loopMaximum",
14209             "type": "Expression",
14210             "serialize": "xsi:type"
14211           }]
14212         }, {
14213           "name": "CallActivity",
14214           "superClass": [
14215             "Activity"
14216           ],
14217           "properties": [{
14218             "name": "calledElement",
14219             "type": "String",
14220             "isAttr": true
14221           }]
14222         }, {
14223           "name": "Task",
14224           "superClass": [
14225             "Activity",
14226             "InteractionNode"
14227           ]
14228         }, {
14229           "name": "InitiateProcess",
14230           "superClass": [
14231             "Activity",
14232             "InteractionNode"
14233           ]
14234         }, {
14235           "name": "VesCollector",
14236           "superClass": [
14237             "Activity",
14238             "InteractionNode"
14239           ]
14240         }, {
14241           "name": "Holmes",
14242           "superClass": [
14243             "Activity",
14244             "InteractionNode"
14245           ]
14246         },
14247
14248         {
14249           "name": "TCA",
14250           "superClass": [
14251             "Activity",
14252             "InteractionNode"
14253           ]
14254         }, {
14255           "name": "GOC",
14256           "superClass": [
14257             "Activity",
14258             "InteractionNode"
14259           ]
14260         }, {
14261           "name": "Policy",
14262           "superClass": [
14263             "Activity",
14264             "InteractionNode"
14265           ]
14266         }, {
14267           "name": "SendTask",
14268           "superClass": [
14269             "Task"
14270           ],
14271           "properties": [{
14272             "name": "implementation",
14273             "isAttr": true,
14274             "type": "String"
14275           }, {
14276             "name": "operationRef",
14277             "type": "Operation",
14278             "isAttr": true,
14279             "isReference": true
14280           }, {
14281             "name": "messageRef",
14282             "type": "Message",
14283             "isAttr": true,
14284             "isReference": true
14285           }]
14286         }, {
14287           "name": "ReceiveTask",
14288           "superClass": [
14289             "Task"
14290           ],
14291           "properties": [{
14292             "name": "implementation",
14293             "isAttr": true,
14294             "type": "String"
14295           }, {
14296             "name": "instantiate",
14297             "default": false,
14298             "isAttr": true,
14299             "type": "Boolean"
14300           }, {
14301             "name": "operationRef",
14302             "type": "Operation",
14303             "isAttr": true,
14304             "isReference": true
14305           }, {
14306             "name": "messageRef",
14307             "type": "Message",
14308             "isAttr": true,
14309             "isReference": true
14310           }]
14311         }, {
14312           "name": "ScriptTask",
14313           "superClass": [
14314             "Task"
14315           ],
14316           "properties": [{
14317             "name": "scriptFormat",
14318             "isAttr": true,
14319             "type": "String"
14320           }, {
14321             "name": "script",
14322             "type": "String"
14323           }]
14324         }, {
14325           "name": "BusinessRuleTask",
14326           "superClass": [
14327             "Task"
14328           ],
14329           "properties": [{
14330             "name": "implementation",
14331             "isAttr": true,
14332             "type": "String"
14333           }]
14334         }, {
14335           "name": "AdHocSubProcess",
14336           "superClass": [
14337             "SubProcess"
14338           ],
14339           "properties": [{
14340             "name": "completionCondition",
14341             "type": "Expression",
14342             "serialize": "xsi:type"
14343           }, {
14344             "name": "ordering",
14345             "type": "AdHocOrdering",
14346             "isAttr": true
14347           }, {
14348             "name": "cancelRemainingInstances",
14349             "default": true,
14350             "isAttr": true,
14351             "type": "Boolean"
14352           }]
14353         }, {
14354           "name": "Transaction",
14355           "superClass": [
14356             "SubProcess"
14357           ],
14358           "properties": [{
14359             "name": "protocol",
14360             "isAttr": true,
14361             "type": "String"
14362           }, {
14363             "name": "method",
14364             "isAttr": true,
14365             "type": "String"
14366           }]
14367         }, {
14368           "name": "GlobalScriptTask",
14369           "superClass": [
14370             "GlobalTask"
14371           ],
14372           "properties": [{
14373             "name": "scriptLanguage",
14374             "isAttr": true,
14375             "type": "String"
14376           }, {
14377             "name": "script",
14378             "isAttr": true,
14379             "type": "String"
14380           }]
14381         }, {
14382           "name": "GlobalBusinessRuleTask",
14383           "superClass": [
14384             "GlobalTask"
14385           ],
14386           "properties": [{
14387             "name": "implementation",
14388             "isAttr": true,
14389             "type": "String"
14390           }]
14391         }, {
14392           "name": "ComplexBehaviorDefinition",
14393           "superClass": [
14394             "BaseElement"
14395           ],
14396           "properties": [{
14397             "name": "condition",
14398             "type": "FormalExpression"
14399           }, {
14400             "name": "event",
14401             "type": "ImplicitThrowEvent"
14402           }]
14403         }, {
14404           "name": "ResourceRole",
14405           "superClass": [
14406             "BaseElement"
14407           ],
14408           "properties": [{
14409             "name": "resourceRef",
14410             "type": "Resource",
14411             "isReference": true
14412           }, {
14413             "name": "resourceParameterBindings",
14414             "type": "ResourceParameterBinding",
14415             "isMany": true
14416           }, {
14417             "name": "resourceAssignmentExpression",
14418             "type": "ResourceAssignmentExpression"
14419           }, {
14420             "name": "name",
14421             "isAttr": true,
14422             "type": "String"
14423           }]
14424         }, {
14425           "name": "ResourceParameterBinding",
14426           "properties": [{
14427             "name": "expression",
14428             "type": "Expression",
14429             "serialize": "xsi:type"
14430           }, {
14431             "name": "parameterRef",
14432             "type": "ResourceParameter",
14433             "isAttr": true,
14434             "isReference": true
14435           }]
14436         }, {
14437           "name": "ResourceAssignmentExpression",
14438           "properties": [{
14439             "name": "expression",
14440             "type": "Expression",
14441             "serialize": "xsi:type"
14442           }]
14443         }, {
14444           "name": "Import",
14445           "properties": [{
14446             "name": "importType",
14447             "isAttr": true,
14448             "type": "String"
14449           }, {
14450             "name": "location",
14451             "isAttr": true,
14452             "type": "String"
14453           }, {
14454             "name": "namespace",
14455             "isAttr": true,
14456             "type": "String"
14457           }]
14458         }, {
14459           "name": "Definitions",
14460           "superClass": [
14461             "BaseElement"
14462           ],
14463           "properties": [{
14464             "name": "name",
14465             "isAttr": true,
14466             "type": "String"
14467           }, {
14468             "name": "targetNamespace",
14469             "isAttr": true,
14470             "type": "String"
14471           }, {
14472             "name": "expressionLanguage",
14473             "default": "http://www.w3.org/1999/XPath",
14474             "isAttr": true,
14475             "type": "String"
14476           }, {
14477             "name": "typeLanguage",
14478             "default": "http://www.w3.org/2001/XMLSchema",
14479             "isAttr": true,
14480             "type": "String"
14481           }, {
14482             "name": "imports",
14483             "type": "Import",
14484             "isMany": true
14485           }, {
14486             "name": "extensions",
14487             "type": "Extension",
14488             "isMany": true
14489           }, {
14490             "name": "rootElements",
14491             "type": "RootElement",
14492             "isMany": true
14493           }, {
14494             "name": "diagrams",
14495             "isMany": true,
14496             "type": "bpmndi:BPMNDiagram"
14497           }, {
14498             "name": "exporter",
14499             "isAttr": true,
14500             "type": "String"
14501           }, {
14502             "name": "relationships",
14503             "type": "Relationship",
14504             "isMany": true
14505           }, {
14506             "name": "exporterVersion",
14507             "isAttr": true,
14508             "type": "String"
14509           }]
14510         }
14511       ],
14512       "emumerations": [{
14513         "name": "ProcessType",
14514         "literalValues": [{
14515           "name": "None"
14516         }, {
14517           "name": "Public"
14518         }, {
14519           "name": "Private"
14520         }]
14521       }, {
14522         "name": "GatewayDirection",
14523         "literalValues": [{
14524           "name": "Unspecified"
14525         }, {
14526           "name": "Converging"
14527         }, {
14528           "name": "Diverging"
14529         }, {
14530           "name": "Mixed"
14531         }]
14532       }, {
14533         "name": "EventBasedGatewayType",
14534         "literalValues": [{
14535           "name": "Parallel"
14536         }, {
14537           "name": "Exclusive"
14538         }]
14539       }, {
14540         "name": "RelationshipDirection",
14541         "literalValues": [{
14542           "name": "None"
14543         }, {
14544           "name": "Forward"
14545         }, {
14546           "name": "Backward"
14547         }, {
14548           "name": "Both"
14549         }]
14550       }, {
14551         "name": "ItemKind",
14552         "literalValues": [{
14553           "name": "Physical"
14554         }, {
14555           "name": "Information"
14556         }]
14557       }, {
14558         "name": "ChoreographyLoopType",
14559         "literalValues": [{
14560           "name": "None"
14561         }, {
14562           "name": "Standard"
14563         }, {
14564           "name": "MultiInstanceSequential"
14565         }, {
14566           "name": "MultiInstanceParallel"
14567         }]
14568       }, {
14569         "name": "AssociationDirection",
14570         "literalValues": [{
14571           "name": "None"
14572         }, {
14573           "name": "One"
14574         }, {
14575           "name": "Both"
14576         }]
14577       }, {
14578         "name": "MultiInstanceBehavior",
14579         "literalValues": [{
14580           "name": "None"
14581         }, {
14582           "name": "One"
14583         }, {
14584           "name": "All"
14585         }, {
14586           "name": "Complex"
14587         }]
14588       }, {
14589         "name": "AdHocOrdering",
14590         "literalValues": [{
14591           "name": "Parallel"
14592         }, {
14593           "name": "Sequential"
14594         }]
14595       }],
14596       "prefix": "bpmn",
14597       "xml": {
14598         "tagAlias": "lowerCase",
14599         "typePrefix": "t"
14600       }
14601     }
14602   }, {}],
14603   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmndi.json": [function(require, module, exports) {
14604     module.exports = {
14605       "name": "BPMNDI",
14606       "uri": "http://www.omg.org/spec/BPMN/20100524/DI",
14607       "types": [{
14608         "name": "BPMNDiagram",
14609         "properties": [{
14610           "name": "plane",
14611           "type": "BPMNPlane",
14612           "redefines": "di:Diagram#rootElement"
14613         }, {
14614           "name": "labelStyle",
14615           "type": "BPMNLabelStyle",
14616           "isMany": true
14617         }],
14618         "superClass": [
14619           "di:Diagram"
14620         ]
14621       }, {
14622         "name": "BPMNPlane",
14623         "properties": [{
14624           "name": "bpmnElement",
14625           "isAttr": true,
14626           "isReference": true,
14627           "type": "bpmn:BaseElement",
14628           "redefines": "di:DiagramElement#modelElement"
14629         }],
14630         "superClass": [
14631           "di:Plane"
14632         ]
14633       }, {
14634         "name": "BPMNShape",
14635         "properties": [{
14636           "name": "bpmnElement",
14637           "isAttr": true,
14638           "isReference": true,
14639           "type": "bpmn:BaseElement",
14640           "redefines": "di:DiagramElement#modelElement"
14641         }, {
14642           "name": "isHorizontal",
14643           "isAttr": true,
14644           "type": "Boolean"
14645         }, {
14646           "name": "isExpanded",
14647           "isAttr": true,
14648           "type": "Boolean"
14649         }, {
14650           "name": "isMarkerVisible",
14651           "isAttr": true,
14652           "type": "Boolean"
14653         }, {
14654           "name": "label",
14655           "type": "BPMNLabel"
14656         }, {
14657           "name": "isMessageVisible",
14658           "isAttr": true,
14659           "type": "Boolean"
14660         }, {
14661           "name": "participantBandKind",
14662           "type": "ParticipantBandKind",
14663           "isAttr": true
14664         }, {
14665           "name": "choreographyActivityShape",
14666           "type": "BPMNShape",
14667           "isAttr": true,
14668           "isReference": true
14669         }],
14670         "superClass": [
14671           "di:LabeledShape"
14672         ]
14673       }, {
14674         "name": "BPMNEdge",
14675         "properties": [{
14676           "name": "label",
14677           "type": "BPMNLabel"
14678         }, {
14679           "name": "bpmnElement",
14680           "isAttr": true,
14681           "isReference": true,
14682           "type": "bpmn:BaseElement",
14683           "redefines": "di:DiagramElement#modelElement"
14684         }, {
14685           "name": "sourceElement",
14686           "isAttr": true,
14687           "isReference": true,
14688           "type": "di:DiagramElement",
14689           "redefines": "di:Edge#source"
14690         }, {
14691           "name": "targetElement",
14692           "isAttr": true,
14693           "isReference": true,
14694           "type": "di:DiagramElement",
14695           "redefines": "di:Edge#target"
14696         }, {
14697           "name": "messageVisibleKind",
14698           "type": "MessageVisibleKind",
14699           "isAttr": true,
14700           "default": "initiating"
14701         }],
14702         "superClass": [
14703           "di:LabeledEdge"
14704         ]
14705       }, {
14706         "name": "BPMNLabel",
14707         "properties": [{
14708           "name": "labelStyle",
14709           "type": "BPMNLabelStyle",
14710           "isAttr": true,
14711           "isReference": true,
14712           "redefines": "di:DiagramElement#style"
14713         }],
14714         "superClass": [
14715           "di:Label"
14716         ]
14717       }, {
14718         "name": "BPMNLabelStyle",
14719         "properties": [{
14720           "name": "font",
14721           "type": "dc:Font"
14722         }],
14723         "superClass": [
14724           "di:Style"
14725         ]
14726       }],
14727       "emumerations": [{
14728         "name": "ParticipantBandKind",
14729         "literalValues": [{
14730           "name": "top_initiating"
14731         }, {
14732           "name": "middle_initiating"
14733         }, {
14734           "name": "bottom_initiating"
14735         }, {
14736           "name": "top_non_initiating"
14737         }, {
14738           "name": "middle_non_initiating"
14739         }, {
14740           "name": "bottom_non_initiating"
14741         }]
14742       }, {
14743         "name": "MessageVisibleKind",
14744         "literalValues": [{
14745           "name": "initiating"
14746         }, {
14747           "name": "non_initiating"
14748         }]
14749       }],
14750       "associations": [],
14751       "prefix": "bpmndi"
14752     }
14753   }, {}],
14754   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\dc.json": [function(require, module, exports) {
14755     module.exports = {
14756       "name": "DC",
14757       "uri": "http://www.omg.org/spec/DD/20100524/DC",
14758       "types": [{
14759         "name": "Boolean"
14760       }, {
14761         "name": "Integer"
14762       }, {
14763         "name": "Real"
14764       }, {
14765         "name": "String"
14766       }, {
14767         "name": "Font",
14768         "properties": [{
14769           "name": "name",
14770           "type": "String",
14771           "isAttr": true
14772         }, {
14773           "name": "size",
14774           "type": "Real",
14775           "isAttr": true
14776         }, {
14777           "name": "isBold",
14778           "type": "Boolean",
14779           "isAttr": true
14780         }, {
14781           "name": "isItalic",
14782           "type": "Boolean",
14783           "isAttr": true
14784         }, {
14785           "name": "isUnderline",
14786           "type": "Boolean",
14787           "isAttr": true
14788         }, {
14789           "name": "isStrikeThrough",
14790           "type": "Boolean",
14791           "isAttr": true
14792         }]
14793       }, {
14794         "name": "Point",
14795         "properties": [{
14796           "name": "x",
14797           "type": "Real",
14798           "default": "0",
14799           "isAttr": true
14800         }, {
14801           "name": "y",
14802           "type": "Real",
14803           "default": "0",
14804           "isAttr": true
14805         }]
14806       }, {
14807         "name": "Bounds",
14808         "properties": [{
14809           "name": "x",
14810           "type": "Real",
14811           "default": "0",
14812           "isAttr": true
14813         }, {
14814           "name": "y",
14815           "type": "Real",
14816           "default": "0",
14817           "isAttr": true
14818         }, {
14819           "name": "width",
14820           "type": "Real",
14821           "isAttr": true
14822         }, {
14823           "name": "height",
14824           "type": "Real",
14825           "isAttr": true
14826         }]
14827       }],
14828       "prefix": "dc",
14829       "associations": []
14830     }
14831   }, {}],
14832   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\di.json": [function(require, module, exports) {
14833     module.exports = {
14834       "name": "DI",
14835       "uri": "http://www.omg.org/spec/DD/20100524/DI",
14836       "types": [{
14837         "name": "DiagramElement",
14838         "isAbstract": true,
14839         "properties": [{
14840           "name": "extension",
14841           "type": "Extension"
14842         }, {
14843           "name": "owningDiagram",
14844           "type": "Diagram",
14845           "isReadOnly": true,
14846           "isVirtual": true,
14847           "isReference": true
14848         }, {
14849           "name": "owningElement",
14850           "type": "DiagramElement",
14851           "isReadOnly": true,
14852           "isVirtual": true,
14853           "isReference": true
14854         }, {
14855           "name": "modelElement",
14856           "isReadOnly": true,
14857           "isVirtual": true,
14858           "isReference": true,
14859           "type": "Element"
14860         }, {
14861           "name": "style",
14862           "type": "Style",
14863           "isReadOnly": true,
14864           "isVirtual": true,
14865           "isReference": true
14866         }, {
14867           "name": "ownedElement",
14868           "type": "DiagramElement",
14869           "isReadOnly": true,
14870           "isVirtual": true,
14871           "isMany": true
14872         }]
14873       }, {
14874         "name": "Node",
14875         "isAbstract": true,
14876         "superClass": [
14877           "DiagramElement"
14878         ]
14879       }, {
14880         "name": "Edge",
14881         "isAbstract": true,
14882         "superClass": [
14883           "DiagramElement"
14884         ],
14885         "properties": [{
14886           "name": "source",
14887           "type": "DiagramElement",
14888           "isReadOnly": true,
14889           "isVirtual": true,
14890           "isReference": true
14891         }, {
14892           "name": "target",
14893           "type": "DiagramElement",
14894           "isReadOnly": true,
14895           "isVirtual": true,
14896           "isReference": true
14897         }, {
14898           "name": "waypoint",
14899           "isUnique": false,
14900           "isMany": true,
14901           "type": "dc:Point",
14902           "serialize": "xsi:type"
14903         }]
14904       }, {
14905         "name": "Diagram",
14906         "isAbstract": true,
14907         "properties": [{
14908           "name": "rootElement",
14909           "type": "DiagramElement",
14910           "isReadOnly": true,
14911           "isVirtual": true
14912         }, {
14913           "name": "name",
14914           "isAttr": true,
14915           "type": "String"
14916         }, {
14917           "name": "documentation",
14918           "isAttr": true,
14919           "type": "String"
14920         }, {
14921           "name": "resolution",
14922           "isAttr": true,
14923           "type": "Real"
14924         }, {
14925           "name": "ownedStyle",
14926           "type": "Style",
14927           "isReadOnly": true,
14928           "isVirtual": true,
14929           "isMany": true
14930         }]
14931       }, {
14932         "name": "Shape",
14933         "isAbstract": true,
14934         "superClass": [
14935           "Node"
14936         ],
14937         "properties": [{
14938           "name": "bounds",
14939           "type": "dc:Bounds"
14940         }]
14941       }, {
14942         "name": "Plane",
14943         "isAbstract": true,
14944         "superClass": [
14945           "Node"
14946         ],
14947         "properties": [{
14948           "name": "planeElement",
14949           "type": "DiagramElement",
14950           "subsettedProperty": "DiagramElement-ownedElement",
14951           "isMany": true
14952         }]
14953       }, {
14954         "name": "LabeledEdge",
14955         "isAbstract": true,
14956         "superClass": [
14957           "Edge"
14958         ],
14959         "properties": [{
14960           "name": "ownedLabel",
14961           "type": "Label",
14962           "isReadOnly": true,
14963           "subsettedProperty": "DiagramElement-ownedElement",
14964           "isVirtual": true,
14965           "isMany": true
14966         }]
14967       }, {
14968         "name": "LabeledShape",
14969         "isAbstract": true,
14970         "superClass": [
14971           "Shape"
14972         ],
14973         "properties": [{
14974           "name": "ownedLabel",
14975           "type": "Label",
14976           "isReadOnly": true,
14977           "subsettedProperty": "DiagramElement-ownedElement",
14978           "isVirtual": true,
14979           "isMany": true
14980         }]
14981       }, {
14982         "name": "Label",
14983         "isAbstract": true,
14984         "superClass": [
14985           "Node"
14986         ],
14987         "properties": [{
14988           "name": "bounds",
14989           "type": "dc:Bounds"
14990         }]
14991       }, {
14992         "name": "Style",
14993         "isAbstract": true
14994       }, {
14995         "name": "Extension",
14996         "properties": [{
14997           "name": "values",
14998           "type": "Element",
14999           "isMany": true
15000         }]
15001       }],
15002       "associations": [],
15003       "prefix": "di",
15004       "xml": {
15005         "tagAlias": "lowerCase"
15006       }
15007     }
15008   }, {}],
15009   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js": [function(require, module, exports) {
15010     module.exports = {
15011       __depends__: [require('diagram-js/lib/features/interaction-events')],
15012       __init__: ['directEditing'],
15013       directEditing: ['type', require('./lib/DirectEditing')]
15014     };
15015   }, {
15016     "./lib/DirectEditing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\DirectEditing.js",
15017     "diagram-js/lib/features/interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js"
15018   }],
15019   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\DirectEditing.js": [function(require, module, exports) {
15020     'use strict';
15021
15022     var bind = require('lodash/function/bind'),
15023       find = require('lodash/collection/find');
15024
15025     var TextBox = require('./TextBox');
15026
15027
15028     /**
15029      * A direct editing component that allows users to edit an elements text
15030      * directly in the diagram
15031      *
15032      * @param {EventBus}
15033      *            eventBus the event bus
15034      */
15035     function DirectEditing(eventBus, canvas) {
15036
15037       this._eventBus = eventBus;
15038
15039       this._providers = [];
15040       this._textbox = new TextBox({
15041         container: canvas.getContainer(),
15042         keyHandler: bind(this._handleKey, this)
15043       });
15044     }
15045
15046     DirectEditing.$inject = ['eventBus', 'canvas'];
15047
15048
15049     /**
15050      * Register a direct editing provider
15051      *
15052      * @param {Object}
15053      *            provider the provider, must expose an #activate(element) method
15054      *            that returns an activation context ({ bounds: {x, y, width, height },
15055      *            text }) if direct editing is available for the given element.
15056      *            Additionally the provider must expose a #update(element, value)
15057      *            method to receive direct editing updates.
15058      */
15059     DirectEditing.prototype.registerProvider = function(provider) {
15060       this._providers.push(provider);
15061     };
15062
15063
15064     /**
15065      * Returns true if direct editing is currently active
15066      *
15067      * @return {Boolean}
15068      */
15069     DirectEditing.prototype.isActive = function() {
15070       return !!this._active;
15071     };
15072
15073
15074     /**
15075      * Cancel direct editing, if it is currently active
15076      */
15077     DirectEditing.prototype.cancel = function() {
15078       if (!this._active) {
15079         return;
15080       }
15081
15082       this._fire('cancel');
15083       this.close();
15084     };
15085
15086
15087     DirectEditing.prototype._fire = function(event) {
15088       this._eventBus.fire('directEditing.' + event, {
15089         active: this._active
15090       });
15091     };
15092
15093     DirectEditing.prototype.close = function() {
15094       this._textbox.destroy();
15095
15096       this._fire('deactivate');
15097
15098       this._active = null;
15099     };
15100
15101
15102     DirectEditing.prototype.complete = function() {
15103
15104       var active = this._active;
15105
15106       if (!active) {
15107         return;
15108       }
15109
15110       var text = this.getValue();
15111
15112       if (text !== active.context.text) {
15113         active.provider.update(active.element, text, active.context.text);
15114       }
15115
15116       this._fire('complete');
15117
15118       this.close();
15119     };
15120
15121
15122     DirectEditing.prototype.getValue = function() {
15123       return this._textbox.getValue();
15124     };
15125
15126
15127     DirectEditing.prototype._handleKey = function(e) {
15128
15129       // stop bubble
15130       e.stopPropagation();
15131
15132       var key = e.keyCode || e.charCode;
15133
15134       // ESC
15135       if (key === 27) {
15136         e.preventDefault();
15137         return this.cancel();
15138       }
15139
15140       // Enter
15141       if (key === 13 && !e.shiftKey) {
15142         e.preventDefault();
15143         return this.complete();
15144       }
15145     };
15146
15147
15148     /**
15149      * Activate direct editing on the given element
15150      *
15151      * @param {Object}
15152      *            ElementDescriptor the descriptor for a shape or connection
15153      * @return {Boolean} true if the activation was possible
15154      */
15155     DirectEditing.prototype.activate = function(element) {
15156
15157       if (this.isActive()) {
15158         this.cancel();
15159       }
15160
15161       // the direct editing context
15162       var context;
15163
15164       var provider = find(this._providers, function(p) {
15165         return !!(context = p.activate(element)) ? p : null;
15166       });
15167
15168       // check if activation took place
15169       if (context) {
15170         this._textbox.create(context.bounds, context.style, context.text);
15171
15172         this._active = {
15173           element: element,
15174           context: context,
15175           provider: provider
15176         };
15177
15178         this._fire('activate');
15179       }
15180
15181       return !!context;
15182     };
15183
15184
15185     module.exports = DirectEditing;
15186   }, {
15187     "./TextBox": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\TextBox.js",
15188     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
15189     "lodash/function/bind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\bind.js"
15190   }],
15191   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\TextBox.js": [function(require, module, exports) {
15192     'use strict';
15193
15194     var assign = require('lodash/object/assign'),
15195       domEvent = require('min-dom/lib/event'),
15196       domRemove = require('min-dom/lib/remove');
15197
15198     function stopPropagation(event) {
15199       event.stopPropagation();
15200     }
15201
15202     function TextBox(options) {
15203
15204       this.container = options.container;
15205       this.textarea = document.createElement('textarea');
15206
15207       this.keyHandler = options.keyHandler || function() {};
15208     }
15209
15210     module.exports = TextBox;
15211
15212
15213     TextBox.prototype.create = function(bounds, style, value) {
15214
15215       var textarea = this.textarea,
15216         container = this.container;
15217
15218       assign(textarea.style, {
15219         width: bounds.width + 'px',
15220         height: bounds.height + 'px',
15221         left: bounds.x + 'px',
15222         top: bounds.y + 'px',
15223         position: 'absolute',
15224         textAlign: 'center',
15225         boxSizing: 'border-box'
15226       }, style || {});
15227
15228       textarea.value = value;
15229       textarea.title = 'Press SHIFT+Enter for line feed';
15230
15231       domEvent.bind(textarea, 'keydown', this.keyHandler);
15232       domEvent.bind(textarea, 'mousedown', stopPropagation);
15233
15234       container.appendChild(textarea);
15235
15236       setTimeout(function() {
15237         if (textarea.parent) {
15238           textarea.select();
15239         }
15240         textarea.focus();
15241       }, 100);
15242     };
15243
15244     TextBox.prototype.destroy = function() {
15245       var textarea = this.textarea;
15246
15247       textarea.value = '';
15248
15249       domEvent.unbind(textarea, 'keydown', this.keyHandler);
15250       domEvent.unbind(textarea, 'mousedown', stopPropagation);
15251
15252       domRemove(textarea);
15253     };
15254
15255     TextBox.prototype.getValue = function() {
15256       return this.textarea.value;
15257     };
15258
15259   }, {
15260     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
15261     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js",
15262     "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"
15263   }],
15264   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\index.js": [function(require, module, exports) {
15265     'use strict';
15266
15267     var hat = require('hat');
15268
15269
15270     /**
15271      * Create a new id generator / cache instance.
15272      *
15273      * You may optionally provide a seed that is used internally.
15274      *
15275      * @param {Seed}
15276      *            seed
15277      */
15278     function Ids(seed) {
15279       seed = seed || [128, 36, 1];
15280       this._seed = seed.length ? hat.rack(seed[0], seed[1], seed[2]) : seed;
15281     }
15282
15283     module.exports = Ids;
15284
15285     /**
15286      * Generate a next id.
15287      *
15288      * @param {Object}
15289      *            [element] element to bind the id to
15290      *
15291      * @return {String} id
15292      */
15293     Ids.prototype.next = function(element) {
15294       return this._seed(element || true);
15295     };
15296
15297     /**
15298      * Generate a next id with a given prefix.
15299      *
15300      * @param {Object}
15301      *            [element] element to bind the id to
15302      *
15303      * @return {String} id
15304      */
15305     Ids.prototype.nextPrefixed = function(prefix, element) {
15306       var id;
15307
15308       do {
15309         id = prefix + this.next(true);
15310       } while (this.assigned(id));
15311
15312       // claim {prefix}{random}
15313       this.claim(id, element);
15314
15315       // return
15316       return id;
15317     };
15318
15319     /**
15320      * Manually claim an existing id.
15321      *
15322      * @param {String}
15323      *            id
15324      * @param {String}
15325      *            [element] element the id is claimed by
15326      */
15327     Ids.prototype.claim = function(id, element) {
15328       this._seed.set(id, element || true);
15329     };
15330
15331     /**
15332      * Returns true if the given id has already been assigned.
15333      *
15334      * @param {String}
15335      *            id
15336      * @return {Boolean}
15337      */
15338     Ids.prototype.assigned = function(id) {
15339       return this._seed.get(id) || false;
15340     };
15341   }, {
15342     "hat": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\node_modules\\hat\\index.js"
15343   }],
15344   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\node_modules\\hat\\index.js": [function(require, module, exports) {
15345     var hat = module.exports = function(bits, base) {
15346       if (!base) base = 16;
15347       if (bits === undefined) bits = 128;
15348       if (bits <= 0) return '0';
15349
15350       var digits = Math.log(Math.pow(2, bits)) / Math.log(base);
15351       for (var i = 2; digits === Infinity; i *= 2) {
15352         digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;
15353       }
15354
15355       var rem = digits - Math.floor(digits);
15356
15357       var res = '';
15358
15359       for (var i = 0; i < Math.floor(digits); i++) {
15360         var x = Math.floor(Math.random() * base).toString(base);
15361         res = x + res;
15362       }
15363
15364       if (rem) {
15365         var b = Math.pow(base, rem);
15366         var x = Math.floor(Math.random() * b).toString(base);
15367         res = x + res;
15368       }
15369
15370       var parsed = parseInt(res, base);
15371       if (parsed !== Infinity && parsed >= Math.pow(2, bits)) {
15372         return hat(bits, base)
15373       } else return res;
15374     };
15375
15376     hat.rack = function(bits, base, expandBy) {
15377       var fn = function(data) {
15378         var iters = 0;
15379         do {
15380           if (iters++ > 10) {
15381             if (expandBy) bits += expandBy;
15382             else throw new Error('too many ID collisions, use more bits')
15383           }
15384
15385           var id = hat(bits, base);
15386         } while (Object.hasOwnProperty.call(hats, id));
15387
15388         hats[id] = data;
15389         return id;
15390       };
15391       var hats = fn.hats = {};
15392
15393       fn.get = function(id) {
15394         return fn.hats[id];
15395       };
15396
15397       fn.set = function(id, value) {
15398         fn.hats[id] = value;
15399         return fn;
15400       };
15401
15402       fn.bits = bits || 128;
15403       fn.base = base || 16;
15404       return fn;
15405     };
15406
15407   }, {}],
15408   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js": [function(require, module, exports) {
15409     if (typeof Object.create === 'function') {
15410       // implementation from standard node.js 'util' module
15411       module.exports = function inherits(ctor, superCtor) {
15412         ctor.super_ = superCtor
15413         ctor.prototype = Object.create(superCtor.prototype, {
15414           constructor: {
15415             value: ctor,
15416             enumerable: false,
15417             writable: true,
15418             configurable: true
15419           }
15420         });
15421       };
15422     } else {
15423       // old school shim for old browsers
15424       module.exports = function inherits(ctor, superCtor) {
15425         ctor.super_ = superCtor
15426         var TempCtor = function() {}
15427         TempCtor.prototype = superCtor.prototype
15428         ctor.prototype = new TempCtor()
15429         ctor.prototype.constructor = ctor
15430       }
15431     }
15432
15433   }, {}],
15434   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js": [function(require, module, exports) {
15435     module.exports = require('domify');
15436   }, {
15437     "domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"
15438   }],
15439   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js": [function(require, module, exports) {
15440     module.exports = require('component-event');
15441   }, {
15442     "component-event": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
15443   }],
15444   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js": [function(require, module, exports) {
15445     module.exports = require('component-query');
15446   }, {
15447     "component-query": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
15448   }],
15449   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js": [function(require, module, exports) {
15450     module.exports = function(el) {
15451       el.parentNode && el.parentNode.removeChild(el);
15452     };
15453   }, {}],
15454   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js": [function(require, module, exports) {
15455     var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
15456       unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
15457       prefix = bind !== 'addEventListener' ? 'on' : '';
15458
15459     /**
15460      * Bind `el` event `type` to `fn`.
15461      *
15462      * @param {Element}
15463      *            el
15464      * @param {String}
15465      *            type
15466      * @param {Function}
15467      *            fn
15468      * @param {Boolean}
15469      *            capture
15470      * @return {Function}
15471      * @api public
15472      */
15473
15474     exports.bind = function(el, type, fn, capture) {
15475       el[bind](prefix + type, fn, capture || false);
15476       return fn;
15477     };
15478
15479     /**
15480      * Unbind `el` event `type`'s callback `fn`.
15481      *
15482      * @param {Element}
15483      *            el
15484      * @param {String}
15485      *            type
15486      * @param {Function}
15487      *            fn
15488      * @param {Boolean}
15489      *            capture
15490      * @return {Function}
15491      * @api public
15492      */
15493
15494     exports.unbind = function(el, type, fn, capture) {
15495       el[unbind](prefix + type, fn, capture || false);
15496       return fn;
15497     };
15498   }, {}],
15499   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js": [function(require, module, exports) {
15500     function one(selector, el) {
15501       return el.querySelector(selector);
15502     }
15503
15504     exports = module.exports = function(selector, el) {
15505       el = el || document;
15506       return one(selector, el);
15507     };
15508
15509     exports.all = function(selector, el) {
15510       el = el || document;
15511       return el.querySelectorAll(selector);
15512     };
15513
15514     exports.engine = function(obj) {
15515       if (!obj.one) throw new Error('.one callback required');
15516       if (!obj.all) throw new Error('.all callback required');
15517       one = obj.one;
15518       exports.all = obj.all;
15519       return exports;
15520     };
15521
15522   }, {}],
15523   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js": [function(require, module, exports) {
15524
15525     /**
15526      * Expose `parse`.
15527      */
15528
15529     module.exports = parse;
15530
15531     /**
15532      * Tests for browser support.
15533      */
15534
15535     var div = document.createElement('div');
15536     // Setup
15537     div.innerHTML = '  <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
15538     // Make sure that link elements get serialized correctly by innerHTML
15539     // This requires a wrapper element in IE
15540     var innerHTMLBug = !div.getElementsByTagName('link').length;
15541     div = undefined;
15542
15543     /**
15544      * Wrap map from jquery.
15545      */
15546
15547     var map = {
15548       legend: [1, '<fieldset>', '</fieldset>'],
15549       tr: [2, '<table><tbody>', '</tbody></table>'],
15550       col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
15551       // for script/link/style tags to work in IE6-8, you have to wrap
15552       // in a div with a non-whitespace character in front, ha!
15553       _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
15554     };
15555
15556     map.td =
15557       map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
15558
15559     map.option =
15560       map.optgroup = [1, '<select multiple="multiple">', '</select>'];
15561
15562     map.thead =
15563       map.tbody =
15564       map.colgroup =
15565       map.caption =
15566       map.tfoot = [1, '<table>', '</table>'];
15567
15568     map.polyline =
15569       map.ellipse =
15570       map.polygon =
15571       map.circle =
15572       map.text =
15573       map.line =
15574       map.path =
15575       map.rect =
15576       map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">', '</svg>'];
15577
15578     /**
15579      * Parse `html` and return a DOM Node instance, which could be a TextNode, HTML
15580      * DOM Node of some kind (<div> for example), or a DocumentFragment instance,
15581      * depending on the contents of the `html` string.
15582      *
15583      * @param {String}
15584      *            html - HTML string to "domify"
15585      * @param {Document}
15586      *            doc - The `document` instance to create the Node for
15587      * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
15588      * @api private
15589      */
15590
15591     function parse(html, doc) {
15592       if ('string' != typeof html) throw new TypeError('String expected');
15593
15594       // default to the global `document` object
15595       if (!doc) doc = document;
15596
15597       // tag name
15598       var m = /<([\w:]+)/.exec(html);
15599       if (!m) return doc.createTextNode(html);
15600
15601       html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing
15602       // whitespace
15603
15604       var tag = m[1];
15605
15606       // body support
15607       if (tag == 'body') {
15608         var el = doc.createElement('html');
15609         el.innerHTML = html;
15610         return el.removeChild(el.lastChild);
15611       }
15612
15613       // wrap map
15614       var wrap = map[tag] || map._default;
15615       var depth = wrap[0];
15616       var prefix = wrap[1];
15617       var suffix = wrap[2];
15618       var el = doc.createElement('div');
15619       el.innerHTML = prefix + html + suffix;
15620       while (depth--) el = el.lastChild;
15621
15622       // one element
15623       if (el.firstChild == el.lastChild) {
15624         return el.removeChild(el.firstChild);
15625       }
15626
15627       // several elements
15628       var fragment = doc.createDocumentFragment();
15629       while (el.firstChild) {
15630         fragment.appendChild(el.removeChild(el.firstChild));
15631       }
15632
15633       return fragment;
15634     }
15635
15636   }, {}],
15637   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js": [function(require, module, exports) {
15638     module.exports = require('./lib/refs');
15639
15640     module.exports.Collection = require('./lib/collection');
15641   }, {
15642     "./lib/collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js",
15643     "./lib/refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js"
15644   }],
15645   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js": [function(require, module, exports) {
15646     'use strict';
15647
15648     /**
15649      * An empty collection stub. Use {@link RefsCollection.extend} to extend a
15650      * collection with ref semantics.
15651      *
15652      * @classdesc A change and inverse-reference aware collection with set
15653      *            semantics.
15654      *
15655      * @class RefsCollection
15656      */
15657     function RefsCollection() {}
15658
15659     /**
15660      * Extends a collection with {@link Refs} aware methods
15661      *
15662      * @memberof RefsCollection
15663      * @static
15664      *
15665      * @param {Array
15666      *            <Object>} collection
15667      * @param {Refs}
15668      *            refs instance
15669      * @param {Object}
15670      *            property represented by the collection
15671      * @param {Object}
15672      *            target object the collection is attached to
15673      *
15674      * @return {RefsCollection<Object>} the extended array
15675      */
15676     function extend(collection, refs, property, target) {
15677
15678       var inverseProperty = property.inverse;
15679
15680       /**
15681        * Removes the given element from the array and returns it.
15682        *
15683        * @method RefsCollection#remove
15684        *
15685        * @param {Object}
15686        *            element the element to remove
15687        */
15688       collection.remove = function(element) {
15689         var idx = this.indexOf(element);
15690         if (idx !== -1) {
15691           this.splice(idx, 1);
15692
15693           // unset inverse
15694           refs.unset(element, inverseProperty, target);
15695         }
15696
15697         return element;
15698       };
15699
15700       /**
15701        * Returns true if the collection contains the given element
15702        *
15703        * @method RefsCollection#contains
15704        *
15705        * @param {Object}
15706        *            element the element to check for
15707        */
15708       collection.contains = function(element) {
15709         return this.indexOf(element) !== -1;
15710       };
15711
15712       /**
15713        * Adds an element to the array, unless it exists already (set semantics).
15714        *
15715        * @method RefsCollection#add
15716        *
15717        * @param {Object}
15718        *            element the element to add
15719        */
15720       collection.add = function(element) {
15721
15722         if (!this.contains(element)) {
15723           this.push(element);
15724
15725           // set inverse
15726           refs.set(element, inverseProperty, target);
15727         }
15728       };
15729
15730       return collection;
15731     }
15732
15733
15734     module.exports.extend = extend;
15735   }, {}],
15736   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js": [function(require, module, exports) {
15737     'use strict';
15738
15739     var Collection = require('./collection');
15740
15741     function hasOwnProperty(e, property) {
15742       return Object.prototype.hasOwnProperty.call(e, property.name || property);
15743     }
15744
15745
15746     function defineCollectionProperty(ref, property, target) {
15747       Object.defineProperty(target, property.name, {
15748         enumerable: property.enumerable,
15749         value: Collection.extend(target[property.name] || [], ref, property, target)
15750       });
15751     }
15752
15753
15754     function defineProperty(ref, property, target) {
15755
15756       var inverseProperty = property.inverse;
15757
15758       var _value = target[property.name];
15759
15760       Object.defineProperty(target, property.name, {
15761         enumerable: property.enumerable,
15762
15763         get: function() {
15764           return _value;
15765         },
15766
15767         set: function(value) {
15768
15769           // return if we already performed all changes
15770           if (value === _value) {
15771             return;
15772           }
15773
15774           var old = _value;
15775
15776           // temporary set null
15777           _value = null;
15778
15779           if (old) {
15780             ref.unset(old, inverseProperty, target);
15781           }
15782
15783           // set new value
15784           _value = value;
15785
15786           // set inverse value
15787           ref.set(_value, inverseProperty, target);
15788         }
15789       });
15790
15791     }
15792
15793     /**
15794      * Creates a new references object defining two inversly related attribute
15795      * descriptors a and b.
15796      *
15797      * <p>
15798      * When bound to an object using {@link Refs#bind} the references get activated
15799      * and ensure that add and remove operations are applied reversely, too.
15800      * </p>
15801      *
15802      * <p>
15803      * For attributes represented as collections {@link Refs} provides the
15804      * {@link RefsCollection#add}, {@link RefsCollection#remove} and
15805      * {@link RefsCollection#contains} extensions that must be used to properly hook
15806      * into the inverse change mechanism.
15807      * </p>
15808      *
15809      * @class Refs
15810      *
15811      * @classdesc A bi-directional reference between two attributes.
15812      *
15813      * @param {Refs.AttributeDescriptor}
15814      *            a property descriptor
15815      * @param {Refs.AttributeDescriptor}
15816      *            b property descriptor
15817      *
15818      * @example
15819      *
15820      * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, {
15821      * name: 'car' });
15822      *
15823      * var car = { name: 'toyota' }; var wheels = [{ pos: 'front-left' }, { pos:
15824      * 'front-right' }];
15825      *
15826      * refs.bind(car, 'wheels');
15827      *
15828      * car.wheels // [] car.wheels.add(wheels[0]); car.wheels.add(wheels[1]);
15829      *
15830      * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]
15831      *
15832      * wheels[0].car // { name: 'toyota' }; car.wheels.remove(wheels[0]);
15833      *
15834      * wheels[0].car // undefined
15835      */
15836     function Refs(a, b) {
15837
15838       if (!(this instanceof Refs)) {
15839         return new Refs(a, b);
15840       }
15841
15842       // link
15843       a.inverse = b;
15844       b.inverse = a;
15845
15846       this.props = {};
15847       this.props[a.name] = a;
15848       this.props[b.name] = b;
15849     }
15850
15851     /**
15852      * Binds one side of a bi-directional reference to a target object.
15853      *
15854      * @memberOf Refs
15855      *
15856      * @param {Object}
15857      *            target
15858      * @param {String}
15859      *            property
15860      */
15861     Refs.prototype.bind = function(target, property) {
15862       if (typeof property === 'string') {
15863         if (!this.props[property]) {
15864           throw new Error('no property <' + property + '> in ref');
15865         }
15866         property = this.props[property];
15867       }
15868
15869       if (property.collection) {
15870         defineCollectionProperty(this, property, target);
15871       } else {
15872         defineProperty(this, property, target);
15873       }
15874     };
15875
15876     Refs.prototype.ensureBound = function(target, property) {
15877       if (!hasOwnProperty(target, property)) {
15878         this.bind(target, property);
15879       }
15880     };
15881
15882     Refs.prototype.unset = function(target, property, value) {
15883
15884       if (target) {
15885         this.ensureBound(target, property);
15886
15887         if (property.collection) {
15888           target[property.name].remove(value);
15889         } else {
15890           target[property.name] = undefined;
15891         }
15892       }
15893     };
15894
15895     Refs.prototype.set = function(target, property, value) {
15896
15897       if (target) {
15898         this.ensureBound(target, property);
15899
15900         if (property.collection) {
15901           target[property.name].add(value);
15902         } else {
15903           target[property.name] = value;
15904         }
15905       }
15906     };
15907
15908     module.exports = Refs;
15909
15910
15911     /**
15912      * An attribute descriptor to be used specify an attribute in a {@link Refs}
15913      * instance
15914      *
15915      * @typedef {Object} Refs.AttributeDescriptor
15916      * @property {String} name
15917      * @property {boolean} [collection=false]
15918      * @property {boolean} [enumerable=false]
15919      */
15920   }, {
15921     "./collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js"
15922   }],
15923   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\index.js": [function(require, module, exports) {
15924     module.exports = require('./lib/Diagram');
15925   }, {
15926     "./lib/Diagram": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\Diagram.js"
15927   }],
15928   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\Diagram.js": [function(require, module, exports) {
15929     'use strict';
15930
15931     var di = require('didi');
15932
15933
15934     /**
15935      * Bootstrap an injector from a list of modules, instantiating a number of
15936      * default components
15937      *
15938      * @ignore
15939      * @param {Array
15940      *            <didi.Module>} bootstrapModules
15941      *
15942      * @return {didi.Injector} a injector to use to access the components
15943      */
15944     function bootstrap(bootstrapModules) {
15945
15946       var modules = [],
15947         components = [];
15948
15949       function hasModule(m) {
15950         return modules.indexOf(m) >= 0;
15951       }
15952
15953       function addModule(m) {
15954         modules.push(m);
15955       }
15956
15957       function visit(m) {
15958         if (hasModule(m)) {
15959           return;
15960         }
15961
15962         (m.__depends__ || []).forEach(visit);
15963
15964         if (hasModule(m)) {
15965           return;
15966         }
15967
15968         addModule(m);
15969
15970         (m.__init__ || []).forEach(function(c) {
15971           components.push(c);
15972         });
15973       }
15974
15975       bootstrapModules.forEach(visit);
15976
15977       var injector = new di.Injector(modules);
15978
15979       components.forEach(function(c) {
15980
15981         try {
15982           // eagerly resolve component (fn or string)
15983           injector[typeof c === 'string' ? 'get' : 'invoke'](c);
15984         } catch (e) {
15985           console.error('Failed to instantiate component');
15986           console.error(e.stack);
15987
15988           throw e;
15989         }
15990       });
15991
15992       return injector;
15993     }
15994
15995     /**
15996      * Creates an injector from passed options.
15997      *
15998      * @ignore
15999      * @param {Object}
16000      *            options
16001      * @return {didi.Injector}
16002      */
16003     function createInjector(options) {
16004
16005       options = options || {};
16006
16007       var configModule = {
16008         'config': ['value', options]
16009       };
16010
16011       var coreModule = require('./core');
16012
16013       var modules = [configModule, coreModule].concat(options.modules || []);
16014
16015       return bootstrap(modules);
16016     }
16017
16018
16019     /**
16020      * The main diagram-js entry point that bootstraps the diagram with the given
16021      * configuration.
16022      *
16023      * To register extensions with the diagram, pass them as Array<didi.Module> to
16024      * the constructor.
16025      *
16026      * @class djs.Diagram
16027      * @memberOf djs
16028      * @constructor
16029      *
16030      * @example
16031      *
16032      * <caption>Creating a plug-in that logs whenever a shape is added to the
16033      * canvas.</caption>
16034      *  // plug-in implemenentation function MyLoggingPlugin(eventBus) {
16035      * eventBus.on('shape.added', function(event) { console.log('shape ',
16036      * event.shape, ' was added to the diagram'); }); }
16037      *  // export as module module.exports = { __init__: [ 'myLoggingPlugin' ],
16038      * myLoggingPlugin: [ 'type', MyLoggingPlugin ] };
16039      *
16040      *  // instantiate the diagram with the new plug-in
16041      *
16042      * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ]
16043      * });
16044      *
16045      * diagram.invoke([ 'canvas', function(canvas) { // add shape to drawing canvas
16046      * canvas.addShape({ x: 10, y: 10 }); });
16047      *  // 'shape ... was added to the diagram' logged to console
16048      *
16049      * @param {Object}
16050      *            options
16051      * @param {Array
16052      *            <didi.Module>} [options.modules] external modules to instantiate
16053      *            with the diagram
16054      * @param {didi.Injector}
16055      *            [injector] an (optional) injector to bootstrap the diagram with
16056      */
16057     function Diagram(options, injector) {
16058
16059       // create injector unless explicitly specified
16060       this.injector = injector = injector || createInjector(options);
16061
16062       // API
16063
16064       /**
16065        * Resolves a diagram service
16066        *
16067        * @method Diagram#get
16068        *
16069        * @param {String}
16070        *            name the name of the diagram service to be retrieved
16071        * @param {Object}
16072        *            [locals] a number of locals to use to resolve certain
16073        *            dependencies
16074        */
16075       this.get = injector.get;
16076
16077       /**
16078        * Executes a function into which diagram services are injected
16079        *
16080        * @method Diagram#invoke
16081        *
16082        * @param {Function|Object[]}
16083        *            fn the function to resolve
16084        * @param {Object}
16085        *            locals a number of locals to use to resolve certain
16086        *            dependencies
16087        */
16088       this.invoke = injector.invoke;
16089
16090       // init
16091
16092       // indicate via event
16093
16094
16095       /**
16096        * An event indicating that all plug-ins are loaded.
16097        *
16098        * Use this event to fire other events to interested plug-ins
16099        *
16100        * @memberOf Diagram
16101        *
16102        * @event diagram.init
16103        *
16104        * @example
16105        *
16106        * eventBus.on('diagram.init', function() { eventBus.fire('my-custom-event', {
16107        * foo: 'BAR' }); });
16108        *
16109        * @type {Object}
16110        */
16111       this.get('eventBus').fire('diagram.init');
16112     }
16113
16114     module.exports = Diagram;
16115
16116
16117     /**
16118      * Destroys the diagram
16119      *
16120      * @method Diagram#destroy
16121      */
16122     Diagram.prototype.destroy = function() {
16123       this.get('eventBus').fire('diagram.destroy');
16124     };
16125   }, {
16126     "./core": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js",
16127     "didi": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\index.js"
16128   }],
16129   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js": [function(require, module, exports) {
16130     'use strict';
16131
16132     var forEach = require('lodash/collection/forEach'),
16133       isFunction = require('lodash/lang/isFunction'),
16134       isArray = require('lodash/lang/isArray');
16135
16136
16137     /**
16138      * A utility that can be used to plug-in into the command execution for
16139      * extension and/or validation.
16140      *
16141      * @param {EventBus}
16142      *            eventBus
16143      *
16144      * @example
16145      *
16146      * var inherits = require('inherits');
16147      *
16148      * var CommandInterceptor =
16149      * require('diagram-js/lib/command/CommandInterceptor');
16150      *
16151      * function CommandLogger(eventBus) { CommandInterceptor.call(this, eventBus);
16152      *
16153      * this.preExecute(function(event) { console.log('command pre-execute', event);
16154      * }); }
16155      *
16156      * inherits(CommandLogger, CommandInterceptor);
16157      *
16158      */
16159     function CommandInterceptor(eventBus) {
16160       this._eventBus = eventBus;
16161     }
16162
16163     CommandInterceptor.$inject = ['eventBus'];
16164
16165     module.exports = CommandInterceptor;
16166
16167     function unwrapEvent(fn) {
16168       return function(event) {
16169         return fn(event.context, event.command, event);
16170       };
16171     }
16172
16173     /**
16174      * Register an interceptor for a command execution
16175      *
16176      * @param {String|Array
16177      *            <String>} [events] list of commands to register on
16178      * @param {String}
16179      *            [hook] command hook, i.e. preExecute, executed to listen on
16180      * @param {Function}
16181      *            handlerFn interceptor to be invoked with (event)
16182      * @param {Boolean}
16183      *            unwrap if true, unwrap the event and pass (context, command,
16184      *            event) to the listener instead
16185      */
16186     CommandInterceptor.prototype.on = function(events, hook, handlerFn, unwrap) {
16187
16188       if (isFunction(hook)) {
16189         unwrap = handlerFn;
16190         handlerFn = hook;
16191         hook = null;
16192       }
16193
16194       if (!isFunction(handlerFn)) {
16195         throw new Error('handlerFn must be a function');
16196       }
16197
16198       if (!isArray(events)) {
16199         events = [events];
16200       }
16201
16202       var eventBus = this._eventBus;
16203
16204       forEach(events, function(event) {
16205         // concat commandStack(.event)?(.hook)?
16206         var fullEvent = ['commandStack', event, hook].filter(function(e) {
16207           return e;
16208         }).join('.');
16209
16210         eventBus.on(fullEvent, unwrap ? unwrapEvent(handlerFn) : handlerFn);
16211       });
16212     };
16213
16214
16215     var hooks = [
16216       'canExecute',
16217       'preExecute',
16218       'execute',
16219       'executed',
16220       'postExecute',
16221       'revert',
16222       'reverted'
16223     ];
16224
16225     /*
16226      * Install hook shortcuts
16227      *
16228      * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
16229      * which will in term forward to CommandInterceptor#on.
16230      */
16231     forEach(hooks, function(hook) {
16232       CommandInterceptor.prototype[hook] = function(events, fn, unwrap) {
16233         if (isFunction(events)) {
16234           unwrap = fn;
16235           fn = events;
16236           events = null;
16237         }
16238
16239         this.on(events, hook, fn, unwrap);
16240       };
16241     });
16242   }, {
16243     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
16244     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
16245     "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js"
16246   }],
16247   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandStack.js": [function(require, module, exports) {
16248     'use strict';
16249
16250     var unique = require('lodash/array/unique'),
16251       isArray = require('lodash/lang/isArray'),
16252       assign = require('lodash/object/assign');
16253
16254     var InternalEvent = require('../core/EventBus').Event;
16255
16256
16257     /**
16258      * A service that offers un- and redoable execution of commands.
16259      *
16260      * The command stack is responsible for executing modeling actions in a un- and
16261      * redoable manner. To do this it delegates the actual command execution to
16262      * {@link CommandHandler}s.
16263      *
16264      * Command handlers provide {@link CommandHandler#execute(ctx)} and
16265      * {@link CommandHandler#revert(ctx)} methods to un- and redo a command
16266      * identified by a command context.
16267      *
16268      *  ## Life-Cycle events
16269      *
16270      * In the process the command stack fires a number of life-cycle events that
16271      * other components to participate in the command execution.
16272      *  * preExecute * execute * executed * postExecute * revert * reverted
16273      *
16274      * A special event is used for validating, whether a command can be performed
16275      * prior to its execution.
16276      *  * canExecute
16277      *
16278      * Each of the events is fired as `commandStack.{eventName}` and
16279      * `commandStack.{commandName}.{eventName}`, respectively. This gives components
16280      * fine grained control on where to hook into.
16281      *
16282      * The event object fired transports `command`, the name of the command and
16283      * `context`, the command context.
16284      *
16285      *  ## Creating Command Handlers
16286      *
16287      * Command handlers should provide the {@link CommandHandler#execute(ctx)} and
16288      * {@link CommandHandler#revert(ctx)} methods to implement redoing and undoing
16289      * of a command. They must ensure undo is performed properly in order not to
16290      * break the undo chain.
16291      *
16292      * Command handlers may execute other modeling operations (and thus commands) in
16293      * their `preExecute` and `postExecute` phases. The command stack will properly
16294      * group all commands together into a logical unit that may be re- and undone
16295      * atomically.
16296      *
16297      * Command handlers must not execute other commands from within their core
16298      * implementation (`execute`, `revert`).
16299      *
16300      *  ## Change Tracking
16301      *
16302      * During the execution of the CommandStack it will keep track of all elements
16303      * that have been touched during the command's execution.
16304      *
16305      * At the end of the CommandStack execution it will notify interested components
16306      * via an 'elements.changed' event with all the dirty elements.
16307      *
16308      * The event can be picked up by components that are interested in the fact that
16309      * elements have been changed. One use case for this is updating their graphical
16310      * representation after moving / resizing or deletion.
16311      *
16312      *
16313      * @param {EventBus}
16314      *            eventBus
16315      * @param {Injector}
16316      *            injector
16317      */
16318     function CommandStack(eventBus, injector) {
16319       /**
16320        * A map of all registered command handlers.
16321        *
16322        * @type {Object}
16323        */
16324       this._handlerMap = {};
16325
16326       /**
16327        * A stack containing all re/undoable actions on the diagram
16328        *
16329        * @type {Array<Object>}
16330        */
16331       this._stack = [];
16332
16333       /**
16334        * The current index on the stack
16335        *
16336        * @type {Number}
16337        */
16338       this._stackIdx = -1;
16339
16340       /**
16341        * Current active commandStack execution
16342        *
16343        * @type {Object}
16344        */
16345       this._currentExecution = {
16346         actions: [],
16347         dirty: []
16348       };
16349
16350
16351       this._injector = injector;
16352       this._eventBus = eventBus;
16353
16354       this._uid = 1;
16355       this._selectedModel = selected_model;
16356
16357       commandStackList.push(this);
16358     }
16359
16360     CommandStack.$inject = ['eventBus', 'injector'];
16361
16362     module.exports = CommandStack;
16363
16364
16365     /**
16366      * Execute a command
16367      *
16368      * @param {String}
16369      *            command the command to execute
16370      * @param {Object}
16371      *            context the environment to execute the command in
16372      */
16373     CommandStack.prototype.execute = function(command, context) {
16374       if (!command) {
16375         throw new Error('command required');
16376       }
16377
16378       var action = {
16379         command: command,
16380         context: context
16381       };
16382
16383       this._pushAction(action);
16384       this._internalExecute(action);
16385       this._popAction(action);
16386     };
16387
16388
16389     /**
16390      * Ask whether a given command can be executed.
16391      *
16392      * Implementors may hook into the mechanism on two ways:
16393      *  * in event listeners:
16394      *
16395      * Users may prevent the execution via an event listener. It must prevent the
16396      * default action for `commandStack.(<command>.)canExecute` events.
16397      *  * in command handlers:
16398      *
16399      * If the method {@link CommandHandler#canExecute} is implemented in a handler
16400      * it will be called to figure out whether the execution is allowed.
16401      *
16402      * @param {String}
16403      *            command the command to execute
16404      * @param {Object}
16405      *            context the environment to execute the command in
16406      *
16407      * @return {Boolean} true if the command can be executed
16408      */
16409     CommandStack.prototype.canExecute = function(command, context) {
16410
16411       var action = {
16412         command: command,
16413         context: context
16414       };
16415
16416       var handler = this._getHandler(command);
16417
16418       if (!handler) {
16419         return false;
16420       }
16421
16422       var result = this._fire(command, 'canExecute', action);
16423
16424       // handler#canExecute will only be called if no listener
16425       // decided on a result already
16426       if (result === undefined && handler.canExecute) {
16427         result = handler.canExecute(context);
16428       }
16429
16430       return result;
16431     };
16432
16433
16434     /**
16435      * Clear the command stack, erasing all undo / redo history
16436      */
16437     CommandStack.prototype.clear = function() {
16438       this._stack.length = 0;
16439       this._stackIdx = -1;
16440
16441       this._fire('changed');
16442     };
16443
16444
16445     /**
16446      * Undo last command(s)
16447      */
16448     CommandStack.prototype.undo = function() {
16449       var action = this._getUndoAction(),
16450         next;
16451       if (action) {
16452         this._pushAction(action);
16453
16454         while (action) {
16455           this._internalUndo(action);
16456           next = this._getUndoAction();
16457
16458           if (!next || next.id !== action.id) {
16459             break;
16460           }
16461
16462           action = next;
16463         }
16464
16465         this._popAction();
16466       }
16467     };
16468
16469
16470     /**
16471      * Redo last command(s)
16472      */
16473     CommandStack.prototype.redo = function() {
16474       var action = this._getRedoAction(),
16475         next;
16476
16477       if (action) {
16478         this._pushAction(action);
16479
16480         while (action) {
16481           this._internalExecute(action, true);
16482           next = this._getRedoAction();
16483
16484           if (!next || next.id !== action.id) {
16485             break;
16486           }
16487
16488           action = next;
16489         }
16490
16491         this._popAction();
16492       }
16493     };
16494
16495
16496     /**
16497      * Register a handler instance with the command stack
16498      *
16499      * @param {String}
16500      *            command
16501      * @param {CommandHandler}
16502      *            handler
16503      */
16504     CommandStack.prototype.register = function(command, handler) {
16505       this._setHandler(command, handler);
16506     };
16507
16508
16509     /**
16510      * Register a handler type with the command stack by instantiating it and
16511      * injecting its dependencies.
16512      *
16513      * @param {String}
16514      *            command
16515      * @param {Function}
16516      *            a constructor for a {@link CommandHandler}
16517      */
16518     CommandStack.prototype.registerHandler = function(command, handlerCls) {
16519
16520       if (!command || !handlerCls) {
16521         throw new Error('command and handlerCls must be defined');
16522       }
16523
16524       var handler = this._injector.instantiate(handlerCls);
16525       this.register(command, handler);
16526     };
16527
16528     CommandStack.prototype.canUndo = function() {
16529       return !!this._getUndoAction();
16530     };
16531
16532     CommandStack.prototype.canRedo = function() {
16533       return !!this._getRedoAction();
16534     };
16535
16536     // //// stack access //////////////////////////////////////
16537
16538     CommandStack.prototype._getRedoAction = function() {
16539       return this._stack[this._stackIdx + 1];
16540     };
16541
16542
16543     CommandStack.prototype._getUndoAction = function() {
16544       return this._stack[this._stackIdx];
16545     };
16546
16547
16548     // //// internal functionality /////////////////////////////
16549
16550     CommandStack.prototype._internalUndo = function(action) {
16551       var command = action.command,
16552         context = action.context;
16553
16554       var handler = this._getHandler(command);
16555
16556       this._fire(command, 'revert', action);
16557
16558       this._markDirty(handler.revert(context));
16559
16560       this._revertedAction(action);
16561
16562       this._fire(command, 'reverted', action);
16563     };
16564
16565
16566     CommandStack.prototype._fire = function(command, qualifier, event) {
16567       if (arguments.length < 3) {
16568         event = qualifier;
16569         qualifier = null;
16570       }
16571
16572       var names = qualifier ? [command + '.' + qualifier, qualifier] : [command],
16573         i, name, result;
16574
16575       event = assign(new InternalEvent(), event);
16576
16577       for (i = 0; !!(name = names[i]); i++) {
16578         result = this._eventBus.fire('commandStack.' + name, event);
16579
16580         if (event.cancelBubble) {
16581           break;
16582         }
16583       }
16584
16585       return result;
16586     };
16587
16588     CommandStack.prototype._createId = function() {
16589       return this._uid++;
16590     };
16591
16592
16593     CommandStack.prototype._internalExecute = function(action, redo) {
16594       var command = action.command,
16595         context = action.context;
16596
16597       var handler = this._getHandler(command);
16598
16599       if (!handler) {
16600         throw new Error('no command handler registered for <' + command + '>');
16601       }
16602
16603       this._pushAction(action);
16604
16605       if (!redo) {
16606         this._fire(command, 'preExecute', action);
16607
16608         if (handler.preExecute) {
16609           handler.preExecute(context);
16610         }
16611       }
16612
16613       this._fire(command, 'execute', action);
16614
16615       // execute
16616       this._markDirty(handler.execute(context));
16617
16618       // log to stack
16619       this._executedAction(action, redo);
16620
16621       this._fire(command, 'executed', action);
16622
16623       if (!redo) {
16624         if (handler.postExecute) {
16625           handler.postExecute(context);
16626         }
16627
16628         this._fire(command, 'postExecute', action);
16629       }
16630
16631       this._popAction(action);
16632     };
16633
16634
16635     CommandStack.prototype._pushAction = function(action) {
16636
16637       var execution = this._currentExecution,
16638         actions = execution.actions;
16639
16640       var baseAction = actions[0];
16641
16642       if (!action.id) {
16643         action.id = (baseAction && baseAction.id) || this._createId();
16644       }
16645
16646       actions.push(action);
16647     };
16648
16649
16650     CommandStack.prototype._popAction = function() {
16651       var execution = this._currentExecution,
16652         actions = execution.actions,
16653         dirty = execution.dirty;
16654
16655       actions.pop();
16656
16657       if (!actions.length) {
16658         this._eventBus.fire('elements.changed', {
16659           elements: unique(dirty)
16660         });
16661
16662         dirty.length = 0;
16663
16664         this._fire('changed');
16665       }
16666     };
16667
16668
16669     CommandStack.prototype._markDirty = function(elements) {
16670       var execution = this._currentExecution;
16671
16672       if (!elements) {
16673         return;
16674       }
16675
16676       elements = isArray(elements) ? elements : [elements];
16677
16678       execution.dirty = execution.dirty.concat(elements);
16679     };
16680
16681
16682     CommandStack.prototype._executedAction = function(action, redo) {
16683       var stackIdx = ++this._stackIdx;
16684
16685       if (!redo) {
16686         this._stack.splice(stackIdx, this._stack.length, action);
16687       }
16688     };
16689
16690
16691     CommandStack.prototype._revertedAction = function(action) {
16692       this._stackIdx--;
16693     };
16694
16695
16696     CommandStack.prototype._getHandler = function(command) {
16697       return this._handlerMap[command];
16698     };
16699
16700     CommandStack.prototype._setHandler = function(command, handler) {
16701       if (!command || !handler) {
16702         throw new Error('command and handler required');
16703       }
16704
16705       if (this._handlerMap[command]) {
16706         throw new Error('overriding handler for command <' + command + '>');
16707       }
16708
16709       this._handlerMap[command] = handler;
16710     };
16711
16712   }, {
16713     "../core/EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
16714     "lodash/array/unique": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\unique.js",
16715     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
16716     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
16717   }],
16718   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js": [function(require, module, exports) {
16719     module.exports = {
16720       __depends__: [require('../core')],
16721       commandStack: ['type', require('./CommandStack')]
16722     };
16723   }, {
16724     "../core": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js",
16725     "./CommandStack": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandStack.js"
16726   }],
16727   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\Canvas.js": [function(require, module, exports) {
16728     'use strict';
16729
16730     var isNumber = require('lodash/lang/isNumber'),
16731       assign = require('lodash/object/assign'),
16732       forEach = require('lodash/collection/forEach');
16733
16734     var Collections = require('../util/Collections');
16735
16736     var Snap = require('../../vendor/snapsvg');
16737
16738     function round(number, resolution) {
16739       return Math.round(number * resolution) / resolution;
16740     }
16741
16742     function ensurePx(number) {
16743       return isNumber(number) ? number + 'px' : number;
16744     }
16745
16746     /**
16747      * Creates a HTML container element for a SVG element with the given
16748      * configuration
16749      *
16750      * @param {Object}
16751      *            options
16752      * @return {HTMLElement} the container element
16753      */
16754     function createContainer(options) {
16755
16756       options = assign({}, {
16757         width: '100%',
16758         height: '100%'
16759       }, options);
16760
16761       var container = options.container || document.body;
16762
16763       // create a <div> around the svg element with the respective size
16764       // this way we can always get the correct container size
16765       // (this is impossible for <svg> elements at the moment)
16766       var parent = document.createElement('div');
16767       parent.setAttribute('class', 'djs-container');
16768
16769       assign(parent.style, {
16770         position: 'relative',
16771         overflow: 'hidden',
16772         width: ensurePx(options.width),
16773         height: ensurePx(options.height)
16774       });
16775
16776       container.appendChild(parent);
16777
16778       return parent;
16779     }
16780
16781     function createGroup(parent, cls) {
16782       return parent.group().attr({
16783         'class': cls
16784       });
16785     }
16786
16787     var BASE_LAYER = 'base';
16788
16789
16790     /**
16791      * The main drawing canvas.
16792      *
16793      * @class
16794      * @constructor
16795      *
16796      * @emits Canvas#canvas.init
16797      *
16798      * @param {Object}
16799      *            config
16800      * @param {EventBus}
16801      *            eventBus
16802      * @param {GraphicsFactory}
16803      *            graphicsFactory
16804      * @param {ElementRegistry}
16805      *            elementRegistry
16806      */
16807     function Canvas(config, eventBus, graphicsFactory, elementRegistry) {
16808       this._eventBus = eventBus;
16809       this._elementRegistry = elementRegistry;
16810       this._graphicsFactory = graphicsFactory;
16811
16812       this._init(config || {});
16813     }
16814
16815     Canvas.$inject = ['config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry'];
16816
16817     module.exports = Canvas;
16818
16819
16820     Canvas.prototype._init = function(config) {
16821
16822       // Creates a <svg> element that is wrapped into a <div>.
16823       // This way we are always able to correctly figure out the size of the svg
16824       // element
16825       // by querying the parent node.
16826       //
16827       // (It is not possible to get the size of a svg element cross browser @
16828       // 2014-04-01)
16829       //
16830       // <div class="djs-container" style="width: {desired-width}, height:
16831       // {desired-height}">
16832       // <svg width="100%" height="100%">
16833       // ...
16834       // </svg>
16835       // </div>
16836
16837       // html container
16838       var eventBus = this._eventBus,
16839
16840         container = createContainer(config),
16841         svg = Snap.createSnapAt('100%', '100%', container),
16842         viewport = createGroup(svg, 'viewport'),
16843
16844         self = this;
16845
16846       this._container = container;
16847       this._svg = svg;
16848       this._viewport = viewport;
16849       this._layers = {};
16850
16851       eventBus.on('diagram.init', function(event) {
16852
16853         /**
16854          * An event indicating that the canvas is ready to be drawn on.
16855          *
16856          * @memberOf Canvas
16857          *
16858          * @event canvas.init
16859          *
16860          * @type {Object}
16861          * @property {Snap<SVGSVGElement>} svg the created svg element
16862          * @property {Snap<SVGGroup>} viewport the direct parent of diagram
16863          *           elements and shapes
16864          */
16865         eventBus.fire('canvas.init', {
16866           svg: svg,
16867           viewport: viewport
16868         });
16869       });
16870
16871       eventBus.on('diagram.destroy', function() {
16872
16873         var parent = self._container.parentNode;
16874
16875         if (parent) {
16876           parent.removeChild(container);
16877         }
16878
16879         eventBus.fire('canvas.destroy', {
16880           svg: self._svg,
16881           viewport: self._viewport
16882         });
16883
16884         self._svg.remove();
16885
16886         self._svg = self._container = self._layers = self._viewport = null;
16887       });
16888
16889     };
16890
16891     /**
16892      * Returns the default layer on which all elements are drawn.
16893      *
16894      * @returns {Snap<SVGGroup>}
16895      */
16896     Canvas.prototype.getDefaultLayer = function() {
16897       return this.getLayer(BASE_LAYER);
16898     };
16899
16900     /**
16901      * Returns a layer that is used to draw elements or annotations on it.
16902      *
16903      * @param {String}
16904      *            name
16905      *
16906      * @returns {Snap<SVGGroup>}
16907      */
16908     Canvas.prototype.getLayer = function(name) {
16909
16910       if (!name) {
16911         throw new Error('must specify a name');
16912       }
16913
16914       var layer = this._layers[name];
16915       if (!layer) {
16916         layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);
16917       }
16918
16919       return layer;
16920     };
16921
16922
16923     /**
16924      * Returns the html element that encloses the drawing canvas.
16925      *
16926      * @return {DOMNode}
16927      */
16928     Canvas.prototype.getContainer = function() {
16929       return this._container;
16930     };
16931
16932
16933     // ///////////// markers ///////////////////////////////////
16934
16935     Canvas.prototype._updateMarker = function(element, marker, add) {
16936       var container;
16937
16938       if (!element.id) {
16939         element = this._elementRegistry.get(element);
16940       }
16941
16942       // we need to access all
16943       container = this._elementRegistry._elements[element.id];
16944
16945       if (!container) {
16946         return;
16947       }
16948
16949       forEach([container.gfx, container.secondaryGfx], function(gfx) {
16950         if (gfx) {
16951           // invoke either addClass or removeClass based on mode
16952           gfx[add ? 'addClass' : 'removeClass'](marker);
16953         }
16954       });
16955
16956       /**
16957        * An event indicating that a marker has been updated for an element
16958        *
16959        * @event element.marker.update
16960        * @type {Object}
16961        * @property {djs.model.Element} element the shape
16962        * @property {Object} gfx the graphical representation of the shape
16963        * @property {String} marker
16964        * @property {Boolean} add true if the marker was added, false if it got
16965        *           removed
16966        */
16967       this._eventBus.fire('element.marker.update', {
16968         element: element,
16969         gfx: container.gfx,
16970         marker: marker,
16971         add: !!add
16972       });
16973     };
16974
16975
16976     /**
16977      * Adds a marker to an element (basically a css class).
16978      *
16979      * Fires the element.marker.update event, making it possible to integrate
16980      * extension into the marker life-cycle, too.
16981      *
16982      * @example canvas.addMarker('foo', 'some-marker');
16983      *
16984      * var fooGfx = canvas.getGraphics('foo');
16985      *
16986      * fooGfx; // <g class="... some-marker"> ... </g>
16987      *
16988      * @param {String|djs.model.Base}
16989      *            element
16990      * @param {String}
16991      *            marker
16992      */
16993     Canvas.prototype.addMarker = function(element, marker) {
16994       this._updateMarker(element, marker, true);
16995     };
16996
16997
16998     /**
16999      * Remove a marker from an element.
17000      *
17001      * Fires the element.marker.update event, making it possible to integrate
17002      * extension into the marker life-cycle, too.
17003      *
17004      * @param {String|djs.model.Base}
17005      *            element
17006      * @param {String}
17007      *            marker
17008      */
17009     Canvas.prototype.removeMarker = function(element, marker) {
17010       this._updateMarker(element, marker, false);
17011     };
17012
17013     /**
17014      * Check the existence of a marker on element.
17015      *
17016      * @param {String|djs.model.Base}
17017      *            element
17018      * @param {String}
17019      *            marker
17020      */
17021     Canvas.prototype.hasMarker = function(element, marker) {
17022       if (!element.id) {
17023         element = this._elementRegistry.get(element);
17024       }
17025
17026       var gfx = this.getGraphics(element);
17027
17028       return gfx && gfx.hasClass(marker);
17029     };
17030
17031     /**
17032      * Toggles a marker on an element.
17033      *
17034      * Fires the element.marker.update event, making it possible to integrate
17035      * extension into the marker life-cycle, too.
17036      *
17037      * @param {String|djs.model.Base}
17038      *            element
17039      * @param {String}
17040      *            marker
17041      */
17042     Canvas.prototype.toggleMarker = function(element, marker) {
17043       if (this.hasMarker(element, marker)) {
17044         this.removeMarker(element, marker);
17045       } else {
17046         this.addMarker(element, marker);
17047       }
17048     };
17049
17050     Canvas.prototype.getRootElement = function() {
17051       if (!this._rootElement) {
17052         this.setRootElement({
17053           id: '__implicitroot'
17054         });
17055       }
17056
17057       return this._rootElement;
17058     };
17059
17060
17061
17062     // ////////////// root element handling ///////////////////////////
17063
17064     /**
17065      * Sets a given element as the new root element for the canvas and returns the
17066      * new root element.
17067      *
17068      * @param {Object|djs.model.Root}
17069      *            element
17070      * @param {Boolean}
17071      *            [override] whether to override the current root element, if any
17072      *
17073      * @return {Object|djs.model.Root} new root element
17074      */
17075     Canvas.prototype.setRootElement = function(element, override) {
17076
17077       this._ensureValidId(element);
17078
17079       var oldRoot = this._rootElement,
17080         elementRegistry = this._elementRegistry,
17081         eventBus = this._eventBus;
17082
17083       if (oldRoot) {
17084         if (!override) {
17085           throw new Error('rootElement already set, need to specify override');
17086         }
17087
17088         // simulate element remove event sequence
17089         eventBus.fire('root.remove', {
17090           element: oldRoot
17091         });
17092         eventBus.fire('root.removed', {
17093           element: oldRoot
17094         });
17095
17096         elementRegistry.remove(oldRoot);
17097       }
17098
17099       var gfx = this.getDefaultLayer();
17100
17101       // resemble element add event sequence
17102       eventBus.fire('root.add', {
17103         element: element
17104       });
17105
17106       elementRegistry.add(element, gfx, this._svg);
17107
17108       eventBus.fire('root.added', {
17109         element: element,
17110         gfx: gfx
17111       });
17112
17113       this._rootElement = element;
17114
17115       return element;
17116     };
17117
17118
17119
17120     // /////////// add functionality ///////////////////////////////
17121
17122     Canvas.prototype._ensureValidId = function(element) {
17123       if (!element.id) {
17124         throw new Error('element must have an id');
17125       }
17126
17127       if (this._elementRegistry.get(element.id)) {
17128         throw new Error('element with id ' + element.id + ' already exists');
17129       }
17130     };
17131
17132     Canvas.prototype._setParent = function(element, parent) {
17133       Collections.add(parent.children, element);
17134       element.parent = parent;
17135     };
17136
17137     /**
17138      * Adds an element to the canvas.
17139      *
17140      * This wires the parent <-> child relationship between the element and a
17141      * explicitly specified parent or an implicit root element.
17142      *
17143      * During add it emits the events
17144      *  * <{type}.add> (element, parent) * <{type}.added> (element, gfx)
17145      *
17146      * Extensions may hook into these events to perform their magic.
17147      *
17148      * @param {String}
17149      *            type
17150      * @param {Object|djs.model.Base}
17151      *            element
17152      * @param {Object|djs.model.Base}
17153      *            [parent]
17154      *
17155      * @return {Object|djs.model.Base} the added element
17156      */
17157     Canvas.prototype._addElement = function(type, element, parent) {
17158
17159       parent = parent || this.getRootElement();
17160
17161       var eventBus = this._eventBus,
17162         graphicsFactory = this._graphicsFactory;
17163
17164       this._ensureValidId(element);
17165
17166       eventBus.fire(type + '.add', {
17167         element: element,
17168         parent: parent
17169       });
17170
17171       this._setParent(element, parent);
17172
17173       // create graphics
17174       var gfx = graphicsFactory.create(type, element);
17175
17176       this._elementRegistry.add(element, gfx);
17177
17178       // update its visual
17179       graphicsFactory.update(type, element, gfx);
17180
17181       eventBus.fire(type + '.added', {
17182         element: element,
17183         gfx: gfx
17184       });
17185
17186       return element;
17187     };
17188
17189     /**
17190      * Adds a shape to the canvas
17191      *
17192      * @param {Object|djs.model.Shape}
17193      *            shape to add to the diagram
17194      * @param {djs.model.Base}
17195      *            [parent]
17196      *
17197      * @return {djs.model.Shape} the added shape
17198      */
17199     Canvas.prototype.addShape = function(shape, parent) {
17200       return this._addElement('shape', shape, parent);
17201     };
17202
17203     /**
17204      * Adds a connection to the canvas
17205      *
17206      * @param {Object|djs.model.Connection}
17207      *            connection to add to the diagram
17208      * @param {djs.model.Base}
17209      *            [parent]
17210      *
17211      * @return {djs.model.Connection} the added connection
17212      */
17213     Canvas.prototype.addConnection = function(connection, parent) {
17214       return this._addElement('connection', connection, parent);
17215     };
17216
17217
17218     /**
17219      * Internal remove element
17220      */
17221     Canvas.prototype._removeElement = function(element, type) {
17222       console.log(element);
17223       var elementRegistry = this._elementRegistry,
17224         graphicsFactory = this._graphicsFactory,
17225         eventBus = this._eventBus;
17226
17227       element = elementRegistry.get(element.id || element);
17228
17229       if (!element) {
17230         // element was removed already
17231         return;
17232       }
17233
17234       eventBus.fire(type + '.remove', {
17235         element: element
17236       });
17237
17238       graphicsFactory.remove(element);
17239
17240       // unset parent <-> child relationship
17241       Collections.remove(element.parent && element.parent.children, element);
17242       element.parent = null;
17243
17244       eventBus.fire(type + '.removed', {
17245         element: element
17246       });
17247
17248       elementRegistry.remove(element);
17249
17250       return element;
17251     };
17252
17253
17254     /**
17255      * Removes a shape from the canvas
17256      *
17257      * @param {String|djs.model.Shape}
17258      *            shape or shape id to be removed
17259      *
17260      * @return {djs.model.Shape} the removed shape
17261      */
17262     Canvas.prototype.removeShape = function(shape) {
17263
17264       /**
17265        * An event indicating that a shape is about to be removed from the canvas.
17266        *
17267        * @memberOf Canvas
17268        *
17269        * @event shape.remove
17270        * @type {Object}
17271        * @property {djs.model.Shape} element the shape descriptor
17272        * @property {Object} gfx the graphical representation of the shape
17273        */
17274
17275       /**
17276        * An event indicating that a shape has been removed from the canvas.
17277        *
17278        * @memberOf Canvas
17279        *
17280        * @event shape.removed
17281        * @type {Object}
17282        * @property {djs.model.Shape} element the shape descriptor
17283        * @property {Object} gfx the graphical representation of the shape
17284        */
17285       return this._removeElement(shape, 'shape');
17286     };
17287
17288
17289     /**
17290      * Removes a connection from the canvas
17291      *
17292      * @param {String|djs.model.Connection}
17293      *            connection or connection id to be removed
17294      *
17295      * @return {djs.model.Connection} the removed connection
17296      */
17297     Canvas.prototype.removeConnection = function(connection) {
17298
17299       /**
17300        * An event indicating that a connection is about to be removed from the
17301        * canvas.
17302        *
17303        * @memberOf Canvas
17304        *
17305        * @event connection.remove
17306        * @type {Object}
17307        * @property {djs.model.Connection} element the connection descriptor
17308        * @property {Object} gfx the graphical representation of the connection
17309        */
17310
17311       /**
17312        * An event indicating that a connection has been removed from the canvas.
17313        *
17314        * @memberOf Canvas
17315        *
17316        * @event connection.removed
17317        * @type {Object}
17318        * @property {djs.model.Connection} element the connection descriptor
17319        * @property {Object} gfx the graphical representation of the connection
17320        */
17321       return this._removeElement(connection, 'connection');
17322     };
17323
17324
17325     /**
17326      * Sends a shape to the front.
17327      *
17328      * This method takes parent / child relationships between shapes into account
17329      * and makes sure that children are properly handled, too.
17330      *
17331      * @param {djs.model.Shape}
17332      *            shape descriptor of the shape to be sent to front
17333      * @param {boolean}
17334      *            [bubble=true] whether to send parent shapes to front, too
17335      */
17336     Canvas.prototype.sendToFront = function(shape, bubble) {
17337
17338       if (bubble !== false) {
17339         bubble = true;
17340       }
17341
17342       if (bubble && shape.parent) {
17343         this.sendToFront(shape.parent);
17344       }
17345
17346       forEach(shape.children, function(child) {
17347         this.sendToFront(child, false);
17348       }, this);
17349
17350       var gfx = this.getGraphics(shape),
17351         gfxParent = gfx.parent();
17352
17353       gfx.remove().appendTo(gfxParent);
17354     };
17355
17356
17357     /**
17358      * Return the graphical object underlaying a certain diagram element
17359      *
17360      * @param {String|djs.model.Base}
17361      *            element descriptor of the element
17362      * @param {Boolean}
17363      *            [secondary=false] whether to return the secondary connected
17364      *            element
17365      *
17366      * @return {SVGElement}
17367      */
17368     Canvas.prototype.getGraphics = function(element, secondary) {
17369       return this._elementRegistry.getGraphics(element, secondary);
17370     };
17371
17372
17373     Canvas.prototype._fireViewboxChange = function() {
17374       this._eventBus.fire('canvas.viewbox.changed', {
17375         viewbox: this.viewbox(false)
17376       });
17377     };
17378
17379
17380     /**
17381      * Gets or sets the view box of the canvas, i.e. the area that is currently
17382      * displayed
17383      *
17384      * @param {Object}
17385      *            [box] the new view box to set
17386      * @param {Number}
17387      *            box.x the top left X coordinate of the canvas visible in view box
17388      * @param {Number}
17389      *            box.y the top left Y coordinate of the canvas visible in view box
17390      * @param {Number}
17391      *            box.width the visible width
17392      * @param {Number}
17393      *            box.height
17394      *
17395      * @example
17396      *
17397      * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })
17398      *  // sets the visible area of the diagram to (100|100) -> (600|100) // and and
17399      * scales it according to the diagram width
17400      *
17401      * @return {Object} the current view box
17402      */
17403     Canvas.prototype.viewbox = function(box) {
17404
17405       if (box === undefined && this._cachedViewbox) {
17406         return this._cachedViewbox;
17407       }
17408
17409       var viewport = this._viewport,
17410         innerBox,
17411         outerBox = this.getSize(),
17412         matrix,
17413         scale,
17414         x, y;
17415
17416       if (!box) {
17417         // compute the inner box based on the
17418         // diagrams default layer. This allows us to exclude
17419         // external components, such as overlays
17420         innerBox = this.getDefaultLayer().getBBox(true);
17421
17422         matrix = viewport.transform().localMatrix;
17423         scale = round(matrix.a, 1000);
17424
17425         x = round(-matrix.e || 0, 1000);
17426         y = round(-matrix.f || 0, 1000);
17427
17428         box = this._cachedViewbox = {
17429           x: x ? x / scale : 0,
17430           y: y ? y / scale : 0,
17431           width: outerBox.width / scale,
17432           height: outerBox.height / scale,
17433           scale: scale,
17434           inner: {
17435             width: innerBox.width,
17436             height: innerBox.height,
17437             x: innerBox.x,
17438             y: innerBox.y
17439           },
17440           outer: outerBox
17441         };
17442
17443         return box;
17444       } else {
17445         scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
17446
17447         matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);
17448         viewport.transform(matrix);
17449
17450         this._fireViewboxChange();
17451       }
17452
17453       return box;
17454     };
17455
17456
17457     /**
17458      * Gets or sets the scroll of the canvas.
17459      *
17460      * @param {Object}
17461      *            [delta] the new scroll to apply.
17462      *
17463      * @param {Number}
17464      *            [delta.dx]
17465      * @param {Number}
17466      *            [delta.dy]
17467      */
17468     Canvas.prototype.scroll = function(delta) {
17469       var node = this._viewport.node;
17470       var matrix = node.getCTM();
17471
17472       if (delta) {
17473         delta = assign({
17474           dx: 0,
17475           dy: 0
17476         }, delta || {});
17477
17478         matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
17479
17480         setCTM(node, matrix);
17481
17482         this._fireViewboxChange();
17483       }
17484
17485       return {
17486         x: matrix.e,
17487         y: matrix.f
17488       };
17489     };
17490
17491
17492     /**
17493      * Gets or sets the current zoom of the canvas, optionally zooming to the
17494      * specified position.
17495      *
17496      * @param {String|Number}
17497      *            [newScale] the new zoom level, either a number, i.e. 0.9, or
17498      *            `fit-viewport` to adjust the size to fit the current viewport
17499      * @param {String|Point}
17500      *            [center] the reference point { x: .., y: ..} to zoom to, 'auto' to
17501      *            zoom into mid or null
17502      *
17503      * @return {Number} the current scale
17504      */
17505     Canvas.prototype.zoom = function(newScale, center) {
17506
17507       if (newScale === 'fit-viewport') {
17508         return this._fitViewport(center);
17509       }
17510
17511       var vbox = this.viewbox();
17512
17513       if (newScale === undefined) {
17514         return vbox.scale;
17515       }
17516
17517       var outer = vbox.outer;
17518
17519       if (center === 'auto') {
17520         center = {
17521           x: outer.width / 2,
17522           y: outer.height / 2
17523         };
17524       }
17525
17526       var matrix = this._setZoom(newScale, center);
17527
17528       this._fireViewboxChange();
17529
17530       return round(matrix.a, 1000);
17531     };
17532
17533     function setCTM(node, m) {
17534       var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
17535       node.setAttribute('transform', mstr);
17536     }
17537
17538     Canvas.prototype._fitViewport = function(center) {
17539
17540       var vbox = this.viewbox(),
17541         outer = vbox.outer,
17542         inner = vbox.inner,
17543         newScale,
17544         newViewbox;
17545
17546       // display the complete diagram without zooming in.
17547       // instead of relying on internal zoom, we perform a
17548       // hard reset on the canvas viewbox to realize this
17549       //
17550       // if diagram does not need to be zoomed in, we focus it around
17551       // the diagram origin instead
17552
17553       if (inner.x >= 0 &&
17554         inner.y >= 0 &&
17555         inner.x + inner.width <= outer.width &&
17556         inner.y + inner.height <= outer.height &&
17557         !center) {
17558
17559         newViewbox = {
17560           x: 0,
17561           y: 0,
17562           width: Math.max(inner.width + inner.x, outer.width),
17563           height: Math.max(inner.height + inner.y, outer.height)
17564         };
17565       } else {
17566
17567         newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);
17568         newViewbox = {
17569           x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),
17570           y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),
17571           width: outer.width / newScale,
17572           height: outer.height / newScale
17573         };
17574       }
17575
17576       this.viewbox(newViewbox);
17577
17578       return this.viewbox().scale;
17579     };
17580
17581
17582     Canvas.prototype._setZoom = function(scale, center) {
17583
17584       var svg = this._svg.node,
17585         viewport = this._viewport.node;
17586
17587       var matrix = svg.createSVGMatrix();
17588       var point = svg.createSVGPoint();
17589
17590       var centerPoint,
17591         originalPoint,
17592         currentMatrix,
17593         scaleMatrix,
17594         newMatrix;
17595
17596       currentMatrix = viewport.getCTM();
17597
17598
17599       var currentScale = currentMatrix.a;
17600
17601       if (center) {
17602         centerPoint = assign(point, center);
17603
17604         // revert applied viewport transformations
17605         originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
17606
17607         // create scale matrix
17608         scaleMatrix = matrix
17609           .translate(originalPoint.x, originalPoint.y)
17610           .scale(1 / currentScale * scale)
17611           .translate(-originalPoint.x, -originalPoint.y);
17612
17613         newMatrix = currentMatrix.multiply(scaleMatrix);
17614       } else {
17615         newMatrix = matrix.scale(scale);
17616       }
17617
17618       setCTM(this._viewport.node, newMatrix);
17619
17620       return newMatrix;
17621     };
17622
17623
17624     /**
17625      * Returns the size of the canvas
17626      *
17627      * @return {Dimensions}
17628      */
17629     Canvas.prototype.getSize = function() {
17630       return {
17631         width: this._container.clientWidth,
17632         height: this._container.clientHeight
17633       };
17634     };
17635
17636
17637     /**
17638      * Return the absolute bounding box for the given element
17639      *
17640      * The absolute bounding box may be used to display overlays in the callers
17641      * (browser) coordinate system rather than the zoomed in/out canvas coordinates.
17642      *
17643      * @param {ElementDescriptor}
17644      *            element
17645      * @return {Bounds} the absolute bounding box
17646      */
17647     Canvas.prototype.getAbsoluteBBox = function(element) {
17648       var vbox = this.viewbox();
17649       var bbox;
17650
17651       // connection
17652       // use svg bbox
17653       if (element.waypoints) {
17654         var gfx = this.getGraphics(element);
17655
17656         var transformBBox = gfx.getBBox(true);
17657         bbox = gfx.getBBox();
17658
17659         bbox.x -= transformBBox.x;
17660         bbox.y -= transformBBox.y;
17661
17662         bbox.width += 2 * transformBBox.x;
17663         bbox.height += 2 * transformBBox.y;
17664       }
17665       // shapes
17666       // use data
17667       else {
17668         bbox = element;
17669       }
17670
17671       var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
17672       var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
17673
17674       var width = bbox.width * vbox.scale;
17675       var height = bbox.height * vbox.scale;
17676
17677       return {
17678         x: x,
17679         y: y,
17680         width: width,
17681         height: height
17682       };
17683     };
17684
17685   }, {
17686     "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
17687     "../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
17688     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
17689     "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
17690     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
17691   }],
17692   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js": [function(require, module, exports) {
17693     'use strict';
17694
17695     var Model = require('../model');
17696
17697
17698     /**
17699      * A factory for diagram-js shapes
17700      */
17701     function ElementFactory() {
17702       this._uid = 12;
17703     }
17704
17705     module.exports = ElementFactory;
17706
17707
17708     ElementFactory.prototype.createRoot = function(attrs) {
17709       return this.create('root', attrs);
17710     };
17711
17712     ElementFactory.prototype.createLabel = function(attrs) {
17713       return this.create('label', attrs);
17714     };
17715
17716     ElementFactory.prototype.createShape = function(attrs) {
17717       // alert("In createShape");
17718       return this.create('shape', attrs);
17719     };
17720
17721     ElementFactory.prototype.createConnection = function(attrs) {
17722       return this.create('connection', attrs);
17723     };
17724
17725     /**
17726      * Create a model element with the given type and a number of pre-set
17727      * attributes.
17728      *
17729      * @param {String}
17730      *            type
17731      * @param {Object}
17732      *            attrs
17733      * @return {djs.model.Base} the newly created model instance
17734      */
17735     ElementFactory.prototype.create = function(type, attrs) {
17736       // alert("In create");
17737
17738       attrs = attrs || {};
17739
17740       if (!attrs.id) {
17741         attrs.id = type + '_' + (this._uid++);
17742       }
17743
17744       return Model.create(type, attrs);
17745     };
17746   }, {
17747     "../model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js"
17748   }],
17749   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementRegistry.js": [function(require, module, exports) {
17750     'use strict';
17751
17752     var ELEMENT_ID = 'data-element-id';
17753
17754
17755     /**
17756      * @class
17757      *
17758      * A registry that keeps track of all shapes in the diagram.
17759      */
17760     function ElementRegistry() {
17761       this._elements = {};
17762     }
17763
17764     module.exports = ElementRegistry;
17765
17766     /**
17767      * Register a pair of (element, gfx, (secondaryGfx)).
17768      *
17769      * @param {djs.model.Base}
17770      *            element
17771      * @param {Snap
17772      *            <SVGElement>} gfx
17773      * @param {Snap
17774      *            <SVGElement>} [secondaryGfx] optional other element to register,
17775      *            too
17776      */
17777     ElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {
17778
17779       var id = element.id;
17780
17781       this._validateId(id);
17782
17783       // associate dom node with element
17784       gfx.attr(ELEMENT_ID, id);
17785
17786       if (secondaryGfx) {
17787         secondaryGfx.attr(ELEMENT_ID, id);
17788       }
17789
17790       this._elements[id] = {
17791         element: element,
17792         gfx: gfx,
17793         secondaryGfx: secondaryGfx
17794       };
17795     };
17796
17797     /**
17798      * Removes an element from the registry.
17799      *
17800      * @param {djs.model.Base}
17801      *            element
17802      */
17803     ElementRegistry.prototype.remove = function(element) {
17804       var elements = this._elements,
17805         id = element.id || element,
17806         container = id && elements[id];
17807
17808       if (container) {
17809
17810         // unset element id on gfx
17811         container.gfx.attr(ELEMENT_ID, null);
17812
17813         if (container.secondaryGfx) {
17814           container.secondaryGfx.attr(ELEMENT_ID, null);
17815         }
17816
17817         delete elements[id];
17818       }
17819     };
17820
17821     /**
17822      * Update the id of an element
17823      *
17824      * @param {djs.model.Base}
17825      *            element
17826      * @param {String}
17827      *            newId
17828      */
17829     ElementRegistry.prototype.updateId = function(element, newId) {
17830
17831       this._validateId(newId);
17832
17833       if (typeof element === 'string') {
17834         element = this.get(element);
17835       }
17836
17837       var gfx = this.getGraphics(element),
17838         secondaryGfx = this.getGraphics(element, true);
17839
17840       this.remove(element);
17841
17842       element.id = newId;
17843
17844       this.add(element, gfx, secondaryGfx);
17845     };
17846
17847     /**
17848      * Return the model element for a given id or graphics.
17849      *
17850      * @example
17851      *
17852      * elementRegistry.get('SomeElementId_1'); elementRegistry.get(gfx);
17853      *
17854      *
17855      * @param {String|SVGElement}
17856      *            filter for selecting the element
17857      *
17858      * @return {djs.model.Base}
17859      */
17860     ElementRegistry.prototype.get = function(filter) {
17861       var id;
17862
17863       if (typeof filter === 'string') {
17864         id = filter;
17865       } else {
17866         id = filter && filter.attr(ELEMENT_ID);
17867       }
17868
17869       var container = this._elements[id];
17870       return container && container.element;
17871     };
17872
17873     /**
17874      * Return all elements that match a given filter function.
17875      *
17876      * @param {Function}
17877      *            fn
17878      *
17879      * @return {Array<djs.model.Base>}
17880      */
17881     ElementRegistry.prototype.filter = function(fn) {
17882
17883       var filtered = [];
17884
17885       this.forEach(function(element, gfx) {
17886         if (fn(element, gfx)) {
17887           filtered.push(element);
17888         }
17889       });
17890
17891       return filtered;
17892     };
17893
17894     /**
17895      * Iterate over all diagram elements.
17896      *
17897      * @param {Function}
17898      *            fn
17899      */
17900     ElementRegistry.prototype.forEach = function(fn) {
17901
17902       var map = this._elements;
17903
17904       Object.keys(map).forEach(function(id) {
17905         var container = map[id],
17906           element = container.element,
17907           gfx = container.gfx;
17908
17909         return fn(element, gfx);
17910       });
17911     };
17912
17913     /**
17914      * Return the graphical representation of an element or its id.
17915      *
17916      * @example elementRegistry.getGraphics('SomeElementId_1');
17917      *          elementRegistry.getGraphics(rootElement); // <g ...>
17918      *
17919      * elementRegistry.getGraphics(rootElement, true); // <svg ...>
17920      *
17921      *
17922      * @param {String|djs.model.Base}
17923      *            filter
17924      * @param {Boolean}
17925      *            [secondary=false] whether to return the secondary connected
17926      *            element
17927      *
17928      * @return {SVGElement}
17929      */
17930     ElementRegistry.prototype.getGraphics = function(filter, secondary) {
17931       var id = filter.id || filter;
17932
17933       var container = this._elements[id];
17934       return container && (secondary ? container.secondaryGfx : container.gfx);
17935     };
17936
17937     /**
17938      * Validate the suitability of the given id and signals a problem with an
17939      * exception.
17940      *
17941      * @param {String}
17942      *            id
17943      *
17944      * @throws {Error}
17945      *             if id is empty or already assigned
17946      */
17947     ElementRegistry.prototype._validateId = function(id) {
17948       if (!id) {
17949         throw new Error('element must have an id');
17950       }
17951
17952       if (this._elements[id]) {
17953         throw new Error('element with id ' + id + ' already added');
17954       }
17955     };
17956   }, {}],
17957   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js": [function(require, module, exports) {
17958     'use strict';
17959
17960     var isFunction = require('lodash/lang/isFunction'),
17961       isArray = require('lodash/lang/isArray'),
17962       isNumber = require('lodash/lang/isNumber'),
17963       assign = require('lodash/object/assign');
17964
17965     var DEFAULT_PRIORITY = 1000;
17966
17967
17968     /**
17969      * A general purpose event bus.
17970      *
17971      * This component is used to communicate across a diagram instance. Other parts
17972      * of a diagram can use it to listen to and broadcast events.
17973      *
17974      *  ## Registering for Events
17975      *
17976      * The event bus provides the {@link EventBus#on} and {@link EventBus#once}
17977      * methods to register for events. {@link EventBus#off} can be used to remove
17978      * event registrations. Listeners receive an instance of {@link Event} as the
17979      * first argument. It allows them to hook into the event execution.
17980      *
17981      * ```javascript
17982      *  // listen for event eventBus.on('foo', function(event) {
17983      *  // access event type event.type; // 'foo'
17984      *  // stop propagation to other listeners event.stopPropagation();
17985      *  // prevent event default event.preventDefault(); });
17986      *  // listen for event with custom payload eventBus.on('bar', function(event,
17987      * payload) { console.log(payload); });
17988      *  // listen for event returning value eventBus.on('foobar', function(event) {
17989      *  // stop event propagation + prevent default return false;
17990      *  // stop event propagation + return custom result return { complex:
17991      * 'listening result' }; });
17992      *
17993      *  // listen with custom priority (default=1000, higher is better)
17994      * eventBus.on('priorityfoo', 1500, function(event) { console.log('invoked
17995      * first!'); }); ```
17996      *
17997      *  ## Emitting Events
17998      *
17999      * Events can be emitted via the event bus using {@link EventBus#fire}.
18000      *
18001      * ```javascript
18002      *  // false indicates that the default action // was prevented by listeners if
18003      * (eventBus.fire('foo') === false) { console.log('default has been
18004      * prevented!'); };
18005      *
18006      *  // custom args + return value listener eventBus.on('sum', function(event, a,
18007      * b) { return a + b; });
18008      *  // you can pass custom arguments + retrieve result values. var sum =
18009      * eventBus.fire('sum', 1, 2); console.log(sum); // 3 ```
18010      */
18011     function EventBus() {
18012       this._listeners = {};
18013
18014       // cleanup on destroy
18015
18016       var self = this;
18017
18018       // destroy on lowest priority to allow
18019       // message passing until the bitter end
18020       this.on('diagram.destroy', 1, function() {
18021         self._listeners = null;
18022       });
18023     }
18024
18025     module.exports = EventBus;
18026
18027
18028     /**
18029      * Register an event listener for events with the given name.
18030      *
18031      * The callback will be invoked with `event, ...additionalArguments` that have
18032      * been passed to {@link EventBus#fire}.
18033      *
18034      * Returning false from a listener will prevent the events default action (if
18035      * any is specified). To stop an event from being processed further in other
18036      * listeners execute {@link Event#stopPropagation}.
18037      *
18038      * Returning anything but `undefined` from a listener will stop the listener
18039      * propagation.
18040      *
18041      * @param {String|Array
18042      *            <String>} events
18043      * @param {Number}
18044      *            [priority=1000] the priority in which this listener is called,
18045      *            larger is higher
18046      * @param {Function}
18047      *            callback
18048      */
18049     EventBus.prototype.on = function(events, priority, callback) {
18050
18051       events = isArray(events) ? events : [events];
18052
18053       if (isFunction(priority)) {
18054         callback = priority;
18055         priority = DEFAULT_PRIORITY;
18056       }
18057
18058       if (!isNumber(priority)) {
18059         throw new Error('priority must be a number');
18060       }
18061
18062       var self = this,
18063         listener = {
18064           priority: priority,
18065           callback: callback
18066         };
18067
18068       events.forEach(function(e) {
18069         self._addListener(e, listener);
18070       });
18071     };
18072
18073
18074     /**
18075      * Register an event listener that is executed only once.
18076      *
18077      * @param {String}
18078      *            event the event name to register for
18079      * @param {Function}
18080      *            callback the callback to execute
18081      */
18082     EventBus.prototype.once = function(event, callback) {
18083
18084       var self = this;
18085
18086       function wrappedCallback() {
18087         callback.apply(self, arguments);
18088         self.off(event, wrappedCallback);
18089       }
18090
18091       this.on(event, wrappedCallback);
18092     };
18093
18094
18095     /**
18096      * Removes event listeners by event and callback.
18097      *
18098      * If no callback is given, all listeners for a given event name are being
18099      * removed.
18100      *
18101      * @param {String}
18102      *            event
18103      * @param {Function}
18104      *            [callback]
18105      */
18106     EventBus.prototype.off = function(event, callback) {
18107       var listeners = this._getListeners(event),
18108         listener, idx;
18109
18110       if (callback) {
18111
18112         // move through listeners from back to front
18113         // and remove matching listeners
18114         for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {
18115           if (listener.callback === callback) {
18116             listeners.splice(idx, 1);
18117           }
18118         }
18119       } else {
18120         // clear listeners
18121         listeners.length = 0;
18122       }
18123     };
18124
18125
18126     /**
18127      * Fires a named event.
18128      *
18129      * @example
18130      *  // fire event by name events.fire('foo');
18131      *  // fire event object with nested type var event = { type: 'foo' };
18132      * events.fire(event);
18133      *  // fire event with explicit type var event = { x: 10, y: 20 };
18134      * events.fire('element.moved', event);
18135      *  // pass additional arguments to the event events.on('foo', function(event,
18136      * bar) { alert(bar); });
18137      *
18138      * events.fire({ type: 'foo' }, 'I am bar!');
18139      *
18140      * @param {String}
18141      *            [name] the optional event name
18142      * @param {Object}
18143      *            [event] the event object
18144      * @param {...Object}
18145      *            additional arguments to be passed to the callback functions
18146      *
18147      * @return {Boolean} the events return value, if specified or false if the
18148      *         default action was prevented by listeners
18149      */
18150     EventBus.prototype.fire = function(type, data) {
18151
18152       var event,
18153         originalType,
18154         listeners, idx, listener,
18155         returnValue,
18156         args;
18157
18158       args = Array.prototype.slice.call(arguments);
18159
18160       if (typeof type === 'object') {
18161         event = type;
18162         type = event.type;
18163       }
18164
18165       if (!type) {
18166         throw new Error('no event type specified');
18167       }
18168
18169       listeners = this._listeners[type];
18170
18171       if (!listeners) {
18172         return;
18173       }
18174
18175       // we make sure we fire instances of our home made
18176       // events here. We wrap them only once, though
18177       if (data instanceof Event) {
18178         // we are fine, we alread have an event
18179         event = data;
18180       } else {
18181         event = new Event();
18182         event.init(data);
18183       }
18184
18185       // ensure we pass the event as the first parameter
18186       args[0] = event;
18187
18188       // original event type (in case we delegate)
18189       originalType = event.type;
18190
18191       try {
18192
18193         // update event type before delegation
18194         if (type !== originalType) {
18195           event.type = type;
18196         }
18197
18198         for (idx = 0; !!(listener = listeners[idx]); idx++) {
18199
18200           // handle stopped propagation
18201           if (event.cancelBubble) {
18202             break;
18203           }
18204
18205           try {
18206             // returning false prevents the default action
18207             returnValue = event.returnValue = listener.callback.apply(null, args);
18208
18209             // stop propagation on return value
18210             if (returnValue !== undefined) {
18211               event.stopPropagation();
18212             }
18213
18214             // prevent default on return false
18215             if (returnValue === false) {
18216               event.preventDefault();
18217             }
18218           } catch (e) {
18219             if (!this.handleError(e)) {
18220               console.error('unhandled error in event listener');
18221               console.error(e.stack);
18222
18223               throw e;
18224             }
18225           }
18226         }
18227       } finally {
18228         // reset event type after delegation
18229         if (type !== originalType) {
18230           event.type = originalType;
18231         }
18232       }
18233
18234       // set the return value to false if the event default
18235       // got prevented and no other return value exists
18236       if (returnValue === undefined && event.defaultPrevented) {
18237         returnValue = false;
18238       }
18239
18240       return returnValue;
18241     };
18242
18243
18244     EventBus.prototype.handleError = function(error) {
18245       return this.fire('error', {
18246         error: error
18247       }) === false;
18248     };
18249
18250
18251     /*
18252      * Add new listener with a certain priority to the list of listeners (for the
18253      * given event).
18254      *
18255      * The semantics of listener registration / listener execution are first
18256      * register, first serve: New listeners will always be inserted after existing
18257      * listeners with the same priority.
18258      *
18259      * Example: Inserting two listeners with priority 1000 and 1300
18260      *  * before: [ 1500, 1500, 1000, 1000 ] * after: [ 1500, 1500, (new=1300),
18261      * 1000, 1000, (new=1000) ]
18262      *
18263      * @param {String} event @param {Object} listener { priority, callback }
18264      */
18265     EventBus.prototype._addListener = function(event, newListener) {
18266
18267       var listeners = this._getListeners(event),
18268         existingListener,
18269         idx;
18270
18271       // ensure we order listeners by priority from
18272       // 0 (high) to n > 0 (low)
18273       for (idx = 0; !!(existingListener = listeners[idx]); idx++) {
18274         if (existingListener.priority < newListener.priority) {
18275
18276           // prepend newListener at before existingListener
18277           listeners.splice(idx, 0, newListener);
18278           return;
18279         }
18280       }
18281
18282       listeners.push(newListener);
18283     };
18284
18285
18286     EventBus.prototype._getListeners = function(name) {
18287       var listeners = this._listeners[name];
18288
18289       if (!listeners) {
18290         this._listeners[name] = listeners = [];
18291       }
18292
18293       return listeners;
18294     };
18295
18296
18297     /**
18298      * A event that is emitted via the event bus.
18299      */
18300     function Event() {}
18301
18302     module.exports.Event = Event;
18303
18304     Event.prototype.stopPropagation = function() {
18305       this.cancelBubble = true;
18306     };
18307
18308     Event.prototype.preventDefault = function() {
18309       this.defaultPrevented = true;
18310     };
18311
18312     Event.prototype.init = function(data) {
18313       assign(this, data || {});
18314     };
18315
18316   }, {
18317     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
18318     "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
18319     "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
18320     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
18321   }],
18322   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\GraphicsFactory.js": [function(require, module, exports) {
18323     'use strict';
18324
18325     var forEach = require('lodash/collection/forEach'),
18326       reduce = require('lodash/collection/reduce');
18327
18328     var GraphicsUtil = require('../util/GraphicsUtil'),
18329       domClear = require('min-dom/lib/clear');
18330
18331     /**
18332      * A factory that creates graphical elements
18333      *
18334      * @param {Renderer}
18335      *            renderer
18336      */
18337     function GraphicsFactory(renderer, elementRegistry) {
18338       this._renderer = renderer;
18339       this._elementRegistry = elementRegistry;
18340     }
18341
18342     GraphicsFactory.$inject = ['renderer', 'elementRegistry'];
18343
18344     module.exports = GraphicsFactory;
18345
18346
18347     GraphicsFactory.prototype._getChildren = function(element) {
18348
18349       var gfx = this._elementRegistry.getGraphics(element);
18350
18351       var childrenGfx;
18352
18353       // root element
18354       if (!element.parent) {
18355         childrenGfx = gfx;
18356       } else {
18357         childrenGfx = GraphicsUtil.getChildren(gfx);
18358         if (!childrenGfx) {
18359           childrenGfx = gfx.parent().group().attr('class', 'djs-children');
18360         }
18361       }
18362
18363       return childrenGfx;
18364     };
18365
18366     /**
18367      * Clears the graphical representation of the element and returns the cleared
18368      * visual (the <g class="djs-visual" /> element).
18369      */
18370     GraphicsFactory.prototype._clear = function(gfx) {
18371       var visual = GraphicsUtil.getVisual(gfx);
18372
18373       domClear(visual.node);
18374
18375       return visual;
18376     };
18377
18378     /**
18379      * Creates a gfx container for shapes and connections
18380      *
18381      * The layout is as follows:
18382      *
18383      * <g class="djs-group">
18384      *
18385      * <!-- the gfx --> <g class="djs-element djs-(shape|connection)"> <g
18386      * class="djs-visual"> <!-- the renderer draws in here --> </g>
18387      *
18388      * <!-- extensions (overlays, click box, ...) goes here </g>
18389      *
18390      * <!-- the gfx child nodes --> <g class="djs-children"></g> </g>
18391      *
18392      * @param {Object}
18393      *            parent
18394      * @param {String}
18395      *            type the type of the element, i.e. shape | connection
18396      */
18397     GraphicsFactory.prototype._createContainer = function(type, parentGfx) {
18398       var outerGfx = parentGfx.group().attr('class', 'djs-group'),
18399         gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);
18400
18401       // create visual
18402       gfx.group().attr('class', 'djs-visual');
18403
18404       return gfx;
18405     };
18406
18407     GraphicsFactory.prototype.create = function(type, element) {
18408       var childrenGfx = this._getChildren(element.parent);
18409       return this._createContainer(type, childrenGfx);
18410     };
18411
18412
18413     GraphicsFactory.prototype.updateContainments = function(elements) {
18414
18415       var self = this,
18416         elementRegistry = this._elementRegistry,
18417         parents;
18418
18419
18420       parents = reduce(elements, function(map, e) {
18421
18422         if (e.parent) {
18423           map[e.parent.id] = e.parent;
18424         }
18425
18426         return map;
18427       }, {});
18428
18429       // update all parents of changed and reorganized their children
18430       // in the correct order (as indicated in our model)
18431       forEach(parents, function(parent) {
18432
18433         var childGfx = self._getChildren(parent),
18434           children = parent.children;
18435
18436         if (!children) {
18437           return;
18438         }
18439
18440         forEach(children.slice().reverse(), function(c) {
18441           var gfx = elementRegistry.getGraphics(c);
18442           gfx.parent().prependTo(childGfx);
18443         });
18444       });
18445
18446     };
18447
18448     GraphicsFactory.prototype.update = function(type, element, gfx) {
18449
18450       // Do not update root element
18451       if (!element.parent) {
18452         return;
18453       }
18454
18455       var visual = this._clear(gfx);
18456
18457       // redraw
18458       if (type === 'shape') {
18459         this._renderer.drawShape(visual, element);
18460
18461         // update positioning
18462         gfx.translate(element.x, element.y);
18463       } else
18464       if (type === 'connection') {
18465         this._renderer.drawConnection(visual, element);
18466       } else {
18467         throw new Error('unknown type: ' + type);
18468       }
18469
18470       gfx.attr('display', element.hidden ? 'none' : 'block');
18471     };
18472
18473
18474     GraphicsFactory.prototype.remove = function(element) {
18475       var gfx = this._elementRegistry.getGraphics(element);
18476
18477       // remove
18478       gfx.parent().remove();
18479     };
18480
18481   }, {
18482     "../util/GraphicsUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\GraphicsUtil.js",
18483     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
18484     "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
18485     "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js"
18486   }],
18487   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js": [function(require, module, exports) {
18488     module.exports = {
18489       __depends__: [require('../draw')],
18490       __init__: ['canvas'],
18491       canvas: ['type', require('./Canvas')],
18492       elementRegistry: ['type', require('./ElementRegistry')],
18493       elementFactory: ['type', require('./ElementFactory')],
18494       eventBus: ['type', require('./EventBus')],
18495       graphicsFactory: ['type', require('./GraphicsFactory')]
18496     };
18497   }, {
18498     "../draw": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\index.js",
18499     "./Canvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\Canvas.js",
18500     "./ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js",
18501     "./ElementRegistry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementRegistry.js",
18502     "./EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
18503     "./GraphicsFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\GraphicsFactory.js"
18504   }],
18505   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js": [function(require, module, exports) {
18506     'use strict';
18507
18508     var Snap = require('../../vendor/snapsvg');
18509
18510
18511     /**
18512      * The default renderer used for shapes and connections.
18513      *
18514      * @param {Styles}
18515      *            styles
18516      */
18517     function Renderer(styles) {
18518       this.CONNECTION_STYLE = styles.style(['no-fill'], {
18519         strokeWidth: 5,
18520         stroke: 'fuchsia'
18521       });
18522       this.SHAPE_STYLE = styles.style({
18523         fill: 'white',
18524         stroke: 'fuchsia',
18525         strokeWidth: 2
18526       });
18527     }
18528
18529     module.exports = Renderer;
18530
18531     Renderer.$inject = ['styles'];
18532
18533
18534     Renderer.prototype.drawShape = function drawShape(gfxGroup, data) {
18535       return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);
18536     };
18537
18538     Renderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {
18539       return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);
18540     };
18541
18542     function componentsToPath(components) {
18543       return components.join(',').replace(/,?([A-z]),?/g, '$1');
18544     }
18545
18546     /**
18547      * Gets the default SVG path of a shape that represents it's visual bounds.
18548      *
18549      * @param {djs.model.Shape}
18550      *            shape
18551      * @return {string} svg path
18552      */
18553     Renderer.prototype.getShapePath = function getShapePath(shape) {
18554
18555       var x = shape.x,
18556         y = shape.y,
18557         width = shape.width,
18558         height = shape.height;
18559
18560       var shapePath = [
18561         ['M', x, y],
18562         ['l', width, 0],
18563         ['l', 0, height],
18564         ['l', -width, 0],
18565         ['z']
18566       ];
18567
18568       return componentsToPath(shapePath);
18569     };
18570
18571     /**
18572      * Gets the default SVG path of a connection that represents it's visual bounds.
18573      *
18574      * @param {djs.model.Connection}
18575      *            connection
18576      * @return {string} svg path
18577      */
18578     Renderer.prototype.getConnectionPath = function getConnectionPath(connection) {
18579       var waypoints = connection.waypoints;
18580
18581       var idx, point, connectionPath = [];
18582
18583       for (idx = 0; !!(point = waypoints[idx]); idx++) {
18584
18585         // take invisible docking into account
18586         // when creating the path
18587         point = point.original || point;
18588
18589         connectionPath.push([idx === 0 ? 'M' : 'L', point.x, point.y]);
18590       }
18591
18592       return componentsToPath(connectionPath);
18593     };
18594
18595
18596     function toSVGPoints(points) {
18597       var result = '';
18598
18599       for (var i = 0, p; !!(p = points[i]); i++) {
18600         result += p.x + ',' + p.y + ' ';
18601       }
18602
18603       return result;
18604     }
18605
18606     function createLine(points, attrs) {
18607       return Snap.create('polyline', {
18608         points: toSVGPoints(points)
18609       }).attr(attrs || {});
18610     }
18611
18612     function updateLine(gfx, points) {
18613       return gfx.attr({
18614         points: toSVGPoints(points)
18615       });
18616     }
18617
18618     module.exports.createLine = createLine;
18619     module.exports.updateLine = updateLine;
18620   }, {
18621     "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js"
18622   }],
18623   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Styles.js": [function(require, module, exports) {
18624     'use strict';
18625
18626     var isArray = require('lodash/lang/isArray'),
18627       assign = require('lodash/object/assign'),
18628       reduce = require('lodash/collection/reduce');
18629
18630
18631     /**
18632      * A component that manages shape styles
18633      */
18634     function Styles() {
18635
18636       var defaultTraits = {
18637
18638         'no-fill': {
18639           fill: 'none'
18640         },
18641         'no-border': {
18642           strokeOpacity: 0.0
18643         },
18644         'no-events': {
18645           pointerEvents: 'none'
18646         }
18647       };
18648
18649       /**
18650        * Builds a style definition from a className, a list of traits and an
18651        * object of additional attributes.
18652        *
18653        * @param {String}
18654        *            className
18655        * @param {Array
18656        *            <String>} traits
18657        * @param {Object}
18658        *            additionalAttrs
18659        *
18660        * @return {Object} the style defintion
18661        */
18662       this.cls = function(className, traits, additionalAttrs) {
18663         var attrs = this.style(traits, additionalAttrs);
18664
18665         return assign(attrs, {
18666           'class': className
18667         });
18668       };
18669
18670       /**
18671        * Builds a style definition from a list of traits and an object of
18672        * additional attributes.
18673        *
18674        * @param {Array
18675        *            <String>} traits
18676        * @param {Object}
18677        *            additionalAttrs
18678        *
18679        * @return {Object} the style defintion
18680        */
18681       this.style = function(traits, additionalAttrs) {
18682
18683         if (!isArray(traits) && !additionalAttrs) {
18684           additionalAttrs = traits;
18685           traits = [];
18686         }
18687
18688         var attrs = reduce(traits, function(attrs, t) {
18689           return assign(attrs, defaultTraits[t] || {});
18690         }, {});
18691
18692         return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
18693       };
18694     }
18695
18696     module.exports = Styles;
18697   }, {
18698     "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
18699     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
18700     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
18701   }],
18702   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\index.js": [function(require, module, exports) {
18703     module.exports = {
18704       renderer: ['type', require('./Renderer')],
18705       styles: ['type', require('./Styles')]
18706     };
18707   }, {
18708     "./Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
18709     "./Styles": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Styles.js"
18710   }],
18711   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointMove.js": [function(require, module, exports) {
18712     'use strict';
18713
18714     var Geometry = require('../../util/Geometry'),
18715       Util = require('./Util');
18716
18717     var MARKER_OK = 'connect-ok',
18718       MARKER_NOT_OK = 'connect-not-ok',
18719       MARKER_CONNECT_HOVER = 'connect-hover',
18720       MARKER_CONNECT_UPDATING = 'djs-updating';
18721
18722     var COMMAND_BENDPOINT_UPDATE = 'connection.updateWaypoints',
18723       COMMAND_RECONNECT_START = 'connection.reconnectStart',
18724       COMMAND_RECONNECT_END = 'connection.reconnectEnd';
18725
18726     var round = Math.round;
18727
18728
18729     /**
18730      * A component that implements moving of bendpoints
18731      */
18732     function BendpointMove(injector, eventBus, canvas, dragging, graphicsFactory, rules, modeling) {
18733
18734       var connectionDocking;
18735
18736       // optional connection docking integration
18737       try {
18738         connectionDocking = injector.get('connectionDocking');
18739       } catch (e) {}
18740
18741
18742       // API
18743
18744       this.start = function(event, connection, bendpointIndex, insert) {
18745
18746         var type,
18747           context,
18748           waypoints = connection.waypoints,
18749           gfx = canvas.getGraphics(connection);
18750
18751         if (!insert && bendpointIndex === 0) {
18752           type = COMMAND_RECONNECT_START;
18753         } else
18754         if (!insert && bendpointIndex === waypoints.length - 1) {
18755           type = COMMAND_RECONNECT_END;
18756         } else {
18757           type = COMMAND_BENDPOINT_UPDATE;
18758         }
18759
18760         context = {
18761           connection: connection,
18762           bendpointIndex: bendpointIndex,
18763           insert: insert,
18764           type: type
18765         };
18766
18767         dragging.activate(event, 'bendpoint.move', {
18768           data: {
18769             connection: connection,
18770             connectionGfx: gfx,
18771             context: context
18772           }
18773         });
18774       };
18775
18776
18777       // DRAGGING IMPLEMENTATION
18778
18779
18780       function redrawConnection(data) {
18781         graphicsFactory.update('connection', data.connection, data.connectionGfx);
18782       }
18783
18784       function filterRedundantWaypoints(waypoints) {
18785         return waypoints.filter(function(r, idx) {
18786           return !Geometry.pointsOnLine(waypoints[idx - 1], waypoints[idx + 1], r);
18787         });
18788       }
18789
18790       eventBus.on('bendpoint.move.start', function(e) {
18791
18792         var context = e.context,
18793           connection = context.connection,
18794           originalWaypoints = connection.waypoints,
18795           waypoints = originalWaypoints.slice(),
18796           insert = context.insert,
18797           idx = context.bendpointIndex;
18798
18799         context.originalWaypoints = originalWaypoints;
18800
18801         if (insert) {
18802           // insert placeholder for bendpoint to-be-added
18803           waypoints.splice(idx, 0, null);
18804         }
18805
18806         connection.waypoints = waypoints;
18807
18808         // add dragger gfx
18809         context.draggerGfx = Util.addBendpoint(canvas.getLayer('overlays'));
18810         context.draggerGfx.addClass('djs-dragging');
18811
18812         canvas.addMarker(connection, MARKER_CONNECT_UPDATING);
18813       });
18814
18815       eventBus.on('bendpoint.move.hover', function(e) {
18816         e.context.hover = e.hover;
18817
18818         canvas.addMarker(e.hover, MARKER_CONNECT_HOVER);
18819       });
18820
18821       eventBus.on([
18822         'bendpoint.move.out',
18823         'bendpoint.move.cleanup'
18824       ], function(e) {
18825
18826         // remove connect marker
18827         // if it was added
18828         var hover = e.context.hover;
18829
18830         if (hover) {
18831           canvas.removeMarker(hover, MARKER_CONNECT_HOVER);
18832           canvas.removeMarker(hover, e.context.target ? MARKER_OK : MARKER_NOT_OK);
18833         }
18834       });
18835
18836       eventBus.on('bendpoint.move.move', function(e) {
18837
18838         var context = e.context,
18839           moveType = context.type,
18840           connection = e.connection,
18841           source, target;
18842
18843         connection.waypoints[context.bendpointIndex] = {
18844           x: e.x,
18845           y: e.y
18846         };
18847
18848         if (connectionDocking) {
18849
18850           if (context.hover) {
18851             if (moveType === COMMAND_RECONNECT_START) {
18852               source = context.hover;
18853             }
18854
18855             if (moveType === COMMAND_RECONNECT_END) {
18856               target = context.hover;
18857             }
18858           }
18859
18860           connection.waypoints = connectionDocking.getCroppedWaypoints(connection, source, target);
18861         }
18862
18863         // asks whether reconnect / bendpoint move / bendpoint add
18864         // is allowed at the given position
18865         var allowed = context.allowed = rules.allowed(context.type, context);
18866
18867         if (allowed) {
18868
18869           if (context.hover) {
18870             canvas.removeMarker(context.hover, MARKER_NOT_OK);
18871             canvas.addMarker(context.hover, MARKER_OK);
18872
18873             context.target = context.hover;
18874           }
18875         } else
18876         if (allowed === false) {
18877           if (context.hover) {
18878             canvas.removeMarker(context.hover, MARKER_OK);
18879             canvas.addMarker(context.hover, MARKER_NOT_OK);
18880
18881             context.target = null;
18882           }
18883         }
18884
18885         // add dragger gfx
18886         context.draggerGfx.translate(e.x, e.y);
18887
18888         redrawConnection(e);
18889       });
18890
18891       eventBus.on([
18892         'bendpoint.move.end',
18893         'bendpoint.move.cancel'
18894       ], function(e) {
18895
18896         var context = e.context,
18897           connection = context.connection;
18898
18899         // remove dragger gfx
18900         context.draggerGfx.remove();
18901
18902         context.newWaypoints = connection.waypoints.slice();
18903
18904         connection.waypoints = context.originalWaypoints;
18905
18906         canvas.removeMarker(connection, MARKER_CONNECT_UPDATING);
18907       });
18908
18909       eventBus.on('bendpoint.move.end', function(e) {
18910
18911         var context = e.context,
18912           waypoints = context.newWaypoints,
18913           bendpointIndex = context.bendpointIndex,
18914           bendpoint = waypoints[bendpointIndex],
18915           allowed = context.allowed;
18916
18917         // ensure we have actual pixel values bendpoint
18918         // coordinates (important when zoom level was > 1 during move)
18919         bendpoint.x = round(bendpoint.x);
18920         bendpoint.y = round(bendpoint.y);
18921
18922         if (allowed === true && context.type === COMMAND_RECONNECT_START) {
18923           modeling.reconnectStart(context.connection, context.target, bendpoint);
18924         } else
18925         if (allowed === true && context.type === COMMAND_RECONNECT_END) {
18926           modeling.reconnectEnd(context.connection, context.target, bendpoint);
18927         } else
18928         if (allowed !== false && context.type === COMMAND_BENDPOINT_UPDATE) {
18929           modeling.updateWaypoints(context.connection, filterRedundantWaypoints(waypoints));
18930         } else {
18931           redrawConnection(e);
18932
18933           return false;
18934         }
18935       });
18936
18937       eventBus.on('bendpoint.move.cancel', function(e) {
18938         redrawConnection(e);
18939       });
18940     }
18941
18942     BendpointMove.$inject = ['injector', 'eventBus', 'canvas', 'dragging', 'graphicsFactory', 'rules', 'modeling'];
18943
18944     module.exports = BendpointMove;
18945   }, {
18946     "../../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js",
18947     "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js"
18948   }],
18949   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointSnapping.js": [function(require, module, exports) {
18950     'use strict';
18951
18952     var assign = require('lodash/object/assign'),
18953       pick = require('lodash/object/pick'),
18954       forEach = require('lodash/collection/forEach');
18955
18956     var Snap = require('../../../vendor/snapsvg');
18957
18958     var round = Math.round;
18959
18960
18961     function BendpointSnapping(eventBus) {
18962
18963       function snapTo(candidates, point) {
18964         return Snap.snapTo(candidates, point);
18965       }
18966
18967       function toPoint(e) {
18968         return pick(e, ['x', 'y']);
18969       }
18970
18971       function mid(element) {
18972         if (element.width) {
18973           return {
18974             x: round(element.width / 2 + element.x),
18975             y: round(element.height / 2 + element.y)
18976           };
18977         }
18978       }
18979
18980       function getSnapPoints(context) {
18981
18982         var snapPoints = context.snapPoints,
18983           waypoints = context.connection.waypoints,
18984           bendpointIndex = context.bendpointIndex,
18985           referenceWaypoints = [waypoints[bendpointIndex - 1], waypoints[bendpointIndex + 1]];
18986
18987         if (!snapPoints) {
18988           context.snapPoints = snapPoints = {
18989             horizontal: [],
18990             vertical: []
18991           };
18992
18993           forEach(referenceWaypoints, function(p) {
18994             // we snap on existing bendpoints only,
18995             // not placeholders that are inserted during add
18996             if (p) {
18997               p = p.original || p;
18998
18999               snapPoints.horizontal.push(p.y);
19000               snapPoints.vertical.push(p.x);
19001             }
19002           });
19003         }
19004
19005         return snapPoints;
19006       }
19007
19008       eventBus.on('bendpoint.move.start', function(event) {
19009         event.context.snapStart = toPoint(event);
19010       });
19011
19012       eventBus.on('bendpoint.move.move', 1500, function(event) {
19013
19014         var context = event.context,
19015           snapPoints = getSnapPoints(context),
19016           start = context.snapStart,
19017           target = context.target,
19018           targetMid = target && mid(target),
19019           x = start.x + event.dx,
19020           y = start.y + event.dy,
19021           sx, sy;
19022
19023         if (!snapPoints) {
19024           return;
19025         }
19026
19027         // snap
19028         sx = snapTo(targetMid ? snapPoints.vertical.concat([targetMid.x]) : snapPoints.vertical, x);
19029         sy = snapTo(targetMid ? snapPoints.horizontal.concat([targetMid.y]) : snapPoints.horizontal, y);
19030
19031
19032         // correction x/y
19033         var cx = (x - sx),
19034           cy = (y - sy);
19035
19036         // update delta
19037         assign(event, {
19038           dx: event.dx - cx,
19039           dy: event.dy - cy,
19040           x: event.x - cx,
19041           y: event.y - cy
19042         });
19043       });
19044     }
19045
19046
19047     BendpointSnapping.$inject = ['eventBus'];
19048
19049     module.exports = BendpointSnapping;
19050   }, {
19051     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
19052     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
19053     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
19054     "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
19055   }],
19056   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Bendpoints.js": [function(require, module, exports) {
19057     'use strict';
19058
19059     var domEvent = require('min-dom/lib/event'),
19060       Util = require('./Util');
19061
19062     var BENDPOINT_CLS = Util.BENDPOINT_CLS;
19063
19064
19065     /**
19066      * A service that adds editable bendpoints to connections.
19067      */
19068     function Bendpoints(injector, eventBus, canvas, interactionEvents, bendpointMove) {
19069
19070       function getConnectionIntersection(waypoints, event) {
19071         var localPosition = Util.toCanvasCoordinates(canvas, event);
19072         return Util.getApproxIntersection(waypoints, localPosition);
19073       }
19074
19075       function activateBendpointMove(event, connection) {
19076         var waypoints = connection.waypoints,
19077           intersection = getConnectionIntersection(waypoints, event);
19078
19079         if (!intersection) {
19080           return;
19081         }
19082
19083         bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);
19084       }
19085
19086       function getBendpointsContainer(element, create) {
19087
19088         var layer = canvas.getLayer('overlays'),
19089           gfx = layer.select('.djs-bendpoints[data-element-id=' + element.id + ']');
19090
19091         if (!gfx && create) {
19092           gfx = layer.group().addClass('djs-bendpoints').attr('data-element-id', element.id);
19093
19094           domEvent.bind(gfx.node, 'mousedown', function(event) {
19095             activateBendpointMove(event, element);
19096           });
19097         }
19098
19099         return gfx;
19100       }
19101
19102       function createBendpoints(gfx, connection) {
19103         connection.waypoints.forEach(function(p, idx) {
19104           Util.addBendpoint(gfx).translate(p.x, p.y);
19105         });
19106
19107         // add floating bendpoint
19108         Util.addBendpoint(gfx).addClass('floating');
19109       }
19110
19111       function clearBendpoints(gfx) {
19112         gfx.selectAll('.' + BENDPOINT_CLS).forEach(function(s) {
19113           s.remove();
19114         });
19115       }
19116
19117       function addBendpoints(connection) {
19118         var gfx = getBendpointsContainer(connection);
19119
19120         if (!gfx) {
19121           gfx = getBendpointsContainer(connection, true);
19122           createBendpoints(gfx, connection);
19123         }
19124
19125         return gfx;
19126       }
19127
19128       function updateBendpoints(connection) {
19129
19130         var gfx = getBendpointsContainer(connection);
19131
19132         if (gfx) {
19133           clearBendpoints(gfx);
19134           createBendpoints(gfx, connection);
19135         }
19136       }
19137
19138       eventBus.on('connection.changed', function(event) {
19139         updateBendpoints(event.element);
19140       });
19141
19142       eventBus.on('connection.remove', function(event) {
19143         var gfx = getBendpointsContainer(event.element);
19144         if (gfx) {
19145           gfx.remove();
19146         }
19147       });
19148
19149       eventBus.on('element.marker.update', function(event) {
19150
19151         var element = event.element,
19152           bendpointsGfx;
19153
19154         if (!element.waypoints) {
19155           return;
19156         }
19157
19158         bendpointsGfx = addBendpoints(element);
19159         bendpointsGfx[event.add ? 'addClass' : 'removeClass'](event.marker);
19160       });
19161
19162       eventBus.on('element.mousemove', function(event) {
19163
19164         var element = event.element,
19165           waypoints = element.waypoints,
19166           bendpointsGfx,
19167           floating,
19168           intersection;
19169
19170         if (waypoints) {
19171
19172           bendpointsGfx = getBendpointsContainer(element, true);
19173           floating = bendpointsGfx.select('.floating');
19174
19175           if (!floating) {
19176             return;
19177           }
19178
19179           intersection = getConnectionIntersection(waypoints, event.originalEvent);
19180
19181           if (intersection) {
19182             floating.translate(intersection.point.x, intersection.point.y);
19183           }
19184         }
19185       });
19186
19187       eventBus.on('element.mousedown', function(event) {
19188
19189         var originalEvent = event.originalEvent,
19190           element = event.element,
19191           waypoints = element.waypoints;
19192
19193         if (!waypoints) {
19194           return;
19195         }
19196
19197         activateBendpointMove(originalEvent, element, waypoints);
19198       });
19199
19200       eventBus.on('selection.changed', function(event) {
19201         var newSelection = event.newSelection,
19202           primary = newSelection[0];
19203
19204         if (primary && primary.waypoints) {
19205           addBendpoints(primary);
19206         }
19207       });
19208
19209       eventBus.on('element.hover', function(event) {
19210         var element = event.element;
19211
19212         if (element.waypoints) {
19213           addBendpoints(element);
19214
19215           interactionEvents.registerEvent(event.gfx.node, 'mousemove', 'element.mousemove');
19216         }
19217       });
19218
19219       eventBus.on('element.out', function(event) {
19220         interactionEvents.unregisterEvent(event.gfx.node, 'mousemove', 'element.mousemove');
19221       });
19222     }
19223
19224     Bendpoints.$inject = ['injector', 'eventBus', 'canvas', 'interactionEvents', 'bendpointMove'];
19225
19226     module.exports = Bendpoints;
19227   }, {
19228     "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js",
19229     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
19230   }],
19231   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js": [function(require, module, exports) {
19232     'use strict';
19233
19234     var Snap = require('../../../vendor/snapsvg');
19235
19236     var Events = require('../../util/Event'),
19237       Geometry = require('../../util/Geometry');
19238
19239     var BENDPOINT_CLS = module.exports.BENDPOINT_CLS = 'djs-bendpoint';
19240
19241     module.exports.toCanvasCoordinates = function(canvas, event) {
19242
19243       var position = Events.toPoint(event),
19244         clientRect = canvas._container.getBoundingClientRect(),
19245         offset;
19246
19247       // canvas relative position
19248
19249       offset = {
19250         x: clientRect.left,
19251         y: clientRect.top
19252       };
19253
19254       // update actual event payload with canvas relative measures
19255
19256       var viewbox = canvas.viewbox();
19257
19258       return {
19259         x: viewbox.x + (position.x - offset.x) / viewbox.scale,
19260         y: viewbox.y + (position.y - offset.y) / viewbox.scale
19261       };
19262     };
19263
19264     module.exports.addBendpoint = function(parentGfx) {
19265       var groupGfx = parentGfx.group().addClass(BENDPOINT_CLS);
19266
19267       groupGfx.circle(0, 0, 4).addClass('djs-visual');
19268       groupGfx.circle(0, 0, 10).addClass('djs-hit');
19269
19270       return groupGfx;
19271     };
19272
19273
19274     function circlePath(center, r) {
19275       var x = center.x,
19276         y = center.y;
19277
19278       return [
19279         ['M', x, y],
19280         ['m', 0, -r],
19281         ['a', r, r, 0, 1, 1, 0, 2 * r],
19282         ['a', r, r, 0, 1, 1, 0, -2 * r],
19283         ['z']
19284       ];
19285     }
19286
19287     function linePath(points) {
19288       var segments = [];
19289
19290       points.forEach(function(p, idx) {
19291         segments.push([idx === 0 ? 'M' : 'L', p.x, p.y]);
19292       });
19293
19294       return segments;
19295     }
19296
19297
19298     var INTERSECTION_THRESHOLD = 10;
19299
19300     function getBendpointIntersection(waypoints, reference) {
19301
19302       var i, w;
19303
19304       for (i = 0; !!(w = waypoints[i]); i++) {
19305
19306         if (Geometry.distance(w, reference) <= INTERSECTION_THRESHOLD) {
19307           return {
19308             point: waypoints[i],
19309             bendpoint: true,
19310             index: i
19311           };
19312         }
19313       }
19314
19315       return null;
19316     }
19317
19318     function getPathIntersection(waypoints, reference) {
19319
19320       var intersections = Snap.path.intersection(circlePath(reference, INTERSECTION_THRESHOLD), linePath(waypoints));
19321
19322       var a = intersections[0],
19323         b = intersections[intersections.length - 1],
19324         idx;
19325
19326       if (!a) {
19327         // no intersection
19328         return null;
19329       }
19330
19331       if (a !== b) {
19332
19333         if (a.segment2 !== b.segment2) {
19334           // we use the bendpoint in between both segments
19335           // as the intersection point
19336
19337           idx = Math.max(a.segment2, b.segment2) - 1;
19338
19339           return {
19340             point: waypoints[idx],
19341             bendpoint: true,
19342             index: idx
19343           };
19344         }
19345
19346         return {
19347           point: {
19348             x: (Math.round(a.x + b.x) / 2),
19349             y: (Math.round(a.y + b.y) / 2)
19350           },
19351           index: a.segment2
19352         };
19353       }
19354
19355       return {
19356         point: {
19357           x: Math.round(a.x),
19358           y: Math.round(a.y)
19359         },
19360         index: a.segment2
19361       };
19362     }
19363
19364     /**
19365      * Returns the closest point on the connection towards a given reference point.
19366      *
19367      * @param {Array
19368      *            <Point>} waypoints
19369      * @param {Point}
19370      *            reference
19371      *
19372      * @return {Object} intersection data (segment, point)
19373      */
19374     module.exports.getApproxIntersection = function(waypoints, reference) {
19375       return getBendpointIntersection(waypoints, reference) || getPathIntersection(waypoints, reference);
19376     };
19377   }, {
19378     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
19379     "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
19380     "../../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js"
19381   }],
19382   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\index.js": [function(require, module, exports) {
19383     module.exports = {
19384       __depends__: [require('../dragging'), require('../rules')],
19385       __init__: ['bendpoints', 'bendpointSnapping'],
19386       bendpoints: ['type', require('./Bendpoints')],
19387       bendpointMove: ['type', require('./BendpointMove')],
19388       bendpointSnapping: ['type', require('./BendpointSnapping')]
19389     };
19390   }, {
19391     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
19392     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
19393     "./BendpointMove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointMove.js",
19394     "./BendpointSnapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointSnapping.js",
19395     "./Bendpoints": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Bendpoints.js"
19396   }],
19397   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\ChangeSupport.js": [function(require, module, exports) {
19398     'use strict';
19399
19400     /**
19401      * Adds change support to the diagram, including
19402      *
19403      * <ul>
19404      * <li>redrawing shapes and connections on change</li>
19405      * </ul>
19406      *
19407      * @param {EventBus}
19408      *            eventBus
19409      * @param {ElementRegistry}
19410      *            elementRegistry
19411      * @param {GraphicsFactory}
19412      *            graphicsFactory
19413      */
19414     function ChangeSupport(eventBus, elementRegistry, graphicsFactory) {
19415
19416       // redraw shapes / connections on change
19417
19418       eventBus.on('element.changed', function(event) {
19419
19420         var element = event.element;
19421
19422         if (!event.gfx) {
19423           event.gfx = elementRegistry.getGraphics(element);
19424         }
19425
19426         // shape + gfx may have been deleted
19427         if (!event.gfx) {
19428           return;
19429         }
19430
19431         if (element.waypoints) {
19432           eventBus.fire('connection.changed', event);
19433         } else {
19434           eventBus.fire('shape.changed', event);
19435         }
19436       });
19437
19438       eventBus.on('elements.changed', function(event) {
19439
19440         var elements = event.elements;
19441
19442         elements.forEach(function(e) {
19443           eventBus.fire('element.changed', {
19444             element: e
19445           });
19446         });
19447
19448         graphicsFactory.updateContainments(elements);
19449       });
19450
19451       eventBus.on('shape.changed', function(event) {
19452         graphicsFactory.update('shape', event.element, event.gfx);
19453       });
19454
19455       eventBus.on('connection.changed', function(event) {
19456         graphicsFactory.update('connection', event.element, event.gfx);
19457       });
19458     }
19459
19460     ChangeSupport.$inject = ['eventBus', 'elementRegistry', 'graphicsFactory'];
19461
19462     module.exports = ChangeSupport;
19463
19464   }, {}],
19465   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js": [function(require, module, exports) {
19466     module.exports = {
19467       __init__: ['changeSupport'],
19468       changeSupport: ['type', require('./ChangeSupport')]
19469     };
19470   }, {
19471     "./ChangeSupport": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\ChangeSupport.js"
19472   }],
19473   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\Connect.js": [function(require, module, exports) {
19474     'use strict';
19475
19476     var LayoutUtil = require('../../layout/LayoutUtil');
19477
19478     var MARKER_OK = 'connect-ok',
19479       MARKER_NOT_OK = 'connect-not-ok';
19480
19481
19482     function Connect(eventBus, dragging, modeling, rules, canvas, renderer) {
19483
19484       // TODO(nre): separate UI and events
19485
19486       // rules
19487
19488       function canConnect(source, target) {
19489         return rules.allowed('connection.create', {
19490           source: source,
19491           target: target
19492         });
19493       }
19494
19495
19496       // layouting
19497
19498       function crop(start, end, source, target) {
19499
19500         var sourcePath = renderer.getShapePath(source),
19501           targetPath = target && renderer.getShapePath(target),
19502           connectionPath = renderer.getConnectionPath({
19503             waypoints: [start, end]
19504           });
19505
19506         start = LayoutUtil.getElementLineIntersection(sourcePath, connectionPath, true) || start;
19507         end = (target && LayoutUtil.getElementLineIntersection(targetPath, connectionPath, false)) || end;
19508
19509         return [start, end];
19510       }
19511
19512
19513       // event handlers
19514
19515       eventBus.on('connect.move', function(event) {
19516
19517         var context = event.context,
19518           source = context.source,
19519           target = context.target,
19520           visual = context.visual,
19521           start, end, waypoints;
19522
19523         // update connection visuals during drag
19524
19525         start = LayoutUtil.getMidPoint(source);
19526
19527         end = {
19528           x: event.x,
19529           y: event.y
19530         };
19531
19532         waypoints = crop(start, end, source, target);
19533
19534         visual.attr('points', [waypoints[0].x, waypoints[0].y, waypoints[1].x, waypoints[1].y]);
19535       });
19536
19537       eventBus.on('connect.hover', function(event) {
19538         var context = event.context,
19539           source = context.source,
19540           hover = event.hover,
19541           canExecute;
19542
19543         canExecute = context.canExecute = canConnect(source, hover);
19544
19545         // simply ignore hover
19546         if (canExecute === null) {
19547           return;
19548         }
19549
19550         context.target = hover;
19551
19552         canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
19553       });
19554
19555       eventBus.on(['connect.out', 'connect.cleanup'], function(event) {
19556         var context = event.context;
19557
19558         if (context.target) {
19559           canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
19560         }
19561
19562         context.target = null;
19563       });
19564
19565       eventBus.on('connect.cleanup', function(event) {
19566         var context = event.context;
19567
19568         if (context.visual) {
19569           context.visual.remove();
19570         }
19571       });
19572
19573       eventBus.on('connect.start', function(event) {
19574         var context = event.context,
19575           visual;
19576
19577         visual = canvas.getDefaultLayer().polyline().attr({
19578           'stroke': '#333',
19579           'strokeDasharray': [1],
19580           'strokeWidth': 2,
19581           'pointer-events': 'none'
19582         });
19583
19584         context.visual = visual;
19585       });
19586
19587       eventBus.on('connect.end', function(event) {
19588
19589         var context = event.context,
19590           source = context.source,
19591           target = context.target,
19592           canExecute = context.canExecute || canConnect(source, target);
19593
19594         if (!canExecute) {
19595           return false;
19596         }
19597
19598         modeling.connect(source, target);
19599       });
19600
19601
19602       // API
19603
19604       this.start = function(event, source, autoActivate) {
19605
19606         dragging.activate(event, 'connect', {
19607           autoActivate: autoActivate,
19608           data: {
19609             shape: source,
19610             context: {
19611               source: source
19612             }
19613           }
19614         });
19615       };
19616     }
19617
19618     Connect.$inject = ['eventBus', 'dragging', 'modeling', 'rules', 'canvas', 'renderer'];
19619
19620     module.exports = Connect;
19621   }, {
19622     "../../layout/LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js"
19623   }],
19624   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\index.js": [function(require, module, exports) {
19625     module.exports = {
19626       __depends__: [
19627         require('../selection'),
19628         require('../rules'),
19629         require('../dragging')
19630       ],
19631       connect: ['type', require('./Connect')]
19632     };
19633
19634   }, {
19635     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
19636     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
19637     "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
19638     "./Connect": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\Connect.js"
19639   }],
19640   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\ContextPad.js": [function(require, module, exports) {
19641     'use strict';
19642
19643     var isFunction = require('lodash/lang/isFunction'),
19644       forEach = require('lodash/collection/forEach'),
19645
19646       domDelegate = require('min-dom/lib/delegate'),
19647       domClear = require('min-dom/lib/clear'),
19648       domEvent = require('min-dom/lib/event'),
19649       domAttr = require('min-dom/lib/attr'),
19650       domQuery = require('min-dom/lib/query'),
19651       domClasses = require('min-dom/lib/classes'),
19652       domify = require('min-dom/lib/domify');
19653
19654
19655     var entrySelector = '.entry';
19656
19657
19658     /**
19659      * A context pad that displays element specific, contextual actions next to a
19660      * diagram element.
19661      *
19662      * @param {EventBus}
19663      *            eventBus
19664      * @param {Overlays}
19665      *            overlays
19666      */
19667     function ContextPad(eventBus, overlays) {
19668
19669       this._providers = [];
19670
19671       this._eventBus = eventBus;
19672       this._overlays = overlays;
19673
19674       this._current = null;
19675
19676       this._init();
19677     }
19678
19679     ContextPad.$inject = ['eventBus', 'overlays'];
19680
19681     /**
19682      * Registers events needed for interaction with other components
19683      */
19684     ContextPad.prototype._init = function() {
19685
19686       var eventBus = this._eventBus;
19687
19688       var self = this;
19689
19690       eventBus.on('selection.changed', function(e) {
19691
19692         var selection = e.newSelection;
19693
19694         if (selection.length === 1) {
19695           self.open(selection[0]);
19696         } else {
19697           self.close();
19698         }
19699       });
19700     };
19701
19702
19703     /**
19704      * Register a provider with the context pad
19705      *
19706      * @param {ContextPadProvider}
19707      *            provider
19708      */
19709     ContextPad.prototype.registerProvider = function(provider) {
19710       this._providers.push(provider);
19711     };
19712
19713
19714     /**
19715      * Returns the context pad entries for a given element
19716      *
19717      * @param {djs.element.Base}
19718      *            element
19719      *
19720      * @return {Array<ContextPadEntryDescriptor>} list of entries
19721      */
19722     ContextPad.prototype.getEntries = function(element) {
19723       var entries = {};
19724
19725       // loop through all providers and their entries.
19726       // group entries by id so that overriding an entry is possible
19727       forEach(this._providers, function(provider) {
19728         var e = provider.getContextPadEntries(element);
19729
19730         forEach(e, function(entry, id) {
19731           entries[id] = entry;
19732         });
19733       });
19734
19735       return entries;
19736     };
19737
19738
19739     /**
19740      * Trigger an action available on the opened context pad
19741      *
19742      * @param {String}
19743      *            action
19744      * @param {Event}
19745      *            event
19746      */
19747     ContextPad.prototype.trigger = function(action, event, autoActivate) {
19748
19749       var current = this._current,
19750         element = current.element,
19751         entries = current.entries,
19752         entry,
19753         handler,
19754         originalEvent,
19755         button = event.delegateTarget || event.target;
19756
19757       if (!button) {
19758         return event.preventDefault();
19759       }
19760
19761       entry = entries[domAttr(button, 'data-action')];
19762       handler = entry.action;
19763
19764       originalEvent = event.originalEvent || event;
19765
19766       // simple action (via callback function)
19767       if (isFunction(handler)) {
19768         if (action === 'click') {
19769           return handler(originalEvent, element, autoActivate);
19770         }
19771       } else {
19772         if (handler[action]) {
19773           return handler[action](originalEvent, element, autoActivate);
19774         }
19775       }
19776
19777       // silence other actions
19778       event.preventDefault();
19779     };
19780
19781
19782     /**
19783      * Open the context pad for the given element
19784      *
19785      * @param {djs.model.Base}
19786      *            element
19787      */
19788     ContextPad.prototype.open = function(element) {
19789
19790       if (this._current && this._current.open) {
19791
19792         if (this._current.element === element) {
19793           // no change needed
19794           return;
19795         }
19796
19797         this.close();
19798       }
19799
19800       this._updateAndOpen(element);
19801     };
19802
19803
19804     ContextPad.prototype._updateAndOpen = function(element) {
19805
19806       var entries = this.getEntries(element),
19807         pad = this.getPad(element),
19808         html = pad.html;
19809
19810       domClear(html);
19811
19812       forEach(entries, function(entry, id) {
19813         var grouping = entry.group || 'default',
19814           control = domify(entry.html || '<div class="entry" draggable="true"></div>'),
19815           container;
19816
19817         domAttr(control, 'data-action', id);
19818
19819         container = domQuery('[data-group=' + grouping + ']', html);
19820         if (!container) {
19821           container = domify('<div class="group" data-group="' + grouping + '"></div>');
19822           html.appendChild(container);
19823         }
19824
19825         container.appendChild(control);
19826
19827         if (entry.className) {
19828           domClasses(control).add(entry.className);
19829         }
19830
19831         if (entry.title) {
19832           domAttr(control, 'title', entry.title);
19833         }
19834
19835         if (entry.imageUrl) {
19836           control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
19837         }
19838       });
19839
19840       domClasses(html).add('open');
19841
19842       this._current = {
19843         element: element,
19844         pad: pad,
19845         entries: entries,
19846         open: true
19847       };
19848
19849       this._eventBus.fire('contextPad.open', {
19850         current: this._current
19851       });
19852     };
19853
19854     ContextPad.prototype.getPad = function(element) {
19855
19856       var self = this;
19857
19858       var overlays = this._overlays,
19859         pads = overlays.get({
19860           element: element,
19861           type: 'context-pad'
19862         });
19863
19864       // create context pad on demand if needed
19865       if (!pads.length) {
19866
19867         var html = domify('<div class="djs-context-pad"></div>');
19868
19869         domDelegate.bind(html, entrySelector, 'click', function(event) {
19870           self.trigger('click', event);
19871         });
19872
19873         domDelegate.bind(html, entrySelector, 'dragstart', function(event) {
19874           self.trigger('dragstart', event);
19875         });
19876
19877         // stop propagation of mouse events
19878         domEvent.bind(html, 'mousedown', function(event) {
19879           event.stopPropagation();
19880         });
19881
19882
19883         overlays.add(element, 'context-pad', {
19884           position: {
19885             right: -9,
19886             top: -6
19887           },
19888           html: html
19889         });
19890
19891         pads = overlays.get({
19892           element: element,
19893           type: 'context-pad'
19894         });
19895
19896         this._eventBus.fire('contextPad.create', {
19897           element: element,
19898           pad: pads[0]
19899         });
19900       }
19901
19902       return pads[0];
19903     };
19904
19905
19906     /**
19907      * Close the context pad
19908      */
19909     ContextPad.prototype.close = function() {
19910
19911       var html;
19912
19913       if (this._current) {
19914         if (this._current.open) {
19915           html = this._current.pad.html;
19916           domClasses(html).remove('open');
19917         }
19918
19919         this._current.open = false;
19920
19921         this._eventBus.fire('contextPad.close', {
19922           current: this._current
19923         });
19924       }
19925     };
19926
19927
19928     /**
19929      * Return the element the context pad is currently opened for, if it is opened.
19930      *
19931      * @example
19932      *
19933      * contextPad.open(shape1);
19934      *
19935      * if (contextPad.isOpen()) { // yes, we are open }
19936      *
19937      * @return {djs.model.Base} element
19938      */
19939     ContextPad.prototype.isOpen = function() {
19940       return this._current && this._current.open;
19941     };
19942
19943     module.exports = ContextPad;
19944
19945   }, {
19946     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
19947     "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
19948     "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
19949     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
19950     "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js",
19951     "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
19952     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
19953     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
19954     "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js"
19955   }],
19956   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\index.js": [function(require, module, exports) {
19957     module.exports = {
19958       __depends__: [
19959         require('../interaction-events'),
19960         require('../overlays')
19961       ],
19962       contextPad: ['type', require('./ContextPad')]
19963     };
19964   }, {
19965     "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
19966     "../overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js",
19967     "./ContextPad": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\ContextPad.js"
19968   }],
19969   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\Create.js": [function(require, module, exports) {
19970     'use strict';
19971
19972     var MARKER_OK = 'drop-ok',
19973       MARKER_NOT_OK = 'drop-not-ok';
19974
19975
19976     function Create(eventBus, dragging, rules, modeling, canvas, elementFactory, renderer, styles) {
19977
19978       // rules
19979
19980       function canCreate(shape, target, source) {
19981
19982         if (source) {
19983           return rules.allowed('shape.append', {
19984             source: source,
19985             shape: shape,
19986             parent: target
19987           });
19988         } else {
19989           return rules.allowed('shape.create', {
19990             shape: shape,
19991             parent: target
19992           });
19993         }
19994       }
19995
19996
19997       // visual helpers
19998
19999       function createVisual(shape) {
20000         var group, preview, visual;
20001
20002         group = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
20003
20004         preview = group.group().addClass('djs-dragger');
20005
20006         preview.translate(shape.width / -2, shape.height / -2);
20007
20008         visual = preview.group().addClass('djs-visual');
20009
20010         // hijack renderer to draw preview
20011         renderer.drawShape(visual, shape);
20012
20013         return group;
20014       }
20015
20016
20017       // event handlers
20018
20019       eventBus.on('create.move', function(event) {
20020
20021         var context = event.context,
20022           shape = context.shape,
20023           visual = context.visual;
20024
20025         // lazy init drag visual once we received the first real
20026         // drag move event (this allows us to get the proper canvas local
20027         // coordinates)
20028         if (!visual) {
20029           visual = context.visual = createVisual(shape);
20030         }
20031
20032         visual.translate(event.x, event.y);
20033
20034         var hover = event.hover,
20035           canExecute;
20036
20037         canExecute = context.canExecute = hover && canCreate(context.shape, hover, context.source);
20038
20039         // ignore hover visually if canExecute is null
20040         if (hover && canExecute !== null) {
20041           context.target = hover;
20042           canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
20043         }
20044       });
20045
20046       eventBus.on(['create.end', 'create.out', 'create.cleanup'], function(event) {
20047         var context = event.context;
20048
20049         if (context.target) {
20050           canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
20051         }
20052       });
20053
20054       eventBus.on('create.end', function(event) {
20055         var context = event.context,
20056           source = context.source,
20057           shape = context.shape,
20058           target = context.target,
20059           canExecute = context.canExecute,
20060           position = {
20061             x: event.x,
20062             y: event.y
20063           };
20064
20065         if (!canExecute) {
20066           return false;
20067         }
20068
20069         if (source) {
20070           modeling.appendShape(source, shape, position, target);
20071         } else {
20072           modeling.createShape(shape, position, target);
20073         }
20074       });
20075
20076
20077       eventBus.on('create.cleanup', function(event) {
20078         var context = event.context;
20079
20080         if (context.visual) {
20081           context.visual.remove();
20082         }
20083       });
20084
20085       // API
20086
20087       this.start = function(event, shape, source) {
20088
20089         dragging.activate(event, 'create', {
20090           cursor: 'grabbing',
20091           autoActivate: true,
20092           data: {
20093             shape: shape,
20094             context: {
20095               shape: shape,
20096               source: source
20097             }
20098           }
20099         });
20100       };
20101     }
20102
20103     Create.$inject = ['eventBus', 'dragging', 'rules', 'modeling', 'canvas', 'elementFactory', 'renderer', 'styles'];
20104
20105     module.exports = Create;
20106   }, {}],
20107   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js": [function(require, module, exports) {
20108     module.exports = {
20109       __depends__: [
20110         require('../dragging'),
20111         require('../selection')
20112       ],
20113       create: ['type', require('./Create')]
20114     };
20115   }, {
20116     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
20117     "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
20118     "./Create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\Create.js"
20119   }],
20120   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\Dragging.js": [function(require, module, exports) {
20121     'use strict';
20122
20123     /* global TouchEvent */
20124
20125     var assign = require('lodash/object/assign');
20126
20127     var domEvent = require('min-dom/lib/event'),
20128       Event = require('../../util/Event'),
20129       ClickTrap = require('../../util/ClickTrap'),
20130       Cursor = require('../../util/Cursor');
20131
20132     function suppressEvent(event) {
20133       if (event instanceof MouseEvent) {
20134         Event.stopEvent(event, true);
20135       } else {
20136         Event.preventDefault(event);
20137       }
20138     }
20139
20140     function getLength(point) {
20141       return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
20142     }
20143
20144     function substract(p1, p2) {
20145       return {
20146         x: p1.x - p2.x,
20147         y: p1.y - p2.y
20148       };
20149     }
20150
20151     /**
20152      * A helper that fires canvas localized drag events and realizes the general
20153      * "drag-and-drop" look and feel.
20154      *
20155      * Calling {@link Dragging#activate} activates dragging on a canvas.
20156      *
20157      * It provides the following:
20158      *  * emits the events `start`, `move`, `end`, `cancel` and `cleanup` via the
20159      * {@link EventBus}. Each of the events is prefixed with a prefix that is
20160      * assigned during activate. * sets and restores the cursor * sets and restores
20161      * the selection * ensures there can be only one drag operation active at a time
20162      *
20163      * Dragging may be canceled manually by calling {@link Dragging#cancel} or by
20164      * pressing ESC.
20165      *
20166      * @example
20167      *
20168      * function MyDragComponent(eventBus, dragging) {
20169      *
20170      * eventBus.on('mydrag.start', function(event) { console.log('yes, we start
20171      * dragging'); });
20172      *
20173      * eventBus.on('mydrag.move', function(event) { console.log('canvas local
20174      * coordinates', event.x, event.y, event.dx, event.dy);
20175      *  // local drag data is passed with the event event.context.foo; // "BAR"
20176      *  // the original mouse event, too event.originalEvent; // MouseEvent(...) });
20177      *
20178      * eventBus.on('element.click', function(event) { dragging.activate(event,
20179      * 'mydrag', { cursor: 'grabbing', data: { context: { foo: "BAR" } } }); }); }
20180      */
20181     function Dragging(eventBus, canvas, selection) {
20182
20183       var defaultOptions = {
20184         threshold: 5
20185       };
20186
20187       // the currently active drag operation
20188       // dragging is active as soon as this context exists.
20189       //
20190       // it is visually _active_ only when a context.active flag is set to true.
20191       var context;
20192
20193
20194       // helpers
20195
20196       function fire(type) {
20197
20198         var ActualEvent = require('../../core/EventBus').Event;
20199
20200         var event = assign(new ActualEvent(), context.payload, context.data);
20201
20202         // default integration
20203         if (eventBus.fire('drag.' + type, event) === false) {
20204           return false;
20205         }
20206
20207         return eventBus.fire(context.prefix + '.' + type, event);
20208       }
20209
20210       // event listeners
20211
20212       function move(event, activate) {
20213
20214         var payload = context.payload,
20215           start = context.start,
20216           position = Event.toPoint(event),
20217           delta = substract(position, start),
20218           clientRect = canvas._container.getBoundingClientRect(),
20219           offset;
20220
20221         // canvas relative position
20222
20223         offset = {
20224           x: clientRect.left,
20225           y: clientRect.top
20226         };
20227
20228         // update actual event payload with canvas relative measures
20229
20230         var viewbox = canvas.viewbox();
20231
20232         var movement = {
20233           x: viewbox.x + (position.x - offset.x) / viewbox.scale,
20234           y: viewbox.y + (position.y - offset.y) / viewbox.scale,
20235           dx: delta.x / viewbox.scale,
20236           dy: delta.y / viewbox.scale
20237         };
20238
20239         // activate context explicitly or once threshold is reached
20240
20241         if (!context.active && (activate || getLength(delta) > context.threshold)) {
20242
20243           // fire start event with original
20244           // starting coordinates
20245
20246           assign(payload, {
20247             x: movement.x - movement.dx,
20248             y: movement.y - movement.dy,
20249             dx: 0,
20250             dy: 0
20251           }, {
20252             originalEvent: event
20253           });
20254
20255           if (false === fire('start')) {
20256             return cancel();
20257           }
20258
20259           context.active = true;
20260
20261           // unset selection
20262           if (!context.keepSelection) {
20263             context.previousSelection = selection.get();
20264             selection.select(null);
20265           }
20266
20267           // allow custom cursor
20268           if (context.cursor) {
20269             Cursor.set(context.cursor);
20270           }
20271         }
20272
20273         suppressEvent(event);
20274
20275         if (context.active) {
20276
20277           // fire move event with actual coordinates
20278           assign(payload, movement, {
20279             originalEvent: event
20280           });
20281
20282           fire('move');
20283         }
20284       }
20285
20286       function end(event) {
20287
20288         var returnValue = true;
20289
20290         if (context.active) {
20291
20292           if (event) {
20293             context.payload.originalEvent = event;
20294
20295             // suppress original event (click, ...)
20296             // because we just ended a drag operation
20297             suppressEvent(event);
20298           }
20299
20300           // implementations may stop restoring the
20301           // original state (selections, ...) by preventing the
20302           // end events default action
20303           returnValue = fire('end');
20304         }
20305
20306         if (returnValue === false) {
20307           fire('rejected');
20308         }
20309
20310         cleanup(returnValue !== true);
20311       }
20312
20313
20314       // cancel active drag operation if the user presses
20315       // the ESC key on the keyboard
20316
20317       function checkCancel(event) {
20318
20319         if (event.which === 27) {
20320           event.preventDefault();
20321
20322           cancel();
20323         }
20324       }
20325
20326
20327       // prevent ghost click that might occur after a finished
20328       // drag and drop session
20329
20330       function trapClickAndEnd(event) {
20331
20332         var untrap;
20333
20334         // trap the click in case we are part of an active
20335         // drag operation. This will effectively prevent
20336         // the ghost click that cannot be canceled otherwise.
20337         if (context.active) {
20338           untrap = ClickTrap.install();
20339           setTimeout(untrap, 400);
20340         }
20341
20342         end(event);
20343       }
20344
20345       function trapTouch(event) {
20346         move(event);
20347       }
20348
20349       // update the drag events hover (djs.model.Base) and hoverGfx
20350       // (Snap<SVGElement>)
20351       // properties during hover and out and fire {prefix}.hover and {prefix}.out
20352       // properties
20353       // respectively
20354
20355       function hover(event) {
20356         var payload = context.payload;
20357
20358         payload.hoverGfx = event.gfx;
20359         payload.hover = event.element;
20360
20361         fire('hover');
20362       }
20363
20364       function out(event) {
20365         fire('out');
20366
20367         var payload = context.payload;
20368
20369         payload.hoverGfx = null;
20370         payload.hover = null;
20371       }
20372
20373
20374       // life-cycle methods
20375
20376       function cancel(restore) {
20377
20378         if (!context) {
20379           return;
20380         }
20381
20382         if (context.active) {
20383           fire('cancel');
20384         }
20385
20386         cleanup(restore);
20387       }
20388
20389       function cleanup(restore) {
20390
20391         fire('cleanup');
20392
20393         // reset cursor
20394         Cursor.unset();
20395
20396         // reset dom listeners
20397         domEvent.unbind(document, 'mousemove', move);
20398
20399         domEvent.unbind(document, 'mousedown', trapClickAndEnd, true);
20400         domEvent.unbind(document, 'mouseup', trapClickAndEnd, true);
20401
20402         domEvent.unbind(document, 'keyup', checkCancel);
20403
20404         domEvent.unbind(document, 'touchstart', trapTouch, true);
20405         domEvent.unbind(document, 'touchcancel', cancel, true);
20406         domEvent.unbind(document, 'touchmove', move, true);
20407         domEvent.unbind(document, 'touchend', end, true);
20408
20409         eventBus.off('element.hover', hover);
20410         eventBus.off('element.out', out);
20411
20412         // restore selection, unless it has changed
20413         if (restore !== false && context.previousSelection && !selection.get().length) {
20414           selection.select(context.previousSelection);
20415         }
20416
20417         context = null;
20418       }
20419
20420       /**
20421        * Activate a drag operation
20422        *
20423        * @param {MouseEvent|TouchEvent}
20424        *            [event]
20425        * @param {String}
20426        *            prefix
20427        * @param {Object}
20428        *            [options]
20429        */
20430       function activate(event, prefix, options) {
20431
20432         // only one drag operation may be active, at a time
20433         if (context) {
20434           cancel(false);
20435         }
20436
20437         options = assign({}, defaultOptions, options || {});
20438
20439         var data = options.data || {},
20440           originalEvent,
20441           start;
20442
20443         if (event) {
20444           originalEvent = Event.getOriginal(event) || event;
20445           start = Event.toPoint(event);
20446
20447           suppressEvent(event);
20448         } else {
20449           originalEvent = null;
20450           start = {
20451             x: 0,
20452             y: 0
20453           };
20454         }
20455
20456         context = assign({
20457           prefix: prefix,
20458           data: data,
20459           payload: {},
20460           start: start
20461         }, options);
20462
20463         // skip dom registration if trigger
20464         // is set to manual (during testing)
20465         if (!options.manual) {
20466
20467           // add dom listeners
20468
20469           // fixes TouchEvent not being available on desktop Firefox
20470           if (typeof TouchEvent !== 'undefined' && originalEvent instanceof TouchEvent) {
20471             domEvent.bind(document, 'touchstart', trapTouch, true);
20472             domEvent.bind(document, 'touchcancel', cancel, true);
20473             domEvent.bind(document, 'touchmove', move, true);
20474             domEvent.bind(document, 'touchend', end, true);
20475           } else {
20476             // assume we use the mouse to interact per default
20477             domEvent.bind(document, 'mousemove', move);
20478
20479             domEvent.bind(document, 'mousedown', trapClickAndEnd, true);
20480             domEvent.bind(document, 'mouseup', trapClickAndEnd, true);
20481           }
20482
20483           domEvent.bind(document, 'keyup', checkCancel);
20484
20485           eventBus.on('element.hover', hover);
20486           eventBus.on('element.out', out);
20487         }
20488
20489         fire('activate');
20490
20491         if (options.autoActivate) {
20492           move(event, true);
20493         }
20494       }
20495
20496       // cancel on diagram destruction
20497       eventBus.on('diagram.destroy', cancel);
20498
20499
20500       // API
20501
20502       this.activate = activate;
20503       this.move = move;
20504       this.hover = hover;
20505       this.out = out;
20506       this.end = end;
20507
20508       this.cancel = cancel;
20509
20510       // for introspection
20511
20512       this.active = function() {
20513         return context;
20514       };
20515
20516       this.setOptions = function(options) {
20517         assign(defaultOptions, options);
20518       };
20519     }
20520
20521     Dragging.$inject = ['eventBus', 'canvas', 'selection'];
20522
20523     module.exports = Dragging;
20524   }, {
20525     "../../core/EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
20526     "../../util/ClickTrap": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js",
20527     "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
20528     "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
20529     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
20530     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
20531   }],
20532   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js": [function(require, module, exports) {
20533     module.exports = {
20534       __depends__: [
20535         require('../selection')
20536       ],
20537       dragging: ['type', require('./Dragging')]
20538     };
20539   }, {
20540     "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
20541     "./Dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\Dragging.js"
20542   }],
20543   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\InteractionEvents.js": [function(require, module, exports) {
20544     'use strict';
20545
20546     var forEach = require('lodash/collection/forEach'),
20547       domDelegate = require('min-dom/lib/delegate'),
20548       Renderer = require('../../draw/Renderer'),
20549       createLine = Renderer.createLine,
20550       updateLine = Renderer.updateLine;
20551
20552
20553     var isPrimaryButton = require('../../util/Mouse').isPrimaryButton;
20554
20555     var Snap = require('../../../vendor/snapsvg');
20556
20557     /**
20558      * A plugin that provides interaction events for diagram elements.
20559      *
20560      * It emits the following events:
20561      *  * element.hover * element.out * element.click * element.dblclick *
20562      * element.mousedown
20563      *
20564      * Each event is a tuple { element, gfx, originalEvent }.
20565      *
20566      * Canceling the event via Event#preventDefault() prevents the original DOM
20567      * operation.
20568      *
20569      * @param {EventBus}
20570      *            eventBus
20571      */
20572     function InteractionEvents(eventBus, elementRegistry, styles) {
20573
20574       var HIT_STYLE = styles.cls('djs-hit', ['no-fill', 'no-border'], {
20575         stroke: 'white',
20576         strokeWidth: 15
20577       });
20578
20579       function fire(type, event) {
20580         var target = event.delegateTarget || event.target,
20581           gfx = target && new Snap(target),
20582           element = elementRegistry.get(gfx),
20583           returnValue;
20584
20585         if (!gfx || !element) {
20586           return;
20587         }
20588
20589         returnValue = eventBus.fire(type, {
20590           element: element,
20591           gfx: gfx,
20592           originalEvent: event
20593         });
20594
20595         if (returnValue === false) {
20596           event.stopPropagation();
20597           event.preventDefault();
20598         }
20599       }
20600
20601       var handlers = {};
20602
20603       function mouseHandler(type) {
20604
20605         var fn = handlers[type];
20606
20607         if (!fn) {
20608           fn = handlers[type] = function(event) {
20609             // only indicate left mouse button interactions
20610             if (isPrimaryButton(event)) {
20611               fire(type, event);
20612             }
20613           };
20614         }
20615
20616         return fn;
20617       }
20618
20619       var bindings = {
20620         mouseover: 'element.hover',
20621         mouseout: 'element.out',
20622         click: 'element.click',
20623         dblclick: 'element.dblclick',
20624         mousedown: 'element.mousedown',
20625         mouseup: 'element.mouseup',
20626         keydown: 'element.keyup'
20627
20628       };
20629
20630       var elementSelector = 'svg, .djs-element';
20631
20632       // /// event registration
20633
20634       function registerEvent(node, event, localEvent) {
20635         var handler = mouseHandler(localEvent);
20636         handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);
20637       }
20638
20639       function unregisterEvent(node, event, localEvent) {
20640         domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);
20641       }
20642
20643       function registerEvents(svg) {
20644         forEach(bindings, function(val, key) {
20645           registerEvent(svg.node, key, val);
20646         });
20647       }
20648
20649       function unregisterEvents(svg) {
20650         forEach(bindings, function(val, key) {
20651           unregisterEvent(svg.node, key, val);
20652         });
20653       }
20654
20655       eventBus.on('canvas.destroy', function(event) {
20656         unregisterEvents(event.svg);
20657       });
20658
20659       eventBus.on('canvas.init', function(event) {
20660         registerEvents(event.svg);
20661       });
20662
20663
20664       eventBus.on(['shape.added', 'connection.added'], function(event) {
20665         var element = event.element,
20666           gfx = event.gfx,
20667           hit,
20668           type;
20669
20670         if (element.waypoints) {
20671           hit = createLine(element.waypoints);
20672           type = 'connection';
20673         } else {
20674           hit = Snap.create('rect', {
20675             x: 0,
20676             y: 0,
20677             width: element.width,
20678             height: element.height
20679           });
20680           type = 'shape';
20681         }
20682
20683         hit.attr(HIT_STYLE).appendTo(gfx.node);
20684       });
20685
20686       // update djs-hit on change
20687
20688       eventBus.on('shape.changed', function(event) {
20689
20690         var element = event.element,
20691           gfx = event.gfx,
20692           hit = gfx.select('.djs-hit');
20693
20694         hit.attr({
20695           width: element.width,
20696           height: element.height
20697         });
20698       });
20699
20700       eventBus.on('connection.changed', function(event) {
20701
20702         var element = event.element,
20703           gfx = event.gfx,
20704           hit = gfx.select('.djs-hit');
20705
20706         updateLine(hit, element.waypoints);
20707       });
20708
20709
20710       // API
20711
20712       this.fire = fire;
20713
20714       this.mouseHandler = mouseHandler;
20715
20716       this.registerEvent = registerEvent;
20717       this.unregisterEvent = unregisterEvent;
20718     }
20719
20720
20721     InteractionEvents.$inject = ['eventBus', 'elementRegistry', 'styles'];
20722
20723     module.exports = InteractionEvents;
20724
20725
20726     /**
20727      * An event indicating that the mouse hovered over an element
20728      *
20729      * @event element.hover
20730      *
20731      * @type {Object}
20732      * @property {djs.model.Base} element
20733      * @property {Snap<Element>} gfx
20734      * @property {Event} originalEvent
20735      */
20736
20737     /**
20738      * An event indicating that the mouse has left an element
20739      *
20740      * @event element.out
20741      *
20742      * @type {Object}
20743      * @property {djs.model.Base} element
20744      * @property {Snap<Element>} gfx
20745      * @property {Event} originalEvent
20746      */
20747
20748     /**
20749      * An event indicating that the mouse has clicked an element
20750      *
20751      * @event element.click
20752      *
20753      * @type {Object}
20754      * @property {djs.model.Base} element
20755      * @property {Snap<Element>} gfx
20756      * @property {Event} originalEvent
20757      */
20758
20759     /**
20760      * An event indicating that the mouse has double clicked an element
20761      *
20762      * @event element.dblclick
20763      *
20764      * @type {Object}
20765      * @property {djs.model.Base} element
20766      * @property {Snap<Element>} gfx
20767      * @property {Event} originalEvent
20768      */
20769
20770     /**
20771      * An event indicating that the mouse has gone down on an element.
20772      *
20773      * @event element.mousedown
20774      *
20775      * @type {Object}
20776      * @property {djs.model.Base} element
20777      * @property {Snap<Element>} gfx
20778      * @property {Event} originalEvent
20779      */
20780
20781     /**
20782      * An event indicating that the mouse has gone up on an element.
20783      *
20784      * @event element.mouseup
20785      *
20786      * @type {Object}
20787      * @property {djs.model.Base} element
20788      * @property {Snap<Element>} gfx
20789      * @property {Event} originalEvent
20790      */
20791   }, {
20792     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
20793     "../../draw/Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
20794     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
20795     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
20796     "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js"
20797   }],
20798   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js": [function(require, module, exports) {
20799     module.exports = {
20800       __init__: ['interactionEvents'],
20801       interactionEvents: ['type', require('./InteractionEvents')]
20802     };
20803   }, {
20804     "./InteractionEvents": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\InteractionEvents.js"
20805   }],
20806   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\Keyboard.js": [function(require, module, exports) {
20807     'use strict';
20808
20809     var domEvent = require('min-dom/lib/event'),
20810       domMatches = require('min-dom/lib/matches');
20811     //keyboard.bindTo=DOMElement;
20812     // var $ = require('jquery'),
20813
20814
20815
20816
20817     /**
20818      * A keyboard abstraction that may be activated and
20819      * deactivated by users at will, consuming key events
20820      * and triggering diagram actions.
20821      *
20822      * The implementation fires the following key events that allow
20823      * other components to hook into key handling:
20824      *
20825      *  - keyboard.bind
20826      *  - keyboard.unbind
20827      *  - keyboard.init
20828      *  - keyboard.destroy
20829      *
20830      * All events contain the fields (node, listeners).
20831      *
20832      * A default binding for the keyboard may be specified via the
20833      * `keyboard.bindTo` configuration option.
20834      *
20835      * @param {EventBus} eventBus
20836      * @param {CommandStack} commandStack
20837      * @param {Modeling} modeling
20838      * @param {Selection} selection
20839      *
20840      */
20841
20842     function Keyboard(config, eventBus, commandStack, modeling, selection, zoomScroll, canvas) {
20843
20844       $(document).keydown(function(e) {
20845         if (commandStack._selectedModel == selected_model) {
20846           if (commandStack._eventBus._listeners != null) {
20847
20848             var model_commandStack = [];
20849             for (var i = 0; i < commandStackList.length; i++) {
20850               if (commandStackList[i]._selectedModel == selected_model) {
20851                 if (commandStackList[i]._stack.length > 0) {
20852                   model_commandStack.push(commandStackList[i]);
20853                 }
20854               }
20855             }
20856
20857             var selected_commandStack;
20858             for (var i = model_commandStack.length - 1; i >= 0; i--) {
20859               if (model_commandStack[i]._stackIdx > -1) {
20860                 selected_commandStack = model_commandStack[i];
20861                 break;
20862               }
20863             }
20864
20865             if (e.which == 90 && e.ctrlKey) {
20866               if (commandStack == selected_commandStack) {
20867                 commandStack.undo();
20868                 return true;
20869               }
20870             } else if (e.which == 89 && e.ctrlKey) {
20871               commandStack.redo();
20872               return true;
20873             }
20874           }
20875
20876
20877         }
20878
20879
20880       });
20881
20882       var self = this;
20883
20884       this._commandStack = commandStack;
20885       this._modeling = modeling;
20886       this._selection = selection;
20887       this._eventBus = eventBus;
20888       this._zoomScroll = zoomScroll;
20889       this._canvas = canvas;
20890
20891       this._listeners = [];
20892
20893       // our key handler is a singleton that passes
20894       // (keycode, modifiers) to each listener.
20895       //
20896       // listeners must indicate that they handled a key event
20897       // by returning true. This stops the event propagation.
20898       //
20899       this._keyHandler = function(event) {
20900
20901         var i, l,
20902           target = event.target,
20903           listeners = self._listeners,
20904           code = event.keyCode || event.charCode || -1;
20905
20906         if (domMatches(target, 'input, textarea')) {
20907           return;
20908         }
20909
20910         for (i = 0; !!(l = listeners[i]); i++) {
20911           if (l(code, event)) {
20912             event.preventDefault();
20913             event.stopPropagation();
20914           }
20915         }
20916       };
20917
20918       // properly clean dom registrations
20919       eventBus.on('diagram.destroy', function() {
20920         self._fire('destroy');
20921
20922         self.unbind();
20923         self._listeners = null;
20924       });
20925
20926       eventBus.on('diagram.init', function() {
20927         self._fire('init');
20928
20929         if (config && config.bindTo) {
20930           self.bind(config.bindTo);
20931         }
20932       });
20933
20934       this._init();
20935     }
20936
20937     Keyboard.$inject = [
20938       'config.keyboard',
20939       'eventBus',
20940       'commandStack',
20941       'modeling',
20942       'selection',
20943       'zoomScroll',
20944       'canvas'
20945     ];
20946
20947     module.exports = Keyboard;
20948
20949
20950     Keyboard.prototype.bind = function(node) {
20951       this._node = node;
20952
20953       // bind key events
20954       domEvent.bind(node, 'keydown', this._keyHandler, true);
20955
20956       this._fire('bind');
20957     };
20958
20959     Keyboard.prototype.getBinding = function() {
20960       return this._node;
20961     };
20962
20963     Keyboard.prototype.unbind = function() {
20964       var node = this._node;
20965
20966       if (node) {
20967         this._fire('unbind');
20968
20969         // unbind key events
20970         domEvent.unbind(node, 'keydown', this._keyHandler, true);
20971       }
20972
20973       this._node = null;
20974     };
20975
20976
20977     Keyboard.prototype._fire = function(event) {
20978       this._eventBus.fire('keyboard.' + event, {
20979         node: this._node,
20980         listeners: this._listeners
20981       });
20982
20983
20984     };
20985
20986
20987
20988     Keyboard.prototype._init = function() {
20989
20990       var listeners = this._listeners,
20991         commandStack = this._commandStack,
20992         modeling = this._modeling,
20993         selection = this._selection,
20994         zoomScroll = this._zoomScroll,
20995         canvas = this._canvas;
20996
20997       // init default listeners
20998
20999       // undo
21000       // (CTRL|CMD) + Z
21001       function undo(key, modifiers) {
21002
21003         if (isCmd(modifiers) && !isShift(modifiers) && key === 90) {
21004           commandStack.undo();
21005
21006           return true;
21007         }
21008       }
21009
21010       // redo
21011       // CTRL + Y
21012       // CMD + SHIFT + Z
21013       function redo(key, modifiers) {
21014
21015         if (isCmd(modifiers) && (key === 89 || (key === 90 && isShift(modifiers)))) {
21016           commandStack.redo();
21017
21018           return true;
21019         }
21020       }
21021
21022       /**
21023        * zoom in one step
21024        * CTRL + +
21025        *
21026        * 107 = numpad plus
21027        * 187 = regular plus
21028        * 171 = regular plus in Firefox (german keyboard layout)
21029        *  61 = regular plus in Firefox (US keyboard layout)
21030        */
21031       function zoomIn(key, modifiers) {
21032
21033         if ((key === 107 || key === 187 || key === 171 || key === 61) && isCmd(modifiers)) {
21034
21035           zoomScroll.stepZoom(1);
21036
21037           return true;
21038         }
21039       }
21040
21041       /**
21042        * zoom out one step
21043        * CTRL + -
21044        *
21045        * 109 = numpad minus
21046        * 189 = regular minus
21047        * 173 = regular minus in Firefox (US and german keyboard layout)
21048        */
21049       function zoomOut(key, modifiers) {
21050
21051         if ((key === 109 || key === 189 || key === 173) && isCmd(modifiers)) {
21052
21053           zoomScroll.stepZoom(-1);
21054
21055           return true;
21056         }
21057       }
21058
21059       /**
21060        * zoom to the default level
21061        * CTRL + 0
21062        *
21063        * 96 = numpad zero
21064        * 48 = regular zero
21065        */
21066       function zoomDefault(key, modifiers) {
21067
21068         if ((key === 96 || key === 48) && isCmd(modifiers)) {
21069
21070           canvas.zoom(1);
21071
21072           return true;
21073         }
21074       }
21075
21076       // delete selected element
21077       // DEL
21078       function remove(key, modifiers) {
21079
21080         if (key === 46) {
21081
21082           var selectedElements = selection.get();
21083           console.log(selectedElements);
21084           if (selectedElements.length) {
21085             modeling.removeElements(selectedElements.slice());
21086           }
21087
21088           return true;
21089         }
21090       }
21091
21092       listeners.push(undo);
21093       listeners.push(redo);
21094       listeners.push(remove);
21095       listeners.push(zoomIn);
21096       listeners.push(zoomOut);
21097       listeners.push(zoomDefault);
21098     };
21099
21100
21101     /**
21102      * Add a listener function that is notified with (key, modifiers) whenever
21103      * the keyboard is bound and the user presses a key.
21104      *
21105      * @param {Function} listenerFn
21106      */
21107     Keyboard.prototype.addListener = function(listenerFn) {
21108
21109       this._listeners.push(listenerFn);
21110     };
21111
21112     Keyboard.prototype.hasModifier = hasModifier;
21113     Keyboard.prototype.isCmd = isCmd;
21114     Keyboard.prototype.isShift = isShift;
21115
21116
21117     function hasModifier(modifiers) {
21118       return (modifiers.ctrlKey || modifiers.metaKey || modifiers.shiftKey || modifiers.altKey);
21119     }
21120
21121     function isCmd(modifiers) {
21122       return modifiers.ctrlKey || modifiers.metaKey;
21123     }
21124
21125     function isShift(modifiers) {
21126       return modifiers.shiftKey;
21127     }
21128
21129   }, {
21130     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
21131     "min-dom/lib/matches": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js"
21132   }],
21133   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\index.js": [function(require, module, exports) {
21134     module.exports = {
21135       __init__: ['keyboard'],
21136       keyboard: ['type', require('./Keyboard')]
21137     };
21138
21139   }, {
21140     "./Keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\Keyboard.js"
21141   }],
21142   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\LassoTool.js": [function(require, module, exports) {
21143     'use strict';
21144
21145     var values = require('lodash/object/values');
21146
21147     var getEnclosedElements = require('../../util/Elements').getEnclosedElements;
21148
21149     var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
21150
21151     var Snap = require('../../../vendor/snapsvg');
21152
21153
21154     function LassoTool(eventBus, canvas, dragging, elementRegistry, selection) {
21155
21156       this._selection = selection;
21157       this._dragging = dragging;
21158
21159       var self = this;
21160
21161       // lasso visuals implementation
21162
21163       /**
21164        * A helper that realizes the selection box visual
21165        */
21166       var visuals = {
21167
21168         create: function(context) {
21169           var container = canvas.getDefaultLayer(),
21170             frame;
21171
21172           frame = context.frame = Snap.create('rect', {
21173             class: 'djs-lasso-overlay',
21174             width: 1,
21175             height: 1,
21176             x: 0,
21177             y: 0
21178           });
21179
21180           frame.appendTo(container);
21181         },
21182
21183         update: function(context) {
21184           var frame = context.frame,
21185             bbox = context.bbox;
21186
21187           frame.attr({
21188             x: bbox.x,
21189             y: bbox.y,
21190             width: bbox.width,
21191             height: bbox.height
21192           });
21193         },
21194
21195         remove: function(context) {
21196
21197           if (context.frame) {
21198             context.frame.remove();
21199           }
21200         }
21201       };
21202
21203
21204       eventBus.on('lasso.selection.end', function(event) {
21205
21206         setTimeout(function() {
21207           self.activateLasso(event.originalEvent, true);
21208         });
21209       });
21210
21211       // lasso interaction implementation
21212
21213       eventBus.on('lasso.end', function(event) {
21214
21215         var bbox = toBBox(event);
21216
21217         var elements = elementRegistry.filter(function(element) {
21218           return element;
21219         });
21220
21221         self.select(elements, bbox);
21222       });
21223
21224       eventBus.on('lasso.start', function(event) {
21225
21226         var context = event.context;
21227
21228         context.bbox = toBBox(event);
21229         visuals.create(context);
21230       });
21231
21232       eventBus.on('lasso.move', function(event) {
21233
21234         var context = event.context;
21235
21236         context.bbox = toBBox(event);
21237         visuals.update(context);
21238       });
21239
21240       eventBus.on('lasso.end', function(event) {
21241
21242         var context = event.context;
21243
21244         visuals.remove(context);
21245       });
21246
21247       eventBus.on('lasso.cleanup', function(event) {
21248
21249         var context = event.context;
21250
21251         visuals.remove(context);
21252       });
21253
21254
21255       // event integration
21256
21257       eventBus.on('element.mousedown', 1500, function(event) {
21258
21259         if (hasPrimaryModifier(event)) {
21260           self.activateLasso(event.originalEvent);
21261
21262           event.stopPropagation();
21263         }
21264       });
21265     }
21266
21267     LassoTool.$inject = [
21268       'eventBus',
21269       'canvas',
21270       'dragging',
21271       'elementRegistry',
21272       'selection'
21273     ];
21274
21275     module.exports = LassoTool;
21276
21277
21278     LassoTool.prototype.activateLasso = function(event, autoActivate) {
21279
21280       this._dragging.activate(event, 'lasso', {
21281         autoActivate: autoActivate,
21282         cursor: 'crosshair',
21283         data: {
21284           context: {}
21285         }
21286       });
21287     };
21288
21289     LassoTool.prototype.activateSelection = function(event) {
21290
21291       this._dragging.activate(event, 'lasso.selection', {
21292         cursor: 'crosshair'
21293       });
21294     };
21295
21296     LassoTool.prototype.select = function(elements, bbox) {
21297       var selectedElements = getEnclosedElements(elements, bbox);
21298
21299       this._selection.select(values(selectedElements));
21300     };
21301
21302
21303     function toBBox(event) {
21304
21305       var start = {
21306
21307         x: event.x - event.dx,
21308         y: event.y - event.dy
21309       };
21310
21311       var end = {
21312         x: event.x,
21313         y: event.y
21314       };
21315
21316       var bbox;
21317
21318       if ((start.x <= end.x && start.y < end.y) ||
21319         (start.x < end.x && start.y <= end.y)) {
21320
21321         bbox = {
21322           x: start.x,
21323           y: start.y,
21324           width: end.x - start.x,
21325           height: end.y - start.y
21326         };
21327       } else if ((start.x >= end.x && start.y < end.y) ||
21328         (start.x > end.x && start.y <= end.y)) {
21329
21330         bbox = {
21331           x: end.x,
21332           y: start.y,
21333           width: start.x - end.x,
21334           height: end.y - start.y
21335         };
21336       } else if ((start.x <= end.x && start.y > end.y) ||
21337         (start.x < end.x && start.y >= end.y)) {
21338
21339         bbox = {
21340           x: start.x,
21341           y: end.y,
21342           width: end.x - start.x,
21343           height: start.y - end.y
21344         };
21345       } else if ((start.x >= end.x && start.y > end.y) ||
21346         (start.x > end.x && start.y >= end.y)) {
21347
21348         bbox = {
21349           x: end.x,
21350           y: end.y,
21351           width: start.x - end.x,
21352           height: start.y - end.y
21353         };
21354       } else {
21355
21356         bbox = {
21357           x: end.x,
21358           y: end.y,
21359           width: 0,
21360           height: 0
21361         };
21362       }
21363       return bbox;
21364     }
21365   }, {
21366     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
21367     "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
21368     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
21369     "lodash/object/values": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js"
21370   }],
21371   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\index.js": [function(require, module, exports) {
21372     'use strict';
21373
21374     module.exports = {
21375       __init__: ['lassoTool'],
21376       lassoTool: ['type', require('./LassoTool')]
21377     };
21378
21379   }, {
21380     "./LassoTool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\LassoTool.js"
21381   }],
21382   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js": [function(require, module, exports) {
21383     'use strict';
21384
21385     var forEach = require('lodash/collection/forEach');
21386
21387     var model = require('../../model');
21388
21389
21390     /**
21391      * The basic modeling entry point.
21392      *
21393      * @param {EventBus}
21394      *            eventBus
21395      * @param {ElementFactory}
21396      *            elementFactory
21397      * @param {CommandStack}
21398      *            commandStack
21399      */
21400     function Modeling(eventBus, elementFactory, commandStack) {
21401       this._eventBus = eventBus;
21402       this._elementFactory = elementFactory;
21403       this._commandStack = commandStack;
21404       var self = this;
21405
21406       eventBus.on('diagram.init', function() {
21407         // register modeling handlers
21408         self.registerHandlers(commandStack);
21409       });
21410     }
21411
21412     Modeling.$inject = ['eventBus', 'elementFactory', 'commandStack'];
21413
21414     module.exports = Modeling;
21415
21416
21417     Modeling.prototype.getHandlers = function() {
21418       return {
21419         'shape.append': require('./cmd/AppendShapeHandler'),
21420         'shape.create': require('./cmd/CreateShapeHandler'),
21421         'shape.delete': require('./cmd/DeleteShapeHandler'),
21422         'shape.move': require('./cmd/MoveShapeHandler'),
21423         'shapes.move': require('./cmd/MoveShapesHandler'),
21424         'shape.resize': require('./cmd/ResizeShapeHandler'),
21425         'shape.replace': require('./cmd/ReplaceShapeHandler'),
21426
21427         'spaceTool': require('./cmd/SpaceToolHandler'),
21428
21429         'label.create': require('./cmd/CreateLabelHandler'),
21430
21431         'connection.create': require('./cmd/CreateConnectionHandler'),
21432         'connection.delete': require('./cmd/DeleteConnectionHandler'),
21433         'connection.move': require('./cmd/MoveConnectionHandler'),
21434         'connection.layout': require('./cmd/LayoutConnectionHandler'),
21435
21436         'connection.updateWaypoints': require('./cmd/UpdateWaypointsHandler'),
21437
21438         'connection.reconnectStart': require('./cmd/ReconnectConnectionHandler'),
21439         'connection.reconnectEnd': require('./cmd/ReconnectConnectionHandler'),
21440
21441         'elements.delete': require('./cmd/DeleteElementsHandler'),
21442         'element.updateAnchors': require('./cmd/UpdateAnchorsHandler')
21443       };
21444     };
21445
21446     /**
21447      * Register handlers with the command stack
21448      *
21449      * @param {CommandStack}
21450      *            commandStack
21451      */
21452     Modeling.prototype.registerHandlers = function(commandStack) {
21453       forEach(this.getHandlers(), function(handler, id) {
21454         commandStack.registerHandler(id, handler);
21455       });
21456     };
21457
21458
21459     // /// modeling helpers /////////////////////////////////////////
21460
21461
21462     Modeling.prototype.moveShape = function(shape, delta, newParent, hints) {
21463
21464       var context = {
21465         shape: shape,
21466         delta: delta,
21467         newParent: newParent,
21468         hints: hints || {}
21469       };
21470
21471       this._commandStack.execute('shape.move', context);
21472     };
21473
21474
21475     Modeling.prototype.moveShapes = function(shapes, delta, newParent, hints) {
21476
21477       var context = {
21478         shapes: shapes,
21479         delta: delta,
21480         newParent: newParent,
21481         hints: hints || {}
21482       };
21483
21484       this._commandStack.execute('shapes.move', context);
21485     };
21486
21487     /**
21488      * Update the anchors on the element with the given delta movement
21489      *
21490      * @param {djs.model.Element}
21491      *            element
21492      * @param {Point}
21493      *            delta
21494      */
21495     Modeling.prototype.updateAnchors = function(element, delta) {
21496       var context = {
21497         element: element,
21498         delta: delta
21499       };
21500
21501       this._commandStack.execute('element.updateAnchors', context);
21502     };
21503
21504     Modeling.prototype.moveConnection = function(connection, delta, newParent, hints) {
21505
21506       var context = {
21507         connection: connection,
21508         delta: delta,
21509         newParent: newParent,
21510         hints: hints || {}
21511       };
21512
21513       this._commandStack.execute('connection.move', context);
21514     };
21515
21516
21517     Modeling.prototype.layoutConnection = function(connection, hints) {
21518
21519       var context = {
21520         connection: connection,
21521         hints: hints || {}
21522       };
21523
21524       this._commandStack.execute('connection.layout', context);
21525     };
21526
21527
21528     Modeling.prototype.createConnection = function(source, target, connection, parent) {
21529
21530       connection = this._create('connection', connection);
21531
21532       var context = {
21533         source: source,
21534         target: target,
21535         parent: parent,
21536         connection: connection
21537       };
21538
21539       this._commandStack.execute('connection.create', context);
21540
21541       return context.connection;
21542     };
21543
21544     Modeling.prototype.createShape = function(shape, position, parent) {
21545
21546       shape = this._create('shape', shape);
21547
21548       var context = {
21549         position: position,
21550         parent: parent,
21551         shape: shape
21552       };
21553
21554       this._commandStack.execute('shape.create', context);
21555
21556       return context.shape;
21557     };
21558
21559
21560     Modeling.prototype.createLabel = function(labelTarget, position, label, parent) {
21561
21562       label = this._create('label', label);
21563
21564       var context = {
21565         labelTarget: labelTarget,
21566         position: position,
21567         parent: parent,
21568         shape: label
21569       };
21570
21571       this._commandStack.execute('label.create', context);
21572
21573       return context.shape;
21574     };
21575
21576
21577     Modeling.prototype.appendShape = function(source, shape, position, parent, connection, connectionParent) {
21578
21579       shape = this._create('shape', shape);
21580
21581       var context = {
21582         source: source,
21583         position: position,
21584         parent: parent,
21585         shape: shape,
21586         connection: connection,
21587         connectionParent: connectionParent
21588       };
21589
21590       this._commandStack.execute('shape.append', context);
21591
21592       return context.shape;
21593     };
21594
21595
21596     Modeling.prototype.removeElements = function(elements) {
21597       console.log(elements);
21598       var context = {
21599         elements: elements
21600       };
21601
21602       this._commandStack.execute('elements.delete', context);
21603     };
21604
21605
21606     Modeling.prototype.removeShape = function(shape) {
21607       var context = {
21608         shape: shape
21609       };
21610
21611       this._commandStack.execute('shape.delete', context);
21612     };
21613
21614
21615     Modeling.prototype.removeConnection = function(connection) {
21616       var context = {
21617         connection: connection
21618       };
21619
21620       this._commandStack.execute('connection.delete', context);
21621     };
21622
21623     Modeling.prototype.replaceShape = function(oldShape, newShape, options) {
21624       var context = {
21625         oldShape: oldShape,
21626         newData: newShape,
21627         options: options
21628       };
21629
21630       this._commandStack.execute('shape.replace', context);
21631
21632       return context.newShape;
21633     };
21634
21635     Modeling.prototype.resizeShape = function(shape, newBounds) {
21636       var context = {
21637         shape: shape,
21638         newBounds: newBounds
21639       };
21640
21641       this._commandStack.execute('shape.resize', context);
21642     };
21643
21644     Modeling.prototype.createSpace = function(movingShapes, resizingShapes, delta, direction) {
21645       var context = {
21646         movingShapes: movingShapes,
21647         resizingShapes: resizingShapes,
21648         delta: delta,
21649         direction: direction
21650       };
21651
21652       this._commandStack.execute('spaceTool', context);
21653     };
21654
21655     Modeling.prototype.updateWaypoints = function(connection, newWaypoints) {
21656       var context = {
21657         connection: connection,
21658         newWaypoints: newWaypoints
21659       };
21660
21661       this._commandStack.execute('connection.updateWaypoints', context);
21662     };
21663
21664     Modeling.prototype.reconnectStart = function(connection, newSource, dockingPoint) {
21665       var context = {
21666         connection: connection,
21667         newSource: newSource,
21668         dockingPoint: dockingPoint
21669       };
21670
21671       this._commandStack.execute('connection.reconnectStart', context);
21672     };
21673
21674     Modeling.prototype.reconnectEnd = function(connection, newTarget, dockingPoint) {
21675       var context = {
21676         connection: connection,
21677         newTarget: newTarget,
21678         dockingPoint: dockingPoint
21679       };
21680
21681       this._commandStack.execute('connection.reconnectEnd', context);
21682     };
21683
21684     Modeling.prototype.connect = function(source, target, attrs) {
21685       return this.createConnection(source, target, attrs || {}, source.parent);
21686     };
21687
21688
21689     Modeling.prototype._create = function(type, attrs) {
21690       if (attrs instanceof model.Base) {
21691         return attrs;
21692       } else {
21693         return this._elementFactory.create(type, attrs);
21694       }
21695     };
21696
21697   }, {
21698     "../../model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js",
21699     "./cmd/AppendShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\AppendShapeHandler.js",
21700     "./cmd/CreateConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateConnectionHandler.js",
21701     "./cmd/CreateLabelHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateLabelHandler.js",
21702     "./cmd/CreateShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js",
21703     "./cmd/DeleteConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteConnectionHandler.js",
21704     "./cmd/DeleteElementsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteElementsHandler.js",
21705     "./cmd/DeleteShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteShapeHandler.js",
21706     "./cmd/LayoutConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\LayoutConnectionHandler.js",
21707     "./cmd/MoveConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveConnectionHandler.js",
21708     "./cmd/MoveShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapeHandler.js",
21709     "./cmd/MoveShapesHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapesHandler.js",
21710     "./cmd/ReconnectConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReconnectConnectionHandler.js",
21711     "./cmd/ReplaceShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReplaceShapeHandler.js",
21712     "./cmd/ResizeShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ResizeShapeHandler.js",
21713     "./cmd/SpaceToolHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\SpaceToolHandler.js",
21714     "./cmd/UpdateAnchorsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateAnchorsHandler.js",
21715     "./cmd/UpdateWaypointsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateWaypointsHandler.js",
21716     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
21717   }],
21718   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\AppendShapeHandler.js": [function(require, module, exports) {
21719     'use strict';
21720
21721     var inherits = require('inherits');
21722
21723
21724     /**
21725      * A handler that implements reversible appending of shapes to a source shape.
21726      *
21727      * @param {canvas}
21728      *            Canvas
21729      * @param {elementFactory}
21730      *            ElementFactory
21731      * @param {modeling}
21732      *            Modeling
21733      */
21734     function AppendShapeHandler(modeling) {
21735       this._modeling = modeling;
21736     }
21737
21738     inherits(AppendShapeHandler, require('./NoopHandler'));
21739
21740
21741     AppendShapeHandler.$inject = ['modeling'];
21742
21743     module.exports = AppendShapeHandler;
21744
21745
21746     // //// api /////////////////////////////////////////////
21747
21748     /**
21749      * Creates a new shape
21750      *
21751      * @param {Object}
21752      *            context
21753      * @param {ElementDescriptor}
21754      *            context.shape the new shape
21755      * @param {ElementDescriptor}
21756      *            context.source the source object
21757      * @param {ElementDescriptor}
21758      *            context.parent the parent object
21759      * @param {Point}
21760      *            context.position position of the new element
21761      */
21762     AppendShapeHandler.prototype.preExecute = function(context) {
21763
21764       if (!context.source) {
21765         throw new Error('source required');
21766       }
21767
21768       var parent = context.parent || context.source.parent,
21769         shape = this._modeling.createShape(context.shape, context.position, parent);
21770
21771       context.shape = shape;
21772     };
21773
21774     AppendShapeHandler.prototype.postExecute = function(context) {
21775       var parent = context.connectionParent || context.shape.parent;
21776
21777       // create connection
21778       this._modeling.connect(context.source, context.shape, context.connection, parent);
21779     };
21780   }, {
21781     "./NoopHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js",
21782     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
21783   }],
21784   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateConnectionHandler.js": [function(require, module, exports) {
21785     'use strict';
21786
21787
21788     function CreateConnectionHandler(canvas, layouter) {
21789       this._canvas = canvas;
21790       this._layouter = layouter;
21791     }
21792
21793     CreateConnectionHandler.$inject = ['canvas', 'layouter'];
21794
21795     module.exports = CreateConnectionHandler;
21796
21797
21798
21799     // //// api /////////////////////////////////////////
21800
21801     /**
21802      * Appends a shape to a target shape
21803      *
21804      * @param {Object}
21805      *            context
21806      * @param {djs.element.Base}
21807      *            context.source the source object
21808      * @param {djs.element.Base}
21809      *            context.target the parent object
21810      * @param {Point}
21811      *            context.position position of the new element
21812      */
21813     CreateConnectionHandler.prototype.execute = function(context) {
21814
21815       var source = context.source,
21816         target = context.target,
21817         parent = context.parent;
21818
21819       if (!source || !target) {
21820         throw new Error('source and target required');
21821       }
21822
21823       if (!parent) {
21824         throw new Error('parent required');
21825       }
21826
21827       var connection = context.connection;
21828
21829       connection.source = source;
21830       connection.target = target;
21831
21832       if (!connection.waypoints) {
21833         connection.waypoints = this._layouter.layoutConnection(connection);
21834       }
21835
21836       // add connection
21837       this._canvas.addConnection(connection, parent);
21838
21839       return connection;
21840     };
21841
21842     CreateConnectionHandler.prototype.revert = function(context) {
21843       var connection = context.connection;
21844
21845       this._canvas.removeConnection(connection);
21846
21847       connection.source = null;
21848       connection.target = null;
21849     };
21850   }, {}],
21851   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateLabelHandler.js": [function(require, module, exports) {
21852     'use strict';
21853
21854     var inherits = require('inherits');
21855
21856     var CreateShapeHandler = require('./CreateShapeHandler');
21857
21858
21859     /**
21860      * A handler that attaches a label to a given target shape.
21861      *
21862      * @param {canvas}
21863      *            Canvas
21864      */
21865     function CreateLabelHandler(canvas) {
21866       CreateShapeHandler.call(this, canvas);
21867     }
21868
21869     inherits(CreateLabelHandler, CreateShapeHandler);
21870
21871     CreateLabelHandler.$inject = ['canvas'];
21872
21873     module.exports = CreateLabelHandler;
21874
21875
21876
21877     // //// api /////////////////////////////////////////
21878
21879
21880     /**
21881      * Appends a label to a target shape.
21882      *
21883      * @method CreateLabelHandler#execute
21884      *
21885      * @param {Object}
21886      *            context
21887      * @param {ElementDescriptor}
21888      *            context.target the element the label is attached to
21889      * @param {ElementDescriptor}
21890      *            context.parent the parent object
21891      * @param {Point}
21892      *            context.position position of the new element
21893      */
21894
21895     /**
21896      * Undo append by removing the shape
21897      */
21898     CreateLabelHandler.prototype.revert = function(context) {
21899       context.shape.labelTarget = null;
21900       this._canvas.removeShape(context.shape);
21901     };
21902
21903
21904     // //// helpers /////////////////////////////////////////
21905
21906     CreateLabelHandler.prototype.getParent = function(context) {
21907       return context.parent || context.labelTarget && context.labelTarget.parent;
21908     };
21909
21910     CreateLabelHandler.prototype.addElement = function(shape, parent, context) {
21911       shape.labelTarget = context.labelTarget;
21912       this._canvas.addShape(shape, parent, true);
21913     };
21914   }, {
21915     "./CreateShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js",
21916     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
21917   }],
21918   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js": [function(require, module, exports) {
21919     'use strict';
21920
21921     var assign = require('lodash/object/assign');
21922
21923
21924     /**
21925      * A handler that implements reversible addition of shapes.
21926      *
21927      * @param {canvas}
21928      *            Canvas
21929      */
21930     function CreateShapeHandler(canvas) {
21931       this._canvas = canvas;
21932     }
21933
21934     CreateShapeHandler.$inject = ['canvas'];
21935
21936     module.exports = CreateShapeHandler;
21937
21938
21939
21940     // //// api /////////////////////////////////////////
21941
21942
21943     /**
21944      * Appends a shape to a target shape
21945      *
21946      * @param {Object}
21947      *            context
21948      * @param {djs.model.Base}
21949      *            context.parent the parent object
21950      * @param {Point}
21951      *            context.position position of the new element
21952      */
21953     CreateShapeHandler.prototype.execute = function(context) {
21954
21955       var parent = this.getParent(context);
21956
21957       var shape = context.shape;
21958
21959       this.setPosition(shape, context);
21960
21961       this.addElement(shape, parent, context);
21962
21963       return shape;
21964     };
21965
21966
21967     /**
21968      * Undo append by removing the shape
21969      */
21970     CreateShapeHandler.prototype.revert = function(context) {
21971       this._canvas.removeShape(context.shape);
21972     };
21973
21974
21975     // //// helpers /////////////////////////////////////////
21976
21977     CreateShapeHandler.prototype.getParent = function(context) {
21978       var parent = context.parent;
21979
21980       if (!parent) {
21981         throw new Error('parent required');
21982       }
21983
21984       return parent;
21985     };
21986
21987     CreateShapeHandler.prototype.getPosition = function(context) {
21988       if (!context.position) {
21989         throw new Error('no position given');
21990       }
21991
21992       return context.position;
21993     };
21994
21995     CreateShapeHandler.prototype.addElement = function(shape, parent) {
21996       this._canvas.addShape(shape, parent);
21997     };
21998
21999     CreateShapeHandler.prototype.setPosition = function(shape, context) {
22000       var position = this.getPosition(context);
22001
22002       // update to center position
22003       // specified in create context
22004       assign(shape, {
22005         x: position.x - shape.width / 2,
22006         y: position.y - shape.height / 2
22007       });
22008     };
22009   }, {
22010     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22011   }],
22012   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteConnectionHandler.js": [function(require, module, exports) {
22013     'use strict';
22014
22015     var Collections = require('../../../util/Collections');
22016
22017
22018     /**
22019      * A handler that implements reversible deletion of Connections.
22020      *
22021      */
22022     function DeleteConnectionHandler(canvas, modeling) {
22023       this._canvas = canvas;
22024       this._modeling = modeling;
22025     }
22026
22027     DeleteConnectionHandler.$inject = ['canvas', 'modeling'];
22028
22029     module.exports = DeleteConnectionHandler;
22030
22031
22032     /**
22033      * - Remove attached label
22034      */
22035     DeleteConnectionHandler.prototype.preExecute = function(context) {
22036
22037       var connection = context.connection;
22038
22039       // Remove label
22040       if (connection.label) {
22041         this._modeling.removeShape(connection.label);
22042       }
22043     };
22044
22045     DeleteConnectionHandler.prototype.execute = function(context) {
22046
22047       var connection = context.connection,
22048         parent = connection.parent;
22049
22050       context.parent = parent;
22051       context.parentIndex = Collections.indexOf(parent.children, connection);
22052
22053       context.source = connection.source;
22054       context.target = connection.target;
22055
22056       this._canvas.removeConnection(connection);
22057
22058       connection.source = null;
22059       connection.target = null;
22060       connection.label = null;
22061     };
22062
22063     /**
22064      * Command revert implementation.
22065      */
22066     DeleteConnectionHandler.prototype.revert = function(context) {
22067
22068       var connection = context.connection,
22069         parent = context.parent,
22070         parentIndex = context.parentIndex;
22071
22072       connection.source = context.source;
22073       connection.target = context.target;
22074
22075       // restore previous location in old parent
22076       Collections.add(parent.children, connection, parentIndex);
22077
22078       this._canvas.addConnection(connection, parent);
22079     };
22080
22081   }, {
22082     "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
22083   }],
22084   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteElementsHandler.js": [function(require, module, exports) {
22085     'use strict';
22086
22087     var forEach = require('lodash/collection/forEach'),
22088       inherits = require('inherits');
22089
22090
22091     function DeleteElementsHandler(modeling, elementRegistry) {
22092       this._modeling = modeling;
22093       this._elementRegistry = elementRegistry;
22094     }
22095
22096     inherits(DeleteElementsHandler, require('./NoopHandler'));
22097
22098     DeleteElementsHandler.$inject = ['modeling', 'elementRegistry'];
22099
22100     module.exports = DeleteElementsHandler;
22101
22102
22103     DeleteElementsHandler.prototype.postExecute = function(context) {
22104
22105       var modeling = this._modeling,
22106         elementRegistry = this._elementRegistry,
22107         elements = context.elements;
22108
22109       forEach(elements, function(element) {
22110
22111         // element may have been removed with previous
22112         // remove operations already (e.g. in case of nesting)
22113         if (!elementRegistry.get(element.id)) {
22114           return;
22115         }
22116
22117         if (element.waypoints) {
22118           modeling.removeConnection(element);
22119         } else {
22120           modeling.removeShape(element);
22121         }
22122       });
22123     };
22124   }, {
22125     "./NoopHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js",
22126     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js",
22127     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22128   }],
22129   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteShapeHandler.js": [function(require, module, exports) {
22130     'use strict';
22131
22132     var Collections = require('../../../util/Collections');
22133
22134
22135     /**
22136      * A handler that implements reversible deletion of shapes.
22137      *
22138      */
22139     function DeleteShapeHandler(canvas, modeling) {
22140       this._canvas = canvas;
22141       this._modeling = modeling;
22142     }
22143
22144     DeleteShapeHandler.$inject = ['canvas', 'modeling'];
22145
22146     module.exports = DeleteShapeHandler;
22147
22148
22149     /**
22150      * - Remove connections - Remove all direct children
22151      */
22152     DeleteShapeHandler.prototype.preExecute = function(context) {
22153
22154       var shape = context.shape,
22155         label = shape.label,
22156         modeling = this._modeling;
22157
22158       // Clean up on removeShape(label)
22159       if (shape.labelTarget) {
22160         context.labelTarget = shape.labelTarget;
22161         shape.labelTarget = null;
22162       }
22163
22164       // Remove label
22165       if (label) {
22166         this._modeling.removeShape(label);
22167       }
22168
22169       // remove connections
22170       this._saveClear(shape.incoming, function(connection) {
22171         // To make sure that the connection isn't removed twice
22172         // For example if a container is removed
22173         modeling.removeConnection(connection);
22174       });
22175
22176       this._saveClear(shape.outgoing, function(connection) {
22177         modeling.removeConnection(connection);
22178       });
22179
22180
22181       // remove children
22182       this._saveClear(shape.children, function(e) {
22183         modeling.removeShape(e);
22184       });
22185     };
22186
22187
22188     DeleteShapeHandler.prototype._saveClear = function(collection, remove) {
22189
22190       var e;
22191
22192       while (!!(e = collection[0])) {
22193         remove(e);
22194       }
22195     };
22196
22197
22198     /**
22199      * Remove shape and remember the parent
22200      */
22201     DeleteShapeHandler.prototype.execute = function(context) {
22202
22203       var shape = context.shape,
22204         parent = shape.parent;
22205
22206       context.parent = parent;
22207       context.parentIndex = Collections.indexOf(parent.children, shape);
22208
22209       shape.label = null;
22210
22211       this._canvas.removeShape(shape);
22212     };
22213
22214
22215     /**
22216      * Command revert implementation
22217      */
22218     DeleteShapeHandler.prototype.revert = function(context) {
22219
22220       var shape = context.shape,
22221         parent = context.parent,
22222         parentIndex = context.parentIndex,
22223         labelTarget = context.labelTarget;
22224
22225       // restore previous location in old parent
22226       Collections.add(parent.children, shape, parentIndex);
22227
22228       if (labelTarget) {
22229         labelTarget.label = shape;
22230       }
22231
22232       this._canvas.addShape(shape, parent);
22233     };
22234
22235   }, {
22236     "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
22237   }],
22238   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\LayoutConnectionHandler.js": [function(require, module, exports) {
22239     'use strict';
22240
22241     var assign = require('lodash/object/assign');
22242
22243
22244     /**
22245      * A handler that implements reversible moving of shapes.
22246      */
22247     function LayoutConnectionHandler(layouter, canvas) {
22248       this._layouter = layouter;
22249       this._canvas = canvas;
22250     }
22251
22252     LayoutConnectionHandler.$inject = ['layouter', 'canvas'];
22253
22254     module.exports = LayoutConnectionHandler;
22255
22256     LayoutConnectionHandler.prototype.execute = function(context) {
22257
22258       var connection = context.connection,
22259         parent = connection.parent,
22260         connectionSiblings = parent.children;
22261
22262       var oldIndex = connectionSiblings.indexOf(connection);
22263
22264       assign(context, {
22265         oldWaypoints: connection.waypoints,
22266         oldIndex: oldIndex
22267       });
22268
22269       sendToFront(connection);
22270
22271       connection.waypoints = this._layouter.layoutConnection(connection, context.hints);
22272
22273       return connection;
22274     };
22275
22276     LayoutConnectionHandler.prototype.revert = function(context) {
22277
22278       var connection = context.connection,
22279         parent = connection.parent,
22280         connectionSiblings = parent.children,
22281         currentIndex = connectionSiblings.indexOf(connection),
22282         oldIndex = context.oldIndex;
22283
22284       connection.waypoints = context.oldWaypoints;
22285
22286       if (oldIndex !== currentIndex) {
22287
22288         // change position of connection in shape
22289         connectionSiblings.splice(currentIndex, 1);
22290         connectionSiblings.splice(oldIndex, 0, connection);
22291       }
22292
22293       return connection;
22294     };
22295
22296     // connections should have a higher z-order as there source and targets
22297     function sendToFront(connection) {
22298
22299       var connectionSiblings = connection.parent.children;
22300
22301       var connectionIdx = connectionSiblings.indexOf(connection),
22302         sourceIdx = findIndex(connectionSiblings, connection.source),
22303         targetIdx = findIndex(connectionSiblings, connection.target),
22304
22305         // ensure we do not send the connection back
22306         // if it is already in front
22307         insertIndex = Math.max(sourceIdx + 1, targetIdx + 1, connectionIdx);
22308
22309       if (connectionIdx < insertIndex) {
22310         connectionSiblings.splice(insertIndex, 0, connection); // add to new
22311         // position
22312         connectionSiblings.splice(connectionIdx, 1); // remove from old position
22313       }
22314
22315       function findIndex(array, obj) {
22316
22317         var index = array.indexOf(obj);
22318         if (index < 0 && obj) {
22319           var parent = obj.parent;
22320           index = findIndex(array, parent);
22321         }
22322         return index;
22323       }
22324
22325       return insertIndex;
22326     }
22327
22328   }, {
22329     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22330   }],
22331   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveConnectionHandler.js": [function(require, module, exports) {
22332     'use strict';
22333
22334     var forEach = require('lodash/collection/forEach');
22335
22336     var Collections = require('../../../util/Collections');
22337
22338
22339     /**
22340      * A handler that implements reversible moving of connections.
22341      *
22342      * The handler differs from the layout connection handler in a sense that it
22343      * preserves the connection layout.
22344      */
22345     function MoveConnectionHandler() {}
22346
22347     module.exports = MoveConnectionHandler;
22348
22349
22350     MoveConnectionHandler.prototype.execute = function(context) {
22351
22352       var updateAnchors = (context.hints.updateAnchors !== false);
22353
22354       var connection = context.connection,
22355         delta = context.delta;
22356
22357       var newParent = this.getNewParent(connection, context),
22358         oldParent = connection.parent;
22359
22360       // save old position + parent in context
22361       context.oldParent = oldParent;
22362       context.oldParentIndex = Collections.indexOf(oldParent.children, connection);
22363
22364       // update waypoint positions
22365       forEach(connection.waypoints, function(p) {
22366         p.x += delta.x;
22367         p.y += delta.y;
22368
22369         if (updateAnchors && p.original) {
22370           p.original.x += delta.x;
22371           p.original.y += delta.y;
22372         }
22373       });
22374
22375       // update parent
22376       connection.parent = newParent;
22377
22378       return connection;
22379     };
22380
22381     MoveConnectionHandler.prototype.revert = function(context) {
22382
22383       var updateAnchors = (context.hints.updateAnchors !== false);
22384
22385       var connection = context.connection,
22386         oldParent = context.oldParent,
22387         oldParentIndex = context.oldParentIndex,
22388         delta = context.delta;
22389
22390       // restore previous location in old parent
22391       Collections.add(oldParent.children, connection, oldParentIndex);
22392
22393       // restore parent
22394       connection.parent = oldParent;
22395
22396       // revert to old waypoint positions
22397       forEach(connection.waypoints, function(p) {
22398         p.x -= delta.x;
22399         p.y -= delta.y;
22400
22401         if (updateAnchors && p.original) {
22402           p.original.x -= delta.x;
22403           p.original.y -= delta.y;
22404         }
22405       });
22406
22407       return connection;
22408     };
22409
22410
22411     MoveConnectionHandler.prototype.getNewParent = function(connection, context) {
22412       return context.newParent || connection.parent;
22413     };
22414
22415   }, {
22416     "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
22417     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22418   }],
22419   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapeHandler.js": [function(require, module, exports) {
22420     'use strict';
22421
22422     var assign = require('lodash/object/assign'),
22423       forEach = require('lodash/collection/forEach');
22424
22425     var MoveHelper = require('./helper/MoveHelper'),
22426       Collections = require('../../../util/Collections');
22427
22428
22429     /**
22430      * A handler that implements reversible moving of shapes.
22431      */
22432     function MoveShapeHandler(modeling) {
22433       this._modeling = modeling;
22434
22435       this._helper = new MoveHelper(modeling);
22436     }
22437
22438     MoveShapeHandler.$inject = ['modeling'];
22439
22440     module.exports = MoveShapeHandler;
22441
22442
22443     MoveShapeHandler.prototype.execute = function(context) {
22444
22445       var shape = context.shape,
22446         delta = context.delta,
22447         newParent = this.getNewParent(context),
22448         oldParent = shape.parent;
22449
22450       // save old parent in context
22451       context.oldParent = oldParent;
22452       context.oldParentIndex = Collections.indexOf(oldParent.children, shape);
22453
22454       // update shape parent + position
22455       assign(shape, {
22456         parent: newParent,
22457         x: shape.x + delta.x,
22458         y: shape.y + delta.y
22459       });
22460
22461       return shape;
22462     };
22463
22464     MoveShapeHandler.prototype.postExecute = function(context) {
22465
22466       var shape = context.shape,
22467         delta = context.delta;
22468
22469       var modeling = this._modeling;
22470
22471       if (context.hints.updateAnchors !== false) {
22472         modeling.updateAnchors(shape, delta);
22473       }
22474
22475       if (context.hints.layout !== false) {
22476         forEach(shape.incoming, function(c) {
22477           modeling.layoutConnection(c, {
22478             endChanged: true
22479           });
22480         });
22481
22482         forEach(shape.outgoing, function(c) {
22483           modeling.layoutConnection(c, {
22484             startChanged: true
22485           });
22486         });
22487       }
22488
22489       if (context.hints.recurse !== false) {
22490         this.moveChildren(context);
22491       }
22492     };
22493
22494     MoveShapeHandler.prototype.revert = function(context) {
22495
22496       var shape = context.shape,
22497         oldParent = context.oldParent,
22498         oldParentIndex = context.oldParentIndex,
22499         delta = context.delta;
22500
22501       // restore previous location in old parent
22502       Collections.add(oldParent.children, shape, oldParentIndex);
22503
22504       // revert to old position and parent
22505       assign(shape, {
22506         parent: oldParent,
22507         x: shape.x - delta.x,
22508         y: shape.y - delta.y
22509       });
22510
22511       return shape;
22512     };
22513
22514     MoveShapeHandler.prototype.moveChildren = function(context) {
22515
22516       var delta = context.delta,
22517         shape = context.shape;
22518
22519       this._helper.moveRecursive(shape.children, delta, null);
22520     };
22521
22522     MoveShapeHandler.prototype.getNewParent = function(context) {
22523       return context.newParent || context.shape.parent;
22524     };
22525   }, {
22526     "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
22527     "./helper/MoveHelper": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js",
22528     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22529     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22530   }],
22531   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapesHandler.js": [function(require, module, exports) {
22532     'use strict';
22533
22534     var MoveHelper = require('./helper/MoveHelper');
22535
22536
22537     /**
22538      * A handler that implements reversible moving of shapes.
22539      */
22540     function MoveShapesHandler(modeling) {
22541       this._helper = new MoveHelper(modeling);
22542     }
22543
22544     MoveShapesHandler.$inject = ['modeling'];
22545
22546     module.exports = MoveShapesHandler;
22547
22548     MoveShapesHandler.prototype.preExecute = function(context) {
22549       context.closure = this._helper.getClosure(context.shapes);
22550     };
22551
22552     MoveShapesHandler.prototype.postExecute = function(context) {
22553       this._helper.moveClosure(context.closure, context.delta, context.newParent);
22554     };
22555
22556
22557     MoveShapesHandler.prototype.execute = function(context) {};
22558     MoveShapesHandler.prototype.revert = function(context) {};
22559
22560   }, {
22561     "./helper/MoveHelper": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js"
22562   }],
22563   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js": [function(require, module, exports) {
22564     'use strict';
22565
22566     function NoopHandler() {}
22567
22568     module.exports = NoopHandler;
22569
22570     NoopHandler.prototype.execute = function() {};
22571     NoopHandler.prototype.revert = function() {};
22572   }, {}],
22573   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReconnectConnectionHandler.js": [function(require, module, exports) {
22574     'use strict';
22575
22576
22577     function ReconnectConnectionHandler(layouter) {}
22578
22579     ReconnectConnectionHandler.$inject = ['layouter'];
22580
22581     module.exports = ReconnectConnectionHandler;
22582
22583     ReconnectConnectionHandler.prototype.execute = function(context) {
22584
22585       var newSource = context.newSource,
22586         newTarget = context.newTarget,
22587         connection = context.connection;
22588
22589       if (!newSource && !newTarget) {
22590         throw new Error('newSource or newTarget are required');
22591       }
22592
22593       if (newSource && newTarget) {
22594         throw new Error('must specify either newSource or newTarget');
22595       }
22596
22597       if (newSource) {
22598         context.oldSource = connection.source;
22599         connection.source = newSource;
22600
22601         context.oldDockingPoint = connection.waypoints[0];
22602         connection.waypoints[0] = context.dockingPoint;
22603       }
22604
22605       if (newTarget) {
22606         context.oldTarget = connection.target;
22607         connection.target = newTarget;
22608
22609         context.oldDockingPoint = connection.waypoints[connection.waypoints.length - 1];
22610         connection.waypoints[connection.waypoints.length - 1] = context.dockingPoint;
22611       }
22612
22613       return connection;
22614     };
22615
22616     ReconnectConnectionHandler.prototype.revert = function(context) {
22617
22618       var newSource = context.newSource,
22619         newTarget = context.newTarget,
22620         connection = context.connection;
22621
22622       if (newSource) {
22623         connection.source = context.oldSource;
22624         connection.waypoints[0] = context.oldDockingPoint;
22625       }
22626
22627       if (newTarget) {
22628         connection.target = context.oldTarget;
22629         connection.waypoints[connection.waypoints.length - 1] = context.oldDockingPoint;
22630       }
22631
22632       return connection;
22633     };
22634   }, {}],
22635   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReplaceShapeHandler.js": [function(require, module, exports) {
22636     'use strict';
22637
22638     var forEach = require('lodash/collection/forEach');
22639
22640
22641     /**
22642      * A handler that implements reversible replacing of shapes. Internally the old
22643      * shape will be removed and the new shape will be added.
22644      *
22645      *
22646      * @class
22647      * @constructor
22648      *
22649      * @param {canvas}
22650      *            Canvas
22651      */
22652     function ReplaceShapeHandler(modeling, rules) {
22653       this._modeling = modeling;
22654       this._rules = rules;
22655     }
22656
22657     ReplaceShapeHandler.$inject = ['modeling', 'rules'];
22658
22659     module.exports = ReplaceShapeHandler;
22660
22661
22662
22663     // //// api /////////////////////////////////////////
22664
22665
22666     /**
22667      * Replaces a shape with an replacement Element.
22668      *
22669      * The newData object should contain type, x, y.
22670      *
22671      * If possible also the incoming/outgoing connection will be restored.
22672      *
22673      * @param {Object}
22674      *            context
22675      */
22676     ReplaceShapeHandler.prototype.preExecute = function(context) {
22677
22678       var modeling = this._modeling,
22679         rules = this._rules;
22680
22681       var oldShape = context.oldShape,
22682         newData = context.newData,
22683         newShape;
22684
22685
22686       // (1) place a new shape at the given position
22687
22688       var position = {
22689         x: newData.x,
22690         y: newData.y
22691       };
22692
22693       newShape = context.newShape = context.newShape || modeling.createShape(newData, position, oldShape.parent);
22694
22695
22696       // (2) reconnect connections to the new shape (where allowed)
22697
22698       var incoming = oldShape.incoming.slice(),
22699         outgoing = oldShape.outgoing.slice();
22700
22701       forEach(incoming, function(connection) {
22702         var waypoints = connection.waypoints,
22703           docking = waypoints[waypoints.length - 1],
22704           allowed = rules.allowed('connection.reconnectEnd', {
22705             source: connection.source,
22706             target: newShape,
22707             connection: connection
22708           });
22709
22710         if (allowed) {
22711           modeling.reconnectEnd(connection, newShape, docking);
22712         }
22713       });
22714
22715       forEach(outgoing, function(connection) {
22716         var waypoints = connection.waypoints,
22717           docking = waypoints[0],
22718           allowed = rules.allowed('connection.reconnectStart', {
22719             source: newShape,
22720             target: connection.target,
22721             connection: connection
22722           });
22723
22724         if (allowed) {
22725           modeling.reconnectStart(connection, newShape, docking);
22726         }
22727       });
22728     };
22729
22730
22731     ReplaceShapeHandler.prototype.postExecute = function(context) {
22732       var modeling = this._modeling;
22733
22734       var oldShape = context.oldShape;
22735
22736       modeling.removeShape(oldShape);
22737     };
22738
22739
22740     ReplaceShapeHandler.prototype.execute = function(context) {};
22741
22742     ReplaceShapeHandler.prototype.revert = function(context) {};
22743
22744   }, {
22745     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22746   }],
22747   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ResizeShapeHandler.js": [function(require, module, exports) {
22748     'use strict';
22749
22750     var assign = require('lodash/object/assign'),
22751       forEach = require('lodash/collection/forEach');
22752
22753
22754     /**
22755      * A handler that implements reversible resizing of shapes.
22756      *
22757      */
22758     function ResizeShapeHandler(modeling) {
22759       this._modeling = modeling;
22760     }
22761
22762     ResizeShapeHandler.$inject = ['modeling'];
22763
22764     module.exports = ResizeShapeHandler;
22765
22766     /**
22767      * { shape: {....} newBounds: { width: 20, height: 40, x: 5, y: 10 }
22768      *  }
22769      */
22770     ResizeShapeHandler.prototype.execute = function(context) {
22771
22772       var shape = context.shape,
22773         newBounds = context.newBounds;
22774
22775       if (newBounds.x === undefined || newBounds.y === undefined ||
22776         newBounds.width === undefined || newBounds.height === undefined) {
22777         throw new Error('newBounds must have {x, y, width, height} properties');
22778       }
22779
22780       if (newBounds.width < 10 || newBounds.height < 10) {
22781         throw new Error('width and height cannot be less than 10px');
22782       }
22783
22784       // save old bbox in context
22785       context.oldBounds = {
22786         width: shape.width,
22787         height: shape.height,
22788         x: shape.x,
22789         y: shape.y
22790       };
22791
22792       // update shape
22793       assign(shape, {
22794         width: newBounds.width,
22795         height: newBounds.height,
22796         x: newBounds.x,
22797         y: newBounds.y
22798       });
22799
22800       return shape;
22801     };
22802
22803     ResizeShapeHandler.prototype.postExecute = function(context) {
22804
22805       var shape = context.shape;
22806
22807       var modeling = this._modeling;
22808
22809       forEach(shape.incoming, function(c) {
22810         modeling.layoutConnection(c, {
22811           endChanged: true
22812         });
22813       });
22814
22815       forEach(shape.outgoing, function(c) {
22816         modeling.layoutConnection(c, {
22817           startChanged: true
22818         });
22819       });
22820
22821     };
22822
22823     ResizeShapeHandler.prototype.revert = function(context) {
22824
22825       var shape = context.shape,
22826         oldBounds = context.oldBounds;
22827
22828       // restore previous bbox
22829       assign(shape, {
22830         width: oldBounds.width,
22831         height: oldBounds.height,
22832         x: oldBounds.x,
22833         y: oldBounds.y
22834       });
22835
22836       return shape;
22837     };
22838
22839   }, {
22840     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22841     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22842   }],
22843   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\SpaceToolHandler.js": [function(require, module, exports) {
22844     'use strict';
22845
22846     var forEach = require('lodash/collection/forEach');
22847
22848     var SpaceUtil = require('../../space-tool/SpaceUtil');
22849
22850     /**
22851      * A handler that implements reversible creating and removing of space.
22852      *
22853      * It executes in two phases:
22854      *
22855      * (1) resize all affected resizeShapes (2) move all affected moveShapes
22856      */
22857     function SpaceToolHandler(modeling) {
22858       this._modeling = modeling;
22859     }
22860
22861     SpaceToolHandler.$inject = ['modeling'];
22862
22863     module.exports = SpaceToolHandler;
22864
22865
22866     SpaceToolHandler.prototype.preExecute = function(context) {
22867
22868       // resize
22869       var modeling = this._modeling,
22870         resizingShapes = context.resizingShapes,
22871         delta = context.delta,
22872         direction = context.direction;
22873
22874       forEach(resizingShapes, function(shape) {
22875         var newBounds = SpaceUtil.resizeBounds(shape, direction, delta);
22876
22877         modeling.resizeShape(shape, newBounds);
22878       });
22879     };
22880
22881     SpaceToolHandler.prototype.postExecute = function(context) {
22882       // move
22883       var modeling = this._modeling,
22884         movingShapes = context.movingShapes,
22885         delta = context.delta;
22886
22887       modeling.moveShapes(movingShapes, delta);
22888     };
22889
22890     SpaceToolHandler.prototype.execute = function(context) {};
22891     SpaceToolHandler.prototype.revert = function(context) {};
22892
22893   }, {
22894     "../../space-tool/SpaceUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js",
22895     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22896   }],
22897   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateAnchorsHandler.js": [function(require, module, exports) {
22898     'use strict';
22899
22900     var forEach = require('lodash/collection/forEach'),
22901       assign = require('lodash/object/assign');
22902
22903
22904     /**
22905      * Update the anchors of
22906      */
22907     function UpdateAnchorsHandler() {}
22908
22909     module.exports = UpdateAnchorsHandler;
22910
22911
22912     UpdateAnchorsHandler.prototype.execute = function(context) {
22913
22914       // update connection anchors
22915       return this.updateAnchors(context.element, context.delta);
22916     };
22917
22918     UpdateAnchorsHandler.prototype.revert = function(context) {
22919
22920       var delta = context.delta,
22921         revertedDelta = {
22922           x: -1 * delta.x,
22923           y: -1 * delta.y
22924         };
22925
22926       // revert update connection anchors
22927       return this.updateAnchors(context.element, revertedDelta);
22928     };
22929
22930     /**
22931      * Update anchors on the element according to the delta movement.
22932      *
22933      * @param {djs.model.Element}
22934      *            element
22935      * @param {Point}
22936      *            delta
22937      *
22938      * @return Array<djs.model.Connection>
22939      */
22940     UpdateAnchorsHandler.prototype.updateAnchors = function(element, delta) {
22941
22942       function add(point, delta) {
22943         return {
22944           x: point.x + delta.x,
22945           y: point.y + delta.y
22946         };
22947       }
22948
22949       function updateAnchor(waypoint) {
22950         var original = waypoint.original;
22951
22952         waypoint.original = assign(original || {}, add(original || waypoint, delta));
22953       }
22954
22955       var changed = [];
22956
22957       forEach(element.incoming, function(c) {
22958         var waypoints = c.waypoints;
22959         updateAnchor(waypoints[waypoints.length - 1]);
22960
22961         changed.push(c);
22962       });
22963
22964       forEach(element.outgoing, function(c) {
22965         var waypoints = c.waypoints;
22966         updateAnchor(waypoints[0]);
22967
22968         changed.push(c);
22969       });
22970
22971       return changed;
22972     };
22973   }, {
22974     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22975     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22976   }],
22977   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateWaypointsHandler.js": [function(require, module, exports) {
22978     'use strict';
22979
22980     function UpdateWaypointsHandler() {}
22981
22982     module.exports = UpdateWaypointsHandler;
22983
22984     UpdateWaypointsHandler.prototype.execute = function(context) {
22985
22986       var connection = context.connection,
22987         newWaypoints = context.newWaypoints;
22988
22989       context.oldWaypoints = connection.waypoints;
22990
22991       connection.waypoints = newWaypoints;
22992
22993       return connection;
22994     };
22995
22996     UpdateWaypointsHandler.prototype.revert = function(context) {
22997
22998       var connection = context.connection,
22999         oldWaypoints = context.oldWaypoints;
23000
23001       connection.waypoints = oldWaypoints;
23002
23003       return connection;
23004     };
23005   }, {}],
23006   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js": [function(require, module, exports) {
23007     'use strict';
23008
23009     var forEach = require('lodash/collection/forEach');
23010
23011     var Elements = require('../../../../util/Elements');
23012
23013
23014     /**
23015      * A helper that is able to carry out serialized move operations on multiple
23016      * elements.
23017      *
23018      * @param {Modeling}
23019      *            modeling
23020      */
23021     function MoveHelper(modeling) {
23022       this._modeling = modeling;
23023     }
23024
23025     module.exports = MoveHelper;
23026
23027     /**
23028      * Move the specified elements and all children by the given delta.
23029      *
23030      * This moves all enclosed connections, too and layouts all affected external
23031      * connections.
23032      *
23033      * @param {Array
23034      *            <djs.model.Base>} elements
23035      * @param {Point}
23036      *            delta
23037      * @param {djs.model.Base}
23038      *            newParent applied to the first level of shapes
23039      *
23040      * @return {Array<djs.model.Base>} list of touched elements
23041      */
23042     MoveHelper.prototype.moveRecursive = function(elements, delta, newParent) {
23043       return this.moveClosure(this.getClosure(elements), delta, newParent);
23044     };
23045
23046     /**
23047      * Move the given closure of elmements
23048      */
23049     MoveHelper.prototype.moveClosure = function(closure, delta, newParent) {
23050
23051       var modeling = this._modeling;
23052
23053       var allShapes = closure.allShapes,
23054         allConnections = closure.allConnections,
23055         enclosedConnections = closure.enclosedConnections,
23056         topLevel = closure.topLevel;
23057
23058       // move all shapes
23059       forEach(allShapes, function(s) {
23060
23061         modeling.moveShape(s, delta, topLevel[s.id] && newParent, {
23062           recurse: false,
23063           layout: false
23064         });
23065       });
23066
23067       // move all child connections / layout external connections
23068       forEach(allConnections, function(c) {
23069
23070         var startMoved = !!allShapes[c.source.id],
23071           endMoved = !!allShapes[c.target.id];
23072
23073         if (enclosedConnections[c.id] &&
23074           startMoved && endMoved) {
23075           modeling.moveConnection(c, delta, topLevel[c.id] && newParent, {
23076             updateAnchors: false
23077           });
23078         } else {
23079           modeling.layoutConnection(c, {
23080             startChanged: startMoved,
23081             endChanged: endMoved
23082           });
23083         }
23084       });
23085     };
23086
23087     /**
23088      * Returns the closure for the selected elements
23089      *
23090      * @param {Array
23091      *            <djs.model.Base>} elements
23092      * @return {Object} closure
23093      */
23094     MoveHelper.prototype.getClosure = function(elements) {
23095       return Elements.getClosure(elements);
23096     };
23097
23098   }, {
23099     "../../../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
23100     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
23101   }],
23102   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js": [function(require, module, exports) {
23103     module.exports = {
23104       __depends__: [
23105         require('../../command'),
23106         require('../change-support'),
23107         require('../rules')
23108       ],
23109       __init__: ['modeling'],
23110       modeling: ['type', require('./Modeling')],
23111       layouter: ['type', require('../../layout/BaseLayouter')]
23112     };
23113
23114   }, {
23115     "../../command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
23116     "../../layout/BaseLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js",
23117     "../change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js",
23118     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
23119     "./Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js"
23120   }],
23121   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\Move.js": [function(require, module, exports) {
23122     'use strict';
23123
23124     var assign = require('lodash/object/assign'),
23125       filter = require('lodash/collection/filter'),
23126       groupBy = require('lodash/collection/groupBy');
23127
23128
23129     var LOW_PRIORITY = 500,
23130       HIGH_PRIORITY = 1500;
23131
23132     var getOriginalEvent = require('../../util/Event').getOriginal;
23133
23134     var round = Math.round;
23135
23136
23137     /**
23138      * Return a filtered list of elements that do not contain those nested into
23139      * others.
23140      *
23141      * @param {Array
23142      *            <djs.model.Base>} elements
23143      *
23144      * @return {Array<djs.model.Base>} filtered
23145      */
23146     function removeNested(elements) {
23147
23148       var ids = groupBy(elements, 'id');
23149
23150       return filter(elements, function(element) {
23151         while (!!(element = element.parent)) {
23152           if (ids[element.id]) {
23153             return false;
23154           }
23155         }
23156
23157         return true;
23158       });
23159     }
23160
23161
23162
23163     /**
23164      * A plugin that makes shapes draggable / droppable.
23165      *
23166      * @param {EventBus}
23167      *            eventBus
23168      * @param {Dragging}
23169      *            dragging
23170      * @param {Modeling}
23171      *            modeling
23172      * @param {Selection}
23173      *            selection
23174      * @param {Rules}
23175      *            rules
23176      */
23177     function MoveEvents(eventBus, dragging, modeling, selection, rules) {
23178
23179       // rules
23180
23181       function canMove(shapes, delta, target) {
23182
23183         return rules.allowed('shapes.move', {
23184           shapes: shapes,
23185           delta: delta,
23186           newParent: target
23187         });
23188       }
23189
23190
23191       // move events
23192
23193       // assign a high priority to this handler to setup the environment
23194       // others may hook up later, e.g. at default priority and modify
23195       // the move environment
23196       //
23197       eventBus.on('shape.move.start', HIGH_PRIORITY, function(event) {
23198
23199         var context = event.context,
23200           shape = event.shape,
23201           shapes = selection.get().slice();
23202
23203         // move only single shape shape if the dragged element
23204         // is not part of the current selection
23205         if (shapes.indexOf(shape) === -1) {
23206           shapes = [shape];
23207         }
23208
23209         // ensure we remove nested elements in the collection
23210         shapes = removeNested(shapes);
23211
23212         // attach shapes to drag context
23213         assign(context, {
23214           shapes: shapes,
23215           shape: shape
23216         });
23217
23218         // check if we can move the elements
23219         if (!canMove(shapes)) {
23220           // suppress move operation
23221           event.stopPropagation();
23222
23223           return false;
23224         }
23225       });
23226
23227       // assign a low priority to this handler
23228       // to let others modify the move event before we update
23229       // the context
23230       //
23231       eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
23232
23233         var context = event.context,
23234           shapes = context.shapes,
23235           hover = event.hover,
23236           delta = {
23237             x: event.dx,
23238             y: event.dy
23239           },
23240           canExecute;
23241
23242         // check if we can move the elements
23243         canExecute = canMove(shapes, delta, hover);
23244
23245         context.delta = delta;
23246         context.canExecute = canExecute;
23247
23248         // simply ignore move over
23249         if (canExecute === null) {
23250           context.target = null;
23251
23252           return;
23253         }
23254
23255         context.target = hover;
23256       });
23257
23258       eventBus.on('shape.move.end', function(event) {
23259
23260         var context = event.context;
23261
23262         var delta = context.delta,
23263           canExecute = context.canExecute;
23264
23265         if (!canExecute) {
23266           return false;
23267         }
23268
23269         // ensure we have actual pixel values deltas
23270         // (important when zoom level was > 1 during move)
23271         delta.x = round(delta.x);
23272         delta.y = round(delta.y);
23273
23274         modeling.moveShapes(context.shapes, delta, context.target);
23275       });
23276
23277
23278       // move activation
23279
23280       eventBus.on('element.mousedown', function(event) {
23281
23282         var originalEvent = getOriginalEvent(event);
23283
23284         if (!originalEvent) {
23285           throw new Error('must supply DOM mousedown event');
23286         }
23287
23288         start(originalEvent, event.element);
23289       });
23290
23291
23292       function start(event, element, activate) {
23293
23294         // do not move connections or the root element
23295         if (element.waypoints || !element.parent) {
23296           return;
23297         }
23298
23299         dragging.activate(event, 'shape.move', {
23300           cursor: 'grabbing',
23301           autoActivate: activate,
23302           data: {
23303             shape: element,
23304             context: {}
23305           }
23306         });
23307       }
23308
23309       // API
23310
23311       this.start = start;
23312     }
23313
23314     MoveEvents.$inject = ['eventBus', 'dragging', 'modeling', 'selection', 'rules'];
23315
23316     module.exports = MoveEvents;
23317
23318   }, {
23319     "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
23320     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
23321     "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
23322     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
23323   }],
23324   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\MoveVisuals.js": [function(require, module, exports) {
23325     'use strict';
23326
23327     var flatten = require('lodash/array/flatten'),
23328       forEach = require('lodash/collection/forEach'),
23329       filter = require('lodash/collection/filter'),
23330       find = require('lodash/collection/find'),
23331       map = require('lodash/collection/map');
23332
23333     var Elements = require('../../util/Elements');
23334
23335     var LOW_PRIORITY = 500;
23336
23337     var MARKER_DRAGGING = 'djs-dragging',
23338       MARKER_OK = 'drop-ok',
23339       MARKER_NOT_OK = 'drop-not-ok';
23340
23341
23342     /**
23343      * A plugin that makes shapes draggable / droppable.
23344      *
23345      * @param {EventBus}
23346      *            eventBus
23347      * @param {ElementRegistry}
23348      *            elementRegistry
23349      * @param {Canvas}
23350      *            canvas
23351      * @param {Styles}
23352      *            styles
23353      */
23354     function MoveVisuals(eventBus, elementRegistry, canvas, styles) {
23355
23356       function getGfx(e) {
23357         return elementRegistry.getGraphics(e);
23358       }
23359
23360       function getVisualDragShapes(shapes) {
23361
23362         var elements = Elements.selfAndDirectChildren(shapes, true);
23363         var filteredElements = removeEdges(elements);
23364
23365         return filteredElements;
23366       }
23367
23368       function getAllDraggedElements(shapes) {
23369         var allShapes = Elements.selfAndAllChildren(shapes, true);
23370
23371         var allConnections = map(allShapes, function(shape) {
23372           return (shape.incoming || []).concat(shape.outgoing || []);
23373         });
23374
23375         return flatten(allShapes.concat(allConnections), true);
23376       }
23377
23378       function addDragger(shape, dragGroup) {
23379         var gfx = getGfx(shape);
23380         var dragger = gfx.clone();
23381         var bbox = gfx.getBBox();
23382
23383         dragger.attr(styles.cls('djs-dragger', [], {
23384           x: bbox.x,
23385           y: bbox.y
23386         }));
23387
23388         dragGroup.add(dragger);
23389       }
23390
23391       // assign a low priority to this handler
23392       // to let others modify the move context before
23393       // we draw things
23394       //
23395       eventBus.on('shape.move.start', LOW_PRIORITY, function(event) {
23396
23397         var context = event.context,
23398           dragShapes = context.shapes;
23399
23400         var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
23401
23402         var visuallyDraggedShapes = getVisualDragShapes(dragShapes);
23403
23404         visuallyDraggedShapes.forEach(function(shape) {
23405           addDragger(shape, dragGroup);
23406         });
23407
23408
23409         // cache all dragged elements / gfx
23410         // so that we can quickly undo their state changes later
23411         var allDraggedElements = context.allDraggedElements = getAllDraggedElements(dragShapes);
23412
23413         // add dragging marker
23414         forEach(allDraggedElements, function(e) {
23415           canvas.addMarker(e, MARKER_DRAGGING);
23416         });
23417
23418         context.dragGroup = dragGroup;
23419       });
23420
23421       // assign a low priority to this handler
23422       // to let others modify the move context before
23423       // we draw things
23424       //
23425       eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
23426
23427         var context = event.context,
23428           dragGroup = context.dragGroup,
23429           target = context.target;
23430
23431         if (target) {
23432           canvas.addMarker(target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
23433         }
23434
23435         dragGroup.translate(event.dx, event.dy);
23436       });
23437
23438       eventBus.on(['shape.move.out', 'shape.move.cleanup'], function(event) {
23439         var context = event.context;
23440
23441         if (context.target) {
23442           canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
23443         }
23444       });
23445
23446       eventBus.on('shape.move.cleanup', function(event) {
23447
23448         var context = event.context,
23449           allDraggedElements = context.allDraggedElements,
23450           dragGroup = context.dragGroup;
23451
23452
23453         // remove dragging marker
23454         forEach(allDraggedElements, function(e) {
23455           canvas.removeMarker(e, MARKER_DRAGGING);
23456         });
23457
23458         if (dragGroup) {
23459           dragGroup.remove();
23460         }
23461       });
23462     }
23463
23464     // returns elements minus all connections
23465     // where source or target is not elements
23466     function removeEdges(elements) {
23467
23468       var filteredElements = filter(elements, function(element) {
23469
23470         if (!element.waypoints) { // shapes
23471           return true;
23472         } else { // connections
23473           var srcFound = find(elements, element.source);
23474           var targetFound = find(elements, element.target);
23475
23476           return srcFound && targetFound;
23477         }
23478       });
23479
23480       return filteredElements;
23481     }
23482
23483     MoveVisuals.$inject = ['eventBus', 'elementRegistry', 'canvas', 'styles'];
23484
23485     module.exports = MoveVisuals;
23486
23487   }, {
23488     "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
23489     "lodash/array/flatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\flatten.js",
23490     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
23491     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
23492     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
23493     "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js"
23494   }],
23495   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\index.js": [function(require, module, exports) {
23496     module.exports = {
23497       __depends__: [
23498         require('../interaction-events'),
23499         require('../selection'),
23500         require('../outline'),
23501         require('../rules'),
23502         require('../dragging')
23503       ],
23504       __init__: ['move', 'moveVisuals'],
23505       move: ['type', require('./Move')],
23506       moveVisuals: ['type', require('./MoveVisuals')]
23507     };
23508
23509   }, {
23510     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
23511     "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
23512     "../outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js",
23513     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
23514     "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
23515     "./Move": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\Move.js",
23516     "./MoveVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\MoveVisuals.js"
23517   }],
23518   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\Outline.js": [function(require, module, exports) {
23519     'use strict';
23520
23521     var Snap = require('../../../vendor/snapsvg');
23522     var getBBox = require('../../util/Elements').getBBox;
23523
23524
23525     /**
23526      * @class
23527      *
23528      * A plugin that adds an outline to shapes and connections that may be activated
23529      * and styled via CSS classes.
23530      *
23531      * @param {EventBus}
23532      *            events the event bus
23533      */
23534     function Outline(eventBus, styles, elementRegistry) {
23535
23536       var OUTLINE_OFFSET = 6;
23537
23538       var OUTLINE_STYLE = styles.cls('djs-outline', ['no-fill']);
23539
23540       function createOutline(gfx, bounds) {
23541         return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);
23542       }
23543
23544       function updateShapeOutline(outline, bounds) {
23545
23546         outline.attr({
23547           x: -OUTLINE_OFFSET,
23548           y: -OUTLINE_OFFSET,
23549           width: bounds.width + OUTLINE_OFFSET * 2,
23550           height: bounds.height + OUTLINE_OFFSET * 2
23551         });
23552       }
23553
23554       function updateConnectionOutline(outline, connection) {
23555
23556         var bbox = getBBox(connection);
23557
23558         outline.attr({
23559           x: bbox.x - OUTLINE_OFFSET,
23560           y: bbox.y - OUTLINE_OFFSET,
23561           width: bbox.width + OUTLINE_OFFSET * 2,
23562           height: bbox.height + OUTLINE_OFFSET * 2
23563         });
23564       }
23565
23566       eventBus.on(['shape.added', 'shape.changed'], function(event) {
23567         var element = event.element,
23568           gfx = event.gfx;
23569
23570         var outline = gfx.select('.djs-outline');
23571
23572         if (!outline) {
23573           outline = createOutline(gfx, element);
23574         }
23575
23576         updateShapeOutline(outline, element);
23577       });
23578
23579       eventBus.on(['connection.added', 'connection.changed'], function(event) {
23580         var element = event.element,
23581           gfx = event.gfx;
23582
23583         var outline = gfx.select('.djs-outline');
23584
23585         if (!outline) {
23586           outline = createOutline(gfx, element);
23587         }
23588
23589         updateConnectionOutline(outline, element);
23590       });
23591
23592
23593     }
23594
23595
23596     Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
23597
23598     module.exports = Outline;
23599
23600   }, {
23601     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
23602     "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js"
23603   }],
23604   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js": [function(require, module, exports) {
23605     'use strict';
23606
23607     module.exports = {
23608       __init__: ['outline'],
23609       outline: ['type', require('./Outline')]
23610     };
23611   }, {
23612     "./Outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\Outline.js"
23613   }],
23614   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\Overlays.js": [function(require, module, exports) {
23615     'use strict';
23616
23617     var isArray = require('lodash/lang/isArray'),
23618       isString = require('lodash/lang/isString'),
23619       isObject = require('lodash/lang/isObject'),
23620       assign = require('lodash/object/assign'),
23621       forEach = require('lodash/collection/forEach'),
23622       filter = require('lodash/collection/filter'),
23623       debounce = require('lodash/function/debounce');
23624
23625     var domify = require('min-dom/lib/domify'),
23626       domClasses = require('min-dom/lib/classes'),
23627       domRemove = require('min-dom/lib/remove');
23628
23629     var getBBox = require('../../util/Elements').getBBox;
23630
23631     // document wide unique overlay ids
23632     var ids = new(require('../../util/IdGenerator'))('ov');
23633
23634
23635     function createRoot(parent) {
23636       var root = domify('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');
23637       parent.insertBefore(root, parent.firstChild);
23638
23639       return root;
23640     }
23641
23642
23643     function setPosition(el, x, y) {
23644       assign(el.style, {
23645         left: x + 'px',
23646         top: y + 'px'
23647       });
23648     }
23649
23650     function setVisible(el, visible) {
23651       el.style.display = visible === false ? 'none' : '';
23652     }
23653
23654     /**
23655      * A service that allows users to attach overlays to diagram elements.
23656      *
23657      * The overlay service will take care of overlay positioning during updates.
23658      *
23659      * @example
23660      *  // add a pink badge on the top left of the shape overlays.add(someShape, {
23661      * position: { top: -5, left: -5 }, html: '<div style="width: 10px; background:
23662      * fuchsia; color: white;">0</div>' });
23663      *  // or add via shape id
23664      *
23665      * overlays.add('some-element-id', { position: { top: -5, left: -5 } html: '<div
23666      * style="width: 10px; background: fuchsia; color: white;">0</div>' });
23667      *  // or add with optional type
23668      *
23669      * overlays.add(someShape, 'badge', { position: { top: -5, left: -5 } html: '<div
23670      * style="width: 10px; background: fuchsia; color: white;">0</div>' });
23671      *
23672      *  // remove an overlay
23673      *
23674      * var id = overlays.add(...); overlays.remove(id);
23675      *
23676      * @param {EventBus}
23677      *            eventBus
23678      * @param {Canvas}
23679      *            canvas
23680      * @param {ElementRegistry}
23681      *            elementRegistry
23682      */
23683     function Overlays(config, eventBus, canvas, elementRegistry) {
23684
23685       this._eventBus = eventBus;
23686       this._canvas = canvas;
23687       this._elementRegistry = elementRegistry;
23688
23689       this._ids = ids;
23690
23691       this._overlayDefaults = {
23692         show: {
23693           minZoom: 0.7,
23694           maxZoom: 5.0
23695         }
23696       };
23697
23698       /**
23699        * Mapping overlayId -> overlay
23700        */
23701       this._overlays = {};
23702
23703       /**
23704        * Mapping elementId -> overlay container
23705        */
23706       this._overlayContainers = {};
23707
23708       // root html element for all overlays
23709       this._overlayRoot = createRoot(canvas.getContainer());
23710
23711       this._init(config);
23712     }
23713
23714
23715     Overlays.$inject = ['config.overlays', 'eventBus', 'canvas', 'elementRegistry'];
23716
23717     module.exports = Overlays;
23718
23719
23720     /**
23721      * Returns the overlay with the specified id or a list of overlays for an
23722      * element with a given type.
23723      *
23724      * @example
23725      *  // return the single overlay with the given id overlays.get('some-id');
23726      *  // return all overlays for the shape overlays.get({ element: someShape });
23727      *  // return all overlays on shape with type 'badge' overlays.get({ element:
23728      * someShape, type: 'badge' });
23729      *  // shape can also be specified as id overlays.get({ element: 'element-id',
23730      * type: 'badge' });
23731      *
23732      *
23733      * @param {Object}
23734      *            search
23735      * @param {String}
23736      *            [search.id]
23737      * @param {String|djs.model.Base}
23738      *            [search.element]
23739      * @param {String}
23740      *            [search.type]
23741      *
23742      * @return {Object|Array<Object>} the overlay(s)
23743      */
23744     Overlays.prototype.get = function(search) {
23745
23746       if (isString(search)) {
23747         search = {
23748           id: search
23749         };
23750       }
23751
23752       if (search.element) {
23753         var container = this._getOverlayContainer(search.element, true);
23754
23755         // return a list of overlays when searching by element (+type)
23756         if (container) {
23757           return search.type ? filter(container.overlays, {
23758             type: search.type
23759           }) : container.overlays.slice();
23760         } else {
23761           return [];
23762         }
23763       } else
23764       if (search.type) {
23765         return filter(this._overlays, {
23766           type: search.type
23767         });
23768       } else {
23769         // return single element when searching by id
23770         return search.id ? this._overlays[search.id] : null;
23771       }
23772     };
23773
23774     /**
23775      * Adds a HTML overlay to an element.
23776      *
23777      * @param {String|djs.model.Base}
23778      *            element attach overlay to this shape
23779      * @param {String}
23780      *            [type] optional type to assign to the overlay
23781      * @param {Object}
23782      *            overlay the overlay configuration
23783      *
23784      * @param {String|DOMElement}
23785      *            overlay.html html element to use as an overlay
23786      * @param {Object}
23787      *            [overlay.show] show configuration
23788      * @param {Number}
23789      *            [overlay.show.minZoom] minimal zoom level to show the overlay
23790      * @param {Number}
23791      *            [overlay.show.maxZoom] maximum zoom level to show the overlay
23792      * @param {Object}
23793      *            overlay.position where to attach the overlay
23794      * @param {Number}
23795      *            [overlay.position.left] relative to element bbox left attachment
23796      * @param {Number}
23797      *            [overlay.position.top] relative to element bbox top attachment
23798      * @param {Number}
23799      *            [overlay.position.bottom] relative to element bbox bottom
23800      *            attachment
23801      * @param {Number}
23802      *            [overlay.position.right] relative to element bbox right attachment
23803      *
23804      * @return {String} id that may be used to reference the overlay for update or
23805      *         removal
23806      */
23807     Overlays.prototype.add = function(element, type, overlay) {
23808
23809       if (isObject(type)) {
23810         overlay = type;
23811         type = null;
23812       }
23813
23814       if (!element.id) {
23815         element = this._elementRegistry.get(element);
23816       }
23817
23818       if (!overlay.position) {
23819         throw new Error('must specifiy overlay position');
23820       }
23821
23822       if (!overlay.html) {
23823         throw new Error('must specifiy overlay html');
23824       }
23825
23826       if (!element) {
23827         throw new Error('invalid element specified');
23828       }
23829
23830       var id = this._ids.next();
23831
23832       overlay = assign({}, this._overlayDefaults, overlay, {
23833         id: id,
23834         type: type,
23835         element: element,
23836         html: overlay.html
23837       });
23838
23839       this._addOverlay(overlay);
23840
23841       return id;
23842     };
23843
23844
23845     /**
23846      * Remove an overlay with the given id or all overlays matching the given
23847      * filter.
23848      *
23849      * @see Overlays#get for filter options.
23850      *
23851      * @param {String}
23852      *            [id]
23853      * @param {Object}
23854      *            [filter]
23855      */
23856     Overlays.prototype.remove = function(filter) {
23857
23858       var overlays = this.get(filter) || [];
23859
23860       if (!isArray(overlays)) {
23861         overlays = [overlays];
23862       }
23863
23864       var self = this;
23865
23866       forEach(overlays, function(overlay) {
23867
23868         var container = self._getOverlayContainer(overlay.element, true);
23869
23870         if (overlay) {
23871           domRemove(overlay.html);
23872           domRemove(overlay.htmlContainer);
23873
23874           delete overlay.htmlContainer;
23875           delete overlay.element;
23876
23877           delete self._overlays[overlay.id];
23878         }
23879
23880         if (container) {
23881           var idx = container.overlays.indexOf(overlay);
23882           if (idx !== -1) {
23883             container.overlays.splice(idx, 1);
23884           }
23885         }
23886       });
23887
23888     };
23889
23890
23891     Overlays.prototype.show = function() {
23892       setVisible(this._overlayRoot);
23893     };
23894
23895
23896     Overlays.prototype.hide = function() {
23897       setVisible(this._overlayRoot, false);
23898     };
23899
23900
23901     Overlays.prototype._updateOverlayContainer = function(container) {
23902       var element = container.element,
23903         html = container.html;
23904
23905       // update container left,top according to the elements x,y coordinates
23906       // this ensures we can attach child elements relative to this container
23907
23908       var x = element.x,
23909         y = element.y;
23910
23911       if (element.waypoints) {
23912         var bbox = getBBox(element);
23913         x = bbox.x;
23914         y = bbox.y;
23915       }
23916
23917       setPosition(html, x, y);
23918     };
23919
23920
23921     Overlays.prototype._updateOverlay = function(overlay) {
23922
23923       var position = overlay.position,
23924         htmlContainer = overlay.htmlContainer,
23925         element = overlay.element;
23926
23927       // update overlay html relative to shape because
23928       // it is already positioned on the element
23929
23930       // update relative
23931       var left = position.left,
23932         top = position.top;
23933
23934       if (position.right !== undefined) {
23935
23936         var width;
23937
23938         if (element.waypoints) {
23939           width = getBBox(element).width;
23940         } else {
23941           width = element.width;
23942         }
23943
23944         left = position.right * -1 + width;
23945       }
23946
23947       if (position.bottom !== undefined) {
23948
23949         var height;
23950
23951         if (element.waypoints) {
23952           height = getBBox(element).height;
23953         } else {
23954           height = element.height;
23955         }
23956
23957         top = position.bottom * -1 + height;
23958       }
23959
23960       setPosition(htmlContainer, left || 0, top || 0);
23961     };
23962
23963
23964     Overlays.prototype._createOverlayContainer = function(element) {
23965       var html = domify('<div class="djs-overlays djs-overlays-' + element.id + '" style="position: absolute" />');
23966
23967       this._overlayRoot.appendChild(html);
23968
23969       var container = {
23970         html: html,
23971         element: element,
23972         overlays: []
23973       };
23974
23975       this._updateOverlayContainer(container);
23976
23977       return container;
23978     };
23979
23980
23981     Overlays.prototype._updateRoot = function(viewbox) {
23982       var a = viewbox.scale || 1;
23983       var d = viewbox.scale || 1;
23984
23985       var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
23986
23987       this._overlayRoot.style.transform = matrix;
23988       this._overlayRoot.style['-ms-transform'] = matrix;
23989     };
23990
23991
23992     Overlays.prototype._getOverlayContainer = function(element, raw) {
23993       var id = (element && element.id) || element;
23994
23995       var container = this._overlayContainers[id];
23996       if (!container && !raw) {
23997         container = this._overlayContainers[id] = this._createOverlayContainer(element);
23998       }
23999
24000       return container;
24001     };
24002
24003
24004     Overlays.prototype._addOverlay = function(overlay) {
24005
24006       var id = overlay.id,
24007         element = overlay.element,
24008         html = overlay.html,
24009         htmlContainer,
24010         overlayContainer;
24011
24012       // unwrap jquery (for those who need it)
24013       if (html.get) {
24014         html = html.get(0);
24015       }
24016
24017       // create proper html elements from
24018       // overlay HTML strings
24019       if (isString(html)) {
24020         html = domify(html);
24021       }
24022
24023       overlayContainer = this._getOverlayContainer(element);
24024
24025       htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: absolute">');
24026
24027       htmlContainer.appendChild(html);
24028
24029       if (overlay.type) {
24030         domClasses(htmlContainer).add('djs-overlay-' + overlay.type);
24031       }
24032
24033       overlay.htmlContainer = htmlContainer;
24034
24035       overlayContainer.overlays.push(overlay);
24036       overlayContainer.html.appendChild(htmlContainer);
24037
24038       this._overlays[id] = overlay;
24039
24040       this._updateOverlay(overlay);
24041     };
24042
24043     Overlays.prototype._updateOverlayVisibilty = function(viewbox) {
24044
24045       forEach(this._overlays, function(overlay) {
24046         var show = overlay.show,
24047           htmlContainer = overlay.htmlContainer,
24048           visible = true;
24049
24050         if (show) {
24051           if (show.minZoom > viewbox.scale ||
24052             show.maxZoom < viewbox.scale) {
24053             visible = false;
24054           }
24055
24056           setVisible(htmlContainer, visible);
24057         }
24058       });
24059     };
24060
24061     Overlays.prototype._init = function(config) {
24062
24063       var eventBus = this._eventBus;
24064
24065       var self = this;
24066
24067
24068       // scroll/zoom integration
24069
24070       var updateViewbox = function(viewbox) {
24071         self._updateRoot(viewbox);
24072         self._updateOverlayVisibilty(viewbox);
24073
24074         self.show();
24075       };
24076
24077       if (!config || config.deferUpdate !== false) {
24078         updateViewbox = debounce(updateViewbox, 300);
24079       }
24080
24081       eventBus.on('canvas.viewbox.changed', function(event) {
24082         self.hide();
24083         updateViewbox(event.viewbox);
24084       });
24085
24086
24087       // remove integration
24088
24089       eventBus.on(['shape.remove', 'connection.remove'], function(e) {
24090         var overlays = self.get({
24091           element: e.element
24092         });
24093
24094         forEach(overlays, function(o) {
24095           self.remove(o.id);
24096         });
24097       });
24098
24099
24100       // move integration
24101
24102       eventBus.on([
24103         'element.changed'
24104       ], function(e) {
24105         var element = e.element;
24106
24107         var container = self._getOverlayContainer(element, true);
24108
24109         if (container) {
24110           forEach(container.overlays, function(overlay) {
24111             self._updateOverlay(overlay);
24112           });
24113
24114           self._updateOverlayContainer(container);
24115         }
24116       });
24117
24118
24119       // marker integration, simply add them on the overlays as classes, too.
24120
24121       eventBus.on('element.marker.update', function(e) {
24122         var container = self._getOverlayContainer(e.element, true);
24123         if (container) {
24124           domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);
24125         }
24126       });
24127     };
24128
24129   }, {
24130     "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
24131     "../../util/IdGenerator": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js",
24132     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
24133     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24134     "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js",
24135     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
24136     "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
24137     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
24138     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
24139     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24140     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24141     "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
24142   }],
24143   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js": [function(require, module, exports) {
24144     module.exports = {
24145       __init__: ['overlays'],
24146       overlays: ['type', require('./Overlays')]
24147     };
24148   }, {
24149     "./Overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\Overlays.js"
24150   }],
24151   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\Palette.js": [function(require, module, exports) {
24152     'use strict';
24153
24154     var isFunction = require('lodash/lang/isFunction'),
24155       forEach = require('lodash/collection/forEach');
24156
24157     var domify = require('min-dom/lib/domify'),
24158       domQuery = require('min-dom/lib/query'),
24159       domAttr = require('min-dom/lib/attr'),
24160       domClear = require('min-dom/lib/clear'),
24161       domClasses = require('min-dom/lib/classes'),
24162       domMatches = require('min-dom/lib/matches'),
24163       domDelegate = require('min-dom/lib/delegate'),
24164       domEvent = require('min-dom/lib/event');
24165
24166
24167     var toggleSelector = '.djs-palette-toggle',
24168       entrySelector = '.entry',
24169       elementSelector = toggleSelector + ', ' + entrySelector;
24170
24171
24172     /**
24173      * A palette containing modeling elements.
24174      */
24175     function Palette(eventBus, canvas) {
24176
24177       this._eventBus = eventBus;
24178       this._canvas = canvas;
24179
24180       this._providers = [];
24181     }
24182
24183     Palette.$inject = ['eventBus', 'canvas'];
24184
24185     module.exports = Palette;
24186
24187
24188     /**
24189      * Register a provider with the palette
24190      *
24191      * @param {PaletteProvider}
24192      *            provider
24193      */
24194     Palette.prototype.registerProvider = function(provider) {
24195       this._providers.push(provider);
24196
24197       if (!this._container) {
24198         this._init();
24199       }
24200
24201       this._update();
24202     };
24203
24204
24205     /**
24206      * Returns the palette entries for a given element
24207      *
24208      * @return {Array<PaletteEntryDescriptor>} list of entries
24209      */
24210     Palette.prototype.getEntries = function() {
24211
24212       var entries = {};
24213
24214       // loop through all providers and their entries.
24215       // group entries by id so that overriding an entry is possible
24216       forEach(this._providers, function(provider) {
24217         var e = provider.getPaletteEntries();
24218
24219         forEach(e, function(entry, id) {
24220           entries[id] = entry;
24221         });
24222       });
24223
24224       return entries;
24225     };
24226
24227
24228     /**
24229      * Initialize
24230      */
24231     Palette.prototype._init = function() {
24232       var parent = this._canvas.getContainer(),
24233         container = this._container = domify(Palette.HTML_MARKUP),
24234         self = this;
24235
24236       parent.appendChild(container);
24237
24238       domDelegate.bind(container, elementSelector, 'click', function(event) {
24239
24240         var target = event.delegateTarget;
24241
24242         if (domMatches(target, toggleSelector)) {
24243           return self.toggle();
24244         }
24245
24246         self.trigger('click', event);
24247       });
24248
24249       // prevent drag propagation
24250       domEvent.bind(container, 'mousedown', function(event) {
24251         event.stopPropagation();
24252       });
24253
24254       // prevent drag propagation
24255       domDelegate.bind(container, entrySelector, 'dragstart', function(event) {
24256         self.trigger('dragstart', event);
24257       });
24258
24259       this._eventBus.fire('palette.create', {
24260         html: container
24261       });
24262     };
24263
24264
24265     Palette.prototype._update = function() {
24266
24267       var entriesContainer = domQuery('.djs-palette-entries', this._container),
24268         entries = this._entries = this.getEntries();
24269
24270       domClear(entriesContainer);
24271
24272       forEach(entries, function(entry, id) {
24273
24274         var grouping = entry.group || 'default';
24275
24276         var container = domQuery('[data-group=' + grouping + ']', entriesContainer);
24277         if (!container) {
24278           container = domify('<div class="group" data-group="' + grouping + '"></div>');
24279           entriesContainer.appendChild(container);
24280         }
24281
24282         var html = entry.html || (
24283           entry.separator ?
24284           '<hr class="separator" />' :
24285           '<div class="entry" draggable="true"></div>');
24286
24287
24288         var control = domify(html);
24289         // alert("Control ::" + control + " HTML :: " + html);
24290
24291         container.appendChild(control);
24292
24293         if (!entry.separator) {
24294           domAttr(control, 'data-action', id);
24295
24296           if (entry.title) {
24297             domAttr(control, 'title', entry.title);
24298           }
24299
24300
24301
24302           if (entry.className) {
24303             domClasses(control).add(entry.className);
24304           }
24305
24306           if (entry.imageUrl) {
24307             control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
24308           }
24309         }
24310
24311         // alert("Entry Title :: " + entry.title + " Entry HTML :: " + html);
24312       });
24313
24314       // open after update
24315       this.open(true);
24316     };
24317
24318
24319     /**
24320      * Trigger an action available on the palette
24321      *
24322      * @param {String}
24323      *            action
24324      * @param {Event}
24325      *            event
24326      */
24327     Palette.prototype.trigger = function(action, event, autoActivate) {
24328
24329       var entries = this._entries,
24330         entry,
24331         handler,
24332         originalEvent,
24333         button = event.delegateTarget || event.target;
24334
24335       if (!button) {
24336         return event.preventDefault();
24337       }
24338
24339
24340       entry = entries[domAttr(button, 'data-action')];
24341       handler = entry.action;
24342
24343       originalEvent = event.originalEvent || event;
24344
24345       // simple action (via callback function)
24346       if (isFunction(handler)) {
24347         if (action === 'click') {
24348           return handler(originalEvent, autoActivate);
24349         }
24350       } else {
24351         if (handler[action]) {
24352           return handler[action](originalEvent, autoActivate);
24353         }
24354       }
24355
24356       // silence other actions
24357       event.preventDefault();
24358     };
24359
24360
24361     /**
24362      * Close the palette
24363      */
24364     Palette.prototype.close = function() {
24365       domClasses(this._container).remove('open');
24366     };
24367
24368
24369     /**
24370      * Open the palette
24371      */
24372     Palette.prototype.open = function() {
24373       domClasses(this._container).add('open');
24374     };
24375
24376
24377     Palette.prototype.toggle = function(open) {
24378       if (this.isOpen()) {
24379         this.close();
24380       } else {
24381         this.open();
24382       }
24383     };
24384
24385
24386     /**
24387      * Return true if the palette is opened.
24388      *
24389      * @example
24390      *
24391      * palette.open();
24392      *
24393      * if (palette.isOpen()) { // yes, we are open }
24394      *
24395      * @return {boolean} true if palette is opened
24396      */
24397     Palette.prototype.isOpen = function() {
24398       return this._container && domClasses(this._container).has('open');
24399     };
24400
24401
24402     /* markup definition */
24403
24404     Palette.HTML_MARKUP =
24405       '<div class="djs-palette">' +
24406       '<div class="djs-palette-entries"></div>' +
24407       '<div class="djs-palette-toggle"></div>' +
24408       '</div>';
24409   }, {
24410     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24411     "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
24412     "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
24413     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24414     "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js",
24415     "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
24416     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24417     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
24418     "min-dom/lib/matches": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js",
24419     "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js"
24420   }],
24421   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\index.js": [function(require, module, exports) {
24422     module.exports = {
24423       __init__: ['palette'],
24424       palette: ['type', require('./Palette')]
24425     };
24426
24427   }, {
24428     "./Palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\Palette.js"
24429   }],
24430   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\PopupMenu.js": [function(require, module, exports) {
24431     'use strict';
24432
24433     var forEach = require('lodash/collection/forEach'),
24434       assign = require('lodash/object/assign'),
24435       domEvent = require('min-dom/lib/event'),
24436       domify = require('min-dom/lib/domify'),
24437       domClasses = require('min-dom/lib/classes'),
24438       domAttr = require('min-dom/lib/attr'),
24439       domRemove = require('min-dom/lib/remove');
24440
24441
24442     function PopupMenu(eventBus, canvas) {
24443
24444       this._eventBus = eventBus;
24445       this._canvas = canvas;
24446       this._instances = {};
24447     }
24448
24449     PopupMenu.$inject = ['eventBus', 'canvas'];
24450
24451     module.exports = PopupMenu;
24452
24453     PopupMenu.prototype.open = function(name, position, entries, options) {
24454
24455       var outer = this,
24456         canvas = this._canvas,
24457         instances = outer._instances;
24458
24459       // return existing instance
24460       if (instances[name]) {
24461         return instances[name];
24462       }
24463
24464       var parent = canvas.getContainer();
24465
24466       // ------------------------
24467       function PopupMenuInstance() {
24468
24469         var self = this;
24470
24471         self._actions = {};
24472         self.name = name || 'popup-menu';
24473
24474         var _options = {
24475           entryClassName: 'entry'
24476         };
24477         assign(_options, options);
24478
24479         // Container setup
24480         var container = this._container = domify('<div class="djs-popup">');
24481
24482         assign(container.style, {
24483           position: 'absolute',
24484           left: position.x + 'px',
24485           top: position.y + 'px'
24486         });
24487         domClasses(container).add(name);
24488
24489         // Add entries
24490         forEach(entries, function(entry) {
24491
24492           var entryContainer = domify('<div>');
24493           domClasses(entryContainer).add(entry.className || _options.entryClassName);
24494           domClasses(entryContainer).add('djs-popup-entry');
24495
24496           if (entry.style) {
24497             domAttr(entryContainer, 'style', entry.style);
24498           }
24499
24500           if (entry.action) {
24501             domAttr(entryContainer, 'data-action', entry.action.name);
24502             self._actions[entry.action.name] = entry.action.handler;
24503           }
24504
24505           var title = domify('<span>');
24506           title.textContent = entry.label;
24507           entryContainer.appendChild(title);
24508
24509           container.appendChild(entryContainer);
24510         });
24511
24512         // Event handler
24513         domEvent.bind(container, 'click', function(event) {
24514           self.trigger(event);
24515         });
24516
24517
24518
24519         // apply canvas zoom level
24520         var zoom = canvas.zoom();
24521
24522         container.style.transformOrigin = 'top left';
24523         container.style.transform = 'scale(' + zoom + ')';
24524
24525         // Attach to DOM
24526         parent.appendChild(container);
24527
24528         // Add Handler
24529         this.bindHandlers();
24530       }
24531
24532       PopupMenuInstance.prototype.close = function() {
24533         this.unbindHandlers();
24534         domRemove(this._container);
24535         delete outer._instances[this.name];
24536       };
24537
24538       PopupMenuInstance.prototype.bindHandlers = function() {
24539
24540         var self = this,
24541           eventBus = outer._eventBus;
24542
24543         this._closeHandler = function() {
24544           self.close();
24545         };
24546
24547         eventBus.once('contextPad.close', this._closeHandler);
24548         eventBus.once('canvas.viewbox.changed', this._closeHandler);
24549       };
24550
24551       PopupMenuInstance.prototype.unbindHandlers = function() {
24552
24553         var eventBus = outer._eventBus;
24554
24555         eventBus.off('contextPad.close', this._closeHandler);
24556         eventBus.off('canvas.viewbox.changed', this._closeHandler);
24557       };
24558
24559       PopupMenuInstance.prototype.trigger = function(event) {
24560
24561         var element = event.target,
24562           actionName = element.getAttribute('data-action') ||
24563           element.parentNode.getAttribute('data-action');
24564
24565         var action = this._actions[actionName];
24566
24567
24568         if (action) {
24569           action();
24570         }
24571
24572         // silence other actions
24573         event.preventDefault();
24574       };
24575
24576       var instance = outer._instances[name] = new PopupMenuInstance(position, entries, parent, options);
24577
24578       return instance;
24579     };
24580
24581   }, {
24582     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24583     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
24584     "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
24585     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24586     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24587     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
24588     "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
24589   }],
24590   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\index.js": [function(require, module, exports) {
24591     'use strict';
24592
24593     module.exports = {
24594       __init__: ['popupMenu'],
24595       popupMenu: ['type', require('./PopupMenu')]
24596     };
24597
24598   }, {
24599     "./PopupMenu": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\PopupMenu.js"
24600   }],
24601   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\Replace.js": [function(require, module, exports) {
24602     'use strict';
24603
24604
24605     /**
24606      * Service that allow replacing of elements.
24607      *
24608      *
24609      * @class
24610      * @constructor
24611      */
24612     function Replace(modeling) {
24613
24614       this._modeling = modeling;
24615     }
24616
24617     module.exports = Replace;
24618
24619     Replace.$inject = ['modeling'];
24620
24621     /**
24622      * @param {Element}
24623      *            oldElement - Element to be replaced
24624      * @param {Object}
24625      *            newElementData - Containing information about the new Element, for
24626      *            example height, width, type.
24627      * @param {Object}
24628      *            options - Custom options that will be attached to the context. It
24629      *            can be used to inject data that is needed in the command chain.
24630      *            For example it could be used in
24631      *            eventbus.on('commandStack.shape.replace.postExecute') to change
24632      *            shape attributes after shape creation.
24633      */
24634     Replace.prototype.replaceElement = function(oldElement, newElementData, options) {
24635
24636       var modeling = this._modeling;
24637
24638       var newElement = null;
24639
24640       if (oldElement.waypoints) {
24641         // TODO
24642         // modeling.replaceConnection
24643       } else {
24644         // set center of element for modeling API
24645         // if no new width / height is given use old elements size
24646         newElementData.x = oldElement.x + (newElementData.width || oldElement.width) / 2;
24647         newElementData.y = oldElement.y + (newElementData.height || oldElement.height) / 2;
24648
24649         newElement = modeling.replaceShape(oldElement, newElementData, options);
24650       }
24651
24652       return newElement;
24653     };
24654
24655   }, {}],
24656   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\index.js": [function(require, module, exports) {
24657     'use strict';
24658
24659     module.exports = {
24660       __init__: ['replace'],
24661       replace: ['type', require('./Replace')]
24662     };
24663
24664   }, {
24665     "./Replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\Replace.js"
24666   }],
24667   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\Resize.js": [function(require, module, exports) {
24668     'use strict';
24669
24670     var forEach = require('lodash/collection/forEach'),
24671       filter = require('lodash/collection/filter'),
24672       pick = require('lodash/object/pick');
24673
24674     var ResizeUtil = require('./ResizeUtil'),
24675       domEvent = require('min-dom/lib/event'),
24676       Elements = require('../../util/Elements');
24677
24678     var isPrimaryButton = require('../../util/Mouse').isPrimaryButton;
24679
24680     var round = Math.round;
24681
24682     var Snap = require('../../../vendor/snapsvg');
24683
24684     var HANDLE_OFFSET = -2,
24685       HANDLE_SIZE = 5,
24686       HANDLE_HIT_SIZE = 20;
24687
24688     var MARKER_RESIZING = 'djs-resizing',
24689       MARKER_RESIZE_NOT_OK = 'resize-not-ok',
24690       CLS_RESIZER = 'djs-resizer';
24691
24692
24693     /**
24694      * Implements resize on shapes by
24695      *  * adding resize handles, * creating a visual during resize * checking resize
24696      * rules * committing a change once finished
24697      *
24698      *  ## Customizing
24699      *
24700      * It's possible to customize the resizing behaviour by intercepting
24701      * 'resize.start' and providing the following parameters through the 'context':
24702      *  * minDimensions ({ width, height }) - Minimum shape dimensions *
24703      * childrenBoxPadding (number) - Gap between the minimum bounding box and the
24704      * container
24705      *
24706      * f.ex:
24707      *
24708      * eventBus.on('resize.start', 1500, function(event) { var context =
24709      * event.context,
24710      *
24711      * context.minDimensions = { width: 140, height: 120 };
24712      * context.childrenBoxPadding = 30; });
24713      */
24714
24715     function Resize(eventBus, elementRegistry, rules, modeling, canvas, selection, dragging) {
24716
24717       function canResize(context) {
24718         var ctx = pick(context, ['newBounds', 'shape', 'delta', 'direction']);
24719         return rules.allowed('shape.resize', ctx);
24720       }
24721
24722
24723       // resizing implementation //////////////////////////////////
24724
24725       /**
24726        * A helper that realizes the resize visuals
24727        */
24728       var visuals = {
24729         create: function(context) {
24730           var container = canvas.getDefaultLayer(),
24731             shape = context.shape,
24732             frame;
24733
24734           frame = context.frame = Snap.create('rect', {
24735             class: 'djs-resize-overlay',
24736             width: shape.width + 10,
24737             height: shape.height + 10,
24738             x: shape.x - 5,
24739             y: shape.y - 5
24740           });
24741
24742           frame.appendTo(container);
24743         },
24744
24745         update: function(context) {
24746           var frame = context.frame,
24747             bounds = context.newBounds;
24748
24749           if (bounds.width > 5) {
24750             frame.attr({
24751               x: bounds.x,
24752               width: bounds.width
24753             });
24754           }
24755
24756           if (bounds.height > 5) {
24757             frame.attr({
24758               y: bounds.y,
24759               height: bounds.height
24760             });
24761           }
24762
24763           frame[context.canExecute ? 'removeClass' : 'addClass'](MARKER_RESIZE_NOT_OK);
24764         },
24765
24766         remove: function(context) {
24767           if (context.frame) {
24768             context.frame.remove();
24769           }
24770         }
24771       };
24772
24773       function computeMinBoundaryBox(context) {
24774
24775         var shape = context.shape,
24776           direction = context.direction,
24777           minDimensions = context.minDimensions || {},
24778           childrenBoxPadding = context.childrenBoxPadding || 20,
24779           children,
24780           minBoundaryBox;
24781
24782         // grab all the shapes that are NOT labels or connections
24783         children = filter(shape.children, function(child) {
24784           // connections
24785           if (child.waypoints) {
24786             return false;
24787           }
24788
24789           // labels
24790           if (child.type === 'label') {
24791             return false;
24792           }
24793
24794           return true;
24795         });
24796
24797         // compute a minimum bounding box
24798         // around the existing children
24799         if (children.length) {
24800           minBoundaryBox = Elements.getBBox(children);
24801
24802           // add a gap between the minBoundaryBox and the resizable container
24803           minBoundaryBox.width += childrenBoxPadding * 2;
24804           minBoundaryBox.height += childrenBoxPadding * 2;
24805           minBoundaryBox.x -= childrenBoxPadding;
24806           minBoundaryBox.y -= childrenBoxPadding;
24807         } else {
24808           minBoundaryBox = ResizeUtil.getMinResizeBounds(direction, shape, {
24809             width: minDimensions.width || 10,
24810             height: minDimensions.height || 10
24811           });
24812         }
24813
24814         return minBoundaryBox;
24815       }
24816
24817       eventBus.on('resize.start', function(event) {
24818
24819         var context = event.context,
24820           shape = context.shape,
24821           minBoundaryBox = context.minBoundaryBox;
24822
24823         if (minBoundaryBox === undefined) {
24824           context.minBoundaryBox = computeMinBoundaryBox(context);
24825         }
24826
24827         // add resizable indicator
24828         canvas.addMarker(shape, MARKER_RESIZING);
24829
24830         visuals.create(context);
24831       });
24832
24833       eventBus.on('resize.move', function(event) {
24834
24835         var context = event.context,
24836           shape = context.shape,
24837           direction = context.direction,
24838           minBoundaryBox = context.minBoundaryBox,
24839           delta;
24840
24841         delta = {
24842           x: event.dx,
24843           y: event.dy
24844         };
24845
24846         context.delta = delta;
24847
24848         context.newBounds = ResizeUtil.resizeBounds(shape, direction, delta);
24849
24850         if (minBoundaryBox) {
24851           context.newBounds = ResizeUtil.ensureMinBounds(context.newBounds, minBoundaryBox);
24852         }
24853
24854         // update + cache executable state
24855         context.canExecute = canResize(context);
24856
24857         // update resize frame visuals
24858         visuals.update(context);
24859       });
24860
24861       eventBus.on('resize.end', function(event) {
24862         var context = event.context,
24863           shape = context.shape;
24864
24865         var newBounds = context.newBounds;
24866
24867
24868         // ensure we have actual pixel values for new bounds
24869         // (important when zoom level was > 1 during move)
24870         newBounds.x = round(newBounds.x);
24871         newBounds.y = round(newBounds.y);
24872         newBounds.width = round(newBounds.width);
24873         newBounds.height = round(newBounds.height);
24874
24875         // perform the actual resize
24876         if (context.canExecute) {
24877           modeling.resizeShape(shape, context.newBounds);
24878         }
24879       });
24880
24881       eventBus.on('resize.cleanup', function(event) {
24882
24883         var context = event.context,
24884           shape = context.shape;
24885
24886         // remove resizable indicator
24887         canvas.removeMarker(shape, MARKER_RESIZING);
24888
24889         // remove frame + destroy context
24890         visuals.remove(context);
24891       });
24892
24893
24894       function activate(event, shape, direction) {
24895
24896         dragging.activate(event, 'resize', {
24897           autoActivate: true,
24898           cursor: 'resize-' + (/nw|se/.test(direction) ? 'nwse' : 'nesw'),
24899           data: {
24900             shape: shape,
24901             context: {
24902               direction: direction,
24903               shape: shape
24904             }
24905           }
24906         });
24907       }
24908
24909       function makeDraggable(element, gfx, direction) {
24910
24911         function listener(event) {
24912           // only trigger on left mouse button
24913           if (isPrimaryButton(event)) {
24914             activate(event, element, direction);
24915           }
24916         }
24917
24918         domEvent.bind(gfx.node, 'mousedown', listener);
24919         domEvent.bind(gfx.node, 'touchstart', listener);
24920       }
24921
24922       function __createResizer(gfx, x, y, rotation, direction) {
24923
24924         var group = gfx.group().addClass(CLS_RESIZER).addClass(CLS_RESIZER + '-' + direction);
24925
24926         var origin = -HANDLE_SIZE + HANDLE_OFFSET;
24927
24928         // Create four drag indicators on the outline
24929         group.rect(origin, origin, HANDLE_SIZE, HANDLE_SIZE).addClass(CLS_RESIZER + '-visual');
24930         group.rect(origin, origin, HANDLE_HIT_SIZE, HANDLE_HIT_SIZE).addClass(CLS_RESIZER + '-hit');
24931
24932         var matrix = new Snap.Matrix().translate(x, y).rotate(rotation, 0, 0);
24933         group.transform(matrix);
24934
24935         return group;
24936       }
24937
24938       function createResizer(element, gfx, direction) {
24939
24940         var resizer;
24941
24942         if (direction === 'nw') {
24943           resizer = __createResizer(gfx, 0, 0, 0, direction);
24944         } else if (direction === 'ne') {
24945           resizer = __createResizer(gfx, element.width, 0, 90, direction);
24946         } else if (direction === 'se') {
24947           resizer = __createResizer(gfx, element.width, element.height, 180, direction);
24948         } else {
24949           resizer = __createResizer(gfx, 0, element.height, 270, direction);
24950         }
24951
24952         makeDraggable(element, resizer, direction);
24953       }
24954
24955       // resize handles implementation ///////////////////////////////
24956
24957       function addResize(shape) {
24958
24959         if (!canResize({
24960             shape: shape
24961           })) {
24962           return;
24963         }
24964
24965         var gfx = elementRegistry.getGraphics(shape);
24966
24967         createResizer(shape, gfx, 'nw');
24968         createResizer(shape, gfx, 'ne');
24969         createResizer(shape, gfx, 'se');
24970         createResizer(shape, gfx, 'sw');
24971       }
24972
24973       function removeResize(shape) {
24974
24975         var gfx = elementRegistry.getGraphics(shape);
24976         var resizers = gfx.selectAll('.' + CLS_RESIZER);
24977
24978         forEach(resizers, function(resizer) {
24979           resizer.remove();
24980         });
24981       }
24982
24983       eventBus.on('selection.changed', function(e) {
24984
24985         var oldSelection = e.oldSelection,
24986           newSelection = e.newSelection;
24987
24988         // remove old selection markers
24989         forEach(oldSelection, removeResize);
24990
24991         // add new selection markers ONLY if single selection
24992         if (newSelection.length === 1) {
24993           forEach(newSelection, addResize);
24994         }
24995       });
24996
24997       eventBus.on('shape.changed', function(e) {
24998         var shape = e.element;
24999
25000         removeResize(shape);
25001
25002         if (selection.isSelected(shape)) {
25003           addResize(shape);
25004         }
25005       });
25006
25007
25008       // API
25009
25010       this.activate = activate;
25011     }
25012
25013     Resize.$inject = ['eventBus', 'elementRegistry', 'rules', 'modeling', 'canvas', 'selection', 'dragging'];
25014
25015     module.exports = Resize;
25016
25017   }, {
25018     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
25019     "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
25020     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
25021     "./ResizeUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\ResizeUtil.js",
25022     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
25023     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
25024     "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js",
25025     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
25026   }],
25027   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\ResizeUtil.js": [function(require, module, exports) {
25028     'use strict';
25029
25030     /**
25031      * Resize the given bounds by the specified delta from a given anchor point.
25032      *
25033      * @param {Bounds}
25034      *            bounds the bounding box that should be resized
25035      * @param {String}
25036      *            direction in which the element is resized (nw, ne, se, sw)
25037      * @param {Point}
25038      *            delta of the resize operation
25039      *
25040      * @return {Bounds} resized bounding box
25041      */
25042     module.exports.resizeBounds = function(bounds, direction, delta) {
25043
25044       var dx = delta.x,
25045         dy = delta.y;
25046
25047       switch (direction) {
25048
25049         case 'nw':
25050           return {
25051             x: bounds.x + dx,
25052             y: bounds.y + dy,
25053             width: bounds.width - dx,
25054             height: bounds.height - dy
25055           };
25056
25057         case 'sw':
25058           return {
25059             x: bounds.x + dx,
25060             y: bounds.y,
25061             width: bounds.width - dx,
25062             height: bounds.height + dy
25063           };
25064
25065         case 'ne':
25066           return {
25067             x: bounds.x,
25068             y: bounds.y + dy,
25069             width: bounds.width + dx,
25070             height: bounds.height - dy
25071           };
25072
25073         case 'se':
25074           return {
25075             x: bounds.x,
25076             y: bounds.y,
25077             width: bounds.width + dx,
25078             height: bounds.height + dy
25079           };
25080
25081         default:
25082           throw new Error('unrecognized direction: ' + direction);
25083       }
25084     };
25085
25086     module.exports.reattachPoint = function(bounds, newBounds, point) {
25087
25088       var sx = bounds.width / newBounds.width,
25089         sy = bounds.height / newBounds.height;
25090
25091       return {
25092         x: Math.round((newBounds.x + newBounds.width / 2)) - Math.floor(((bounds.x + bounds.width / 2) - point.x) / sx),
25093         y: Math.round((newBounds.y + newBounds.height / 2)) - Math.floor(((bounds.y + bounds.height / 2) - point.y) / sy)
25094       };
25095     };
25096
25097
25098     module.exports.ensureMinBounds = function(currentBounds, minBounds) {
25099       var topLeft = {
25100         x: Math.min(currentBounds.x, minBounds.x),
25101         y: Math.min(currentBounds.y, minBounds.y)
25102       };
25103
25104       var bottomRight = {
25105         x: Math.max(currentBounds.x + currentBounds.width, minBounds.x + minBounds.width),
25106         y: Math.max(currentBounds.y + currentBounds.height, minBounds.y + minBounds.height)
25107       };
25108
25109       return {
25110         x: topLeft.x,
25111         y: topLeft.y,
25112         width: bottomRight.x - topLeft.x,
25113         height: bottomRight.y - topLeft.y
25114       };
25115     };
25116
25117
25118     module.exports.getMinResizeBounds = function(direction, currentBounds, minDimensions) {
25119
25120       switch (direction) {
25121         case 'nw':
25122           return {
25123             x: currentBounds.x + currentBounds.width - minDimensions.width,
25124             y: currentBounds.y + currentBounds.height - minDimensions.height,
25125             width: minDimensions.width,
25126             height: minDimensions.height
25127           };
25128         case 'sw':
25129           return {
25130             x: currentBounds.x + currentBounds.width - minDimensions.width,
25131             y: currentBounds.y,
25132             width: minDimensions.width,
25133             height: minDimensions.height
25134           };
25135         case 'ne':
25136           return {
25137             x: currentBounds.x,
25138             y: currentBounds.y + currentBounds.height - minDimensions.height,
25139             width: minDimensions.width,
25140             height: minDimensions.height
25141           };
25142         case 'se':
25143           return {
25144             x: currentBounds.x,
25145             y: currentBounds.y,
25146             width: minDimensions.width,
25147             height: minDimensions.height
25148           };
25149         default:
25150           throw new Error('unrecognized direction: ' + direction);
25151       }
25152     };
25153
25154
25155
25156   }, {}],
25157   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\index.js": [function(require, module, exports) {
25158     module.exports = {
25159       __depends__: [
25160         require('../modeling'),
25161         require('../rules'),
25162         require('../dragging')
25163       ],
25164       __init__: ['resize'],
25165       resize: ['type', require('./Resize')]
25166     };
25167
25168   }, {
25169     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
25170     "../modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js",
25171     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
25172     "./Resize": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\Resize.js"
25173   }],
25174   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\RuleProvider.js": [function(require, module, exports) {
25175     'use strict';
25176
25177     var inherits = require('inherits');
25178
25179     var CommandInterceptor = require('../../command/CommandInterceptor');
25180
25181     /**
25182      * A basic provider that may be extended to implement modeling rules.
25183      *
25184      * Extensions should implement the init method to actually add their custom
25185      * modeling checks. Checks may be added via the #addRule(action, fn) method.
25186      *
25187      * @param {EventBus}
25188      *            eventBus
25189      */
25190     function RuleProvider(eventBus) {
25191       CommandInterceptor.call(this, eventBus);
25192
25193       this.init();
25194     }
25195
25196     RuleProvider.$inject = ['eventBus'];
25197
25198     inherits(RuleProvider, CommandInterceptor);
25199
25200     module.exports = RuleProvider;
25201
25202
25203     /**
25204      * Adds a modeling rule for the given action, implemented through a callback
25205      * function.
25206      *
25207      * The function will receive the modeling specific action context to perform its
25208      * check. It must return false or null to disallow the action from happening.
25209      *
25210      * Returning <code>null</code> may encode simply ignoring the action.
25211      *
25212      * @example
25213      *
25214      * ResizableRules.prototype.init = function() {
25215      *
25216      * this.addRule('shape.resize', function(context) {
25217      *
25218      * var shape = context.shape;
25219      *
25220      * if (!context.newBounds) { // check general resizability if (!shape.resizable) {
25221      * return false; } } else { // element must have minimum size of 10*10 points
25222      * return context.newBounds.width > 10 && context.newBounds.height > 10; } }); };
25223      *
25224      * @param {String|Array
25225      *            <String>} actions the identifier for the modeling action to check
25226      * @param {Function}
25227      *            fn the callback function that performs the actual check
25228      */
25229     RuleProvider.prototype.addRule = function(actions, fn) {
25230
25231       var self = this;
25232
25233       if (typeof actions === 'string') {
25234         actions = [actions];
25235       }
25236
25237       actions.forEach(function(action) {
25238
25239         self.canExecute(action, function(context, action, event) {
25240           return fn(context);
25241         }, true);
25242       });
25243     };
25244   }, {
25245     "../../command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
25246     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
25247   }],
25248   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\Rules.js": [function(require, module, exports) {
25249     'use strict';
25250
25251     /**
25252      * A service that provides rules for certain diagram actions.
25253      *
25254      * @param {CommandStack}
25255      *            commandStack
25256      */
25257     function Rules(commandStack) {
25258       this._commandStack = commandStack;
25259     }
25260
25261     Rules.$inject = ['commandStack'];
25262
25263     module.exports = Rules;
25264
25265
25266     /**
25267      * This method can be queried to ask whether certain modeling actions are
25268      * allowed or not.
25269      *
25270      * @param {String}
25271      *            action the action to be checked
25272      * @param {Object}
25273      *            [context] the context to check the action in
25274      *
25275      * @return {Boolean} returns true, false or null depending on whether the
25276      *         operation is allowed, not allowed or should be ignored.
25277      */
25278     Rules.prototype.allowed = function(action, context) {
25279       var allowed = this._commandStack.canExecute(action, context);
25280
25281       // map undefined to true, i.e. no rules
25282       return allowed === undefined ? true : allowed;
25283     };
25284   }, {}],
25285   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js": [function(require, module, exports) {
25286     module.exports = {
25287       __depends__: [require('../../command')],
25288       __init__: ['rules'],
25289       rules: ['type', require('./Rules')]
25290     };
25291
25292   }, {
25293     "../../command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
25294     "./Rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\Rules.js"
25295   }],
25296   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\Selection.js": [function(require, module, exports) {
25297     'use strict';
25298
25299     var isArray = require('lodash/lang/isArray'),
25300       forEach = require('lodash/collection/forEach');
25301
25302
25303     /**
25304      * A service that offers the current selection in a diagram. Offers the api to
25305      * control the selection, too.
25306      *
25307      * @class
25308      *
25309      * @param {EventBus}
25310      *            eventBus the event bus
25311      */
25312     function Selection(eventBus) {
25313
25314       this._eventBus = eventBus;
25315
25316       this._selectedElements = [];
25317
25318       var self = this;
25319
25320       eventBus.on(['shape.remove', 'connection.remove'], function(e) {
25321         var element = e.element;
25322         self.deselect(element);
25323       });
25324     }
25325
25326     Selection.$inject = ['eventBus'];
25327
25328     module.exports = Selection;
25329
25330
25331     Selection.prototype.deselect = function(element) {
25332       var selectedElements = this._selectedElements;
25333
25334       var idx = selectedElements.indexOf(element);
25335
25336       if (idx !== -1) {
25337         var oldSelection = selectedElements.slice();
25338
25339         selectedElements.splice(idx, 1);
25340
25341         this._eventBus.fire('selection.changed', {
25342           oldSelection: oldSelection,
25343           newSelection: selectedElements
25344         });
25345       }
25346     };
25347
25348
25349     Selection.prototype.get = function() {
25350       return this._selectedElements;
25351     };
25352
25353     Selection.prototype.isSelected = function(element) {
25354       return this._selectedElements.indexOf(element) !== -1;
25355     };
25356
25357
25358     /**
25359      * This method selects one or more elements on the diagram.
25360      *
25361      * By passing an additional add parameter you can decide whether or not the
25362      * element(s) should be added to the already existing selection or not.
25363      *
25364      * @method Selection#select
25365      *
25366      * @param {Object|Object[]}
25367      *            elements element or array of elements to be selected
25368      * @param {boolean}
25369      *            [add] whether the element(s) should be appended to the current
25370      *            selection, defaults to false
25371      */
25372     Selection.prototype.select = function(elements, add) {
25373       var selectedElements = this._selectedElements,
25374         oldSelection = selectedElements.slice();
25375
25376       if (!isArray(elements)) {
25377         elements = elements ? [elements] : [];
25378       }
25379
25380       // selection may be cleared by passing an empty array or null
25381       // to the method
25382       if (add) {
25383         forEach(elements, function(element) {
25384           if (selectedElements.indexOf(element) !== -1) {
25385             // already selected
25386             return;
25387           } else {
25388             selectedElements.push(element);
25389           }
25390         });
25391       } else {
25392         this._selectedElements = selectedElements = elements.slice();
25393       }
25394       this._eventBus.fire('selection.changed', {
25395         oldSelection: oldSelection,
25396         newSelection: selectedElements
25397       });
25398     };
25399
25400   }, {
25401     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
25402     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
25403   }],
25404   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionBehavior.js": [function(require, module, exports) {
25405     'use strict';
25406
25407     var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
25408
25409
25410     function SelectionBehavior(eventBus, selection, canvas) {
25411
25412       eventBus.on('create.end', 500, function(e) {
25413         if (e.context.canExecute) {
25414           selection.select(e.shape);
25415         }
25416       });
25417
25418       eventBus.on('connect.end', 500, function(e) {
25419         if (e.context.canExecute && e.context.target) {
25420           selection.select(e.context.target);
25421         }
25422       });
25423
25424       eventBus.on('shape.move.end', 500, function(e) {
25425         selection.select(e.context.shapes);
25426       });
25427
25428       eventBus.on('element.keydown', function(event) {
25429         alert("Key Down Elements ");
25430       });
25431       // Shift + click selection
25432       eventBus.on('element.click', function(event) {
25433
25434         var element = event.element;
25435
25436         // do not select the root element
25437         // or connections
25438         if (element === canvas.getRootElement()) {
25439           element = null;
25440         }
25441
25442         var isSelected = selection.isSelected(element),
25443           isMultiSelect = selection.get().length > 1;
25444
25445         // mouse-event: SELECTION_KEY
25446         var add = hasPrimaryModifier(event);
25447
25448         // select OR deselect element in multi selection
25449         if (isSelected && isMultiSelect) {
25450           if (add) {
25451             return selection.deselect(element);
25452           } else {
25453             return selection.select(element);
25454           }
25455         } else
25456         if (!isSelected) {
25457           selection.select(element, add);
25458         } else {
25459           selection.deselect(element);
25460         }
25461       });
25462
25463     }
25464
25465     SelectionBehavior.$inject = ['eventBus', 'selection', 'canvas'];
25466
25467     module.exports = SelectionBehavior;
25468
25469   }, {
25470     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js"
25471   }],
25472   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionVisuals.js": [function(require, module, exports) {
25473     'use strict';
25474
25475     var forEach = require('lodash/collection/forEach');
25476
25477     var MARKER_HOVER = 'hover',
25478       MARKER_SELECTED = 'selected';
25479
25480
25481     /**
25482      * A plugin that adds a visible selection UI to shapes and connections by
25483      * appending the <code>hover</code> and <code>selected</code> classes to
25484      * them.
25485      *
25486      * @class
25487      *
25488      * Makes elements selectable, too.
25489      *
25490      * @param {EventBus}
25491      *            events
25492      * @param {SelectionService}
25493      *            selection
25494      * @param {Canvas}
25495      *            canvas
25496      */
25497     function SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {
25498
25499       this._multiSelectionBox = null;
25500
25501       function addMarker(e, cls) {
25502         canvas.addMarker(e, cls);
25503       }
25504
25505       function removeMarker(e, cls) {
25506         canvas.removeMarker(e, cls);
25507       }
25508
25509       events.on('element.hover', function(event) {
25510         addMarker(event.element, MARKER_HOVER);
25511       });
25512
25513       events.on('element.out', function(event) {
25514         removeMarker(event.element, MARKER_HOVER);
25515       });
25516
25517       events.on('selection.changed', function(event) {
25518
25519         function deselect(s) {
25520           removeMarker(s, MARKER_SELECTED);
25521         }
25522
25523         function select(s) {
25524           addMarker(s, MARKER_SELECTED);
25525         }
25526
25527         var oldSelection = event.oldSelection,
25528           newSelection = event.newSelection;
25529
25530         forEach(oldSelection, function(e) {
25531           if (newSelection.indexOf(e) === -1) {
25532             deselect(e);
25533           }
25534         });
25535
25536         forEach(newSelection, function(e) {
25537           if (oldSelection.indexOf(e) === -1) {
25538             select(e);
25539           }
25540         });
25541       });
25542     }
25543
25544     SelectionVisuals.$inject = [
25545       'eventBus',
25546       'canvas',
25547       'selection',
25548       'graphicsFactory',
25549       'styles'
25550     ];
25551
25552     module.exports = SelectionVisuals;
25553
25554   }, {
25555     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
25556   }],
25557   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js": [function(require, module, exports) {
25558     module.exports = {
25559       __init__: ['selectionVisuals', 'selectionBehavior'],
25560       __depends__: [
25561         require('../interaction-events'),
25562         require('../outline')
25563       ],
25564       selection: ['type', require('./Selection')],
25565       selectionVisuals: ['type', require('./SelectionVisuals')],
25566       selectionBehavior: ['type', require('./SelectionBehavior')]
25567     };
25568
25569   }, {
25570     "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
25571     "../outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js",
25572     "./Selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\Selection.js",
25573     "./SelectionBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionBehavior.js",
25574     "./SelectionVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionVisuals.js"
25575   }],
25576   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapContext.js": [function(require, module, exports) {
25577     'use strict';
25578
25579     var forEach = require('lodash/collection/forEach');
25580
25581     var snapTo = require('./SnapUtil').snapTo;
25582
25583
25584     /**
25585      * A snap context, containing the (possibly incomplete) mappings of drop targets
25586      * (to identify the snapping) to computed snap points.
25587      */
25588     function SnapContext() {
25589
25590       /**
25591        * Map<String, SnapPoints> mapping drop targets to a list of possible
25592        * snappings.
25593        *
25594        * @type {Object}
25595        */
25596       this._targets = {};
25597
25598       /**
25599        * Map<String, Point> initial positioning of element regarding various snap
25600        * directions.
25601        *
25602        * @type {Object}
25603        */
25604       this._snapOrigins = {};
25605
25606       /**
25607        * List of snap locations
25608        *
25609        * @type {Array<String>}
25610        */
25611       this._snapLocations = [];
25612
25613       /**
25614        * Map<String, Array<Point>> of default snapping locations
25615        *
25616        * @type {Object}
25617        */
25618       this._defaultSnaps = {};
25619     }
25620
25621
25622     SnapContext.prototype.getSnapOrigin = function(snapLocation) {
25623       return this._snapOrigins[snapLocation];
25624     };
25625
25626
25627     SnapContext.prototype.setSnapOrigin = function(snapLocation, initialValue) {
25628       this._snapOrigins[snapLocation] = initialValue;
25629
25630       if (this._snapLocations.indexOf(snapLocation) === -1) {
25631         this._snapLocations.push(snapLocation);
25632       }
25633     };
25634
25635
25636     SnapContext.prototype.addDefaultSnap = function(type, point) {
25637
25638       var snapValues = this._defaultSnaps[type];
25639
25640       if (!snapValues) {
25641         snapValues = this._defaultSnaps[type] = [];
25642       }
25643
25644       snapValues.push(point);
25645     };
25646
25647     /**
25648      * Return a number of initialized snaps, i.e. snap locations such as top-left,
25649      * mid, bottom-right and so forth.
25650      *
25651      * @return {Array<String>} snapLocations
25652      */
25653     SnapContext.prototype.getSnapLocations = function() {
25654       return this._snapLocations;
25655     };
25656
25657     /**
25658      * Set the snap locations for this context.
25659      *
25660      * The order of locations determines precedence.
25661      *
25662      * @param {Array
25663      *            <String>} snapLocations
25664      */
25665     SnapContext.prototype.setSnapLocations = function(snapLocations) {
25666       this._snapLocations = snapLocations;
25667     };
25668
25669     /**
25670      * Get snap points for a given target
25671      *
25672      * @param {Element|String}
25673      *            target
25674      */
25675     SnapContext.prototype.pointsForTarget = function(target) {
25676
25677       var targetId = target.id || target;
25678
25679       var snapPoints = this._targets[targetId];
25680
25681       if (!snapPoints) {
25682         snapPoints = this._targets[targetId] = new SnapPoints();
25683         snapPoints.initDefaults(this._defaultSnaps);
25684       }
25685
25686       return snapPoints;
25687     };
25688
25689     module.exports = SnapContext;
25690
25691
25692     /**
25693      * Creates the snap points and initializes them with the given default values.
25694      *
25695      * @param {Object
25696      *            <String, Array<Point>>} [defaultPoints]
25697      */
25698     function SnapPoints(defaultSnaps) {
25699
25700       /**
25701        * Map<String, Map<(x|y), Array<Number>>> mapping snap locations, i.e.
25702        * top-left, bottom-right, center to actual snap values.
25703        *
25704        * @type {Object}
25705        */
25706       this._snapValues = {};
25707     }
25708
25709     SnapPoints.prototype.add = function(snapLocation, point) {
25710
25711       var snapValues = this._snapValues[snapLocation];
25712
25713       if (!snapValues) {
25714         snapValues = this._snapValues[snapLocation] = {
25715           x: [],
25716           y: []
25717         };
25718       }
25719
25720       if (snapValues.x.indexOf(point.x) === -1) {
25721         snapValues.x.push(point.x);
25722       }
25723
25724       if (snapValues.y.indexOf(point.y) === -1) {
25725         snapValues.y.push(point.y);
25726       }
25727     };
25728
25729
25730     SnapPoints.prototype.snap = function(point, snapLocation, axis, tolerance) {
25731       var snappingValues = this._snapValues[snapLocation];
25732
25733       return snappingValues && snapTo(point[axis], snappingValues[axis], tolerance);
25734     };
25735
25736     /**
25737      * Initialize a number of default snapping points.
25738      *
25739      * @param {Object}
25740      *            defaultSnaps
25741      */
25742     SnapPoints.prototype.initDefaults = function(defaultSnaps) {
25743
25744       var self = this;
25745
25746       forEach(defaultSnaps || {}, function(snapPoints, snapLocation) {
25747         forEach(snapPoints, function(point) {
25748           self.add(snapLocation, point);
25749         });
25750       });
25751     };
25752   }, {
25753     "./SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
25754     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
25755   }],
25756   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js": [function(require, module, exports) {
25757     'use strict';
25758
25759     var abs = Math.abs,
25760       round = Math.round;
25761
25762
25763     /**
25764      * Snap value to a collection of reference values.
25765      *
25766      * @param {Number}
25767      *            value
25768      * @param {Array
25769      *            <Number>} values
25770      * @param {Number}
25771      *            [tolerance=10]
25772      *
25773      * @return {Number} the value we snapped to or null, if none snapped
25774      */
25775     function snapTo(value, values, tolerance) {
25776       tolerance = tolerance === undefined ? 10 : tolerance;
25777
25778       var idx, snapValue;
25779
25780       for (idx = 0; idx < values.length; idx++) {
25781         snapValue = values[idx];
25782
25783         if (abs(snapValue - value) <= tolerance) {
25784           return snapValue;
25785         }
25786       }
25787     }
25788
25789
25790     module.exports.snapTo = snapTo;
25791
25792
25793     function topLeft(bounds) {
25794       return {
25795         x: bounds.x,
25796         y: bounds.y
25797       };
25798     }
25799
25800     module.exports.topLeft = topLeft;
25801
25802
25803     function mid(bounds, defaultValue) {
25804
25805       if (!bounds || isNaN(bounds.x) || isNaN(bounds.y)) {
25806         return defaultValue;
25807       }
25808
25809       return {
25810         x: round(bounds.x + bounds.width / 2),
25811         y: round(bounds.y + bounds.height / 2)
25812       };
25813     }
25814
25815     module.exports.mid = mid;
25816
25817
25818     function bottomRight(bounds) {
25819       return {
25820         x: bounds.x + bounds.width,
25821         y: bounds.y + bounds.height
25822       };
25823     }
25824
25825     module.exports.bottomRight = bottomRight;
25826   }, {}],
25827   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\Snapping.js": [function(require, module, exports) {
25828     'use strict';
25829
25830     var filter = require('lodash/collection/filter'),
25831       forEach = require('lodash/collection/forEach'),
25832       debounce = require('lodash/function/debounce');
25833
25834
25835     var mid = require('./SnapUtil').mid;
25836
25837     var SnapContext = require('./SnapContext');
25838
25839     /**
25840      * A general purpose snapping component for diagram elements.
25841      *
25842      * @param {EventBus}
25843      *            eventBus
25844      * @param {Canvas}
25845      *            canvas
25846      */
25847     function Snapping(eventBus, canvas) {
25848
25849       this._canvas = canvas;
25850
25851       var self = this;
25852
25853       eventBus.on(['shape.move.start', 'create.start'], function(event) {
25854         self.initSnap(event);
25855       });
25856
25857       eventBus.on(['shape.move.move', 'shape.move.end', 'create.move', 'create.end'], function(event) {
25858         if (event.snapped) {
25859           return;
25860         }
25861
25862         self.snap(event);
25863       });
25864
25865       eventBus.on(['shape.move.cleanup', 'create.cleanup'], function(event) {
25866         self.hide();
25867       });
25868
25869       // delay hide by 1000 seconds since last match
25870       this._asyncHide = debounce(this.hide, 1000);
25871     }
25872
25873     Snapping.$inject = ['eventBus', 'canvas'];
25874
25875     module.exports = Snapping;
25876
25877
25878     Snapping.prototype.initSnap = function(event) {
25879
25880       var context = event.context,
25881         shape = context.shape,
25882         snapContext = context.snapContext;
25883
25884       if (!snapContext) {
25885         snapContext = context.snapContext = new SnapContext();
25886       }
25887
25888       var snapMid = mid(shape, event);
25889
25890       snapContext.setSnapOrigin('mid', {
25891         x: snapMid.x - event.x,
25892         y: snapMid.y - event.y
25893       });
25894
25895       return snapContext;
25896     };
25897
25898
25899     Snapping.prototype.snap = function(event) {
25900
25901       var context = event.context,
25902         snapContext = context.snapContext,
25903         shape = context.shape,
25904         target = context.target,
25905         snapLocations = snapContext.getSnapLocations();
25906
25907       if (!target) {
25908         return;
25909       }
25910
25911       var snapPoints = snapContext.pointsForTarget(target);
25912
25913       if (!snapPoints.initialized) {
25914         this.addTargetSnaps(snapPoints, shape, target);
25915
25916         snapPoints.initialized = true;
25917       }
25918
25919
25920       var snapping = {};
25921
25922       forEach(snapLocations, function(location) {
25923
25924         var snapOrigin = snapContext.getSnapOrigin(location);
25925
25926         var snapCurrent = {
25927           x: event.x + snapOrigin.x,
25928           y: event.y + snapOrigin.y
25929         };
25930
25931         // snap on both axis, if not snapped already
25932         forEach(['x', 'y'], function(axis) {
25933           var locationSnapping;
25934
25935           if (!snapping[axis]) {
25936             locationSnapping = snapPoints.snap(snapCurrent, location, axis, 7);
25937
25938             if (locationSnapping !== undefined) {
25939               snapping[axis] = {
25940                 value: locationSnapping,
25941                 originValue: locationSnapping - snapOrigin[axis]
25942               };
25943             }
25944           }
25945         });
25946
25947         // no more need to snap, drop out of interation
25948         if (snapping.x && snapping.y) {
25949           return false;
25950         }
25951       });
25952
25953
25954       // show snap visuals
25955
25956       this.showSnapLine('vertical', snapping.x && snapping.x.value);
25957       this.showSnapLine('horizontal', snapping.y && snapping.y.value);
25958
25959
25960       // adjust event { x, y, dx, dy } and mark as snapping
25961       var cx, cy;
25962
25963       if (snapping.x) {
25964
25965         cx = event.x - snapping.x.originValue;
25966
25967         event.x = snapping.x.originValue;
25968         event.dx = event.dx - cx;
25969
25970         event.snapped = true;
25971       }
25972
25973       if (snapping.y) {
25974         cy = event.y - snapping.y.originValue;
25975
25976         event.y = snapping.y.originValue;
25977         event.dy = event.dy - cy;
25978
25979         event.snapped = true;
25980       }
25981     };
25982
25983
25984     Snapping.prototype._createLine = function(orientation) {
25985
25986       var root = this._canvas.getLayer('snap');
25987
25988       var line = root.path('M0,0 L0,0').addClass('djs-snap-line');
25989
25990       return {
25991         update: function(position) {
25992
25993           if (position === undefined) {
25994             line.attr({
25995               display: 'none'
25996             });
25997           } else {
25998             if (orientation === 'horizontal') {
25999               line.attr({
26000                 path: 'M-100000,' + position + ' L+100000,' + position,
26001                 display: ''
26002               });
26003             } else {
26004               line.attr({
26005                 path: 'M ' + position + ',-100000 L ' + position + ', +100000',
26006                 display: ''
26007               });
26008             }
26009           }
26010         }
26011       };
26012     };
26013
26014
26015     Snapping.prototype._createSnapLines = function() {
26016
26017       this._snapLines = {
26018         horizontal: this._createLine('horizontal'),
26019         vertical: this._createLine('vertical')
26020       };
26021     };
26022
26023     Snapping.prototype.showSnapLine = function(orientation, position) {
26024
26025       var line = this.getSnapLine(orientation);
26026
26027       if (line) {
26028         line.update(position);
26029       }
26030
26031       this._asyncHide();
26032     };
26033
26034     Snapping.prototype.getSnapLine = function(orientation) {
26035       if (!this._snapLines) {
26036         this._createSnapLines();
26037       }
26038
26039       return this._snapLines[orientation];
26040     };
26041
26042     Snapping.prototype.hide = function() {
26043       forEach(this._snapLines, function(l) {
26044         l.update();
26045       });
26046     };
26047
26048     Snapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
26049
26050       var siblings = this.getSiblings(shape, target);
26051
26052       forEach(siblings, function(s) {
26053         snapPoints.add('mid', mid(s));
26054       });
26055
26056     };
26057
26058     Snapping.prototype.getSiblings = function(element, target) {
26059
26060       // snap to all non connection siblings
26061       return target && filter(target.children, function(e) {
26062         return !e.hidden && !e.labelTarget && !e.waypoints && e !== element;
26063       });
26064     };
26065   }, {
26066     "./SnapContext": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapContext.js",
26067     "./SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
26068     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
26069     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
26070     "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js"
26071   }],
26072   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceTool.js": [function(require, module, exports) {
26073     'use strict';
26074
26075     var SpaceUtil = require('./SpaceUtil');
26076
26077     var Cursor = require('../../util/Cursor');
26078
26079     var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
26080
26081     var abs = Math.abs,
26082       round = Math.round;
26083
26084     var HIGH_PRIORITY = 1500;
26085
26086     /**
26087      * A tool that allows users to create and remove space in a diagram.
26088      *
26089      * The tool needs to be activated manually via
26090      * {@link SpaceTool#activate(MouseEvent)}.
26091      */
26092     function SpaceTool(eventBus, dragging, elementRegistry, modeling, rules) {
26093
26094       function canResize(shape) {
26095         var ctx = {
26096           shape: shape
26097         };
26098         return rules.allowed('shape.resize', ctx);
26099       }
26100
26101       function activateSelection(event, autoActivate) {
26102         dragging.activate(event, 'spaceTool.selection', {
26103           cursor: 'crosshair',
26104           autoActivate: autoActivate,
26105           data: {
26106             context: {
26107               crosshair: {}
26108             }
26109           }
26110         });
26111       }
26112
26113       function activateMakeSpace(event) {
26114         dragging.activate(event, 'spaceTool', {
26115           autoActivate: true,
26116           cursor: 'crosshair',
26117           data: {
26118             context: {}
26119           }
26120         });
26121       }
26122
26123
26124       eventBus.on('spaceTool.selection.end', function(event) {
26125         setTimeout(function() {
26126           activateMakeSpace(event.originalEvent);
26127         });
26128       });
26129
26130
26131       var AXIS_TO_DIMENSION = {
26132           x: 'width',
26133           y: 'height'
26134         },
26135         AXIS_INVERTED = {
26136           x: 'y',
26137           y: 'x'
26138         };
26139
26140
26141       function initializeMakeSpace(event, context) {
26142
26143         var axis = abs(event.dx) > abs(event.dy) ? 'x' : 'y',
26144           offset = event['d' + axis],
26145           // start point of create space operation
26146           spacePos = event[axis] - offset,
26147           // list of moving shapes
26148           movingShapes = [],
26149           // list of resizing shapes
26150           resizingShapes = [];
26151
26152         if (abs(offset) < 5) {
26153           return false;
26154         }
26155
26156         // inverts the offset to choose the shapes
26157         // on the opposite side of the resizer if
26158         // a key modifier is pressed
26159         if (hasPrimaryModifier(event)) {
26160           offset *= -1;
26161         }
26162
26163         // collect all elements that need to be moved _AND_
26164         // resized given on the initial create space position
26165         elementRegistry.forEach(function(shape) {
26166           var shapeStart = shape[[axis]],
26167             shapeEnd = shapeStart + shape[AXIS_TO_DIMENSION[axis]];
26168
26169           // checking if it's root
26170           if (!shape.parent) {
26171             return;
26172           }
26173
26174           // checking if it's a shape
26175           if (shape.waypoints) {
26176             return;
26177           }
26178
26179           // shape after spacePos
26180           if (offset > 0 && shapeStart > spacePos) {
26181             return movingShapes.push(shape);
26182           }
26183
26184           // shape before spacePos
26185           if (offset < 0 && shapeEnd < spacePos) {
26186             return movingShapes.push(shape);
26187           }
26188
26189           // shape on top of spacePos, resize only if allowed
26190           if (shapeStart < spacePos && shapeEnd > spacePos && canResize(shape)) {
26191             return resizingShapes.push(shape);
26192           }
26193         });
26194
26195         // store data in context
26196         context.axis = axis;
26197         context.direction = SpaceUtil.getDirection(axis, offset);
26198         context.movingShapes = movingShapes;
26199         context.resizingShapes = resizingShapes;
26200
26201         Cursor.set('resize-' + (axis === 'x' ? 'ew' : 'ns'));
26202
26203         return true;
26204       }
26205
26206
26207       eventBus.on('spaceTool.move', HIGH_PRIORITY, function(event) {
26208
26209         var context = event.context;
26210
26211         if (!context.initialized) {
26212           context.initialized = initializeMakeSpace(event, context);
26213         }
26214       });
26215
26216
26217       eventBus.on('spaceTool.end', function(event) {
26218
26219         var context = event.context,
26220           axis = context.axis,
26221           direction = context.direction,
26222           movingShapes = context.movingShapes,
26223           resizingShapes = context.resizingShapes;
26224
26225         // skip if create space has not been initialized yet
26226         if (!context.initialized) {
26227           return;
26228         }
26229
26230         var delta = {
26231           x: round(event.dx),
26232           y: round(event.dy)
26233         };
26234         delta[AXIS_INVERTED[axis]] = 0;
26235
26236         return modeling.createSpace(movingShapes, resizingShapes, delta, direction);
26237       });
26238
26239       // API
26240       this.activateSelection = activateSelection;
26241       this.activateMakeSpace = activateMakeSpace;
26242     }
26243
26244     SpaceTool.$inject = ['eventBus', 'dragging', 'elementRegistry', 'modeling', 'rules'];
26245
26246     module.exports = SpaceTool;
26247
26248   }, {
26249     "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
26250     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
26251     "./SpaceUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js"
26252   }],
26253   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceToolVisuals.js": [function(require, module, exports) {
26254     'use strict';
26255
26256     var forEach = require('lodash/collection/forEach');
26257
26258
26259     var MARKER_DRAGGING = 'djs-dragging';
26260
26261
26262     /**
26263      * A plugin that makes shapes draggable / droppable.
26264      *
26265      * @param {EventBus}
26266      *            eventBus
26267      * @param {ElementRegistry}
26268      *            elementRegistry
26269      * @param {Canvas}
26270      *            canvas
26271      * @param {Styles}
26272      *            styles
26273      */
26274
26275     function SpaceToolVisuals(eventBus, elementRegistry, canvas, styles) {
26276
26277       function getGfx(e) {
26278         return elementRegistry.getGraphics(e);
26279       }
26280
26281       function addDragger(shape, dragGroup) {
26282         var gfx = getGfx(shape);
26283         var dragger = gfx.clone();
26284         var bbox = gfx.getBBox();
26285
26286         dragger.attr(styles.cls('djs-dragger', [], {
26287           x: bbox.x,
26288           y: bbox.y
26289         }));
26290
26291         dragGroup.add(dragger);
26292       }
26293
26294       eventBus.on('spaceTool.selection.start', function(event) {
26295         var space = canvas.getLayer('space'),
26296           context = event.context;
26297
26298         var orientation = {
26299           x: 'M 0,-10000 L 0,10000',
26300           y: 'M -10000,0 L 10000,0'
26301         };
26302
26303         var crosshairGroup = space.group().attr(styles.cls('djs-crosshair-group', ['no-events']));
26304
26305         crosshairGroup.path(orientation.x).addClass('djs-crosshair');
26306         crosshairGroup.path(orientation.y).addClass('djs-crosshair');
26307
26308         context.crosshairGroup = crosshairGroup;
26309       });
26310
26311       eventBus.on('spaceTool.selection.move', function(event) {
26312         var crosshairGroup = event.context.crosshairGroup;
26313
26314         crosshairGroup.translate(event.x, event.y);
26315       });
26316
26317       eventBus.on('spaceTool.selection.cleanup', function(event) {
26318         var context = event.context,
26319           crosshairGroup = context.crosshairGroup;
26320
26321         if (crosshairGroup) {
26322           crosshairGroup.remove();
26323         }
26324       });
26325
26326
26327       // assign a low priority to this handler
26328       // to let others modify the move context before
26329       // we draw things
26330       eventBus.on('spaceTool.move', function(event) {
26331         /*
26332          * TODO (Ricardo): extend connections while adding space
26333          */
26334
26335         var context = event.context,
26336           line = context.line,
26337           axis = context.axis,
26338           dragShapes = context.movingShapes;
26339
26340         if (!context.initialized) {
26341           return;
26342         }
26343
26344         if (!context.dragGroup) {
26345           var spaceLayer = canvas.getLayer('space');
26346           line = spaceLayer.path('M0,0 L0,0').addClass('djs-crosshair');
26347
26348           context.line = line;
26349           var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
26350
26351
26352           forEach(dragShapes, function(shape) {
26353             addDragger(shape, dragGroup);
26354             canvas.addMarker(shape, MARKER_DRAGGING);
26355           });
26356
26357           context.dragGroup = dragGroup;
26358         }
26359
26360         var orientation = {
26361           x: 'M' + event.x + ', -10000 L' + event.x + ', 10000',
26362           y: 'M -10000, ' + event.y + ' L 10000, ' + event.y
26363         };
26364
26365         line.attr({
26366           path: orientation[axis],
26367           display: ''
26368         });
26369
26370         var opposite = {
26371           x: 'y',
26372           y: 'x'
26373         };
26374         var delta = {
26375           x: event.dx,
26376           y: event.dy
26377         };
26378         delta[opposite[context.axis]] = 0;
26379
26380         context.dragGroup.translate(delta.x, delta.y);
26381       });
26382
26383       eventBus.on('spaceTool.cleanup', function(event) {
26384
26385         var context = event.context,
26386           shapes = context.movingShapes,
26387           line = context.line,
26388           dragGroup = context.dragGroup;
26389
26390         // remove dragging marker
26391         forEach(shapes, function(e) {
26392           canvas.removeMarker(e, MARKER_DRAGGING);
26393         });
26394
26395         if (dragGroup) {
26396           line.remove();
26397           dragGroup.remove();
26398         }
26399       });
26400     }
26401
26402     SpaceToolVisuals.$inject = ['eventBus', 'elementRegistry', 'canvas', 'styles'];
26403
26404     module.exports = SpaceToolVisuals;
26405
26406   }, {
26407     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
26408   }],
26409   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js": [function(require, module, exports) {
26410     'use strict';
26411
26412     /**
26413      * Get Resize direction given axis + offset
26414      *
26415      * @param {String}
26416      *            axis (x|y)
26417      * @param {Number}
26418      *            offset
26419      *
26420      * @return {String} (e|w|n|s)
26421      */
26422     function getDirection(axis, offset) {
26423
26424       if (axis === 'x') {
26425         if (offset > 0) {
26426           return 'e';
26427         }
26428
26429         if (offset < 0) {
26430           return 'w';
26431         }
26432       }
26433
26434       if (axis === 'y') {
26435         if (offset > 0) {
26436           return 's';
26437         }
26438
26439         if (offset < 0) {
26440           return 'n';
26441         }
26442       }
26443
26444       return null;
26445     }
26446
26447     module.exports.getDirection = getDirection;
26448
26449     /**
26450      * Resize the given bounds by the specified delta from a given anchor point.
26451      *
26452      * @param {Bounds}
26453      *            bounds the bounding box that should be resized
26454      * @param {String}
26455      *            direction in which the element is resized (n, s, e, w)
26456      * @param {Point}
26457      *            delta of the resize operation
26458      *
26459      * @return {Bounds} resized bounding box
26460      */
26461     module.exports.resizeBounds = function(bounds, direction, delta) {
26462
26463       var dx = delta.x,
26464         dy = delta.y;
26465
26466       switch (direction) {
26467
26468         case 'n':
26469           return {
26470             x: bounds.x,
26471             y: bounds.y + dy,
26472             width: bounds.width,
26473             height: bounds.height - dy
26474           };
26475
26476         case 's':
26477           return {
26478             x: bounds.x,
26479             y: bounds.y,
26480             width: bounds.width,
26481             height: bounds.height + dy
26482           };
26483
26484         case 'w':
26485           return {
26486             x: bounds.x + dx,
26487             y: bounds.y,
26488             width: bounds.width - dx,
26489             height: bounds.height
26490           };
26491
26492         case 'e':
26493           return {
26494             x: bounds.x,
26495             y: bounds.y,
26496             width: bounds.width + dx,
26497             height: bounds.height
26498           };
26499
26500         default:
26501           throw new Error('unrecognized direction: ' + direction);
26502       }
26503     };
26504   }, {}],
26505   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\index.js": [function(require, module, exports) {
26506     module.exports = {
26507       __init__: ['spaceToolVisuals'],
26508       __depends__: [require('../dragging'), require('../modeling'), require('../rules')],
26509       spaceTool: ['type', require('./SpaceTool')],
26510       spaceToolVisuals: ['type', require('./SpaceToolVisuals')]
26511     };
26512
26513   }, {
26514     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
26515     "../modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js",
26516     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
26517     "./SpaceTool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceTool.js",
26518     "./SpaceToolVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceToolVisuals.js"
26519   }],
26520   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\Tooltips.js": [function(require, module, exports) {
26521     'use strict';
26522
26523     var isString = require('lodash/lang/isString'),
26524       assign = require('lodash/object/assign'),
26525       forEach = require('lodash/collection/forEach'),
26526       debounce = require('lodash/function/debounce');
26527
26528     var domify = require('min-dom/lib/domify'),
26529       domAttr = require('min-dom/lib/attr'),
26530       domClasses = require('min-dom/lib/classes'),
26531       domRemove = require('min-dom/lib/remove'),
26532       domDelegate = require('min-dom/lib/delegate');
26533
26534
26535     // document wide unique tooltip ids
26536     var ids = new(require('../../util/IdGenerator'))('tt');
26537
26538
26539     function createRoot(parent) {
26540       var root = domify('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />');
26541       parent.insertBefore(root, parent.firstChild);
26542
26543       return root;
26544     }
26545
26546
26547     function setPosition(el, x, y) {
26548       assign(el.style, {
26549         left: x + 'px',
26550         top: y + 'px'
26551       });
26552     }
26553
26554     function setVisible(el, visible) {
26555       el.style.display = visible === false ? 'none' : '';
26556     }
26557
26558
26559     var tooltipClass = 'djs-tooltip',
26560       tooltipSelector = '.' + tooltipClass;
26561
26562     /**
26563      * A service that allows users to render tool tips on the diagram.
26564      *
26565      * The tooltip service will take care of updating the tooltip positioning during
26566      * navigation + zooming.
26567      *
26568      * @example
26569      *
26570      * ```javascript
26571      *  // add a pink badge on the top left of the shape tooltips.add({ position: {
26572      * x: 50, y: 100 }, html: '<div style="width: 10px; background: fuchsia; color:
26573      * white;">0</div>' });
26574      *  // or with optional life span tooltips.add({ position: { top: -5, left: -5 },
26575      * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>',
26576      * ttl: 2000 });
26577      *  // remove a tool tip var id = tooltips.add(...); tooltips.remove(id); ```
26578      *
26579      * @param {Object}
26580      *            config
26581      * @param {EventBus}
26582      *            eventBus
26583      * @param {Canvas}
26584      *            canvas
26585      */
26586     function Tooltips(config, eventBus, canvas) {
26587
26588       this._eventBus = eventBus;
26589       this._canvas = canvas;
26590
26591       this._ids = ids;
26592
26593       this._tooltipDefaults = {
26594         show: {
26595           minZoom: 0.7,
26596           maxZoom: 5.0
26597         }
26598       };
26599
26600       /**
26601        * Mapping tooltipId -> tooltip
26602        */
26603       this._tooltips = {};
26604
26605       // root html element for all tooltips
26606       this._tooltipRoot = createRoot(canvas.getContainer());
26607
26608
26609       var self = this;
26610
26611       domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mousedown', function(event) {
26612         event.stopPropagation();
26613       });
26614
26615       domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseover', function(event) {
26616         self.trigger('mouseover', event);
26617       });
26618
26619       domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseout', function(event) {
26620         self.trigger('mouseout', event);
26621       });
26622
26623       this._init(config);
26624     }
26625
26626
26627     Tooltips.$inject = ['config.tooltips', 'eventBus', 'canvas'];
26628
26629     module.exports = Tooltips;
26630
26631
26632     /**
26633      * Adds a HTML tooltip to the diagram
26634      *
26635      * @param {Object}
26636      *            tooltip the tooltip configuration
26637      *
26638      * @param {String|DOMElement}
26639      *            tooltip.html html element to use as an tooltip
26640      * @param {Object}
26641      *            [tooltip.show] show configuration
26642      * @param {Number}
26643      *            [tooltip.show.minZoom] minimal zoom level to show the tooltip
26644      * @param {Number}
26645      *            [tooltip.show.maxZoom] maximum zoom level to show the tooltip
26646      * @param {Object}
26647      *            tooltip.position where to attach the tooltip
26648      * @param {Number}
26649      *            [tooltip.position.left] relative to element bbox left attachment
26650      * @param {Number}
26651      *            [tooltip.position.top] relative to element bbox top attachment
26652      * @param {Number}
26653      *            [tooltip.position.bottom] relative to element bbox bottom
26654      *            attachment
26655      * @param {Number}
26656      *            [tooltip.position.right] relative to element bbox right attachment
26657      * @param {Number}
26658      *            [tooltip.timeout=-1]
26659      *
26660      * @return {String} id that may be used to reference the tooltip for update or
26661      *         removal
26662      */
26663     Tooltips.prototype.add = function(tooltip) {
26664
26665       if (!tooltip.position) {
26666         throw new Error('must specifiy tooltip position');
26667       }
26668
26669       if (!tooltip.html) {
26670         throw new Error('must specifiy tooltip html');
26671       }
26672
26673       var id = this._ids.next();
26674
26675       tooltip = assign({}, this._tooltipDefaults, tooltip, {
26676         id: id
26677       });
26678
26679       this._addTooltip(tooltip);
26680
26681       if (tooltip.timeout) {
26682         this.setTimeout(tooltip);
26683       }
26684
26685       return id;
26686     };
26687
26688     Tooltips.prototype.trigger = function(action, event) {
26689
26690       var node = event.delegateTarget || event.target;
26691
26692       var tooltip = this.get(domAttr(node, 'data-tooltip-id'));
26693
26694       if (!tooltip) {
26695         return;
26696       }
26697
26698       if (action === 'mouseover' && tooltip.timeout) {
26699         this.clearTimeout(tooltip);
26700       }
26701
26702       if (action === 'mouseout' && tooltip.timeout) {
26703         // cut timeout after mouse out
26704         tooltip.timeout = 1000;
26705
26706         this.setTimeout(tooltip);
26707       }
26708
26709       console.log('mouse leave', event);
26710     };
26711
26712     /**
26713      * Get a tooltip with the given id
26714      *
26715      * @param {String}
26716      *            id
26717      */
26718     Tooltips.prototype.get = function(id) {
26719
26720       if (typeof id !== 'string') {
26721         id = id.id;
26722       }
26723
26724       return this._tooltips[id];
26725     };
26726
26727     Tooltips.prototype.clearTimeout = function(tooltip) {
26728
26729       tooltip = this.get(tooltip);
26730
26731       if (!tooltip) {
26732         return;
26733       }
26734
26735       var removeTimer = tooltip.removeTimer;
26736
26737       if (removeTimer) {
26738         clearTimeout(removeTimer);
26739         tooltip.removeTimer = null;
26740       }
26741     };
26742
26743     Tooltips.prototype.setTimeout = function(tooltip) {
26744
26745       tooltip = this.get(tooltip);
26746
26747       if (!tooltip) {
26748         return;
26749       }
26750
26751       this.clearTimeout(tooltip);
26752
26753       var self = this;
26754
26755       tooltip.removeTimer = setTimeout(function() {
26756         self.remove(tooltip);
26757       }, tooltip.timeout);
26758     };
26759
26760     /**
26761      * Remove an tooltip with the given id
26762      *
26763      * @param {String}
26764      *            id
26765      */
26766     Tooltips.prototype.remove = function(id) {
26767
26768       var tooltip = this.get(id);
26769
26770       if (tooltip) {
26771         domRemove(tooltip.html);
26772         domRemove(tooltip.htmlContainer);
26773
26774         delete tooltip.htmlContainer;
26775
26776         delete this._tooltips[tooltip.id];
26777       }
26778     };
26779
26780
26781     Tooltips.prototype.show = function() {
26782       setVisible(this._tooltipRoot);
26783     };
26784
26785
26786     Tooltips.prototype.hide = function() {
26787       setVisible(this._tooltipRoot, false);
26788     };
26789
26790
26791     Tooltips.prototype._updateRoot = function(viewbox) {
26792       var a = viewbox.scale || 1;
26793       var d = viewbox.scale || 1;
26794
26795       var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
26796
26797       this._tooltipRoot.style.transform = matrix;
26798       this._tooltipRoot.style['-ms-transform'] = matrix;
26799     };
26800
26801
26802     Tooltips.prototype._addTooltip = function(tooltip) {
26803
26804       var id = tooltip.id,
26805         html = tooltip.html,
26806         htmlContainer,
26807         tooltipRoot = this._tooltipRoot;
26808
26809       // unwrap jquery (for those who need it)
26810       if (html.get) {
26811         html = html.get(0);
26812       }
26813
26814       // create proper html elements from
26815       // tooltip HTML strings
26816       if (isString(html)) {
26817         html = domify(html);
26818       }
26819
26820       htmlContainer = domify('<div data-tooltip-id="' + id + '" class="' + tooltipClass + '" style="position: absolute">');
26821
26822       htmlContainer.appendChild(html);
26823
26824       if (tooltip.type) {
26825         domClasses(htmlContainer).add('djs-tooltip-' + tooltip.type);
26826       }
26827
26828       if (tooltip.className) {
26829         domClasses(htmlContainer).add(tooltip.className);
26830       }
26831
26832       tooltip.htmlContainer = htmlContainer;
26833
26834       tooltipRoot.appendChild(htmlContainer);
26835
26836       this._tooltips[id] = tooltip;
26837
26838       this._updateTooltip(tooltip);
26839     };
26840
26841
26842     Tooltips.prototype._updateTooltip = function(tooltip) {
26843
26844       var position = tooltip.position,
26845         htmlContainer = tooltip.htmlContainer;
26846
26847       // update overlay html based on tooltip x, y
26848
26849       setPosition(htmlContainer, position.x, position.y);
26850     };
26851
26852
26853     Tooltips.prototype._updateTooltipVisibilty = function(viewbox) {
26854
26855       forEach(this._tooltips, function(tooltip) {
26856         var show = tooltip.show,
26857           htmlContainer = tooltip.htmlContainer,
26858           visible = true;
26859
26860         if (show) {
26861           if (show.minZoom > viewbox.scale ||
26862             show.maxZoom < viewbox.scale) {
26863             visible = false;
26864           }
26865
26866           setVisible(htmlContainer, visible);
26867         }
26868       });
26869     };
26870
26871     Tooltips.prototype._init = function(config) {
26872
26873       var self = this;
26874
26875
26876       // scroll/zoom integration
26877
26878       var updateViewbox = function(viewbox) {
26879         self._updateRoot(viewbox);
26880         self._updateTooltipVisibilty(viewbox);
26881
26882         self.show();
26883       };
26884
26885       if (!config || config.deferUpdate !== false) {
26886         updateViewbox = debounce(updateViewbox, 300);
26887       }
26888
26889       this._eventBus.on('canvas.viewbox.changed', function(event) {
26890         self.hide();
26891         updateViewbox(event.viewbox);
26892       });
26893     };
26894
26895   }, {
26896     "../../util/IdGenerator": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js",
26897     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
26898     "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js",
26899     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
26900     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
26901     "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
26902     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
26903     "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
26904     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
26905     "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
26906   }],
26907   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\index.js": [function(require, module, exports) {
26908     module.exports = {
26909       __init__: ['tooltips'],
26910       tooltips: ['type', require('./Tooltips')]
26911     };
26912   }, {
26913     "./Tooltips": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\Tooltips.js"
26914   }],
26915   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchFix.js": [function(require, module, exports) {
26916     'use strict';
26917
26918     function TouchFix(canvas, eventBus) {
26919
26920       var self = this;
26921
26922       eventBus.on('canvas.init', function(e) {
26923         self.addBBoxMarker(e.svg);
26924       });
26925     }
26926
26927     TouchFix.$inject = ['canvas', 'eventBus'];
26928
26929     module.exports = TouchFix;
26930
26931
26932     /**
26933      * Safari mobile (iOS 7) does not fire touchstart event in <SVG> element if
26934      * there is no shape between 0,0 and viewport elements origin.
26935      *
26936      * So touchstart event is only fired when the <g class="viewport"> element was
26937      * hit. Putting an element over and below the 'viewport' fixes that behavior.
26938      */
26939     TouchFix.prototype.addBBoxMarker = function(paper) {
26940
26941       var markerStyle = {
26942         fill: 'none',
26943         class: 'outer-bound-marker'
26944       };
26945
26946       paper.rect(-10000, -10000, 10, 10).attr(markerStyle);
26947       paper.rect(10000, 10000, 10, 10).attr(markerStyle);
26948     };
26949
26950   }, {}],
26951   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchInteractionEvents.js": [function(require, module, exports) {
26952     'use strict';
26953
26954     var forEach = require('lodash/collection/forEach'),
26955       domEvent = require('min-dom/lib/event'),
26956       domClosest = require('min-dom/lib/closest'),
26957       Hammer = require('hammerjs'),
26958       Snap = require('../../../vendor/snapsvg'),
26959       Event = require('../../util/Event');
26960
26961     var MIN_ZOOM = 0.2,
26962       MAX_ZOOM = 4;
26963
26964     var mouseEvents = [
26965       'mousedown',
26966       'mouseup',
26967       'mouseover',
26968       'mouseout',
26969       'click',
26970       'dblclick'
26971     ];
26972
26973     function log() {
26974       if (false) {
26975         console.log.apply(console, arguments);
26976       }
26977     }
26978
26979     function get(service, injector) {
26980       try {
26981         return injector.get(service);
26982       } catch (e) {
26983         return null;
26984       }
26985     }
26986
26987     function createTouchRecognizer(node) {
26988
26989       function stopEvent(event) {
26990         Event.stopEvent(event, true);
26991       }
26992
26993       function stopMouse(event) {
26994
26995         forEach(mouseEvents, function(e) {
26996           domEvent.bind(node, e, stopEvent, true);
26997         });
26998       }
26999
27000       function allowMouse(event) {
27001         setTimeout(function() {
27002           forEach(mouseEvents, function(e) {
27003             domEvent.unbind(node, e, stopEvent, true);
27004           });
27005         }, 500);
27006       }
27007
27008       domEvent.bind(node, 'touchstart', stopMouse, true);
27009       domEvent.bind(node, 'touchend', allowMouse, true);
27010       domEvent.bind(node, 'touchcancel', allowMouse, true);
27011
27012       // A touch event recognizer that handles
27013       // touch events only (we know, we can already handle
27014       // mouse events out of the box)
27015
27016       var recognizer = new Hammer.Manager(node, {
27017         inputClass: Hammer.TouchInput,
27018         recognizers: []
27019       });
27020
27021
27022       var tap = new Hammer.Tap();
27023       var pan = new Hammer.Pan({
27024         threshold: 10
27025       });
27026       var press = new Hammer.Press();
27027       var pinch = new Hammer.Pinch();
27028
27029       var doubleTap = new Hammer.Tap({
27030         event: 'doubletap',
27031         taps: 2
27032       });
27033
27034       pinch.requireFailure(pan);
27035       pinch.requireFailure(press);
27036
27037       recognizer.add([pan, press, pinch, doubleTap, tap]);
27038
27039       recognizer.reset = function(force) {
27040         var recognizers = this.recognizers,
27041           session = this.session;
27042
27043         if (session.stopped) {
27044           return;
27045         }
27046
27047         log('recognizer', 'stop');
27048
27049         recognizer.stop(force);
27050
27051         setTimeout(function() {
27052           var i, r;
27053
27054           log('recognizer', 'reset');
27055           for (i = 0; !!(r = recognizers[i]); i++) {
27056             r.reset();
27057             r.state = 8; // FAILED STATE
27058           }
27059
27060           session.curRecognizer = null;
27061         }, 0);
27062       };
27063
27064       recognizer.on('hammer.input', function(event) {
27065         if (event.srcEvent.defaultPrevented) {
27066           recognizer.reset(true);
27067         }
27068       });
27069
27070       return recognizer;
27071     }
27072
27073     /**
27074      * A plugin that provides touch events for elements.
27075      *
27076      * @param {EventBus}
27077      *            eventBus
27078      * @param {InteractionEvents}
27079      *            interactionEvents
27080      */
27081     function TouchInteractionEvents(injector, canvas, eventBus, elementRegistry, interactionEvents, snap) {
27082
27083       // optional integrations
27084       var dragging = get('dragging', injector),
27085         move = get('move', injector),
27086         contextPad = get('contextPad', injector),
27087         palette = get('palette', injector);
27088
27089       // the touch recognizer
27090       var recognizer;
27091
27092       function handler(type) {
27093
27094         return function(event) {
27095           log('element', type, event);
27096
27097           interactionEvents.fire(type, event);
27098         };
27099       }
27100
27101       function getGfx(target) {
27102         var node = domClosest(target, 'svg, .djs-element', true);
27103         return node && new Snap(node);
27104       }
27105
27106       function initEvents(svg) {
27107
27108         // touch recognizer
27109         recognizer = createTouchRecognizer(svg);
27110
27111         recognizer.on('doubletap', handler('element.dblclick'));
27112
27113         recognizer.on('tap', handler('element.click'));
27114
27115         function startGrabCanvas(event) {
27116
27117           log('canvas', 'grab start');
27118
27119           var lx = 0,
27120             ly = 0;
27121
27122           function update(e) {
27123
27124             var dx = e.deltaX - lx,
27125               dy = e.deltaY - ly;
27126
27127             canvas.scroll({
27128               dx: dx,
27129               dy: dy
27130             });
27131
27132             lx = e.deltaX;
27133             ly = e.deltaY;
27134           }
27135
27136           function end(e) {
27137             recognizer.off('panmove', update);
27138             recognizer.off('panend', end);
27139             recognizer.off('pancancel', end);
27140
27141             log('canvas', 'grab end');
27142           }
27143
27144           recognizer.on('panmove', update);
27145           recognizer.on('panend', end);
27146           recognizer.on('pancancel', end);
27147         }
27148
27149         function startGrab(event) {
27150
27151           var gfx = getGfx(event.target),
27152             element = gfx && elementRegistry.get(gfx);
27153
27154           // recognizer
27155           if (move && canvas.getRootElement() !== element) {
27156             log('element', 'move start', element, event, true);
27157             return move.start(event, element, true);
27158           } else {
27159             startGrabCanvas(event);
27160           }
27161         }
27162
27163         function startZoom(e) {
27164
27165           log('canvas', 'zoom start');
27166
27167           var zoom = canvas.zoom(),
27168             mid = e.center;
27169
27170           function update(e) {
27171
27172             var ratio = 1 - (1 - e.scale) / 1.50,
27173               newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, ratio * zoom));
27174
27175             canvas.zoom(newZoom, mid);
27176
27177             Event.stopEvent(e, true);
27178           }
27179
27180           function end(e) {
27181             recognizer.off('pinchmove', update);
27182             recognizer.off('pinchend', end);
27183             recognizer.off('pinchcancel', end);
27184
27185             recognizer.reset(true);
27186
27187             log('canvas', 'zoom end');
27188           }
27189
27190           recognizer.on('pinchmove', update);
27191           recognizer.on('pinchend', end);
27192           recognizer.on('pinchcancel', end);
27193         }
27194
27195         recognizer.on('panstart', startGrab);
27196         recognizer.on('press', startGrab);
27197
27198         recognizer.on('pinchstart', startZoom);
27199       }
27200
27201       if (dragging) {
27202
27203         // simulate hover during dragging
27204         eventBus.on('drag.move', function(event) {
27205
27206           var position = Event.toPoint(event.originalEvent);
27207
27208           var node = document.elementFromPoint(position.x, position.y),
27209             gfx = getGfx(node),
27210             element = gfx && elementRegistry.get(gfx);
27211
27212           if (element !== event.hover) {
27213             if (event.hover) {
27214               dragging.out(event);
27215             }
27216
27217             if (element) {
27218               dragging.hover({
27219                 element: element,
27220                 gfx: gfx
27221               });
27222
27223               event.hover = element;
27224               event.hoverGfx = gfx;
27225             }
27226           }
27227         });
27228       }
27229
27230       if (contextPad) {
27231
27232         eventBus.on('contextPad.create', function(event) {
27233           var node = event.pad.html;
27234
27235           // touch recognizer
27236           var padRecognizer = createTouchRecognizer(node);
27237
27238           padRecognizer.on('panstart', function(event) {
27239             log('context-pad', 'panstart', event);
27240             contextPad.trigger('dragstart', event, true);
27241           });
27242
27243           padRecognizer.on('press', function(event) {
27244             log('context-pad', 'press', event);
27245             contextPad.trigger('dragstart', event, true);
27246           });
27247
27248           padRecognizer.on('tap', function(event) {
27249             log('context-pad', 'tap', event);
27250             contextPad.trigger('click', event);
27251           });
27252         });
27253       }
27254
27255       if (palette) {
27256         eventBus.on('palette.create', function(event) {
27257           var node = event.html;
27258
27259           // touch recognizer
27260           var padRecognizer = createTouchRecognizer(node);
27261
27262           padRecognizer.on('panstart', function(event) {
27263             log('palette', 'panstart', event);
27264             palette.trigger('dragstart', event, true);
27265           });
27266
27267           padRecognizer.on('press', function(event) {
27268             log('palette', 'press', event);
27269             palette.trigger('dragstart', event, true);
27270           });
27271
27272           padRecognizer.on('tap', function(event) {
27273             log('palette', 'tap', event);
27274             palette.trigger('click', event);
27275           });
27276         });
27277       }
27278
27279       eventBus.on('canvas.init', function(event) {
27280         initEvents(event.svg.node);
27281       });
27282     }
27283
27284
27285     TouchInteractionEvents.$inject = [
27286       'injector',
27287       'canvas',
27288       'eventBus',
27289       'elementRegistry',
27290       'interactionEvents',
27291       'touchFix'
27292     ];
27293
27294     module.exports = TouchInteractionEvents;
27295   }, {
27296     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
27297     "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
27298     "hammerjs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\hammerjs\\hammer.js",
27299     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
27300     "min-dom/lib/closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\closest.js",
27301     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
27302   }],
27303   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\index.js": [function(require, module, exports) {
27304     module.exports = {
27305       __depends__: [require('../interaction-events')],
27306       __init__: ['touchInteractionEvents'],
27307       touchInteractionEvents: ['type', require('./TouchInteractionEvents')],
27308       touchFix: ['type', require('./TouchFix')]
27309     };
27310   }, {
27311     "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
27312     "./TouchFix": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchFix.js",
27313     "./TouchInteractionEvents": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchInteractionEvents.js"
27314   }],
27315   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js": [function(require, module, exports) {
27316     'use strict';
27317
27318     var LayoutUtil = require('./LayoutUtil');
27319
27320
27321     /**
27322      * A base connection layouter implementation that layouts the connection by
27323      * directly connecting mid(source) + mid(target).
27324      */
27325     function BaseLayouter() {}
27326
27327     module.exports = BaseLayouter;
27328
27329
27330     /**
27331      * Return the new layouted waypoints for the given connection.
27332      *
27333      * @param {djs.model.Connection}
27334      *            connection
27335      * @param {Object}
27336      *            hints
27337      * @param {Boolean}
27338      *            [hints.movedStart=false]
27339      * @param {Boolean}
27340      *            [hints.movedEnd=false]
27341      *
27342      * @return {Array<Point>} the layouted connection waypoints
27343      */
27344     BaseLayouter.prototype.layoutConnection = function(connection, hints) {
27345       return [
27346         LayoutUtil.getMidPoint(connection.source),
27347         LayoutUtil.getMidPoint(connection.target)
27348       ];
27349     };
27350
27351   }, {
27352     "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js"
27353   }],
27354   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\CroppingConnectionDocking.js": [function(require, module, exports) {
27355     'use strict';
27356
27357     var assign = require('lodash/object/assign');
27358
27359     var LayoutUtil = require('./LayoutUtil');
27360
27361
27362     function dockingToPoint(docking) {
27363       // use the dockings actual point and
27364       // retain the original docking
27365       return assign({
27366         original: docking.point.original || docking.point
27367       }, docking.actual);
27368     }
27369
27370
27371     /**
27372      * A {@link ConnectionDocking} that crops connection waypoints based on the
27373      * path(s) of the connection source and target.
27374      *
27375      * @param {djs.core.ElementRegistry}
27376      *            elementRegistry
27377      */
27378     function CroppingConnectionDocking(elementRegistry, renderer) {
27379       this._elementRegistry = elementRegistry;
27380       this._renderer = renderer;
27381     }
27382
27383     CroppingConnectionDocking.$inject = ['elementRegistry', 'renderer'];
27384
27385     module.exports = CroppingConnectionDocking;
27386
27387
27388     /**
27389      * @inheritDoc ConnectionDocking#getCroppedWaypoints
27390      */
27391     CroppingConnectionDocking.prototype.getCroppedWaypoints = function(connection, source, target) {
27392
27393       source = source || connection.source;
27394       target = target || connection.target;
27395
27396       var sourceDocking = this.getDockingPoint(connection, source, true),
27397         targetDocking = this.getDockingPoint(connection, target);
27398
27399       var croppedWaypoints = connection.waypoints.slice(sourceDocking.idx + 1, targetDocking.idx);
27400
27401       croppedWaypoints.unshift(dockingToPoint(sourceDocking));
27402       croppedWaypoints.push(dockingToPoint(targetDocking));
27403
27404       return croppedWaypoints;
27405     };
27406
27407     /**
27408      * Return the connection docking point on the specified shape
27409      *
27410      * @inheritDoc ConnectionDocking#getDockingPoint
27411      */
27412     CroppingConnectionDocking.prototype.getDockingPoint = function(connection, shape, dockStart) {
27413
27414       var waypoints = connection.waypoints,
27415         dockingIdx,
27416         dockingPoint,
27417         croppedPoint;
27418
27419       dockingIdx = dockStart ? 0 : waypoints.length - 1;
27420       dockingPoint = waypoints[dockingIdx];
27421
27422       croppedPoint = this._getIntersection(shape, connection, dockStart);
27423
27424       return {
27425         point: dockingPoint,
27426         actual: croppedPoint || dockingPoint,
27427         idx: dockingIdx
27428       };
27429     };
27430
27431
27432     // //// helper methods ///////////////////////////////////////////////////
27433
27434     CroppingConnectionDocking.prototype._getIntersection = function(shape, connection, takeFirst) {
27435
27436       var shapePath = this._getShapePath(shape),
27437         connectionPath = this._getConnectionPath(connection);
27438
27439       return LayoutUtil.getElementLineIntersection(shapePath, connectionPath, takeFirst);
27440     };
27441
27442     CroppingConnectionDocking.prototype._getConnectionPath = function(connection) {
27443       return this._renderer.getConnectionPath(connection);
27444     };
27445
27446     CroppingConnectionDocking.prototype._getShapePath = function(shape) {
27447       return this._renderer.getShapePath(shape);
27448     };
27449
27450     CroppingConnectionDocking.prototype._getGfx = function(element) {
27451       return this._elementRegistry.getGraphics(element);
27452     };
27453   }, {
27454     "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
27455     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
27456   }],
27457   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js": [function(require, module, exports) {
27458     'use strict';
27459
27460     var isArray = require('lodash/lang/isArray'),
27461       sortBy = require('lodash/collection/sortBy');
27462
27463     var Snap = require('../../vendor/snapsvg');
27464
27465     /**
27466      * Returns whether two points are in a horizontal or vertical line.
27467      *
27468      * @param {Point}
27469      *            a
27470      * @param {Point}
27471      *            b
27472      *
27473      * @return {String|Boolean} returns false if the points are not aligned or 'h|v'
27474      *         if they are aligned horizontally / vertically.
27475      */
27476     function pointsAligned(a, b) {
27477       switch (true) {
27478         case a.x === b.x:
27479           return 'h';
27480         case a.y === b.y:
27481           return 'v';
27482       }
27483
27484       return false;
27485     }
27486
27487     module.exports.pointsAligned = pointsAligned;
27488
27489
27490     function roundPoint(point) {
27491
27492       return {
27493         x: Math.round(point.x),
27494         y: Math.round(point.y)
27495       };
27496     }
27497
27498     module.exports.roundPoint = roundPoint;
27499
27500
27501     function pointsEqual(a, b) {
27502       return a.x === b.x && a.y === b.y;
27503     }
27504
27505     module.exports.pointsEqual = pointsEqual;
27506
27507
27508     function pointDistance(a, b) {
27509       return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
27510     }
27511
27512     module.exports.pointDistance = pointDistance;
27513
27514
27515     function asTRBL(bounds) {
27516       return {
27517         top: bounds.y,
27518         right: bounds.x + (bounds.width || 0),
27519         bottom: bounds.y + (bounds.height || 0),
27520         left: bounds.x
27521       };
27522     }
27523
27524     module.exports.asTRBL = asTRBL;
27525
27526
27527     function getMidPoint(bounds) {
27528       return roundPoint({
27529         x: bounds.x + bounds.width / 2,
27530         y: bounds.y + bounds.height / 2
27531       });
27532     }
27533
27534     module.exports.getMidPoint = getMidPoint;
27535
27536
27537     // //// orientation utils //////////////////////////////
27538
27539     function getOrientation(rect, reference, pointDistance) {
27540
27541       pointDistance = pointDistance || 0;
27542
27543       var rectOrientation = asTRBL(rect),
27544         referenceOrientation = asTRBL(reference);
27545
27546       var top = rectOrientation.bottom + pointDistance <= referenceOrientation.top,
27547         right = rectOrientation.left - pointDistance >= referenceOrientation.right,
27548         bottom = rectOrientation.top - pointDistance >= referenceOrientation.bottom,
27549         left = rectOrientation.right + pointDistance <= referenceOrientation.left;
27550
27551       var vertical = top ? 'top' : (bottom ? 'bottom' : null),
27552         horizontal = left ? 'left' : (right ? 'right' : null);
27553
27554       if (horizontal && vertical) {
27555         return vertical + '-' + horizontal;
27556       } else
27557       if (horizontal || vertical) {
27558         return horizontal || vertical;
27559       } else {
27560         return 'intersect';
27561       }
27562     }
27563
27564     module.exports.getOrientation = getOrientation;
27565
27566
27567     function hasAnyOrientation(rect, reference, pointDistance, locations) {
27568
27569       if (isArray(pointDistance)) {
27570         locations = pointDistance;
27571         pointDistance = 0;
27572       }
27573
27574       var orientation = getOrientation(rect, reference, pointDistance);
27575
27576       return locations.indexOf(orientation) !== -1;
27577     }
27578
27579     module.exports.hasAnyOrientation = hasAnyOrientation;
27580
27581
27582     // //// intersection utils //////////////////////////////
27583
27584     function getElementLineIntersection(elementPath, linePath, cropStart) {
27585
27586       var intersections = getIntersections(elementPath, linePath);
27587
27588       // recognize intersections
27589       // only one -> choose
27590       // two close together -> choose first
27591       // two or more distinct -> pull out appropriate one
27592       // none -> ok (fallback to point itself)
27593       if (intersections.length === 1) {
27594         return roundPoint(intersections[0]);
27595       } else if (intersections.length === 2 && pointDistance(intersections[0], intersections[1]) < 1) {
27596         return roundPoint(intersections[0]);
27597       } else if (intersections.length > 1) {
27598
27599         // sort by intersections based on connection segment +
27600         // distance from start
27601         intersections = sortBy(intersections, function(i) {
27602           var distance = Math.floor(i.t2 * 100) || 1;
27603
27604           distance = 100 - distance;
27605
27606           distance = (distance < 10 ? '0' : '') + distance;
27607
27608           // create a sort string that makes sure we sort
27609           // line segment ASC + line segment position DESC (for cropStart)
27610           // line segment ASC + line segment position ASC (for cropEnd)
27611           return i.segment2 + '#' + distance;
27612         });
27613
27614         return roundPoint(intersections[cropStart ? 0 : intersections.length - 1]);
27615       }
27616
27617       return null;
27618     }
27619
27620     module.exports.getElementLineIntersection = getElementLineIntersection;
27621
27622
27623     function getIntersections(a, b) {
27624       return Snap.path.intersection(a, b);
27625     }
27626
27627     module.exports.getIntersections = getIntersections;
27628   }, {
27629     "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
27630     "lodash/collection/sortBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\sortBy.js",
27631     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
27632   }],
27633   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\ManhattanLayout.js": [function(require, module, exports) {
27634     'use strict';
27635
27636     var isArray = require('lodash/lang/isArray'),
27637       find = require('lodash/collection/find');
27638
27639     var LayoutUtil = require('./LayoutUtil'),
27640       Geometry = require('../util/Geometry');
27641
27642     var MIN_DISTANCE = 20;
27643
27644
27645     /**
27646      * Returns the mid points for a manhattan connection between two points.
27647      *
27648      * @example
27649      *
27650      * [a]----[x] | [x]--->[b]
27651      *
27652      * @param {Point}
27653      *            a
27654      * @param {Point}
27655      *            b
27656      * @param {String}
27657      *            directions
27658      *
27659      * @return {Array<Point>}
27660      */
27661     module.exports.getMidPoints = function(a, b, directions) {
27662
27663       directions = directions || 'h:h';
27664
27665       var xmid, ymid;
27666
27667       // one point, next to a
27668       if (directions === 'h:v') {
27669         return [{
27670           x: b.x,
27671           y: a.y
27672         }];
27673       } else
27674         // one point, above a
27675         if (directions === 'v:h') {
27676           return [{
27677             x: a.x,
27678             y: b.y
27679           }];
27680         } else
27681           // vertical edge xmid
27682           if (directions === 'h:h') {
27683             xmid = Math.round((b.x - a.x) / 2 + a.x);
27684
27685             return [{
27686               x: xmid,
27687               y: a.y
27688             }, {
27689               x: xmid,
27690               y: b.y
27691             }];
27692           } else
27693             // horizontal edge ymid
27694             if (directions === 'v:v') {
27695               ymid = Math.round((b.y - a.y) / 2 + a.y);
27696
27697               return [{
27698                 x: a.x,
27699                 y: ymid
27700               }, {
27701                 x: b.x,
27702                 y: ymid
27703               }];
27704             } else {
27705               throw new Error(
27706                 'unknown directions: <' + directions + '>: ' +
27707                 'directions must be specified as {a direction}:{b direction} (direction in h|v)');
27708             }
27709     };
27710
27711
27712     /**
27713      * Create a connection between the two points according to the manhattan layout
27714      * (only horizontal and vertical) edges.
27715      *
27716      * @param {Point}
27717      *            a
27718      * @param {Point}
27719      *            b
27720      *
27721      * @param {String}
27722      *            [directions='h:h'] specifies manhattan directions for each point
27723      *            as {adirection}:{bdirection}. A directionfor a point is either `h`
27724      *            (horizontal) or `v` (vertical)
27725      *
27726      * @return {Array<Point>}
27727      */
27728     module.exports.connectPoints = function(a, b, directions) {
27729
27730       var points = [];
27731
27732       if (!LayoutUtil.pointsAligned(a, b)) {
27733         points = this.getMidPoints(a, b, directions);
27734       }
27735
27736       points.unshift(a);
27737       points.push(b);
27738
27739       return points;
27740     };
27741
27742
27743     /**
27744      * Connect two rectangles using a manhattan layouted connection.
27745      *
27746      * @param {Bounds}
27747      *            source source rectangle
27748      * @param {Bounds}
27749      *            target target rectangle
27750      * @param {Point}
27751      *            [start] source docking
27752      * @param {Point}
27753      *            [end] target docking
27754      *
27755      * @return {Array<Point>} connection points
27756      */
27757     module.exports.connectRectangles = function(source, target, start, end, options) {
27758
27759       options = options || {};
27760
27761       var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
27762
27763       var directions = this.getDirections(source, target, options.preferVertical);
27764
27765       start = start || LayoutUtil.getMidPoint(source);
27766       end = end || LayoutUtil.getMidPoint(target);
27767
27768       // overlapping elements
27769       if (!directions) {
27770         return;
27771       }
27772
27773       if (directions === 'h:h') {
27774
27775         switch (orientation) {
27776           case 'top-right':
27777           case 'right':
27778           case 'bottom-right':
27779             start = {
27780               original: start,
27781               x: source.x,
27782               y: start.y
27783             };
27784             end = {
27785               original: end,
27786               x: target.x + target.width,
27787               y: end.y
27788             };
27789             break;
27790           case 'top-left':
27791           case 'left':
27792           case 'bottom-left':
27793             start = {
27794               original: start,
27795               x: source.x + source.width,
27796               y: start.y
27797             };
27798             end = {
27799               original: end,
27800               x: target.x,
27801               y: end.y
27802             };
27803             break;
27804         }
27805       }
27806
27807       if (directions === 'v:v') {
27808
27809         switch (orientation) {
27810           case 'top-left':
27811           case 'top':
27812           case 'top-right':
27813             start = {
27814               original: start,
27815               x: start.x,
27816               y: source.y + source.height
27817             };
27818             end = {
27819               original: end,
27820               x: end.x,
27821               y: target.y
27822             };
27823             break;
27824           case 'bottom-left':
27825           case 'bottom':
27826           case 'bottom-right':
27827             start = {
27828               original: start,
27829               x: start.x,
27830               y: source.y
27831             };
27832             end = {
27833               original: end,
27834               x: end.x,
27835               y: target.y + target.height
27836             };
27837             break;
27838         }
27839       }
27840
27841       return this.connectPoints(start, end, directions);
27842     };
27843
27844     /**
27845      * Repair the connection between two rectangles, of which one has been updated.
27846      *
27847      * @param {Bounds}
27848      *            source
27849      * @param {Bounds}
27850      *            target
27851      * @param {Point}
27852      *            [start]
27853      * @param {Point}
27854      *            [end]
27855      * @param {Array
27856      *            <Point>} waypoints
27857      * @param {Object}
27858      *            [hints]
27859      * @param {Boolean}
27860      *            hints.preferStraight
27861      * @param {Boolean}
27862      *            hints.preferVertical
27863      * @param {Boolean}
27864      *            hints.startChanged
27865      * @param {Boolean}
27866      *            hints.endChanged
27867      *
27868      * @return {Array<Point>} repaired waypoints
27869      */
27870     module.exports.repairConnection = function(source, target, start, end, waypoints, hints) {
27871
27872       if (isArray(start)) {
27873         waypoints = start;
27874         hints = end;
27875
27876         start = LayoutUtil.getMidPoint(source);
27877         end = LayoutUtil.getMidPoint(target);
27878       }
27879
27880       hints = hints || {};
27881
27882
27883       var repairedWaypoints;
27884
27885       // just layout non-existing or simple connections
27886       // attempt to render straight lines, if required
27887       if (!waypoints || waypoints.length < 3) {
27888
27889         if (hints.preferStraight) {
27890           // attempt to layout a straight line
27891           repairedWaypoints = this.layoutStraight(source, target, start, end, hints);
27892         }
27893       } else {
27894         // check if we layout from start or end
27895         if (hints.endChanged) {
27896           repairedWaypoints = this._repairConnectionSide(target, source, end, waypoints.slice().reverse());
27897           repairedWaypoints = repairedWaypoints && repairedWaypoints.reverse();
27898         } else
27899         if (hints.startChanged) {
27900           repairedWaypoints = this._repairConnectionSide(source, target, start, waypoints);
27901         }
27902         // or whether nothing seems to have changed
27903         else {
27904           repairedWaypoints = waypoints;
27905         }
27906       }
27907
27908       // simply reconnect if nothing else worked
27909       if (!repairedWaypoints) {
27910         return this.connectRectangles(source, target, start, end, hints);
27911       }
27912
27913       return repairedWaypoints;
27914     };
27915
27916     function max(a, b) {
27917       return Math.max(a, b);
27918     }
27919
27920     function min(a, b) {
27921       return Math.min(a, b);
27922     }
27923
27924     function inRange(a, start, end) {
27925       return a >= start && a <= end;
27926     }
27927
27928     module.exports.layoutStraight = function(source, target, start, end, hints) {
27929
27930       var startX, endX, x,
27931         startY, endY, y;
27932
27933       startX = max(source.x + 10, target.x + 10);
27934       endX = min(source.x + source.width - 10, target.x + target.width - 10);
27935
27936       if (startX < endX) {
27937
27938         if (source.width === target.width) {
27939
27940           if (hints.endChanged && inRange(end.x, startX, endX)) {
27941             x = end.x;
27942           } else
27943           if (inRange(start.x, startX, endX)) {
27944             x = start.x;
27945           }
27946         }
27947
27948         if (x === undefined) {
27949           if (source.width < target.width && inRange(start.x, startX, endX)) {
27950             x = start.x;
27951           } else
27952           if (source.width > target.width && inRange(end.x, startX, endX)) {
27953             x = end.x;
27954           } else {
27955             x = (startX + endX) / 2;
27956           }
27957         }
27958       }
27959
27960       startY = max(source.y + 10, target.y + 10);
27961       endY = min(source.y + source.height - 10, target.y + target.height - 10);
27962
27963       if (startY < endY) {
27964
27965         if (source.height === target.height) {
27966           if (hints.endChanged && inRange(end.y, startY, endY)) {
27967             y = end.y;
27968           } else
27969           if (inRange(start.y, startY, endY)) {
27970             y = start.y;
27971           }
27972         }
27973
27974         if (y === undefined) {
27975           if (source.height <= target.height && inRange(start.y, startY, endY)) {
27976             y = start.y;
27977           } else
27978           if (target.height <= source.height && inRange(end.y, startY, endY)) {
27979             y = end.y;
27980           } else {
27981             y = (startY + endY) / 2;
27982           }
27983         }
27984       }
27985
27986       // cannot layout straight
27987       if (x === undefined && y === undefined) {
27988         return null;
27989       }
27990
27991       return [{
27992         x: x !== undefined ? x : start.x,
27993         y: y !== undefined ? y : start.y
27994       }, {
27995         x: x !== undefined ? x : end.x,
27996         y: y !== undefined ? y : end.y
27997       }];
27998     };
27999
28000
28001     /**
28002      * Repair a connection from one side that moved.
28003      *
28004      * @param {Bounds}
28005      *            moved
28006      * @param {Bounds}
28007      *            other
28008      * @param {Point}
28009      *            newDocking
28010      * @param {Array
28011      *            <Point>} points originalPoints from moved to other
28012      *
28013      * @return {Array<Point>} the repaired points between the two rectangles
28014      */
28015     module.exports._repairConnectionSide = function(moved, other, newDocking, points) {
28016
28017       function needsRelayout(moved, other, points) {
28018
28019         if (points.length < 3) {
28020           return true;
28021         }
28022
28023         if (points.length > 4) {
28024           return false;
28025         }
28026
28027         // relayout if two points overlap
28028         // this is most likely due to
28029         return !!find(points, function(p, idx) {
28030           var q = points[idx - 1];
28031
28032           return q && Geometry.distance(p, q) < 3;
28033         });
28034       }
28035
28036       function repairBendpoint(candidate, oldPeer, newPeer) {
28037
28038         var alignment = LayoutUtil.pointsAligned(oldPeer, candidate);
28039
28040         switch (alignment) {
28041           case 'v':
28042             // repair vertical alignment
28043             return {
28044               x: candidate.x,
28045               y: newPeer.y
28046             };
28047           case 'h':
28048             // repair horizontal alignment
28049             return {
28050               x: newPeer.x,
28051               y: candidate.y
28052             };
28053         }
28054
28055         return {
28056           x: candidate.x,
28057           y: candidate.y
28058         };
28059       }
28060
28061       function removeOverlapping(points, a, b) {
28062         var i;
28063
28064         for (i = points.length - 2; i !== 0; i--) {
28065
28066           // intersects (?) break, remove all bendpoints up to this one and
28067           // relayout
28068           if (Geometry.pointInRect(points[i], a, MIN_DISTANCE) ||
28069             Geometry.pointInRect(points[i], b, MIN_DISTANCE)) {
28070
28071             // return sliced old connection
28072             return points.slice(i);
28073           }
28074         }
28075
28076         return points;
28077       }
28078
28079
28080       // (0) only repair what has layoutable bendpoints
28081
28082       // (1) if only one bendpoint and on shape moved onto other shapes axis
28083       // (horizontally / vertically), relayout
28084
28085       if (needsRelayout(moved, other, points)) {
28086         return null;
28087       }
28088
28089       var oldDocking = points[0],
28090         newPoints = points.slice(),
28091         slicedPoints;
28092
28093       // (2) repair only last line segment and only if it was layouted before
28094
28095       newPoints[0] = newDocking;
28096       newPoints[1] = repairBendpoint(newPoints[1], oldDocking, newDocking);
28097
28098
28099       // (3) if shape intersects with any bendpoint after repair,
28100       // remove all segments up to this bendpoint and repair from there
28101
28102       slicedPoints = removeOverlapping(newPoints, moved, other);
28103       if (slicedPoints !== newPoints) {
28104         return this._repairConnectionSide(moved, other, newDocking, slicedPoints);
28105       }
28106
28107       return newPoints;
28108     };
28109
28110     /**
28111      * Returns the default manhattan directions connecting two rectangles.
28112      *
28113      * @param {Bounds}
28114      *            source
28115      * @param {Bounds}
28116      *            target
28117      * @param {Boolean}
28118      *            preferVertical
28119      *
28120      * @return {String}
28121      */
28122     module.exports.getDirections = function(source, target, preferVertical) {
28123       var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
28124
28125       switch (orientation) {
28126         case 'intersect':
28127           return null;
28128
28129         case 'top':
28130         case 'bottom':
28131           return 'v:v';
28132
28133         case 'left':
28134         case 'right':
28135           return 'h:h';
28136
28137         default:
28138           return preferVertical ? 'v:v' : 'h:h';
28139       }
28140     };
28141   }, {
28142     "../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js",
28143     "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
28144     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
28145     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
28146   }],
28147   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js": [function(require, module, exports) {
28148     'use strict';
28149
28150     var assign = require('lodash/object/assign'),
28151       inherits = require('inherits');
28152
28153     var Refs = require('object-refs');
28154
28155     var parentRefs = new Refs({
28156         name: 'children',
28157         enumerable: true,
28158         collection: true
28159       }, {
28160         name: 'parent'
28161       }),
28162       labelRefs = new Refs({
28163         name: 'label',
28164         enumerable: true
28165       }, {
28166         name: 'labelTarget'
28167       }),
28168       outgoingRefs = new Refs({
28169         name: 'outgoing',
28170         collection: true
28171       }, {
28172         name: 'source'
28173       }),
28174       incomingRefs = new Refs({
28175         name: 'incoming',
28176         collection: true
28177       }, {
28178         name: 'target'
28179       });
28180
28181     /**
28182      * @namespace djs.model
28183      */
28184
28185     /**
28186      * @memberOf djs.model
28187      */
28188
28189     /**
28190      * The basic graphical representation
28191      *
28192      * @class
28193      *
28194      * @abstract
28195      */
28196     function Base() {
28197
28198       /**
28199        * The object that backs up the shape
28200        *
28201        * @name Base#businessObject
28202        * @type Object
28203        */
28204       Object.defineProperty(this, 'businessObject', {
28205         writable: true
28206       });
28207
28208       /**
28209        * The parent shape
28210        *
28211        * @name Base#parent
28212        * @type Shape
28213        */
28214       parentRefs.bind(this, 'parent');
28215
28216       /**
28217        * @name Base#label
28218        * @type Label
28219        */
28220       labelRefs.bind(this, 'label');
28221
28222       /**
28223        * The list of outgoing connections
28224        *
28225        * @name Base#outgoing
28226        * @type Array<Connection>
28227        */
28228       outgoingRefs.bind(this, 'outgoing');
28229
28230       /**
28231        * The list of outgoing connections
28232        *
28233        * @name Base#incoming
28234        * @type Array<Connection>
28235        */
28236       incomingRefs.bind(this, 'incoming');
28237     }
28238
28239
28240     /**
28241      * A graphical object
28242      *
28243      * @class
28244      * @constructor
28245      *
28246      * @extends Base
28247      */
28248     function Shape() {
28249       Base.call(this);
28250
28251       /**
28252        * The list of children
28253        *
28254        * @name Shape#children
28255        * @type Array<Base>
28256        */
28257       parentRefs.bind(this, 'children');
28258     }
28259
28260     inherits(Shape, Base);
28261
28262
28263     /**
28264      * A root graphical object
28265      *
28266      * @class
28267      * @constructor
28268      *
28269      * @extends Shape
28270      */
28271     function Root() {
28272       Shape.call(this);
28273     }
28274
28275     inherits(Root, Shape);
28276
28277
28278     /**
28279      * A label for an element
28280      *
28281      * @class
28282      * @constructor
28283      *
28284      * @extends Shape
28285      */
28286     function Label() {
28287       Shape.call(this);
28288
28289       /**
28290        * The labeled element
28291        *
28292        * @name Label#labelTarget
28293        * @type Base
28294        */
28295       labelRefs.bind(this, 'labelTarget');
28296     }
28297
28298     inherits(Label, Shape);
28299
28300
28301     /**
28302      * A connection between two elements
28303      *
28304      * @class
28305      * @constructor
28306      *
28307      * @extends Base
28308      */
28309     function Connection() {
28310       Base.call(this);
28311
28312       /**
28313        * The element this connection originates from
28314        *
28315        * @name Connection#source
28316        * @type Base
28317        */
28318       outgoingRefs.bind(this, 'source');
28319
28320       /**
28321        * The element this connection points to
28322        *
28323        * @name Connection#target
28324        * @type Base
28325        */
28326       incomingRefs.bind(this, 'target');
28327     }
28328
28329     inherits(Connection, Base);
28330
28331
28332     var types = {
28333       connection: Connection,
28334       shape: Shape,
28335       label: Label,
28336       root: Root
28337     };
28338
28339     /**
28340      * Creates a new model element of the specified type
28341      *
28342      * @method create
28343      *
28344      * @example
28345      *
28346      * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100
28347      * }); var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height:
28348      * 100 });
28349      *
28350      * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 },
28351      * {x: 210, y: 55 } ] });
28352      *
28353      * @param {String}
28354      *            type lower-cased model name
28355      * @param {Object}
28356      *            attrs attributes to initialize the new model instance with
28357      *
28358      * @return {Base} the new model instance
28359      */
28360     module.exports.create = function(type, attrs) {
28361       var Type = types[type];
28362       if (!Type) {
28363         throw new Error('unknown type: <' + type + '>');
28364       }
28365       return assign(new Type(), attrs);
28366     };
28367
28368
28369     module.exports.Base = Base;
28370     module.exports.Root = Root;
28371     module.exports.Shape = Shape;
28372     module.exports.Connection = Connection;
28373     module.exports.Label = Label;
28374   }, {
28375     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js",
28376     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
28377     "object-refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\index.js"
28378   }],
28379   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\MoveCanvas.js": [function(require, module, exports) {
28380     'use strict';
28381
28382     var Cursor = require('../../util/Cursor'),
28383       ClickTrap = require('../../util/ClickTrap'),
28384       domEvent = require('min-dom/lib/event'),
28385       Event = require('../../util/Event');
28386
28387     function substract(p1, p2) {
28388       return {
28389         x: p1.x - p2.x,
28390         y: p1.y - p2.y
28391       };
28392     }
28393
28394     function length(point) {
28395       return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
28396     }
28397
28398
28399     var THRESHOLD = 15;
28400
28401
28402     function MoveCanvas(eventBus, canvas) {
28403
28404       var container = canvas._container,
28405         context;
28406
28407
28408       function handleMove(event) {
28409
28410         var start = context.start,
28411           position = Event.toPoint(event),
28412           delta = substract(position, start);
28413
28414         if (!context.dragging && length(delta) > THRESHOLD) {
28415           context.dragging = true;
28416
28417           // prevent mouse click in this
28418           // interaction sequence
28419           ClickTrap.install();
28420
28421           Cursor.set('move');
28422         }
28423
28424         if (context.dragging) {
28425
28426           var lastPosition = context.last || context.start;
28427
28428           delta = substract(position, lastPosition);
28429
28430           canvas.scroll({
28431             dx: delta.x,
28432             dy: delta.y
28433           });
28434
28435           context.last = position;
28436         }
28437
28438         // prevent select
28439         event.preventDefault();
28440       }
28441
28442
28443       function handleEnd(event) {
28444         domEvent.unbind(document, 'mousemove', handleMove);
28445         domEvent.unbind(document, 'mouseup', handleEnd);
28446
28447         context = null;
28448
28449         Cursor.unset();
28450
28451         // prevent select
28452         Event.stopEvent(event);
28453       }
28454
28455       function handleStart(event) {
28456
28457         // reject non-left left mouse button or modifier key
28458         if (event.button || event.ctrlKey || event.shiftKey || event.altKey) {
28459           return;
28460         }
28461
28462         context = {
28463           start: Event.toPoint(event)
28464         };
28465
28466         domEvent.bind(document, 'mousemove', handleMove);
28467         domEvent.bind(document, 'mouseup', handleEnd);
28468
28469         // prevent select
28470         Event.stopEvent(event);
28471       }
28472
28473       domEvent.bind(container, 'mousedown', handleStart);
28474     }
28475
28476
28477     MoveCanvas.$inject = ['eventBus', 'canvas'];
28478
28479     module.exports = MoveCanvas;
28480
28481   }, {
28482     "../../util/ClickTrap": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js",
28483     "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
28484     "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
28485     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28486   }],
28487   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\index.js": [function(require, module, exports) {
28488     module.exports = {
28489       __init__: ['moveCanvas'],
28490       moveCanvas: ['type', require('./MoveCanvas')]
28491     };
28492   }, {
28493     "./MoveCanvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\MoveCanvas.js"
28494   }],
28495   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\touch\\index.js": [function(require, module, exports) {
28496     module.exports = {
28497       __depends__: [require('../../features/touch')]
28498     };
28499   }, {
28500     "../../features/touch": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\index.js"
28501   }],
28502   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\ZoomScroll.js": [function(require, module, exports) {
28503     'use strict';
28504
28505     var domEvent = require('min-dom/lib/event');
28506
28507     var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier,
28508       hasSecondaryModifier = require('../../util/Mouse').hasSecondaryModifier;
28509
28510     var isMac = require('../../util/Platform').isMac;
28511
28512
28513     function ZoomScroll(events, canvas) {
28514       var $canvas = $(canvas.getContainer()), //canvas.getContainer()
28515         $controls = $('<div></div>'),
28516         $zoomOut = $('<div><span class="glyphicon glyphicon-zoom-out"></span></div>'),
28517         $zoomIn = $('<div><span class="glyphicon glyphicon-zoom-in"></span></div>'),
28518         $zoomFit = $('<div><span class="glyphicon glyphicon-fullscreen"></span></div>'),
28519         zlevel = 1,
28520         zstep = 0.2;
28521
28522       $canvas.append($controls);
28523       $controls.append($zoomIn);
28524       $controls.append($zoomOut);
28525       $controls.append($zoomFit);
28526
28527       $controls.addClass('zoom-controls');
28528       $zoomOut.addClass('zoom zoom-out');
28529       $zoomIn.addClass('zoom zoom-in');
28530       $zoomFit.addClass('zoom zoom-fit');
28531
28532       $zoomOut.attr('title', 'Zoom out');
28533       $zoomIn.attr('title', 'Zoom in');
28534       $zoomFit.attr('title', 'Fit to viewport');
28535
28536       // set initial zoom level
28537       //canvas.zoom( zlevel, 'auto' );
28538
28539       // update our zoom level on viewbox change
28540       events.on('canvas.viewbox.changed', function(evt) {
28541         zlevel = evt.viewbox.scale;
28542       });
28543
28544       // define click handlers for controls
28545       $zoomFit.on('click', function() {
28546         canvas.zoom('fit-viewport', 'auto');
28547       });
28548
28549       $zoomOut.on('click', function() {
28550         zlevel = Math.max(zlevel - zstep, zstep);
28551         canvas.zoom(zlevel, 'auto');
28552       });
28553
28554       $zoomIn.on('click', function() {
28555         zlevel = Math.min(zlevel + zstep, 7);
28556         canvas.zoom(zlevel, 'auto');
28557       });
28558
28559       $(".TCS").click(function() {
28560         console.log($(this).data("stuff"));
28561         var modelElements = $(this).data("stuff").modelElements;
28562         var modelName = $(this).data("model").name;
28563         var hElements = [];
28564         modelElements.forEach(function(mElement) {
28565           if (hElements.indexOf(mElement.elementID) == -1) {
28566             hElements.push(mElement.elementID);
28567           }
28568         });
28569         highlightPath(hElements);
28570       });
28571
28572       function highlightPath(hElements) {
28573         clear();
28574         var elementRegistry = canvas._elementRegistry;
28575         //console.log(elementRegistry);
28576         hElements.forEach(function(hElement) {
28577           try {
28578             //console.log(hElement);
28579             var activityShape = elementRegistry.get(hElement);
28580             var outgoing = activityShape.incoming;
28581
28582             if (canvas.hasMarker(hElement, 'highlight')) {
28583               canvas.removeMarker(hElement, 'highlight');
28584               outgoing.forEach(function(flow) {
28585                 var outgoingGfx = elementRegistry.getGraphics(flow.id);
28586                 if (hElements.indexOf(flow.id) != -1) {
28587                   outgoingGfx.select('path').attr({
28588                     stroke: 'black'
28589                   });
28590                 }
28591               });
28592             } else {
28593               canvas.addMarker(hElement, 'highlight');
28594               outgoing.forEach(function(flow) {
28595                 var outgoingGfx = elementRegistry.getGraphics(flow.id);
28596                 if (hElements.indexOf(flow.id) != -1) {
28597                   outgoingGfx.select('path').attr({
28598                     stroke: 'blue'
28599                   });
28600                 }
28601               });
28602             }
28603           } catch (err) {
28604             //console.log(err);
28605           }
28606
28607         });
28608       }
28609
28610       function clear() {
28611         var elementRegistry = canvas._elementRegistry;
28612         elementRegistry.forEach(function(hElement) {
28613           try {
28614             canvas.removeMarker(hElement, 'highlight');
28615             var outgoing = hElement.incoming;
28616             outgoing.forEach(function(flow) {
28617               var outgoingGfx = elementRegistry.getGraphics(flow.id);
28618               outgoingGfx.select('path').attr({
28619                 stroke: 'black'
28620               });
28621             });
28622           } catch (err) {
28623
28624           }
28625         });
28626       }
28627
28628       //console.log('endzoom');
28629
28630
28631       var RANGE = {
28632         min: 0.2,
28633         max: 4
28634       };
28635
28636       function cap(scale) {
28637         return Math.max(RANGE.min, Math.min(RANGE.max, scale));
28638       }
28639
28640       function reset() {
28641         canvas.zoom('fit-viewport');
28642       }
28643
28644       function zoom(direction, position) {
28645
28646         var currentZoom = canvas.zoom();
28647         var factor = Math.pow(1 + Math.abs(direction), direction > 0 ? 1 : -1);
28648
28649         canvas.zoom(cap(currentZoom * factor), position);
28650       }
28651
28652       function scroll(delta) {
28653         canvas.scroll(delta);
28654       }
28655
28656       function init(element) {
28657
28658         domEvent.bind(element, 'wheel', function(event) {
28659           /*
28660
28661                               event.preventDefault();
28662
28663                               // mouse-event: SELECTION_KEY
28664                               // mouse-event: AND_KEY
28665                               var isVerticalScroll = hasPrimaryModifier(event),
28666                                   isHorizontalScroll = hasSecondaryModifier(event);
28667
28668                               var factor;
28669
28670                               if (isVerticalScroll || isHorizontalScroll) {
28671
28672                                   if (isMac) {
28673                                       factor = event.deltaMode === 0 ? 1.25 : 50;
28674                                   } else {
28675                                       factor = event.deltaMode === 0 ? 1 / 40 : 1 / 2;
28676                                   }
28677
28678                                   var delta = {};
28679
28680                                   if (isHorizontalScroll) {
28681                                       delta.dx = (factor * (event.deltaX || event.deltaY));
28682                                   } else {
28683                                       delta.dy = (factor * event.deltaY);
28684                                   }
28685
28686                                   scroll(delta);
28687                               } else {
28688                                   factor = (event.deltaMode === 0 ? 1 / 40 : 1 / 2);
28689
28690                                   var elementRect = element.getBoundingClientRect();
28691
28692                                   var offset = {
28693                                       x: event.clientX - elementRect.left,
28694                                       y: event.clientY - elementRect.top
28695                                   };
28696
28697                                   // zoom in relative to diagram {x,y} coordinates
28698                                   zoom(event.deltaY * factor / (-5), offset);
28699                               }
28700                           */
28701         });
28702       }
28703
28704       events.on('canvas.init', function(e) {
28705         init(canvas._container);
28706       });
28707
28708       // API
28709       this.zoom = zoom;
28710       this.reset = reset;
28711     }
28712
28713
28714     ZoomScroll.$inject = ['eventBus', 'canvas'];
28715
28716     module.exports = ZoomScroll;
28717
28718
28719   }, {
28720     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
28721     "../../util/Platform": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js",
28722     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28723   }],
28724   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\index.js": [function(require, module, exports) {
28725     module.exports = {
28726       __init__: ['zoomScroll'],
28727       zoomScroll: ['type', require('./ZoomScroll')]
28728     };
28729   }, {
28730     "./ZoomScroll": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\ZoomScroll.js"
28731   }],
28732   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js": [function(require, module, exports) {
28733     'use strict';
28734
28735     var domEvent = require('min-dom/lib/event'),
28736       stopEvent = require('./Event').stopEvent;
28737
28738     function trap(event) {
28739       stopEvent(event);
28740
28741       toggle(false);
28742     }
28743
28744     function toggle(active) {
28745       domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);
28746     }
28747
28748     /**
28749      * Installs a click trap that prevents a ghost click following a dragging
28750      * operation.
28751      *
28752      * @return {Function} a function to immediately remove the installed trap.
28753      */
28754     function install() {
28755
28756       toggle(true);
28757
28758       return function() {
28759         toggle(false);
28760       };
28761     }
28762
28763     module.exports.install = install;
28764   }, {
28765     "./Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
28766     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28767   }],
28768   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js": [function(require, module, exports) {
28769     'use strict';
28770
28771     /**
28772      * Failsafe remove an element from a collection
28773      *
28774      * @param {Array
28775      *            <Object>} [collection]
28776      * @param {Object}
28777      *            [element]
28778      *
28779      * @return {Object} the element that got removed or undefined
28780      */
28781     module.exports.remove = function(collection, element) {
28782
28783       if (!collection || !element) {
28784         return;
28785       }
28786
28787       var idx = collection.indexOf(element);
28788       if (idx === -1) {
28789         return;
28790       }
28791
28792       collection.splice(idx, 1);
28793
28794       return element;
28795     };
28796
28797     /**
28798      * Fail save add an element to the given connection, ensuring it does not yet
28799      * exist.
28800      *
28801      * @param {Array
28802      *            <Object>} collection
28803      * @param {Object}
28804      *            element
28805      * @param {Number}
28806      *            idx
28807      */
28808     module.exports.add = function(collection, element, idx) {
28809
28810       if (!collection || !element) {
28811         return;
28812       }
28813
28814       if (isNaN(idx)) {
28815         idx = -1;
28816       }
28817
28818       var currentIdx = collection.indexOf(element);
28819
28820       if (currentIdx !== -1) {
28821
28822         if (currentIdx === idx) {
28823           // nothing to do, position has not changed
28824           return;
28825         } else {
28826
28827           if (idx !== -1) {
28828             // remove from current position
28829             collection.splice(currentIdx, 1);
28830           } else {
28831             // already exists in collection
28832             return;
28833           }
28834         }
28835       }
28836
28837       if (idx !== -1) {
28838         // insert at specified position
28839         collection.splice(idx, 0, element);
28840       } else {
28841         // push to end
28842         collection.push(element);
28843       }
28844     };
28845
28846
28847     /**
28848      * Fail get the index of an element in a collection.
28849      *
28850      * @param {Array
28851      *            <Object>} collection
28852      * @param {Object}
28853      *            element
28854      *
28855      * @return {Number} the index or -1 if collection or element do not exist or the
28856      *         element is not contained.
28857      */
28858     module.exports.indexOf = function(collection, element) {
28859
28860       if (!collection || !element) {
28861         return -1;
28862       }
28863
28864       return collection.indexOf(element);
28865     };
28866
28867   }, {}],
28868   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js": [function(require, module, exports) {
28869     'use strict';
28870
28871     var domClasses = require('min-dom/lib/classes');
28872
28873     var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;
28874
28875
28876     module.exports.set = function(mode) {
28877       var classes = domClasses(document.body);
28878
28879       classes.removeMatching(CURSOR_CLS_PATTERN);
28880
28881       if (mode) {
28882         classes.add('djs-cursor-' + mode);
28883       }
28884     };
28885
28886     module.exports.unset = function() {
28887       this.set(null);
28888     };
28889   }, {
28890     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js"
28891   }],
28892   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js": [function(require, module, exports) {
28893     'use strict';
28894
28895     var isArray = require('lodash/lang/isArray'),
28896       isNumber = require('lodash/lang/isNumber'),
28897       groupBy = require('lodash/collection/groupBy'),
28898       forEach = require('lodash/collection/forEach');
28899
28900     /**
28901      * Adds an element to a collection and returns true if the element was added.
28902      *
28903      * @param {Array
28904      *            <Object>} elements
28905      * @param {Object}
28906      *            e
28907      * @param {Boolean}
28908      *            unique
28909      */
28910     function add(elements, e, unique) {
28911       var canAdd = !unique || elements.indexOf(e) === -1;
28912
28913       if (canAdd) {
28914         elements.push(e);
28915       }
28916
28917       return canAdd;
28918     }
28919
28920     function eachElement(elements, fn, depth) {
28921
28922       depth = depth || 0;
28923
28924       forEach(elements, function(s, i) {
28925         var filter = fn(s, i, depth);
28926
28927         if (isArray(filter) && filter.length) {
28928           eachElement(filter, fn, depth + 1);
28929         }
28930       });
28931     }
28932
28933     /**
28934      * Collects self + child elements up to a given depth from a list of elements.
28935      *
28936      * @param {Array
28937      *            <djs.model.Base>} elements the elements to select the children
28938      *            from
28939      * @param {Boolean}
28940      *            unique whether to return a unique result set (no duplicates)
28941      * @param {Number}
28942      *            maxDepth the depth to search through or -1 for infinite
28943      *
28944      * @return {Array<djs.model.Base>} found elements
28945      */
28946     function selfAndChildren(elements, unique, maxDepth) {
28947       var result = [],
28948         processedChildren = [];
28949
28950       eachElement(elements, function(element, i, depth) {
28951         add(result, element, unique);
28952
28953         var children = element.children;
28954
28955         // max traversal depth not reached yet
28956         if (maxDepth === -1 || depth < maxDepth) {
28957
28958           // children exist && children not yet processed
28959           if (children && add(processedChildren, children, unique)) {
28960             return children;
28961           }
28962         }
28963       });
28964
28965       return result;
28966     }
28967
28968     /**
28969      * Return self + direct children for a number of elements
28970      *
28971      * @param {Array
28972      *            <djs.model.Base>} elements to query
28973      * @param {Boolean}
28974      *            allowDuplicates to allow duplicates in the result set
28975      *
28976      * @return {Array<djs.model.Base>} the collected elements
28977      */
28978     function selfAndDirectChildren(elements, allowDuplicates) {
28979       return selfAndChildren(elements, !allowDuplicates, 1);
28980     }
28981
28982     /**
28983      * Return self + ALL children for a number of elements
28984      *
28985      * @param {Array
28986      *            <djs.model.Base>} elements to query
28987      * @param {Boolean}
28988      *            allowDuplicates to allow duplicates in the result set
28989      *
28990      * @return {Array<djs.model.Base>} the collected elements
28991      */
28992     function selfAndAllChildren(elements, allowDuplicates) {
28993       return selfAndChildren(elements, !allowDuplicates, -1);
28994     }
28995
28996     /**
28997      * Gets the the closure fo all selected elements, their connections and
28998      *
28999      * @param {Array
29000      *            <djs.model.Base>} elements
29001      * @return {Object} enclosure
29002      */
29003     function getClosure(elements) {
29004
29005       // original elements passed to this function
29006       var topLevel = groupBy(elements, function(e) {
29007         return e.id;
29008       });
29009
29010       var allShapes = {},
29011         allConnections = {},
29012         enclosedElements = {},
29013         enclosedConnections = {};
29014
29015       function handleConnection(c) {
29016         if (topLevel[c.source.id] && topLevel[c.target.id]) {
29017           topLevel[c.id] = c;
29018         }
29019
29020         // not enclosed as a child, but maybe logically
29021         // (connecting two moved elements?)
29022         if (allShapes[c.source.id] && allShapes[c.target.id]) {
29023           enclosedConnections[c.id] = enclosedElements[c.id] = c;
29024         }
29025
29026         allConnections[c.id] = c;
29027       }
29028
29029       function handleElement(element) {
29030
29031         enclosedElements[element.id] = element;
29032
29033         if (element.waypoints) {
29034           // remember connection
29035           enclosedConnections[element.id] = allConnections[element.id] = element;
29036         } else {
29037           // remember shape
29038           allShapes[element.id] = element;
29039
29040           // remember all connections
29041           forEach(element.incoming, handleConnection);
29042
29043           forEach(element.outgoing, handleConnection);
29044
29045           // recurse into children
29046           return element.children;
29047         }
29048       }
29049
29050       eachElement(elements, handleElement);
29051
29052       return {
29053         allShapes: allShapes,
29054         allConnections: allConnections,
29055         topLevel: topLevel,
29056         enclosedConnections: enclosedConnections,
29057         enclosedElements: enclosedElements
29058       };
29059     }
29060
29061     /**
29062      * Returns the surrounding bbox for all elements in the array or the element
29063      * primitive.
29064      */
29065     function getBBox(elements, stopRecursion) {
29066
29067       stopRecursion = !!stopRecursion;
29068       if (!isArray(elements)) {
29069         elements = [elements];
29070       }
29071
29072       var minX,
29073         minY,
29074         maxX,
29075         maxY;
29076
29077       forEach(elements, function(element) {
29078
29079         // If element is a connection the bbox must be computed first
29080         var bbox = element;
29081         if (element.waypoints && !stopRecursion) {
29082           bbox = getBBox(element.waypoints, true);
29083         }
29084
29085         var x = bbox.x,
29086           y = bbox.y,
29087           height = bbox.height || 0,
29088           width = bbox.width || 0;
29089
29090         if (x < minX || minX === undefined) {
29091           minX = x;
29092         }
29093         if (y < minY || minY === undefined) {
29094           minY = y;
29095         }
29096
29097         if ((x + width) > maxX || maxX === undefined) {
29098           maxX = x + width;
29099         }
29100         if ((y + height) > maxY || maxY === undefined) {
29101           maxY = y + height;
29102         }
29103       });
29104
29105       return {
29106         x: minX,
29107         y: minY,
29108         height: maxY - minY,
29109         width: maxX - minX
29110       };
29111     }
29112
29113
29114     /**
29115      * Returns all elements that are enclosed from the bounding box.
29116      *
29117      * @param {Array
29118      *            <Object>} elements List of Elements to search through
29119      * @param {Object}
29120      *            bbox the enclosing bbox.
29121      *            <ul>
29122      *            <li>If bbox.(width|height) is not specified the method returns
29123      *            all elements with element.x/y &gt; bbox.x/y </li>
29124      *            <li>If only bbox.x or bbox.y is specified, method return all
29125      *            elements with e.x &gt; bbox.x or e.y &gt; bbox.y.</li>
29126      *            </ul>
29127      *
29128      */
29129     function getEnclosedElements(elements, bbox) {
29130
29131       var filteredElements = {};
29132
29133       forEach(elements, function(element) {
29134
29135         var e = element;
29136
29137         if (e.waypoints) {
29138           e = getBBox(e);
29139         }
29140
29141         if (!isNumber(bbox.y) && (e.x > bbox.x)) {
29142           filteredElements[element.id] = element;
29143         }
29144         if (!isNumber(bbox.x) && (e.y > bbox.y)) {
29145           filteredElements[element.id] = element;
29146         }
29147         if (e.x > bbox.x && e.y > bbox.y) {
29148           if (isNumber(bbox.width) && isNumber(bbox.height) &&
29149             e.width + e.x < bbox.width + bbox.x &&
29150             e.height + e.y < bbox.height + bbox.y) {
29151
29152             filteredElements[element.id] = element;
29153           } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {
29154             filteredElements[element.id] = element;
29155           }
29156         }
29157       });
29158
29159       return filteredElements;
29160     }
29161
29162
29163
29164     module.exports.eachElement = eachElement;
29165     module.exports.selfAndDirectChildren = selfAndDirectChildren;
29166     module.exports.selfAndAllChildren = selfAndAllChildren;
29167     module.exports.getBBox = getBBox;
29168     module.exports.getEnclosedElements = getEnclosedElements;
29169
29170     module.exports.getClosure = getClosure;
29171
29172   }, {
29173     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
29174     "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
29175     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
29176     "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js"
29177   }],
29178   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js": [function(require, module, exports) {
29179     'use strict';
29180
29181     function __preventDefault(event) {
29182       return event && event.preventDefault();
29183     }
29184
29185     function __stopPropagation(event, immediate) {
29186       if (!event) {
29187         return;
29188       }
29189
29190       if (event.stopPropagation) {
29191         event.stopPropagation();
29192       }
29193
29194       if (immediate && event.stopImmediatePropagation) {
29195         event.stopImmediatePropagation();
29196       }
29197     }
29198
29199
29200     function getOriginal(event) {
29201       return event.originalEvent || event.srcEvent;
29202     }
29203
29204     module.exports.getOriginal = getOriginal;
29205
29206
29207     function stopEvent(event, immediate) {
29208       stopPropagation(event, immediate);
29209       preventDefault(event);
29210     }
29211
29212     module.exports.stopEvent = stopEvent;
29213
29214
29215     function preventDefault(event) {
29216       __preventDefault(event);
29217       __preventDefault(getOriginal(event));
29218     }
29219
29220     module.exports.preventDefault = preventDefault;
29221
29222
29223     function stopPropagation(event, immediate) {
29224       __stopPropagation(event, immediate);
29225       __stopPropagation(getOriginal(event), immediate);
29226     }
29227
29228     module.exports.stopPropagation = stopPropagation;
29229
29230
29231     function toPoint(event) {
29232
29233       if (event.pointers && event.pointers.length) {
29234         event = event.pointers[0];
29235       }
29236
29237       if (event.touches && event.touches.length) {
29238         event = event.touches[0];
29239       }
29240
29241       return event ? {
29242         x: event.clientX,
29243         y: event.clientY
29244       } : null;
29245     }
29246
29247     module.exports.toPoint = toPoint;
29248
29249   }, {}],
29250   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js": [function(require, module, exports) {
29251     'use strict';
29252
29253     /**
29254      * Computes the distance between two points
29255      *
29256      * @param {Point}
29257      *            p
29258      * @param {Point}
29259      *            q
29260      *
29261      * @return {Number} distance
29262      */
29263     var distance = module.exports.distance = function(p, q) {
29264       return Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2));
29265     };
29266
29267     /**
29268      * Returns true if the point r is on the line between p and y
29269      *
29270      * @param {Point}
29271      *            p
29272      * @param {Point}
29273      *            q
29274      * @param {Point}
29275      *            r
29276      *
29277      * @return {Boolean}
29278      */
29279     module.exports.pointsOnLine = function(p, q, r) {
29280
29281       if (!p || !q || !r) {
29282         return false;
29283       }
29284
29285       var val = (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x),
29286         dist = distance(p, q);
29287
29288       // @see http://stackoverflow.com/a/907491/412190
29289       return Math.abs(val / dist) < 5;
29290     };
29291
29292     module.exports.pointInRect = function(p, rect, tolerance) {
29293       tolerance = tolerance || 0;
29294
29295       return p.x > rect.x - tolerance &&
29296         p.y > rect.y - tolerance &&
29297         p.x < rect.x + rect.width + tolerance &&
29298         p.y < rect.y + rect.height + tolerance;
29299     };
29300   }, {}],
29301   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\GraphicsUtil.js": [function(require, module, exports) {
29302     'use strict';
29303
29304     /**
29305      * SVGs for elements are generated by the {@link GraphicsFactory}.
29306      *
29307      * This utility gives quick access to the important semantic parts of an
29308      * element.
29309      */
29310
29311     /**
29312      * Returns the visual part of a diagram element
29313      *
29314      * @param {Snap
29315      *            <SVGElement>} gfx
29316      *
29317      * @return {Snap<SVGElement>}
29318      */
29319     function getVisual(gfx) {
29320       return gfx.select('.djs-visual');
29321     }
29322
29323     /**
29324      * Returns the children for a given diagram element.
29325      *
29326      * @param {Snap
29327      *            <SVGElement>} gfx
29328      * @return {Snap<SVGElement>}
29329      */
29330     function getChildren(gfx) {
29331       return gfx.parent().children()[1];
29332     }
29333
29334     /**
29335      * Returns the visual bbox of an element
29336      *
29337      * @param {Snap
29338      *            <SVGElement>} gfx
29339      *
29340      * @return {Bounds}
29341      */
29342     function getBBox(gfx) {
29343       return getVisual(gfx).select('*').getBBox();
29344     }
29345
29346
29347     module.exports.getVisual = getVisual;
29348     module.exports.getChildren = getChildren;
29349     module.exports.getBBox = getBBox;
29350   }, {}],
29351   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js": [function(require, module, exports) {
29352     'use strict';
29353
29354     /**
29355      * Util that provides unique IDs.
29356      *
29357      * @class djs.util.IdGenerator
29358      * @constructor
29359      * @memberOf djs.util
29360      *
29361      * The ids can be customized via a given prefix and contain a random value to
29362      * avoid collisions.
29363      *
29364      * @param {String}
29365      *            prefix a prefix to prepend to generated ids (for better
29366      *            readability)
29367      */
29368     function IdGenerator(prefix) {
29369
29370       this._counter = 0;
29371       this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';
29372     }
29373
29374     module.exports = IdGenerator;
29375
29376     /**
29377      * Returns a next unique ID.
29378      *
29379      * @method djs.util.IdGenerator#next
29380      *
29381      * @returns {String} the id
29382      */
29383     IdGenerator.prototype.next = function() {
29384       return this._prefix + (++this._counter);
29385     };
29386
29387   }, {}],
29388   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js": [function(require, module, exports) {
29389     'use strict';
29390
29391     var getOriginalEvent = require('./Event').getOriginal;
29392
29393     var isMac = require('./Platform').isMac;
29394
29395
29396     function isPrimaryButton(event) {
29397       // button === 0 -> left ÃƒÆ’ƒÂ¡ka primary mouse button
29398       return !(getOriginalEvent(event) || event).button;
29399     }
29400
29401     module.exports.isPrimaryButton = isPrimaryButton;
29402
29403     module.exports.isMac = isMac;
29404
29405     module.exports.hasPrimaryModifier = function(event) {
29406       var originalEvent = getOriginalEvent(event) || event;
29407
29408       if (!isPrimaryButton(event)) {
29409         return false;
29410       }
29411
29412       // Use alt as primary modifier key for mac OS
29413       if (isMac()) {
29414         return originalEvent.altKey;
29415       } else {
29416         return originalEvent.ctrlKey;
29417       }
29418     };
29419
29420
29421     module.exports.hasSecondaryModifier = function(event) {
29422       var originalEvent = getOriginalEvent(event) || event;
29423
29424       return isPrimaryButton(event) && originalEvent.shiftKey;
29425     };
29426
29427   }, {
29428     "./Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
29429     "./Platform": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js"
29430   }],
29431   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js": [function(require, module, exports) {
29432     'use strict';
29433
29434     module.exports.isMac = function isMac() {
29435       return (/mac/i).test(navigator.platform);
29436     };
29437   }, {}],
29438   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Text.js": [function(require, module, exports) {
29439     'use strict';
29440
29441     var isObject = require('lodash/lang/isObject'),
29442       assign = require('lodash/object/assign'),
29443       forEach = require('lodash/collection/forEach'),
29444       reduce = require('lodash/collection/reduce'),
29445       merge = require('lodash/object/merge');
29446
29447     var Snap = require('../../vendor/snapsvg');
29448
29449     var DEFAULT_BOX_PADDING = 0;
29450
29451     var DEFAULT_LABEL_SIZE = {
29452       width: 150,
29453       height: 50
29454     };
29455
29456
29457     function parseAlign(align) {
29458
29459       var parts = align.split('-');
29460
29461       return {
29462         horizontal: parts[0] || 'center',
29463         vertical: parts[1] || 'top'
29464       };
29465     }
29466
29467     function parsePadding(padding) {
29468
29469       if (isObject(padding)) {
29470         return assign({
29471           top: 0,
29472           left: 0,
29473           right: 0,
29474           bottom: 0
29475         }, padding);
29476       } else {
29477         return {
29478           top: padding,
29479           left: padding,
29480           right: padding,
29481           bottom: padding
29482         };
29483       }
29484     }
29485
29486     function getTextBBox(text, fakeText) {
29487       fakeText.textContent = text;
29488       return fakeText.getBBox();
29489     }
29490
29491
29492     /**
29493      * Layout the next line and return the layouted element.
29494      *
29495      * Alters the lines passed.
29496      *
29497      * @param {Array
29498      *            <String>} lines
29499      * @return {Object} the line descriptor, an object { width, height, text }
29500      */
29501     function layoutNext(lines, maxWidth, fakeText) {
29502
29503       var originalLine = lines.shift(),
29504         fitLine = originalLine;
29505
29506       var textBBox;
29507
29508       while (true) {
29509         textBBox = getTextBBox(fitLine, fakeText);
29510
29511         textBBox.width = fitLine ? textBBox.width : 0;
29512
29513         // try to fit
29514         if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {
29515           return fit(lines, fitLine, originalLine, textBBox);
29516         }
29517
29518
29519         fitLine = shortenLine(fitLine, textBBox.width, maxWidth);
29520       }
29521     }
29522
29523     function fit(lines, fitLine, originalLine, textBBox) {
29524       if (fitLine.length < originalLine.length) {
29525         var nextLine = lines[0] || '',
29526           remainder = originalLine.slice(fitLine.length).trim();
29527
29528         if (/-\s*$/.test(remainder)) {
29529           nextLine = remainder.replace(/-\s*$/, '') + nextLine.replace(/^\s+/, '');
29530         } else {
29531           nextLine = remainder + ' ' + nextLine;
29532         }
29533
29534         lines[0] = nextLine;
29535       }
29536       return {
29537         width: textBBox.width,
29538         height: textBBox.height,
29539         text: fitLine
29540       };
29541     }
29542
29543
29544     /**
29545      * Shortens a line based on spacing and hyphens. Returns the shortened result on
29546      * success.
29547      *
29548      * @param {String}
29549      *            line
29550      * @param {Number}
29551      *            maxLength the maximum characters of the string
29552      * @return {String} the shortened string
29553      */
29554     function semanticShorten(line, maxLength) {
29555       var parts = line.split(/(\s|-)/g),
29556         part,
29557         shortenedParts = [],
29558         length = 0;
29559
29560       // try to shorten via spaces + hyphens
29561       if (parts.length > 1) {
29562         while ((part = parts.shift())) {
29563           if (part.length + length < maxLength) {
29564             shortenedParts.push(part);
29565             length += part.length;
29566           } else {
29567             // remove previous part, too if hyphen does not fit anymore
29568             if (part === '-') {
29569               shortenedParts.pop();
29570             }
29571
29572             break;
29573           }
29574         }
29575       }
29576
29577       return shortenedParts.join('');
29578     }
29579
29580
29581     function shortenLine(line, width, maxWidth) {
29582       var length = Math.max(line.length * (maxWidth / width), 1);
29583
29584       // try to shorten semantically (i.e. based on spaces and hyphens)
29585       var shortenedLine = semanticShorten(line, length);
29586
29587       if (!shortenedLine) {
29588
29589         // force shorten by cutting the long word
29590         shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));
29591       }
29592
29593       return shortenedLine;
29594     }
29595
29596
29597     /**
29598      * Creates a new label utility
29599      *
29600      * @param {Object}
29601      *            config
29602      * @param {Dimensions}
29603      *            config.size
29604      * @param {Number}
29605      *            config.padding
29606      * @param {Object}
29607      *            config.style
29608      * @param {String}
29609      *            config.align
29610      */
29611     function Text(config) {
29612
29613       this._config = assign({}, {
29614         size: DEFAULT_LABEL_SIZE,
29615         padding: DEFAULT_BOX_PADDING,
29616         style: {},
29617         align: 'center-top'
29618       }, config || {});
29619     }
29620
29621
29622     /**
29623      * Create a label in the parent node.
29624      *
29625      * @method Text#createText
29626      *
29627      * @param {SVGElement}
29628      *            parent the parent to draw the label on
29629      * @param {String}
29630      *            text the text to render on the label
29631      * @param {Object}
29632      *            options
29633      * @param {String}
29634      *            options.align how to align in the bounding box. Any of {
29635      *            'center-middle', 'center-top' }, defaults to 'center-top'.
29636      * @param {String}
29637      *            options.style style to be applied to the text
29638      *
29639      * @return {SVGText} the text element created
29640      */
29641     Text.prototype.createText = function(parent, text, options) {
29642
29643       var box = merge({}, this._config.size, options.box || {}),
29644         style = merge({}, this._config.style, options.style || {}),
29645         align = parseAlign(options.align || this._config.align),
29646         padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);
29647
29648       var lines = text.split(/\r?\n/g),
29649         layouted = [];
29650
29651       var maxWidth = box.width - padding.left - padding.right;
29652
29653       // FF regression: ensure text is shown during rendering
29654       // by attaching it directly to the body
29655       var fakeText = parent.paper.text(0, 0, '').attr(style).node;
29656
29657       while (lines.length) {
29658         layouted.push(layoutNext(lines, maxWidth, fakeText));
29659       }
29660
29661       var totalHeight = reduce(layouted, function(sum, line, idx) {
29662         return sum + line.height;
29663       }, 0);
29664
29665       // the y position of the next line
29666       var y, x;
29667
29668       switch (align.vertical) {
29669         case 'middle':
29670           y = (box.height - totalHeight) / 2 - layouted[0].height / 4;
29671           break;
29672
29673         default:
29674           y = padding.top;
29675       }
29676
29677       var textElement = parent.text().attr(style);
29678
29679       forEach(layouted, function(line) {
29680         y += line.height;
29681
29682         switch (align.horizontal) {
29683           case 'left':
29684             x = padding.left;
29685             break;
29686
29687           case 'right':
29688             x = (maxWidth - padding.right - line.width);
29689             break;
29690
29691           default:
29692             // aka center
29693             x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);
29694         }
29695
29696
29697         var tspan = Snap.create('tspan', {
29698           x: x,
29699           y: y
29700         }).node;
29701         tspan.textContent = line.text;
29702
29703         textElement.append(tspan);
29704       });
29705
29706       // remove fake text
29707       fakeText.parentNode.removeChild(fakeText);
29708
29709       return textElement;
29710     };
29711
29712
29713     module.exports = Text;
29714   }, {
29715     "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
29716     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
29717     "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
29718     "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
29719     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
29720     "lodash/object/merge": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\merge.js"
29721   }],
29722   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js": [function(require, module, exports) {
29723
29724     var isArray = function(obj) {
29725       return Object.prototype.toString.call(obj) === '[object Array]';
29726     };
29727
29728     var annotate = function() {
29729       var args = Array.prototype.slice.call(arguments);
29730
29731       if (args.length === 1 && isArray(args[0])) {
29732         args = args[0];
29733       }
29734
29735       var fn = args.pop();
29736
29737       fn.$inject = args;
29738
29739       return fn;
29740     };
29741
29742
29743     // Current limitations:
29744     // - can't put into "function arg" comments
29745     // function /* (no parenthesis like this) */ (){}
29746     // function abc( /* xx (no parenthesis like this) */ a, b) {}
29747     //
29748     // Just put the comment before function or inside:
29749     // /* (((this is fine))) */ function(a, b) {}
29750     // function abc(a) { /* (((this is fine))) */}
29751
29752     var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
29753     var FN_ARG = /\/\*([^\*]*)\*\//m;
29754
29755     var parse = function(fn) {
29756       if (typeof fn !== 'function') {
29757         throw new Error('Cannot annotate "' + fn + '". Expected a function!');
29758       }
29759
29760       var match = fn.toString().match(FN_ARGS);
29761       return match[1] && match[1].split(',').map(function(arg) {
29762         match = arg.match(FN_ARG);
29763         return match ? match[1].trim() : arg.trim();
29764       }) || [];
29765     };
29766
29767
29768     exports.annotate = annotate;
29769     exports.parse = parse;
29770     exports.isArray = isArray;
29771
29772   }, {}],
29773   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\index.js": [function(require, module, exports) {
29774     module.exports = {
29775       annotate: require('./annotation').annotate,
29776       Module: require('./module'),
29777       Injector: require('./injector')
29778     };
29779
29780   }, {
29781     "./annotation": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js",
29782     "./injector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\injector.js",
29783     "./module": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js"
29784   }],
29785   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\injector.js": [function(require, module, exports) {
29786     var Module = require('./module');
29787     var autoAnnotate = require('./annotation').parse;
29788     var annotate = require('./annotation').annotate;
29789     var isArray = require('./annotation').isArray;
29790
29791
29792     var Injector = function(modules, parent) {
29793       parent = parent || {
29794         get: function(name) {
29795           currentlyResolving.push(name);
29796           throw error('No provider for "' + name + '"!');
29797         }
29798       };
29799
29800       var currentlyResolving = [];
29801       var providers = this._providers = Object.create(parent._providers || null);
29802       var instances = this._instances = Object.create(null);
29803
29804       var self = instances.injector = this;
29805
29806       var error = function(msg) {
29807         var stack = currentlyResolving.join(' -> ');
29808         currentlyResolving.length = 0;
29809         return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
29810       };
29811
29812       var get = function(name) {
29813         if (!providers[name] && name.indexOf('.') !== -1) {
29814           var parts = name.split('.');
29815           var pivot = get(parts.shift());
29816
29817           while (parts.length) {
29818             pivot = pivot[parts.shift()];
29819           }
29820
29821           return pivot;
29822         }
29823
29824         if (Object.hasOwnProperty.call(instances, name)) {
29825           return instances[name];
29826         }
29827
29828         if (Object.hasOwnProperty.call(providers, name)) {
29829           if (currentlyResolving.indexOf(name) !== -1) {
29830             currentlyResolving.push(name);
29831             throw error('Cannot resolve circular dependency!');
29832           }
29833
29834           currentlyResolving.push(name);
29835           instances[name] = providers[name][0](providers[name][1]);
29836           currentlyResolving.pop();
29837
29838           return instances[name];
29839         }
29840
29841         return parent.get(name);
29842       };
29843
29844       var instantiate = function(Type) {
29845         var instance = Object.create(Type.prototype);
29846         var returned = invoke(Type, instance);
29847
29848         return typeof returned === 'object' ? returned : instance;
29849       };
29850
29851       var invoke = function(fn, context) {
29852         if (typeof fn !== 'function') {
29853           if (isArray(fn)) {
29854             fn = annotate(fn.slice());
29855           } else {
29856             throw new Error('Cannot invoke "' + fn + '". Expected a function!');
29857           }
29858         }
29859
29860         var inject = fn.$inject && fn.$inject || autoAnnotate(fn);
29861         var dependencies = inject.map(function(dep) {
29862           return get(dep);
29863         });
29864
29865         // TODO(vojta): optimize without apply
29866         return fn.apply(context, dependencies);
29867       };
29868
29869
29870       var createPrivateInjectorFactory = function(privateChildInjector) {
29871         return annotate(function(key) {
29872           return privateChildInjector.get(key);
29873         });
29874       };
29875
29876       var createChild = function(modules, forceNewInstances) {
29877         if (forceNewInstances && forceNewInstances.length) {
29878           var fromParentModule = Object.create(null);
29879           var matchedScopes = Object.create(null);
29880
29881           var privateInjectorsCache = [];
29882           var privateChildInjectors = [];
29883           var privateChildFactories = [];
29884
29885           var provider;
29886           var cacheIdx;
29887           var privateChildInjector;
29888           var privateChildInjectorFactory;
29889           for (var name in providers) {
29890             provider = providers[name];
29891
29892             if (forceNewInstances.indexOf(name) !== -1) {
29893               if (provider[2] === 'private') {
29894                 cacheIdx = privateInjectorsCache.indexOf(provider[3]);
29895                 if (cacheIdx === -1) {
29896                   privateChildInjector = provider[3].createChild([], forceNewInstances);
29897                   privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);
29898                   privateInjectorsCache.push(provider[3]);
29899                   privateChildInjectors.push(privateChildInjector);
29900                   privateChildFactories.push(privateChildInjectorFactory);
29901                   fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];
29902                 } else {
29903                   fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];
29904                 }
29905               } else {
29906                 fromParentModule[name] = [provider[2], provider[1]];
29907               }
29908               matchedScopes[name] = true;
29909             }
29910
29911             if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
29912               forceNewInstances.forEach(function(scope) {
29913                 if (provider[1].$scope.indexOf(scope) !== -1) {
29914                   fromParentModule[name] = [provider[2], provider[1]];
29915                   matchedScopes[scope] = true;
29916                 }
29917               });
29918             }
29919           }
29920
29921           forceNewInstances.forEach(function(scope) {
29922             if (!matchedScopes[scope]) {
29923               throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
29924             }
29925           });
29926
29927           modules.unshift(fromParentModule);
29928         }
29929
29930         return new Injector(modules, self);
29931       };
29932
29933       var factoryMap = {
29934         factory: invoke,
29935         type: instantiate,
29936         value: function(value) {
29937           return value;
29938         }
29939       };
29940
29941       modules.forEach(function(module) {
29942
29943         function arrayUnwrap(type, value) {
29944           if (type !== 'value' && isArray(value)) {
29945             value = annotate(value.slice());
29946           }
29947
29948           return value;
29949         }
29950
29951         // TODO(vojta): handle wrong inputs (modules)
29952         if (module instanceof Module) {
29953           module.forEach(function(provider) {
29954             var name = provider[0];
29955             var type = provider[1];
29956             var value = provider[2];
29957
29958             providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
29959           });
29960         } else if (typeof module === 'object') {
29961           if (module.__exports__) {
29962             var clonedModule = Object.keys(module).reduce(function(m, key) {
29963               if (key.substring(0, 2) !== '__') {
29964                 m[key] = module[key];
29965               }
29966               return m;
29967             }, Object.create(null));
29968
29969             var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);
29970             var getFromPrivateInjector = annotate(function(key) {
29971               return privateInjector.get(key);
29972             });
29973             module.__exports__.forEach(function(key) {
29974               providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
29975             });
29976           } else {
29977             Object.keys(module).forEach(function(name) {
29978               if (module[name][2] === 'private') {
29979                 providers[name] = module[name];
29980                 return;
29981               }
29982
29983               var type = module[name][0];
29984               var value = module[name][1];
29985
29986               providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
29987             });
29988           }
29989         }
29990       });
29991
29992       // public API
29993       this.get = get;
29994       this.invoke = invoke;
29995       this.instantiate = instantiate;
29996       this.createChild = createChild;
29997     };
29998
29999     module.exports = Injector;
30000
30001   }, {
30002     "./annotation": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js",
30003     "./module": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js"
30004   }],
30005   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js": [function(require, module, exports) {
30006     var Module = function() {
30007       var providers = [];
30008
30009       this.factory = function(name, factory) {
30010         providers.push([name, 'factory', factory]);
30011         return this;
30012       };
30013
30014       this.value = function(name, value) {
30015         providers.push([name, 'value', value]);
30016         return this;
30017       };
30018
30019       this.type = function(name, type) {
30020         providers.push([name, 'type', type]);
30021         return this;
30022       };
30023
30024       this.forEach = function(iterator) {
30025         providers.forEach(iterator);
30026       };
30027     };
30028
30029     module.exports = Module;
30030
30031   }, {}],
30032   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\eve\\eve.js": [function(require, module, exports) {
30033     // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
30034     //
30035     // Licensed under the Apache License, Version 2.0 (the "License");
30036     // you may not use this file except in compliance with the License.
30037     // You may obtain a copy of the License at
30038     //
30039     // http://www.apache.org/licenses/LICENSE-2.0
30040     //
30041     // Unless required by applicable law or agreed to in writing, software
30042     // distributed under the License is distributed on an "AS IS" BASIS,
30043     // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30044     // See the License for the specific language governing permissions and
30045     // limitations under the License.
30046     // ÃƒÆ’¢â€�Ήâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�Â�
30047     // \\
30048     // ÃƒÆ’¢â€�‚ Eve 0.4.2 - JavaScript Events Library ÃƒÆ’¢â€�‚ \\
30049     // ÃƒÆ’¢â€�ωâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�¤
30050     // \\
30051     // ÃƒÆ’¢â€�‚ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) ÃƒÆ’¢â€�‚
30052     // \\
30053     // ÃƒÆ’¢â€�â€�ââ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�Ëœ
30054     // \\
30055
30056     (function(glob) {
30057       var version = "0.4.2",
30058         has = "hasOwnProperty",
30059         separator = /[\.\/]/,
30060         comaseparator = /\s*,\s*/,
30061         wildcard = "*",
30062         fun = function() {},
30063         numsort = function(a, b) {
30064           return a - b;
30065         },
30066         current_event,
30067         stop,
30068         events = {
30069           n: {}
30070         },
30071         firstDefined = function() {
30072           for (var i = 0, ii = this.length; i < ii; i++) {
30073             if (typeof this[i] != "undefined") {
30074               return this[i];
30075             }
30076           }
30077         },
30078         lastDefined = function() {
30079           var i = this.length;
30080           while (--i) {
30081             if (typeof this[i] != "undefined") {
30082               return this[i];
30083             }
30084           }
30085         },
30086         /*
30087          * \ eve [ method ]
30088          *
30089          * Fires event with given `name`, given scope and other parameters.
30090          *  > Arguments
30091          *  - name (string) name of the *event*, dot (`.`) or slash (`/`) separated -
30092          * scope (object) context for the event handlers - varargs (...) the rest of
30093          * arguments will be sent to event handlers
30094          *  = (object) array of returned values from the listeners. Array has two
30095          * methods `.firstDefined()` and `.lastDefined()` to get first or last not
30096          * `undefined` value. \
30097          */
30098         eve = function(name, scope) {
30099           name = String(name);
30100           var e = events,
30101             oldstop = stop,
30102             args = Array.prototype.slice.call(arguments, 2),
30103             listeners = eve.listeners(name),
30104             z = 0,
30105             f = false,
30106             l,
30107             indexed = [],
30108             queue = {},
30109             out = [],
30110             ce = current_event,
30111             errors = [];
30112           out.firstDefined = firstDefined;
30113           out.lastDefined = lastDefined;
30114           current_event = name;
30115           stop = 0;
30116           for (var i = 0, ii = listeners.length; i < ii; i++)
30117             if ("zIndex" in listeners[i]) {
30118               indexed.push(listeners[i].zIndex);
30119               if (listeners[i].zIndex < 0) {
30120                 queue[listeners[i].zIndex] = listeners[i];
30121               }
30122             }
30123           indexed.sort(numsort);
30124           while (indexed[z] < 0) {
30125             l = queue[indexed[z++]];
30126             out.push(l.apply(scope, args));
30127             if (stop) {
30128               stop = oldstop;
30129               return out;
30130             }
30131           }
30132           for (i = 0; i < ii; i++) {
30133             l = listeners[i];
30134             if ("zIndex" in l) {
30135               if (l.zIndex == indexed[z]) {
30136                 out.push(l.apply(scope, args));
30137                 if (stop) {
30138                   break;
30139                 }
30140                 do {
30141                   z++;
30142                   l = queue[indexed[z]];
30143                   l && out.push(l.apply(scope, args));
30144                   if (stop) {
30145                     break;
30146                   }
30147                 } while (l)
30148               } else {
30149                 queue[l.zIndex] = l;
30150               }
30151             } else {
30152               out.push(l.apply(scope, args));
30153               if (stop) {
30154                 break;
30155               }
30156             }
30157           }
30158           stop = oldstop;
30159           current_event = ce;
30160           return out;
30161         };
30162       // Undocumented. Debug only.
30163       eve._events = events;
30164       /*
30165        * \ eve.listeners [ method ]
30166        *
30167        * Internal method which gives you array of all event handlers that will be
30168        * triggered by the given `name`.
30169        *  > Arguments
30170        *  - name (string) name of the event, dot (`.`) or slash (`/`) separated
30171        *  = (array) array of event handlers \
30172        */
30173       eve.listeners = function(name) {
30174         var names = name.split(separator),
30175           e = events,
30176           item,
30177           items,
30178           k,
30179           i,
30180           ii,
30181           j,
30182           jj,
30183           nes,
30184           es = [e],
30185           out = [];
30186         for (i = 0, ii = names.length; i < ii; i++) {
30187           nes = [];
30188           for (j = 0, jj = es.length; j < jj; j++) {
30189             e = es[j].n;
30190             items = [e[names[i]], e[wildcard]];
30191             k = 2;
30192             while (k--) {
30193               item = items[k];
30194               if (item) {
30195                 nes.push(item);
30196                 out = out.concat(item.f || []);
30197               }
30198             }
30199           }
30200           es = nes;
30201         }
30202         return out;
30203       };
30204
30205       /*
30206        * \ eve.on [ method ] * Binds given event handler with a given name. You
30207        * can use wildcards ÃƒÆ’¢â‚¬Å“`*`� for the names: | eve.on("*.under.*",
30208        * f); | eve("mouse.under.floor"); // triggers f Use @eve to trigger the
30209        * listener. * > Arguments * - name (string) name of the event, dot (`.`) or
30210        * slash (`/`) separated, with optional wildcards - f (function) event
30211        * handler function * = (function) returned function accepts a single
30212        * numeric parameter that represents z-index of the handler. It is an
30213        * optional feature and only used when you need to ensure that some subset
30214        * of handlers will be invoked in a given order, despite of the order of
30215        * assignment. > Example: | eve.on("mouse", eatIt)(2); | eve.on("mouse",
30216        * scream); | eve.on("mouse", catchIt)(1); This will ensure that `catchIt`
30217        * function will be called before `eatIt`.
30218        *
30219        * If you want to put your handler before non-indexed handlers, specify a
30220        * negative value. Note: I assume most of the time you don’t need to
30221        * worry about z-index, but it’s nice to have this feature
30222        * ÃƒÆ’¢â‚¬Å“just in case�. \
30223        */
30224       eve.on = function(name, f) {
30225         name = String(name);
30226         if (typeof f != "function") {
30227           return function() {};
30228         }
30229         var names = name.split(comaseparator);
30230         for (var i = 0, ii = names.length; i < ii; i++) {
30231           (function(name) {
30232             var names = name.split(separator),
30233               e = events,
30234               exist;
30235             for (var i = 0, ii = names.length; i < ii; i++) {
30236               e = e.n;
30237               e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {
30238                 n: {}
30239               });
30240             }
30241             e.f = e.f || [];
30242             for (i = 0, ii = e.f.length; i < ii; i++)
30243               if (e.f[i] == f) {
30244                 exist = true;
30245                 break;
30246               }!exist && e.f.push(f);
30247           }(names[i]));
30248         }
30249         return function(zIndex) {
30250           if (+zIndex == +zIndex) {
30251             f.zIndex = +zIndex;
30252           }
30253         };
30254       };
30255       /*
30256        * \ eve.f [ method ] * Returns function that will fire given event with
30257        * optional arguments. Arguments that will be passed to the result function
30258        * will be also concated to the list of final arguments. | el.onclick =
30259        * eve.f("click", 1, 2); | eve.on("click", function (a, b, c) { |
30260        * console.log(a, b, c); // 1, 2, [event object] | }); > Arguments - event
30261        * (string) event name - varargs (…) and any other arguments =
30262        * (function) possible event handler function \
30263        */
30264       eve.f = function(event) {
30265         var attrs = [].slice.call(arguments, 1);
30266         return function() {
30267           eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
30268         };
30269       };
30270       /*
30271        * \ eve.stop [ method ] * Is used inside an event handler to stop the
30272        * event, preventing any subsequent listeners from firing. \
30273        */
30274       eve.stop = function() {
30275         stop = 1;
30276       };
30277       /*
30278        * \ eve.nt [ method ] * Could be used inside event handler to figure out
30279        * actual name of the event. * > Arguments * - subname (string) #optional
30280        * subname of the event * = (string) name of the event, if `subname` is not
30281        * specified or = (boolean) `true`, if current event’s name contains
30282        * `subname` \
30283        */
30284       eve.nt = function(subname) {
30285         if (subname) {
30286           return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
30287         }
30288         return current_event;
30289       };
30290       /*
30291        * \ eve.nts [ method ] * Could be used inside event handler to figure out
30292        * actual name of the event. * * = (array) names of the event \
30293        */
30294       eve.nts = function() {
30295         return current_event.split(separator);
30296       };
30297       /*
30298        * \ eve.off [ method ] * Removes given function from the list of event
30299        * listeners assigned to given name. If no arguments specified all the
30300        * events will be cleared. * > Arguments * - name (string) name of the
30301        * event, dot (`.`) or slash (`/`) separated, with optional wildcards - f
30302        * (function) event handler function \
30303        */
30304       /*
30305        * \ eve.unbind [ method ] * See @eve.off \
30306        */
30307       eve.off = eve.unbind = function(name, f) {
30308         if (!name) {
30309           eve._events = events = {
30310             n: {}
30311           };
30312           return;
30313         }
30314         var names = name.split(comaseparator);
30315         if (names.length > 1) {
30316           for (var i = 0, ii = names.length; i < ii; i++) {
30317             eve.off(names[i], f);
30318           }
30319           return;
30320         }
30321         names = name.split(separator);
30322         var e,
30323           key,
30324           splice,
30325           i, ii, j, jj,
30326           cur = [events];
30327         for (i = 0, ii = names.length; i < ii; i++) {
30328           for (j = 0; j < cur.length; j += splice.length - 2) {
30329             splice = [j, 1];
30330             e = cur[j].n;
30331             if (names[i] != wildcard) {
30332               if (e[names[i]]) {
30333                 splice.push(e[names[i]]);
30334               }
30335             } else {
30336               for (key in e)
30337                 if (e[has](key)) {
30338                   splice.push(e[key]);
30339                 }
30340             }
30341             cur.splice.apply(cur, splice);
30342           }
30343         }
30344         for (i = 0, ii = cur.length; i < ii; i++) {
30345           e = cur[i];
30346           while (e.n) {
30347             if (f) {
30348               if (e.f) {
30349                 for (j = 0, jj = e.f.length; j < jj; j++)
30350                   if (e.f[j] == f) {
30351                     e.f.splice(j, 1);
30352                     break;
30353                   }!e.f.length && delete e.f;
30354               }
30355               for (key in e.n)
30356                 if (e.n[has](key) && e.n[key].f) {
30357                   var funcs = e.n[key].f;
30358                   for (j = 0, jj = funcs.length; j < jj; j++)
30359                     if (funcs[j] == f) {
30360                       funcs.splice(j, 1);
30361                       break;
30362                     }!funcs.length && delete e.n[key].f;
30363                 }
30364             } else {
30365               delete e.f;
30366               for (key in e.n)
30367                 if (e.n[has](key) && e.n[key].f) {
30368                   delete e.n[key].f;
30369                 }
30370             }
30371             e = e.n;
30372           }
30373         }
30374       };
30375       /*
30376        * \ eve.once [ method ] * Binds given event handler with a given name to
30377        * only run once then unbind itself. | eve.once("login", f); | eve("login"); //
30378        * triggers f | eve("login"); // no listeners Use @eve to trigger the
30379        * listener. * > Arguments * - name (string) name of the event, dot (`.`) or
30380        * slash (`/`) separated, with optional wildcards - f (function) event
30381        * handler function * = (function) same return function as @eve.on \
30382        */
30383       eve.once = function(name, f) {
30384         var f2 = function() {
30385           eve.unbind(name, f2);
30386           return f.apply(this, arguments);
30387         };
30388         return eve.on(name, f2);
30389       };
30390       /*
30391        * \ eve.version [ property (string) ] * Current version of the library. \
30392        */
30393       eve.version = version;
30394       eve.toString = function() {
30395         return "You are running Eve " + version;
30396       };
30397       (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (typeof define === "function" && define.amd ? (define("eve", [], function() {
30398         return eve;
30399       })) : (glob.eve = eve));
30400     })(this);
30401
30402   }, {}],
30403   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\hammerjs\\hammer.js": [function(require, module, exports) {
30404     /*
30405      * ! Hammer.JS - v2.0.4 - 2014-09-28 http://hammerjs.github.io/
30406      *
30407      * Copyright (c) 2014 Jorik Tangelder; Licensed under the MIT license
30408      */
30409     (function(window, document, exportName, undefined) {
30410       'use strict';
30411
30412       var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
30413       var TEST_ELEMENT = document.createElement('div');
30414
30415       var TYPE_FUNCTION = 'function';
30416
30417       var round = Math.round;
30418       var abs = Math.abs;
30419       var now = Date.now;
30420
30421       /**
30422        * set a timeout with a given scope
30423        *
30424        * @param {Function}
30425        *            fn
30426        * @param {Number}
30427        *            timeout
30428        * @param {Object}
30429        *            context
30430        * @returns {number}
30431        */
30432       function setTimeoutContext(fn, timeout, context) {
30433         return setTimeout(bindFn(fn, context), timeout);
30434       }
30435
30436       /**
30437        * if the argument is an array, we want to execute the fn on each entry if it
30438        * aint an array we don't want to do a thing. this is used by all the methods
30439        * that accept a single and array argument.
30440        *
30441        * @param {*|Array}
30442        *            arg
30443        * @param {String}
30444        *            fn
30445        * @param {Object}
30446        *            [context]
30447        * @returns {Boolean}
30448        */
30449       function invokeArrayArg(arg, fn, context) {
30450         if (Array.isArray(arg)) {
30451           each(arg, context[fn], context);
30452           return true;
30453         }
30454         return false;
30455       }
30456
30457       /**
30458        * walk objects and arrays
30459        *
30460        * @param {Object}
30461        *            obj
30462        * @param {Function}
30463        *            iterator
30464        * @param {Object}
30465        *            context
30466        */
30467       function each(obj, iterator, context) {
30468         var i;
30469
30470         if (!obj) {
30471           return;
30472         }
30473
30474         if (obj.forEach) {
30475           obj.forEach(iterator, context);
30476         } else if (obj.length !== undefined) {
30477           i = 0;
30478           while (i < obj.length) {
30479             iterator.call(context, obj[i], i, obj);
30480             i++;
30481           }
30482         } else {
30483           for (i in obj) {
30484             obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
30485           }
30486         }
30487       }
30488
30489       /**
30490        * extend object. means that properties in dest will be overwritten by the ones
30491        * in src.
30492        *
30493        * @param {Object}
30494        *            dest
30495        * @param {Object}
30496        *            src
30497        * @param {Boolean}
30498        *            [merge]
30499        * @returns {Object} dest
30500        */
30501       function extend(dest, src, merge) {
30502         var keys = Object.keys(src);
30503         var i = 0;
30504         while (i < keys.length) {
30505           if (!merge || (merge && dest[keys[i]] === undefined)) {
30506             dest[keys[i]] = src[keys[i]];
30507           }
30508           i++;
30509         }
30510         return dest;
30511       }
30512
30513       /**
30514        * merge the values from src in the dest. means that properties that exist in
30515        * dest will not be overwritten by src
30516        *
30517        * @param {Object}
30518        *            dest
30519        * @param {Object}
30520        *            src
30521        * @returns {Object} dest
30522        */
30523       function merge(dest, src) {
30524         return extend(dest, src, true);
30525       }
30526
30527       /**
30528        * simple class inheritance
30529        *
30530        * @param {Function}
30531        *            child
30532        * @param {Function}
30533        *            base
30534        * @param {Object}
30535        *            [properties]
30536        */
30537       function inherit(child, base, properties) {
30538         var baseP = base.prototype,
30539           childP;
30540
30541         childP = child.prototype = Object.create(baseP);
30542         childP.constructor = child;
30543         childP._super = baseP;
30544
30545         if (properties) {
30546           extend(childP, properties);
30547         }
30548       }
30549
30550       /**
30551        * simple function bind
30552        *
30553        * @param {Function}
30554        *            fn
30555        * @param {Object}
30556        *            context
30557        * @returns {Function}
30558        */
30559       function bindFn(fn, context) {
30560         return function boundFn() {
30561           return fn.apply(context, arguments);
30562         };
30563       }
30564
30565       /**
30566        * let a boolean value also be a function that must return a boolean this first
30567        * item in args will be used as the context
30568        *
30569        * @param {Boolean|Function}
30570        *            val
30571        * @param {Array}
30572        *            [args]
30573        * @returns {Boolean}
30574        */
30575       function boolOrFn(val, args) {
30576         if (typeof val == TYPE_FUNCTION) {
30577           return val.apply(args ? args[0] || undefined : undefined, args);
30578         }
30579         return val;
30580       }
30581
30582       /**
30583        * use the val2 when val1 is undefined
30584        *
30585        * @param {*}
30586        *            val1
30587        * @param {*}
30588        *            val2
30589        * @returns {*}
30590        */
30591       function ifUndefined(val1, val2) {
30592         return (val1 === undefined) ? val2 : val1;
30593       }
30594
30595       /**
30596        * addEventListener with multiple events at once
30597        *
30598        * @param {EventTarget}
30599        *            target
30600        * @param {String}
30601        *            types
30602        * @param {Function}
30603        *            handler
30604        */
30605       function addEventListeners(target, types, handler) {
30606         each(splitStr(types), function(type) {
30607           target.addEventListener(type, handler, false);
30608         });
30609       }
30610
30611       /**
30612        * removeEventListener with multiple events at once
30613        *
30614        * @param {EventTarget}
30615        *            target
30616        * @param {String}
30617        *            types
30618        * @param {Function}
30619        *            handler
30620        */
30621       function removeEventListeners(target, types, handler) {
30622         each(splitStr(types), function(type) {
30623           target.removeEventListener(type, handler, false);
30624         });
30625       }
30626
30627       /**
30628        * find if a node is in the given parent
30629        *
30630        * @method hasParent
30631        * @param {HTMLElement}
30632        *            node
30633        * @param {HTMLElement}
30634        *            parent
30635        * @return {Boolean} found
30636        */
30637       function hasParent(node, parent) {
30638         while (node) {
30639           if (node == parent) {
30640             return true;
30641           }
30642           node = node.parentNode;
30643         }
30644         return false;
30645       }
30646
30647       /**
30648        * small indexOf wrapper
30649        *
30650        * @param {String}
30651        *            str
30652        * @param {String}
30653        *            find
30654        * @returns {Boolean} found
30655        */
30656       function inStr(str, find) {
30657         return str.indexOf(find) > -1;
30658       }
30659
30660       /**
30661        * split string on whitespace
30662        *
30663        * @param {String}
30664        *            str
30665        * @returns {Array} words
30666        */
30667       function splitStr(str) {
30668         return str.trim().split(/\s+/g);
30669       }
30670
30671       /**
30672        * find if a array contains the object using indexOf or a simple polyFill
30673        *
30674        * @param {Array}
30675        *            src
30676        * @param {String}
30677        *            find
30678        * @param {String}
30679        *            [findByKey]
30680        * @return {Boolean|Number} false when not found, or the index
30681        */
30682       function inArray(src, find, findByKey) {
30683         if (src.indexOf && !findByKey) {
30684           return src.indexOf(find);
30685         } else {
30686           var i = 0;
30687           while (i < src.length) {
30688             if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
30689               return i;
30690             }
30691             i++;
30692           }
30693           return -1;
30694         }
30695       }
30696
30697       /**
30698        * convert array-like objects to real arrays
30699        *
30700        * @param {Object}
30701        *            obj
30702        * @returns {Array}
30703        */
30704       function toArray(obj) {
30705         return Array.prototype.slice.call(obj, 0);
30706       }
30707
30708       /**
30709        * unique array with objects based on a key (like 'id') or just by the array's
30710        * value
30711        *
30712        * @param {Array}
30713        *            src [{id:1},{id:2},{id:1}]
30714        * @param {String}
30715        *            [key]
30716        * @param {Boolean}
30717        *            [sort=False]
30718        * @returns {Array} [{id:1},{id:2}]
30719        */
30720       function uniqueArray(src, key, sort) {
30721         var results = [];
30722         var values = [];
30723         var i = 0;
30724
30725         while (i < src.length) {
30726           var val = key ? src[i][key] : src[i];
30727           if (inArray(values, val) < 0) {
30728             results.push(src[i]);
30729           }
30730           values[i] = val;
30731           i++;
30732         }
30733
30734         if (sort) {
30735           if (!key) {
30736             results = results.sort();
30737           } else {
30738             results = results.sort(function sortUniqueArray(a, b) {
30739               return a[key] > b[key];
30740             });
30741           }
30742         }
30743
30744         return results;
30745       }
30746
30747       /**
30748        * get the prefixed property
30749        *
30750        * @param {Object}
30751        *            obj
30752        * @param {String}
30753        *            property
30754        * @returns {String|Undefined} prefixed
30755        */
30756       function prefixed(obj, property) {
30757         var prefix, prop;
30758         var camelProp = property[0].toUpperCase() + property.slice(1);
30759
30760         var i = 0;
30761         while (i < VENDOR_PREFIXES.length) {
30762           prefix = VENDOR_PREFIXES[i];
30763           prop = (prefix) ? prefix + camelProp : property;
30764
30765           if (prop in obj) {
30766             return prop;
30767           }
30768           i++;
30769         }
30770         return undefined;
30771       }
30772
30773       /**
30774        * get a unique id
30775        *
30776        * @returns {number} uniqueId
30777        */
30778       var _uniqueId = 1;
30779
30780       function uniqueId() {
30781         return _uniqueId++;
30782       }
30783
30784       /**
30785        * get the window object of an element
30786        *
30787        * @param {HTMLElement}
30788        *            element
30789        * @returns {DocumentView|Window}
30790        */
30791       function getWindowForElement(element) {
30792         var doc = element.ownerDocument;
30793         return (doc.defaultView || doc.parentWindow);
30794       }
30795
30796       var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
30797
30798       var SUPPORT_TOUCH = ('ontouchstart' in window);
30799       var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
30800       var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
30801
30802       var INPUT_TYPE_TOUCH = 'touch';
30803       var INPUT_TYPE_PEN = 'pen';
30804       var INPUT_TYPE_MOUSE = 'mouse';
30805       var INPUT_TYPE_KINECT = 'kinect';
30806
30807       var COMPUTE_INTERVAL = 25;
30808
30809       var INPUT_START = 1;
30810       var INPUT_MOVE = 2;
30811       var INPUT_END = 4;
30812       var INPUT_CANCEL = 8;
30813
30814       var DIRECTION_NONE = 1;
30815       var DIRECTION_LEFT = 2;
30816       var DIRECTION_RIGHT = 4;
30817       var DIRECTION_UP = 8;
30818       var DIRECTION_DOWN = 16;
30819
30820       var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
30821       var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
30822       var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
30823
30824       var PROPS_XY = ['x', 'y'];
30825       var PROPS_CLIENT_XY = ['clientX', 'clientY'];
30826
30827       /**
30828        * create new input type manager
30829        *
30830        * @param {Manager}
30831        *            manager
30832        * @param {Function}
30833        *            callback
30834        * @returns {Input}
30835        * @constructor
30836        */
30837       function Input(manager, callback) {
30838         var self = this;
30839         this.manager = manager;
30840         this.callback = callback;
30841         this.element = manager.element;
30842         this.target = manager.options.inputTarget;
30843
30844         // smaller wrapper around the handler, for the scope and the enabled state
30845         // of the manager,
30846         // so when disabled the input events are completely bypassed.
30847         this.domHandler = function(ev) {
30848           if (boolOrFn(manager.options.enable, [manager])) {
30849             self.handler(ev);
30850           }
30851         };
30852
30853         this.init();
30854
30855       }
30856
30857       Input.prototype = {
30858         /**
30859          * should handle the inputEvent data and trigger the callback
30860          *
30861          * @virtual
30862          */
30863         handler: function() {},
30864
30865         /**
30866          * bind the events
30867          */
30868         init: function() {
30869           this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
30870           this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
30871           this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
30872         },
30873
30874         /**
30875          * unbind the events
30876          */
30877         destroy: function() {
30878           this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
30879           this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
30880           this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
30881         }
30882       };
30883
30884       /**
30885        * create new input type manager called by the Manager constructor
30886        *
30887        * @param {Hammer}
30888        *            manager
30889        * @returns {Input}
30890        */
30891       function createInputInstance(manager) {
30892         var Type;
30893         var inputClass = manager.options.inputClass;
30894
30895         if (inputClass) {
30896           Type = inputClass;
30897         } else if (SUPPORT_POINTER_EVENTS) {
30898           Type = PointerEventInput;
30899         } else if (SUPPORT_ONLY_TOUCH) {
30900           Type = TouchInput;
30901         } else if (!SUPPORT_TOUCH) {
30902           Type = MouseInput;
30903         } else {
30904           Type = TouchMouseInput;
30905         }
30906         return new(Type)(manager, inputHandler);
30907       }
30908
30909       /**
30910        * handle input events
30911        *
30912        * @param {Manager}
30913        *            manager
30914        * @param {String}
30915        *            eventType
30916        * @param {Object}
30917        *            input
30918        */
30919       function inputHandler(manager, eventType, input) {
30920         var pointersLen = input.pointers.length;
30921         var changedPointersLen = input.changedPointers.length;
30922         var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
30923         var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
30924
30925         input.isFirst = !!isFirst;
30926         input.isFinal = !!isFinal;
30927
30928         if (isFirst) {
30929           manager.session = {};
30930         }
30931
30932         // source event is the normalized value of the domEvents
30933         // like 'touchstart, mouseup, pointerdown'
30934         input.eventType = eventType;
30935
30936         // compute scale, rotation etc
30937         computeInputData(manager, input);
30938
30939         // emit secret event
30940         manager.emit('hammer.input', input);
30941
30942         manager.recognize(input);
30943         manager.session.prevInput = input;
30944       }
30945
30946       /**
30947        * extend the data with some usable properties like scale, rotate, velocity etc
30948        *
30949        * @param {Object}
30950        *            manager
30951        * @param {Object}
30952        *            input
30953        */
30954       function computeInputData(manager, input) {
30955         var session = manager.session;
30956         var pointers = input.pointers;
30957         var pointersLength = pointers.length;
30958
30959         // store the first input to calculate the distance and direction
30960         if (!session.firstInput) {
30961           session.firstInput = simpleCloneInputData(input);
30962         }
30963
30964         // to compute scale and rotation we need to store the multiple touches
30965         if (pointersLength > 1 && !session.firstMultiple) {
30966           session.firstMultiple = simpleCloneInputData(input);
30967         } else if (pointersLength === 1) {
30968           session.firstMultiple = false;
30969         }
30970
30971         var firstInput = session.firstInput;
30972         var firstMultiple = session.firstMultiple;
30973         var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
30974
30975         var center = input.center = getCenter(pointers);
30976         input.timeStamp = now();
30977         input.deltaTime = input.timeStamp - firstInput.timeStamp;
30978
30979         input.angle = getAngle(offsetCenter, center);
30980         input.distance = getDistance(offsetCenter, center);
30981
30982         computeDeltaXY(session, input);
30983         input.offsetDirection = getDirection(input.deltaX, input.deltaY);
30984
30985         input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
30986         input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
30987
30988         computeIntervalInputData(session, input);
30989
30990         // find the correct target
30991         var target = manager.element;
30992         if (hasParent(input.srcEvent.target, target)) {
30993           target = input.srcEvent.target;
30994         }
30995         input.target = target;
30996       }
30997
30998       function computeDeltaXY(session, input) {
30999         var center = input.center;
31000         var offset = session.offsetDelta || {};
31001         var prevDelta = session.prevDelta || {};
31002         var prevInput = session.prevInput || {};
31003
31004         if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
31005           prevDelta = session.prevDelta = {
31006             x: prevInput.deltaX || 0,
31007             y: prevInput.deltaY || 0
31008           };
31009
31010           offset = session.offsetDelta = {
31011             x: center.x,
31012             y: center.y
31013           };
31014         }
31015
31016         input.deltaX = prevDelta.x + (center.x - offset.x);
31017         input.deltaY = prevDelta.y + (center.y - offset.y);
31018       }
31019
31020       /**
31021        * velocity is calculated every x ms
31022        *
31023        * @param {Object}
31024        *            session
31025        * @param {Object}
31026        *            input
31027        */
31028       function computeIntervalInputData(session, input) {
31029         var last = session.lastInterval || input,
31030           deltaTime = input.timeStamp - last.timeStamp,
31031           velocity, velocityX, velocityY, direction;
31032
31033         if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
31034           var deltaX = last.deltaX - input.deltaX;
31035           var deltaY = last.deltaY - input.deltaY;
31036
31037           var v = getVelocity(deltaTime, deltaX, deltaY);
31038           velocityX = v.x;
31039           velocityY = v.y;
31040           velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
31041           direction = getDirection(deltaX, deltaY);
31042
31043           session.lastInterval = input;
31044         } else {
31045           // use latest velocity info if it doesn't overtake a minimum period
31046           velocity = last.velocity;
31047           velocityX = last.velocityX;
31048           velocityY = last.velocityY;
31049           direction = last.direction;
31050         }
31051
31052         input.velocity = velocity;
31053         input.velocityX = velocityX;
31054         input.velocityY = velocityY;
31055         input.direction = direction;
31056       }
31057
31058       /**
31059        * create a simple clone from the input used for storage of firstInput and
31060        * firstMultiple
31061        *
31062        * @param {Object}
31063        *            input
31064        * @returns {Object} clonedInputData
31065        */
31066       function simpleCloneInputData(input) {
31067         // make a simple copy of the pointers because we will get a reference if we
31068         // don't
31069         // we only need clientXY for the calculations
31070         var pointers = [];
31071         var i = 0;
31072         while (i < input.pointers.length) {
31073           pointers[i] = {
31074             clientX: round(input.pointers[i].clientX),
31075             clientY: round(input.pointers[i].clientY)
31076           };
31077           i++;
31078         }
31079
31080         return {
31081           timeStamp: now(),
31082           pointers: pointers,
31083           center: getCenter(pointers),
31084           deltaX: input.deltaX,
31085           deltaY: input.deltaY
31086         };
31087       }
31088
31089       /**
31090        * get the center of all the pointers
31091        *
31092        * @param {Array}
31093        *            pointers
31094        * @return {Object} center contains `x` and `y` properties
31095        */
31096       function getCenter(pointers) {
31097         var pointersLength = pointers.length;
31098
31099         // no need to loop when only one touch
31100         if (pointersLength === 1) {
31101           return {
31102             x: round(pointers[0].clientX),
31103             y: round(pointers[0].clientY)
31104           };
31105         }
31106
31107         var x = 0,
31108           y = 0,
31109           i = 0;
31110         while (i < pointersLength) {
31111           x += pointers[i].clientX;
31112           y += pointers[i].clientY;
31113           i++;
31114         }
31115
31116         return {
31117           x: round(x / pointersLength),
31118           y: round(y / pointersLength)
31119         };
31120       }
31121
31122       /**
31123        * calculate the velocity between two points. unit is in px per ms.
31124        *
31125        * @param {Number}
31126        *            deltaTime
31127        * @param {Number}
31128        *            x
31129        * @param {Number}
31130        *            y
31131        * @return {Object} velocity `x` and `y`
31132        */
31133       function getVelocity(deltaTime, x, y) {
31134         return {
31135           x: x / deltaTime || 0,
31136           y: y / deltaTime || 0
31137         };
31138       }
31139
31140       /**
31141        * get the direction between two points
31142        *
31143        * @param {Number}
31144        *            x
31145        * @param {Number}
31146        *            y
31147        * @return {Number} direction
31148        */
31149       function getDirection(x, y) {
31150         if (x === y) {
31151           return DIRECTION_NONE;
31152         }
31153
31154         if (abs(x) >= abs(y)) {
31155           return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
31156         }
31157         return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;
31158       }
31159
31160       /**
31161        * calculate the absolute distance between two points
31162        *
31163        * @param {Object}
31164        *            p1 {x, y}
31165        * @param {Object}
31166        *            p2 {x, y}
31167        * @param {Array}
31168        *            [props] containing x and y keys
31169        * @return {Number} distance
31170        */
31171       function getDistance(p1, p2, props) {
31172         if (!props) {
31173           props = PROPS_XY;
31174         }
31175         var x = p2[props[0]] - p1[props[0]],
31176           y = p2[props[1]] - p1[props[1]];
31177
31178         return Math.sqrt((x * x) + (y * y));
31179       }
31180
31181       /**
31182        * calculate the angle between two coordinates
31183        *
31184        * @param {Object}
31185        *            p1
31186        * @param {Object}
31187        *            p2
31188        * @param {Array}
31189        *            [props] containing x and y keys
31190        * @return {Number} angle
31191        */
31192       function getAngle(p1, p2, props) {
31193         if (!props) {
31194           props = PROPS_XY;
31195         }
31196         var x = p2[props[0]] - p1[props[0]],
31197           y = p2[props[1]] - p1[props[1]];
31198         return Math.atan2(y, x) * 180 / Math.PI;
31199       }
31200
31201       /**
31202        * calculate the rotation degrees between two pointersets
31203        *
31204        * @param {Array}
31205        *            start array of pointers
31206        * @param {Array}
31207        *            end array of pointers
31208        * @return {Number} rotation
31209        */
31210       function getRotation(start, end) {
31211         return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY);
31212       }
31213
31214       /**
31215        * calculate the scale factor between two pointersets no scale is 1, and goes
31216        * down to 0 when pinched together, and bigger when pinched out
31217        *
31218        * @param {Array}
31219        *            start array of pointers
31220        * @param {Array}
31221        *            end array of pointers
31222        * @return {Number} scale
31223        */
31224       function getScale(start, end) {
31225         return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
31226       }
31227
31228       var MOUSE_INPUT_MAP = {
31229         mousedown: INPUT_START,
31230         mousemove: INPUT_MOVE,
31231         mouseup: INPUT_END
31232       };
31233
31234       var MOUSE_ELEMENT_EVENTS = 'mousedown';
31235       var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
31236
31237       /**
31238        * Mouse events input
31239        *
31240        * @constructor
31241        * @extends Input
31242        */
31243       function MouseInput() {
31244         this.evEl = MOUSE_ELEMENT_EVENTS;
31245         this.evWin = MOUSE_WINDOW_EVENTS;
31246
31247         this.allow = true; // used by Input.TouchMouse to disable mouse events
31248         this.pressed = false; // mousedown state
31249
31250         Input.apply(this, arguments);
31251       }
31252
31253       inherit(MouseInput, Input, {
31254         /**
31255          * handle mouse events
31256          *
31257          * @param {Object}
31258          *            ev
31259          */
31260         handler: function MEhandler(ev) {
31261           var eventType = MOUSE_INPUT_MAP[ev.type];
31262
31263           // on start we want to have the left mouse button down
31264           if (eventType & INPUT_START && ev.button === 0) {
31265             this.pressed = true;
31266           }
31267
31268           if (eventType & INPUT_MOVE && ev.which !== 1) {
31269             eventType = INPUT_END;
31270           }
31271
31272           // mouse must be down, and mouse events are allowed (see the TouchMouse
31273           // input)
31274           if (!this.pressed || !this.allow) {
31275             return;
31276           }
31277
31278           if (eventType & INPUT_END) {
31279             this.pressed = false;
31280           }
31281
31282           this.callback(this.manager, eventType, {
31283             pointers: [ev],
31284             changedPointers: [ev],
31285             pointerType: INPUT_TYPE_MOUSE,
31286             srcEvent: ev
31287           });
31288         }
31289       });
31290
31291       var POINTER_INPUT_MAP = {
31292         pointerdown: INPUT_START,
31293         pointermove: INPUT_MOVE,
31294         pointerup: INPUT_END,
31295         pointercancel: INPUT_CANCEL,
31296         pointerout: INPUT_CANCEL
31297       };
31298
31299       // in IE10 the pointer types is defined as an enum
31300       var IE10_POINTER_TYPE_ENUM = {
31301         2: INPUT_TYPE_TOUCH,
31302         3: INPUT_TYPE_PEN,
31303         4: INPUT_TYPE_MOUSE,
31304         5: INPUT_TYPE_KINECT // see
31305         // https://twitter.com/jacobrossi/status/480596438489890816
31306       };
31307
31308       var POINTER_ELEMENT_EVENTS = 'pointerdown';
31309       var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
31310
31311       // IE10 has prefixed support, and case-sensitive
31312       if (window.MSPointerEvent) {
31313         POINTER_ELEMENT_EVENTS = 'MSPointerDown';
31314         POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
31315       }
31316
31317       /**
31318        * Pointer events input
31319        *
31320        * @constructor
31321        * @extends Input
31322        */
31323       function PointerEventInput() {
31324         this.evEl = POINTER_ELEMENT_EVENTS;
31325         this.evWin = POINTER_WINDOW_EVENTS;
31326
31327         Input.apply(this, arguments);
31328
31329         this.store = (this.manager.session.pointerEvents = []);
31330       }
31331
31332       inherit(PointerEventInput, Input, {
31333         /**
31334          * handle mouse events
31335          *
31336          * @param {Object}
31337          *            ev
31338          */
31339         handler: function PEhandler(ev) {
31340           var store = this.store;
31341           var removePointer = false;
31342
31343           var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
31344           var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
31345           var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
31346
31347           var isTouch = (pointerType == INPUT_TYPE_TOUCH);
31348
31349           // get index of the event in the store
31350           var storeIndex = inArray(store, ev.pointerId, 'pointerId');
31351
31352           // start and mouse must be down
31353           if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
31354             if (storeIndex < 0) {
31355               store.push(ev);
31356               storeIndex = store.length - 1;
31357             }
31358           } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
31359             removePointer = true;
31360           }
31361
31362           // it not found, so the pointer hasn't been down (so it's probably a
31363           // hover)
31364           if (storeIndex < 0) {
31365             return;
31366           }
31367
31368           // update the event in the store
31369           store[storeIndex] = ev;
31370
31371           this.callback(this.manager, eventType, {
31372             pointers: store,
31373             changedPointers: [ev],
31374             pointerType: pointerType,
31375             srcEvent: ev
31376           });
31377
31378           if (removePointer) {
31379             // remove from the store
31380             store.splice(storeIndex, 1);
31381           }
31382         }
31383       });
31384
31385       var SINGLE_TOUCH_INPUT_MAP = {
31386         touchstart: INPUT_START,
31387         touchmove: INPUT_MOVE,
31388         touchend: INPUT_END,
31389         touchcancel: INPUT_CANCEL
31390       };
31391
31392       var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
31393       var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
31394
31395       /**
31396        * Touch events input
31397        *
31398        * @constructor
31399        * @extends Input
31400        */
31401       function SingleTouchInput() {
31402         this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
31403         this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
31404         this.started = false;
31405
31406         Input.apply(this, arguments);
31407       }
31408
31409       inherit(SingleTouchInput, Input, {
31410         handler: function TEhandler(ev) {
31411           var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
31412
31413           // should we handle the touch events?
31414           if (type === INPUT_START) {
31415             this.started = true;
31416           }
31417
31418           if (!this.started) {
31419             return;
31420           }
31421
31422           var touches = normalizeSingleTouches.call(this, ev, type);
31423
31424           // when done, reset the started state
31425           if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
31426             this.started = false;
31427           }
31428
31429           this.callback(this.manager, type, {
31430             pointers: touches[0],
31431             changedPointers: touches[1],
31432             pointerType: INPUT_TYPE_TOUCH,
31433             srcEvent: ev
31434           });
31435         }
31436       });
31437
31438       /**
31439        * @this {TouchInput}
31440        * @param {Object}
31441        *            ev
31442        * @param {Number}
31443        *            type flag
31444        * @returns {undefined|Array} [all, changed]
31445        */
31446       function normalizeSingleTouches(ev, type) {
31447         var all = toArray(ev.touches);
31448         var changed = toArray(ev.changedTouches);
31449
31450         if (type & (INPUT_END | INPUT_CANCEL)) {
31451           all = uniqueArray(all.concat(changed), 'identifier', true);
31452         }
31453
31454         return [all, changed];
31455       }
31456
31457       var TOUCH_INPUT_MAP = {
31458         touchstart: INPUT_START,
31459         touchmove: INPUT_MOVE,
31460         touchend: INPUT_END,
31461         touchcancel: INPUT_CANCEL
31462       };
31463
31464       var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
31465
31466       /**
31467        * Multi-user touch events input
31468        *
31469        * @constructor
31470        * @extends Input
31471        */
31472       function TouchInput() {
31473         this.evTarget = TOUCH_TARGET_EVENTS;
31474         this.targetIds = {};
31475
31476         Input.apply(this, arguments);
31477       }
31478
31479       inherit(TouchInput, Input, {
31480         handler: function MTEhandler(ev) {
31481           var type = TOUCH_INPUT_MAP[ev.type];
31482           var touches = getTouches.call(this, ev, type);
31483           if (!touches) {
31484             return;
31485           }
31486
31487           this.callback(this.manager, type, {
31488             pointers: touches[0],
31489             changedPointers: touches[1],
31490             pointerType: INPUT_TYPE_TOUCH,
31491             srcEvent: ev
31492           });
31493         }
31494       });
31495
31496       /**
31497        * @this {TouchInput}
31498        * @param {Object}
31499        *            ev
31500        * @param {Number}
31501        *            type flag
31502        * @returns {undefined|Array} [all, changed]
31503        */
31504       function getTouches(ev, type) {
31505         var allTouches = toArray(ev.touches);
31506         var targetIds = this.targetIds;
31507
31508         // when there is only one touch, the process can be simplified
31509         if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
31510           targetIds[allTouches[0].identifier] = true;
31511           return [allTouches, allTouches];
31512         }
31513
31514         var i,
31515           targetTouches,
31516           changedTouches = toArray(ev.changedTouches),
31517           changedTargetTouches = [],
31518           target = this.target;
31519
31520         // get target touches from touches
31521         targetTouches = allTouches.filter(function(touch) {
31522           return hasParent(touch.target, target);
31523         });
31524
31525         // collect touches
31526         if (type === INPUT_START) {
31527           i = 0;
31528           while (i < targetTouches.length) {
31529             targetIds[targetTouches[i].identifier] = true;
31530             i++;
31531           }
31532         }
31533
31534         // filter changed touches to only contain touches that exist in the
31535         // collected target ids
31536         i = 0;
31537         while (i < changedTouches.length) {
31538           if (targetIds[changedTouches[i].identifier]) {
31539             changedTargetTouches.push(changedTouches[i]);
31540           }
31541
31542           // cleanup removed touches
31543           if (type & (INPUT_END | INPUT_CANCEL)) {
31544             delete targetIds[changedTouches[i].identifier];
31545           }
31546           i++;
31547         }
31548
31549         if (!changedTargetTouches.length) {
31550           return;
31551         }
31552
31553         return [
31554           // merge targetTouches with changedTargetTouches so it contains ALL
31555           // touches, including 'end' and 'cancel'
31556           uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
31557           changedTargetTouches
31558         ];
31559       }
31560
31561       /**
31562        * Combined touch and mouse input
31563        *
31564        * Touch has a higher priority then mouse, and while touching no mouse events
31565        * are allowed. This because touch devices also emit mouse events while doing a
31566        * touch.
31567        *
31568        * @constructor
31569        * @extends Input
31570        */
31571       function TouchMouseInput() {
31572         Input.apply(this, arguments);
31573
31574         var handler = bindFn(this.handler, this);
31575         this.touch = new TouchInput(this.manager, handler);
31576         this.mouse = new MouseInput(this.manager, handler);
31577       }
31578
31579       inherit(TouchMouseInput, Input, {
31580         /**
31581          * handle mouse and touch events
31582          *
31583          * @param {Hammer}
31584          *            manager
31585          * @param {String}
31586          *            inputEvent
31587          * @param {Object}
31588          *            inputData
31589          */
31590         handler: function TMEhandler(manager, inputEvent, inputData) {
31591           var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
31592             isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
31593
31594           // when we're in a touch event, so block all upcoming mouse events
31595           // most mobile browser also emit mouseevents, right after touchstart
31596           if (isTouch) {
31597             this.mouse.allow = false;
31598           } else if (isMouse && !this.mouse.allow) {
31599             return;
31600           }
31601
31602           // reset the allowMouse when we're done
31603           if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
31604             this.mouse.allow = true;
31605           }
31606
31607           this.callback(manager, inputEvent, inputData);
31608         },
31609
31610         /**
31611          * remove the event listeners
31612          */
31613         destroy: function destroy() {
31614           this.touch.destroy();
31615           this.mouse.destroy();
31616         }
31617       });
31618
31619       var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
31620       var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
31621
31622       // magical touchAction value
31623       var TOUCH_ACTION_COMPUTE = 'compute';
31624       var TOUCH_ACTION_AUTO = 'auto';
31625       var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
31626       var TOUCH_ACTION_NONE = 'none';
31627       var TOUCH_ACTION_PAN_X = 'pan-x';
31628       var TOUCH_ACTION_PAN_Y = 'pan-y';
31629
31630       /**
31631        * Touch Action sets the touchAction property or uses the js alternative
31632        *
31633        * @param {Manager}
31634        *            manager
31635        * @param {String}
31636        *            value
31637        * @constructor
31638        */
31639       function TouchAction(manager, value) {
31640         this.manager = manager;
31641         this.set(value);
31642       }
31643
31644       TouchAction.prototype = {
31645         /**
31646          * set the touchAction value on the element or enable the polyfill
31647          *
31648          * @param {String}
31649          *            value
31650          */
31651         set: function(value) {
31652           // find out the touch-action by the event handlers
31653           if (value == TOUCH_ACTION_COMPUTE) {
31654             value = this.compute();
31655           }
31656
31657           if (NATIVE_TOUCH_ACTION) {
31658             this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
31659           }
31660           this.actions = value.toLowerCase().trim();
31661         },
31662
31663         /**
31664          * just re-set the touchAction value
31665          */
31666         update: function() {
31667           this.set(this.manager.options.touchAction);
31668         },
31669
31670         /**
31671          * compute the value for the touchAction property based on the recognizer's
31672          * settings
31673          *
31674          * @returns {String} value
31675          */
31676         compute: function() {
31677           var actions = [];
31678           each(this.manager.recognizers, function(recognizer) {
31679             if (boolOrFn(recognizer.options.enable, [recognizer])) {
31680               actions = actions.concat(recognizer.getTouchAction());
31681             }
31682           });
31683           return cleanTouchActions(actions.join(' '));
31684         },
31685
31686         /**
31687          * this method is called on each input cycle and provides the preventing of
31688          * the browser behavior
31689          *
31690          * @param {Object}
31691          *            input
31692          */
31693         preventDefaults: function(input) {
31694           // not needed with native support for the touchAction property
31695           if (NATIVE_TOUCH_ACTION) {
31696             return;
31697           }
31698
31699           var srcEvent = input.srcEvent;
31700           var direction = input.offsetDirection;
31701
31702           // if the touch action did prevented once this session
31703           if (this.manager.session.prevented) {
31704             srcEvent.preventDefault();
31705             return;
31706           }
31707
31708           var actions = this.actions;
31709           var hasNone = inStr(actions, TOUCH_ACTION_NONE);
31710           var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
31711           var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
31712
31713           if (hasNone ||
31714             (hasPanY && direction & DIRECTION_HORIZONTAL) ||
31715             (hasPanX && direction & DIRECTION_VERTICAL)) {
31716             return this.preventSrc(srcEvent);
31717           }
31718         },
31719
31720         /**
31721          * call preventDefault to prevent the browser's default behavior (scrolling
31722          * in most cases)
31723          *
31724          * @param {Object}
31725          *            srcEvent
31726          */
31727         preventSrc: function(srcEvent) {
31728           this.manager.session.prevented = true;
31729           srcEvent.preventDefault();
31730         }
31731       };
31732
31733       /**
31734        * when the touchActions are collected they are not a valid value, so we need to
31735        * clean things up. *
31736        *
31737        * @param {String}
31738        *            actions
31739        * @returns {*}
31740        */
31741       function cleanTouchActions(actions) {
31742         // none
31743         if (inStr(actions, TOUCH_ACTION_NONE)) {
31744           return TOUCH_ACTION_NONE;
31745         }
31746
31747         var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
31748         var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
31749
31750         // pan-x and pan-y can be combined
31751         if (hasPanX && hasPanY) {
31752           return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y;
31753         }
31754
31755         // pan-x OR pan-y
31756         if (hasPanX || hasPanY) {
31757           return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
31758         }
31759
31760         // manipulation
31761         if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
31762           return TOUCH_ACTION_MANIPULATION;
31763         }
31764
31765         return TOUCH_ACTION_AUTO;
31766       }
31767
31768       /**
31769        * Recognizer flow explained; * All recognizers have the initial state of
31770        * POSSIBLE when a input session starts. The definition of a input session is
31771        * from the first input until the last input, with all it's movement in it. *
31772        * Example session for mouse-input: mousedown -> mousemove -> mouseup
31773        *
31774        * On each recognizing cycle (see Manager.recognize) the .recognize() method is
31775        * executed which determines with state it should be.
31776        *
31777        * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals
31778        * ENDED), it is reset to POSSIBLE to give it another change on the next cycle.
31779        *
31780        * Possible | +-----+---------------+ | | +-----+-----+ | | | | Failed Cancelled |
31781        * +-------+------+ | | Recognized Began | Changed | Ended/Recognized
31782        */
31783       var STATE_POSSIBLE = 1;
31784       var STATE_BEGAN = 2;
31785       var STATE_CHANGED = 4;
31786       var STATE_ENDED = 8;
31787       var STATE_RECOGNIZED = STATE_ENDED;
31788       var STATE_CANCELLED = 16;
31789       var STATE_FAILED = 32;
31790
31791       /**
31792        * Recognizer Every recognizer needs to extend from this class.
31793        *
31794        * @constructor
31795        * @param {Object}
31796        *            options
31797        */
31798       function Recognizer(options) {
31799         this.id = uniqueId();
31800
31801         this.manager = null;
31802         this.options = merge(options || {}, this.defaults);
31803
31804         // default is enable true
31805         this.options.enable = ifUndefined(this.options.enable, true);
31806
31807         this.state = STATE_POSSIBLE;
31808
31809         this.simultaneous = {};
31810         this.requireFail = [];
31811       }
31812
31813       Recognizer.prototype = {
31814         /**
31815          * @virtual
31816          * @type {Object}
31817          */
31818         defaults: {},
31819
31820         /**
31821          * set options
31822          *
31823          * @param {Object}
31824          *            options
31825          * @return {Recognizer}
31826          */
31827         set: function(options) {
31828           extend(this.options, options);
31829
31830           // also update the touchAction, in case something changed about the
31831           // directions/enabled state
31832           this.manager && this.manager.touchAction.update();
31833           return this;
31834         },
31835
31836         /**
31837          * recognize simultaneous with an other recognizer.
31838          *
31839          * @param {Recognizer}
31840          *            otherRecognizer
31841          * @returns {Recognizer} this
31842          */
31843         recognizeWith: function(otherRecognizer) {
31844           if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
31845             return this;
31846           }
31847
31848           var simultaneous = this.simultaneous;
31849           otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31850           if (!simultaneous[otherRecognizer.id]) {
31851             simultaneous[otherRecognizer.id] = otherRecognizer;
31852             otherRecognizer.recognizeWith(this);
31853           }
31854           return this;
31855         },
31856
31857         /**
31858          * drop the simultaneous link. it doesnt remove the link on the other
31859          * recognizer.
31860          *
31861          * @param {Recognizer}
31862          *            otherRecognizer
31863          * @returns {Recognizer} this
31864          */
31865         dropRecognizeWith: function(otherRecognizer) {
31866           if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
31867             return this;
31868           }
31869
31870           otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31871           delete this.simultaneous[otherRecognizer.id];
31872           return this;
31873         },
31874
31875         /**
31876          * recognizer can only run when an other is failing
31877          *
31878          * @param {Recognizer}
31879          *            otherRecognizer
31880          * @returns {Recognizer} this
31881          */
31882         requireFailure: function(otherRecognizer) {
31883           if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
31884             return this;
31885           }
31886
31887           var requireFail = this.requireFail;
31888           otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31889           if (inArray(requireFail, otherRecognizer) === -1) {
31890             requireFail.push(otherRecognizer);
31891             otherRecognizer.requireFailure(this);
31892           }
31893           return this;
31894         },
31895
31896         /**
31897          * drop the requireFailure link. it does not remove the link on the other
31898          * recognizer.
31899          *
31900          * @param {Recognizer}
31901          *            otherRecognizer
31902          * @returns {Recognizer} this
31903          */
31904         dropRequireFailure: function(otherRecognizer) {
31905           if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
31906             return this;
31907           }
31908
31909           otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31910           var index = inArray(this.requireFail, otherRecognizer);
31911           if (index > -1) {
31912             this.requireFail.splice(index, 1);
31913           }
31914           return this;
31915         },
31916
31917         /**
31918          * has require failures boolean
31919          *
31920          * @returns {boolean}
31921          */
31922         hasRequireFailures: function() {
31923           return this.requireFail.length > 0;
31924         },
31925
31926         /**
31927          * if the recognizer can recognize simultaneous with an other recognizer
31928          *
31929          * @param {Recognizer}
31930          *            otherRecognizer
31931          * @returns {Boolean}
31932          */
31933         canRecognizeWith: function(otherRecognizer) {
31934           return !!this.simultaneous[otherRecognizer.id];
31935         },
31936
31937         /**
31938          * You should use `tryEmit` instead of `emit` directly to check that all the
31939          * needed recognizers has failed before emitting.
31940          *
31941          * @param {Object}
31942          *            input
31943          */
31944         emit: function(input) {
31945           var self = this;
31946           var state = this.state;
31947
31948           function emit(withState) {
31949             self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input);
31950           }
31951
31952           // 'panstart' and 'panmove'
31953           if (state < STATE_ENDED) {
31954             emit(true);
31955           }
31956
31957           emit(); // simple 'eventName' events
31958
31959           // panend and pancancel
31960           if (state >= STATE_ENDED) {
31961             emit(true);
31962           }
31963         },
31964
31965         /**
31966          * Check that all the require failure recognizers has failed, if true, it
31967          * emits a gesture event, otherwise, setup the state to FAILED.
31968          *
31969          * @param {Object}
31970          *            input
31971          */
31972         tryEmit: function(input) {
31973           if (this.canEmit()) {
31974             return this.emit(input);
31975           }
31976           // it's failing anyway
31977           this.state = STATE_FAILED;
31978         },
31979
31980         /**
31981          * can we emit?
31982          *
31983          * @returns {boolean}
31984          */
31985         canEmit: function() {
31986           var i = 0;
31987           while (i < this.requireFail.length) {
31988             if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
31989               return false;
31990             }
31991             i++;
31992           }
31993           return true;
31994         },
31995
31996         /**
31997          * update the recognizer
31998          *
31999          * @param {Object}
32000          *            inputData
32001          */
32002         recognize: function(inputData) {
32003           // make a new copy of the inputData
32004           // so we can change the inputData without messing up the other
32005           // recognizers
32006           var inputDataClone = extend({}, inputData);
32007
32008           // is is enabled and allow recognizing?
32009           if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
32010             this.reset();
32011             this.state = STATE_FAILED;
32012             return;
32013           }
32014
32015           // reset when we've reached the end
32016           if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
32017             this.state = STATE_POSSIBLE;
32018           }
32019
32020           this.state = this.process(inputDataClone);
32021
32022           // the recognizer has recognized a gesture
32023           // so trigger an event
32024           if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
32025             this.tryEmit(inputDataClone);
32026           }
32027         },
32028
32029         /**
32030          * return the state of the recognizer the actual recognizing happens in this
32031          * method
32032          *
32033          * @virtual
32034          * @param {Object}
32035          *            inputData
32036          * @returns {Const} STATE
32037          */
32038         process: function(inputData) {}, // jshint ignore:line
32039
32040         /**
32041          * return the preferred touch-action
32042          *
32043          * @virtual
32044          * @returns {Array}
32045          */
32046         getTouchAction: function() {},
32047
32048         /**
32049          * called when the gesture isn't allowed to recognize like when another is
32050          * being recognized or it is disabled
32051          *
32052          * @virtual
32053          */
32054         reset: function() {}
32055       };
32056
32057       /**
32058        * get a usable string, used as event postfix
32059        *
32060        * @param {Const}
32061        *            state
32062        * @returns {String} state
32063        */
32064       function stateStr(state) {
32065         if (state & STATE_CANCELLED) {
32066           return 'cancel';
32067         } else if (state & STATE_ENDED) {
32068           return 'end';
32069         } else if (state & STATE_CHANGED) {
32070           return 'move';
32071         } else if (state & STATE_BEGAN) {
32072           return 'start';
32073         }
32074         return '';
32075       }
32076
32077       /**
32078        * direction cons to string
32079        *
32080        * @param {Const}
32081        *            direction
32082        * @returns {String}
32083        */
32084       function directionStr(direction) {
32085         if (direction == DIRECTION_DOWN) {
32086           return 'down';
32087         } else if (direction == DIRECTION_UP) {
32088           return 'up';
32089         } else if (direction == DIRECTION_LEFT) {
32090           return 'left';
32091         } else if (direction == DIRECTION_RIGHT) {
32092           return 'right';
32093         }
32094         return '';
32095       }
32096
32097       /**
32098        * get a recognizer by name if it is bound to a manager
32099        *
32100        * @param {Recognizer|String}
32101        *            otherRecognizer
32102        * @param {Recognizer}
32103        *            recognizer
32104        * @returns {Recognizer}
32105        */
32106       function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
32107         var manager = recognizer.manager;
32108         if (manager) {
32109           return manager.get(otherRecognizer);
32110         }
32111         return otherRecognizer;
32112       }
32113
32114       /**
32115        * This recognizer is just used as a base for the simple attribute recognizers.
32116        *
32117        * @constructor
32118        * @extends Recognizer
32119        */
32120       function AttrRecognizer() {
32121         Recognizer.apply(this, arguments);
32122       }
32123
32124       inherit(AttrRecognizer, Recognizer, {
32125         /**
32126          * @namespace
32127          * @memberof AttrRecognizer
32128          */
32129         defaults: {
32130           /**
32131            * @type {Number}
32132            * @default 1
32133            */
32134           pointers: 1
32135         },
32136
32137         /**
32138          * Used to check if it the recognizer receives valid input, like
32139          * input.distance > 10.
32140          *
32141          * @memberof AttrRecognizer
32142          * @param {Object}
32143          *            input
32144          * @returns {Boolean} recognized
32145          */
32146         attrTest: function(input) {
32147           var optionPointers = this.options.pointers;
32148           return optionPointers === 0 || input.pointers.length === optionPointers;
32149         },
32150
32151         /**
32152          * Process the input and return the state for the recognizer
32153          *
32154          * @memberof AttrRecognizer
32155          * @param {Object}
32156          *            input
32157          * @returns {*} State
32158          */
32159         process: function(input) {
32160           var state = this.state;
32161           var eventType = input.eventType;
32162
32163           var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
32164           var isValid = this.attrTest(input);
32165
32166           // on cancel input and we've recognized before, return STATE_CANCELLED
32167           if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
32168             return state | STATE_CANCELLED;
32169           } else if (isRecognized || isValid) {
32170             if (eventType & INPUT_END) {
32171               return state | STATE_ENDED;
32172             } else if (!(state & STATE_BEGAN)) {
32173               return STATE_BEGAN;
32174             }
32175             return state | STATE_CHANGED;
32176           }
32177           return STATE_FAILED;
32178         }
32179       });
32180
32181       /**
32182        * Pan Recognized when the pointer is down and moved in the allowed direction.
32183        *
32184        * @constructor
32185        * @extends AttrRecognizer
32186        */
32187       function PanRecognizer() {
32188         AttrRecognizer.apply(this, arguments);
32189
32190         this.pX = null;
32191         this.pY = null;
32192       }
32193
32194       inherit(PanRecognizer, AttrRecognizer, {
32195         /**
32196          * @namespace
32197          * @memberof PanRecognizer
32198          */
32199         defaults: {
32200           event: 'pan',
32201           threshold: 10,
32202           pointers: 1,
32203           direction: DIRECTION_ALL
32204         },
32205
32206         getTouchAction: function() {
32207           var direction = this.options.direction;
32208           var actions = [];
32209           if (direction & DIRECTION_HORIZONTAL) {
32210             actions.push(TOUCH_ACTION_PAN_Y);
32211           }
32212           if (direction & DIRECTION_VERTICAL) {
32213             actions.push(TOUCH_ACTION_PAN_X);
32214           }
32215           return actions;
32216         },
32217
32218         directionTest: function(input) {
32219           var options = this.options;
32220           var hasMoved = true;
32221           var distance = input.distance;
32222           var direction = input.direction;
32223           var x = input.deltaX;
32224           var y = input.deltaY;
32225
32226           // lock to axis?
32227           if (!(direction & options.direction)) {
32228             if (options.direction & DIRECTION_HORIZONTAL) {
32229               direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
32230               hasMoved = x != this.pX;
32231               distance = Math.abs(input.deltaX);
32232             } else {
32233               direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
32234               hasMoved = y != this.pY;
32235               distance = Math.abs(input.deltaY);
32236             }
32237           }
32238           input.direction = direction;
32239           return hasMoved && distance > options.threshold && direction & options.direction;
32240         },
32241
32242         attrTest: function(input) {
32243           return AttrRecognizer.prototype.attrTest.call(this, input) &&
32244             (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
32245         },
32246
32247         emit: function(input) {
32248           this.pX = input.deltaX;
32249           this.pY = input.deltaY;
32250
32251           var direction = directionStr(input.direction);
32252           if (direction) {
32253             this.manager.emit(this.options.event + direction, input);
32254           }
32255
32256           this._super.emit.call(this, input);
32257         }
32258       });
32259
32260       /**
32261        * Pinch Recognized when two or more pointers are moving toward (zoom-in) or
32262        * away from each other (zoom-out).
32263        *
32264        * @constructor
32265        * @extends AttrRecognizer
32266        */
32267       function PinchRecognizer() {
32268         AttrRecognizer.apply(this, arguments);
32269       }
32270
32271       inherit(PinchRecognizer, AttrRecognizer, {
32272         /**
32273          * @namespace
32274          * @memberof PinchRecognizer
32275          */
32276         defaults: {
32277           event: 'pinch',
32278           threshold: 0,
32279           pointers: 2
32280         },
32281
32282         getTouchAction: function() {
32283           return [TOUCH_ACTION_NONE];
32284         },
32285
32286         attrTest: function(input) {
32287           return this._super.attrTest.call(this, input) &&
32288             (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
32289         },
32290
32291         emit: function(input) {
32292           this._super.emit.call(this, input);
32293           if (input.scale !== 1) {
32294             var inOut = input.scale < 1 ? 'in' : 'out';
32295             this.manager.emit(this.options.event + inOut, input);
32296           }
32297         }
32298       });
32299
32300       /**
32301        * Press Recognized when the pointer is down for x ms without any movement.
32302        *
32303        * @constructor
32304        * @extends Recognizer
32305        */
32306       function PressRecognizer() {
32307         Recognizer.apply(this, arguments);
32308
32309         this._timer = null;
32310         this._input = null;
32311       }
32312
32313       inherit(PressRecognizer, Recognizer, {
32314         /**
32315          * @namespace
32316          * @memberof PressRecognizer
32317          */
32318         defaults: {
32319           event: 'press',
32320           pointers: 1,
32321           time: 500, // minimal time of the pointer to be pressed
32322           threshold: 5 // a minimal movement is ok, but keep it low
32323         },
32324
32325         getTouchAction: function() {
32326           return [TOUCH_ACTION_AUTO];
32327         },
32328
32329         process: function(input) {
32330           var options = this.options;
32331           var validPointers = input.pointers.length === options.pointers;
32332           var validMovement = input.distance < options.threshold;
32333           var validTime = input.deltaTime > options.time;
32334
32335           this._input = input;
32336
32337           // we only allow little movement
32338           // and we've reached an end event, so a tap is possible
32339           if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
32340             this.reset();
32341           } else if (input.eventType & INPUT_START) {
32342             this.reset();
32343             this._timer = setTimeoutContext(function() {
32344               this.state = STATE_RECOGNIZED;
32345               this.tryEmit();
32346             }, options.time, this);
32347           } else if (input.eventType & INPUT_END) {
32348             return STATE_RECOGNIZED;
32349           }
32350           return STATE_FAILED;
32351         },
32352
32353         reset: function() {
32354           clearTimeout(this._timer);
32355         },
32356
32357         emit: function(input) {
32358           if (this.state !== STATE_RECOGNIZED) {
32359             return;
32360           }
32361
32362           if (input && (input.eventType & INPUT_END)) {
32363             this.manager.emit(this.options.event + 'up', input);
32364           } else {
32365             this._input.timeStamp = now();
32366             this.manager.emit(this.options.event, this._input);
32367           }
32368         }
32369       });
32370
32371       /**
32372        * Rotate Recognized when two or more pointer are moving in a circular motion.
32373        *
32374        * @constructor
32375        * @extends AttrRecognizer
32376        */
32377       function RotateRecognizer() {
32378         AttrRecognizer.apply(this, arguments);
32379       }
32380
32381       inherit(RotateRecognizer, AttrRecognizer, {
32382         /**
32383          * @namespace
32384          * @memberof RotateRecognizer
32385          */
32386         defaults: {
32387           event: 'rotate',
32388           threshold: 0,
32389           pointers: 2
32390         },
32391
32392         getTouchAction: function() {
32393           return [TOUCH_ACTION_NONE];
32394         },
32395
32396         attrTest: function(input) {
32397           return this._super.attrTest.call(this, input) &&
32398             (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
32399         }
32400       });
32401
32402       /**
32403        * Swipe Recognized when the pointer is moving fast (velocity), with enough
32404        * distance in the allowed direction.
32405        *
32406        * @constructor
32407        * @extends AttrRecognizer
32408        */
32409       function SwipeRecognizer() {
32410         AttrRecognizer.apply(this, arguments);
32411       }
32412
32413       inherit(SwipeRecognizer, AttrRecognizer, {
32414         /**
32415          * @namespace
32416          * @memberof SwipeRecognizer
32417          */
32418         defaults: {
32419           event: 'swipe',
32420           threshold: 10,
32421           velocity: 0.65,
32422           direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
32423           pointers: 1
32424         },
32425
32426         getTouchAction: function() {
32427           return PanRecognizer.prototype.getTouchAction.call(this);
32428         },
32429
32430         attrTest: function(input) {
32431           var direction = this.options.direction;
32432           var velocity;
32433
32434           if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
32435             velocity = input.velocity;
32436           } else if (direction & DIRECTION_HORIZONTAL) {
32437             velocity = input.velocityX;
32438           } else if (direction & DIRECTION_VERTICAL) {
32439             velocity = input.velocityY;
32440           }
32441
32442           return this._super.attrTest.call(this, input) &&
32443             direction & input.direction &&
32444             input.distance > this.options.threshold &&
32445             abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
32446         },
32447
32448         emit: function(input) {
32449           var direction = directionStr(input.direction);
32450           if (direction) {
32451             this.manager.emit(this.options.event + direction, input);
32452           }
32453
32454           this.manager.emit(this.options.event, input);
32455         }
32456       });
32457
32458       /**
32459        * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps
32460        * are recognized if they occur between the given interval and position. The
32461        * delay option can be used to recognize multi-taps without firing a single tap.
32462        *
32463        * The eventData from the emitted event contains the property `tapCount`, which
32464        * contains the amount of multi-taps being recognized.
32465        *
32466        * @constructor
32467        * @extends Recognizer
32468        */
32469       function TapRecognizer() {
32470         Recognizer.apply(this, arguments);
32471
32472         // previous time and center,
32473         // used for tap counting
32474         this.pTime = false;
32475         this.pCenter = false;
32476
32477         this._timer = null;
32478         this._input = null;
32479         this.count = 0;
32480       }
32481
32482       inherit(TapRecognizer, Recognizer, {
32483         /**
32484          * @namespace
32485          * @memberof PinchRecognizer
32486          */
32487         defaults: {
32488           event: 'tap',
32489           pointers: 1,
32490           taps: 1,
32491           interval: 300, // max time between the multi-tap taps
32492           time: 250, // max time of the pointer to be down (like finger on the
32493           // screen)
32494           threshold: 2, // a minimal movement is ok, but keep it low
32495           posThreshold: 10 // a multi-tap can be a bit off the initial position
32496         },
32497
32498         getTouchAction: function() {
32499           return [TOUCH_ACTION_MANIPULATION];
32500         },
32501
32502         process: function(input) {
32503           var options = this.options;
32504
32505           var validPointers = input.pointers.length === options.pointers;
32506           var validMovement = input.distance < options.threshold;
32507           var validTouchTime = input.deltaTime < options.time;
32508
32509           this.reset();
32510
32511           if ((input.eventType & INPUT_START) && (this.count === 0)) {
32512             return this.failTimeout();
32513           }
32514
32515           // we only allow little movement
32516           // and we've reached an end event, so a tap is possible
32517           if (validMovement && validTouchTime && validPointers) {
32518             if (input.eventType != INPUT_END) {
32519               return this.failTimeout();
32520             }
32521
32522             var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
32523             var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
32524
32525             this.pTime = input.timeStamp;
32526             this.pCenter = input.center;
32527
32528             if (!validMultiTap || !validInterval) {
32529               this.count = 1;
32530             } else {
32531               this.count += 1;
32532             }
32533
32534             this._input = input;
32535
32536             // if tap count matches we have recognized it,
32537             // else it has began recognizing...
32538             var tapCount = this.count % options.taps;
32539             if (tapCount === 0) {
32540               // no failing requirements, immediately trigger the tap event
32541               // or wait as long as the multitap interval to trigger
32542               if (!this.hasRequireFailures()) {
32543                 return STATE_RECOGNIZED;
32544               } else {
32545                 this._timer = setTimeoutContext(function() {
32546                   this.state = STATE_RECOGNIZED;
32547                   this.tryEmit();
32548                 }, options.interval, this);
32549                 return STATE_BEGAN;
32550               }
32551             }
32552           }
32553           return STATE_FAILED;
32554         },
32555
32556         failTimeout: function() {
32557           this._timer = setTimeoutContext(function() {
32558             this.state = STATE_FAILED;
32559           }, this.options.interval, this);
32560           return STATE_FAILED;
32561         },
32562
32563         reset: function() {
32564           clearTimeout(this._timer);
32565         },
32566
32567         emit: function() {
32568           if (this.state == STATE_RECOGNIZED) {
32569             this._input.tapCount = this.count;
32570             this.manager.emit(this.options.event, this._input);
32571           }
32572         }
32573       });
32574
32575       /**
32576        * Simple way to create an manager with a default set of recognizers.
32577        *
32578        * @param {HTMLElement}
32579        *            element
32580        * @param {Object}
32581        *            [options]
32582        * @constructor
32583        */
32584       function Hammer(element, options) {
32585         options = options || {};
32586         options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
32587         return new Manager(element, options);
32588       }
32589
32590       /**
32591        * @const {string}
32592        */
32593       Hammer.VERSION = '2.0.4';
32594
32595       /**
32596        * default settings
32597        *
32598        * @namespace
32599        */
32600       Hammer.defaults = {
32601         /**
32602          * set if DOM events are being triggered. But this is slower and unused by
32603          * simple implementations, so disabled by default.
32604          *
32605          * @type {Boolean}
32606          * @default false
32607          */
32608         domEvents: false,
32609
32610         /**
32611          * The value for the touchAction property/fallback. When set to `compute` it
32612          * will magically set the correct value based on the added recognizers.
32613          *
32614          * @type {String}
32615          * @default compute
32616          */
32617         touchAction: TOUCH_ACTION_COMPUTE,
32618
32619         /**
32620          * @type {Boolean}
32621          * @default true
32622          */
32623         enable: true,
32624
32625         /**
32626          * EXPERIMENTAL FEATURE -- can be removed/changed Change the parent input
32627          * target element. If Null, then it is being set the to main element.
32628          *
32629          * @type {Null|EventTarget}
32630          * @default null
32631          */
32632         inputTarget: null,
32633
32634         /**
32635          * force an input class
32636          *
32637          * @type {Null|Function}
32638          * @default null
32639          */
32640         inputClass: null,
32641
32642         /**
32643          * Default recognizer setup when calling `Hammer()` When creating a new
32644          * Manager these will be skipped.
32645          *
32646          * @type {Array}
32647          */
32648         preset: [
32649           // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
32650           [RotateRecognizer, {
32651             enable: false
32652           }],
32653           [PinchRecognizer, {
32654               enable: false
32655             },
32656             ['rotate']
32657           ],
32658           [SwipeRecognizer, {
32659             direction: DIRECTION_HORIZONTAL
32660           }],
32661           [PanRecognizer, {
32662               direction: DIRECTION_HORIZONTAL
32663             },
32664             ['swipe']
32665           ],
32666           [TapRecognizer],
32667           [TapRecognizer, {
32668               event: 'doubletap',
32669               taps: 2
32670             },
32671             ['tap']
32672           ],
32673           [PressRecognizer]
32674         ],
32675
32676         /**
32677          * Some CSS properties can be used to improve the working of Hammer. Add
32678          * them to this method and they will be set when creating a new Manager.
32679          *
32680          * @namespace
32681          */
32682         cssProps: {
32683           /**
32684            * Disables text selection to improve the dragging gesture. Mainly for
32685            * desktop browsers.
32686            *
32687            * @type {String}
32688            * @default 'none'
32689            */
32690           userSelect: 'none',
32691
32692           /**
32693            * Disable the Windows Phone grippers when pressing an element.
32694            *
32695            * @type {String}
32696            * @default 'none'
32697            */
32698           touchSelect: 'none',
32699
32700           /**
32701            * Disables the default callout shown when you touch and hold a touch
32702            * target. On iOS, when you touch and hold a touch target such as a
32703            * link, Safari displays a callout containing information about the
32704            * link. This property allows you to disable that callout.
32705            *
32706            * @type {String}
32707            * @default 'none'
32708            */
32709           touchCallout: 'none',
32710
32711           /**
32712            * Specifies whether zooming is enabled. Used by IE10>
32713            *
32714            * @type {String}
32715            * @default 'none'
32716            */
32717           contentZooming: 'none',
32718
32719           /**
32720            * Specifies that an entire element should be draggable instead of its
32721            * contents. Mainly for desktop browsers.
32722            *
32723            * @type {String}
32724            * @default 'none'
32725            */
32726           userDrag: 'none',
32727
32728           /**
32729            * Overrides the highlight color shown when the user taps a link or a
32730            * JavaScript clickable element in iOS. This property obeys the alpha
32731            * value, if specified.
32732            *
32733            * @type {String}
32734            * @default 'rgba(0,0,0,0)'
32735            */
32736           tapHighlightColor: 'rgba(0,0,0,0)'
32737         }
32738       };
32739
32740       var STOP = 1;
32741       var FORCED_STOP = 2;
32742
32743       /**
32744        * Manager
32745        *
32746        * @param {HTMLElement}
32747        *            element
32748        * @param {Object}
32749        *            [options]
32750        * @constructor
32751        */
32752       function Manager(element, options) {
32753         options = options || {};
32754
32755         this.options = merge(options, Hammer.defaults);
32756         this.options.inputTarget = this.options.inputTarget || element;
32757
32758         this.handlers = {};
32759         this.session = {};
32760         this.recognizers = [];
32761
32762         this.element = element;
32763         this.input = createInputInstance(this);
32764         this.touchAction = new TouchAction(this, this.options.touchAction);
32765
32766         toggleCssProps(this, true);
32767
32768         each(options.recognizers, function(item) {
32769           var recognizer = this.add(new(item[0])(item[1]));
32770           item[2] && recognizer.recognizeWith(item[2]);
32771           item[3] && recognizer.requireFailure(item[3]);
32772         }, this);
32773       }
32774
32775       Manager.prototype = {
32776         /**
32777          * set options
32778          *
32779          * @param {Object}
32780          *            options
32781          * @returns {Manager}
32782          */
32783         set: function(options) {
32784           extend(this.options, options);
32785
32786           // Options that need a little more setup
32787           if (options.touchAction) {
32788             this.touchAction.update();
32789           }
32790           if (options.inputTarget) {
32791             // Clean up existing event listeners and reinitialize
32792             this.input.destroy();
32793             this.input.target = options.inputTarget;
32794             this.input.init();
32795           }
32796           return this;
32797         },
32798
32799         /**
32800          * stop recognizing for this session. This session will be discarded, when a
32801          * new [input]start event is fired. When forced, the recognizer cycle is
32802          * stopped immediately.
32803          *
32804          * @param {Boolean}
32805          *            [force]
32806          */
32807         stop: function(force) {
32808           this.session.stopped = force ? FORCED_STOP : STOP;
32809         },
32810
32811         /**
32812          * run the recognizers! called by the inputHandler function on every
32813          * movement of the pointers (touches) it walks through all the recognizers
32814          * and tries to detect the gesture that is being made
32815          *
32816          * @param {Object}
32817          *            inputData
32818          */
32819         recognize: function(inputData) {
32820           var session = this.session;
32821           if (session.stopped) {
32822             return;
32823           }
32824
32825           // run the touch-action polyfill
32826           this.touchAction.preventDefaults(inputData);
32827
32828           var recognizer;
32829           var recognizers = this.recognizers;
32830
32831           // this holds the recognizer that is being recognized.
32832           // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or
32833           // RECOGNIZED
32834           // if no recognizer is detecting a thing, it is set to `null`
32835           var curRecognizer = session.curRecognizer;
32836
32837           // reset when the last recognizer is recognized
32838           // or when we're in a new session
32839           if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
32840             curRecognizer = session.curRecognizer = null;
32841           }
32842
32843           var i = 0;
32844           while (i < recognizers.length) {
32845             recognizer = recognizers[i];
32846
32847             // find out if we are allowed try to recognize the input for this
32848             // one.
32849             // 1. allow if the session is NOT forced stopped (see the .stop()
32850             // method)
32851             // 2. allow if we still haven't recognized a gesture in this
32852             // session, or the this recognizer is the one
32853             // that is being recognized.
32854             // 3. allow if the recognizer is allowed to run simultaneous with
32855             // the current recognized recognizer.
32856             // this can be setup with the `recognizeWith()` method on the
32857             // recognizer.
32858             if (session.stopped !== FORCED_STOP && ( // 1
32859                 !curRecognizer || recognizer == curRecognizer || // 2
32860                 recognizer.canRecognizeWith(curRecognizer))) { // 3
32861               recognizer.recognize(inputData);
32862             } else {
32863               recognizer.reset();
32864             }
32865
32866             // if the recognizer has been recognizing the input as a valid
32867             // gesture, we want to store this one as the
32868             // current active recognizer. but only if we don't already have an
32869             // active recognizer
32870             if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
32871               curRecognizer = session.curRecognizer = recognizer;
32872             }
32873             i++;
32874           }
32875         },
32876
32877         /**
32878          * get a recognizer by its event name.
32879          *
32880          * @param {Recognizer|String}
32881          *            recognizer
32882          * @returns {Recognizer|Null}
32883          */
32884         get: function(recognizer) {
32885           if (recognizer instanceof Recognizer) {
32886             return recognizer;
32887           }
32888
32889           var recognizers = this.recognizers;
32890           for (var i = 0; i < recognizers.length; i++) {
32891             if (recognizers[i].options.event == recognizer) {
32892               return recognizers[i];
32893             }
32894           }
32895           return null;
32896         },
32897
32898         /**
32899          * add a recognizer to the manager existing recognizers with the same event
32900          * name will be removed
32901          *
32902          * @param {Recognizer}
32903          *            recognizer
32904          * @returns {Recognizer|Manager}
32905          */
32906         add: function(recognizer) {
32907           if (invokeArrayArg(recognizer, 'add', this)) {
32908             return this;
32909           }
32910
32911           // remove existing
32912           var existing = this.get(recognizer.options.event);
32913           if (existing) {
32914             this.remove(existing);
32915           }
32916
32917           this.recognizers.push(recognizer);
32918           recognizer.manager = this;
32919
32920           this.touchAction.update();
32921           return recognizer;
32922         },
32923
32924         /**
32925          * remove a recognizer by name or instance
32926          *
32927          * @param {Recognizer|String}
32928          *            recognizer
32929          * @returns {Manager}
32930          */
32931         remove: function(recognizer) {
32932           if (invokeArrayArg(recognizer, 'remove', this)) {
32933             return this;
32934           }
32935
32936           var recognizers = this.recognizers;
32937           recognizer = this.get(recognizer);
32938           recognizers.splice(inArray(recognizers, recognizer), 1);
32939
32940           this.touchAction.update();
32941           return this;
32942         },
32943
32944         /**
32945          * bind event
32946          *
32947          * @param {String}
32948          *            events
32949          * @param {Function}
32950          *            handler
32951          * @returns {EventEmitter} this
32952          */
32953         on: function(events, handler) {
32954           var handlers = this.handlers;
32955           each(splitStr(events), function(event) {
32956             handlers[event] = handlers[event] || [];
32957             handlers[event].push(handler);
32958           });
32959           return this;
32960         },
32961
32962         /**
32963          * unbind event, leave emit blank to remove all handlers
32964          *
32965          * @param {String}
32966          *            events
32967          * @param {Function}
32968          *            [handler]
32969          * @returns {EventEmitter} this
32970          */
32971         off: function(events, handler) {
32972           var handlers = this.handlers;
32973           each(splitStr(events), function(event) {
32974             if (!handler) {
32975               delete handlers[event];
32976             } else {
32977               handlers[event].splice(inArray(handlers[event], handler), 1);
32978             }
32979           });
32980           return this;
32981         },
32982
32983         /**
32984          * emit event to the listeners
32985          *
32986          * @param {String}
32987          *            event
32988          * @param {Object}
32989          *            data
32990          */
32991         emit: function(event, data) {
32992           // we also want to trigger dom events
32993           if (this.options.domEvents) {
32994             triggerDomEvent(event, data);
32995           }
32996
32997           // no handlers, so skip it all
32998           var handlers = this.handlers[event] && this.handlers[event].slice();
32999           if (!handlers || !handlers.length) {
33000             return;
33001           }
33002
33003           data.type = event;
33004           data.preventDefault = function() {
33005             data.srcEvent.preventDefault();
33006           };
33007
33008           var i = 0;
33009           while (i < handlers.length) {
33010             handlers[i](data);
33011             i++;
33012           }
33013         },
33014
33015         /**
33016          * destroy the manager and unbinds all events it doesn't unbind dom events,
33017          * that is the user own responsibility
33018          */
33019         destroy: function() {
33020           this.element && toggleCssProps(this, false);
33021
33022           this.handlers = {};
33023           this.session = {};
33024           this.input.destroy();
33025           this.element = null;
33026         }
33027       };
33028
33029       /**
33030        * add/remove the css properties as defined in manager.options.cssProps
33031        *
33032        * @param {Manager}
33033        *            manager
33034        * @param {Boolean}
33035        *            add
33036        */
33037       function toggleCssProps(manager, add) {
33038         var element = manager.element;
33039         each(manager.options.cssProps, function(value, name) {
33040           element.style[prefixed(element.style, name)] = add ? value : '';
33041         });
33042       }
33043
33044       /**
33045        * trigger dom event
33046        *
33047        * @param {String}
33048        *            event
33049        * @param {Object}
33050        *            data
33051        */
33052       function triggerDomEvent(event, data) {
33053         var gestureEvent = document.createEvent('Event');
33054         gestureEvent.initEvent(event, true, true);
33055         gestureEvent.gesture = data;
33056         data.target.dispatchEvent(gestureEvent);
33057       }
33058
33059       extend(Hammer, {
33060         INPUT_START: INPUT_START,
33061         INPUT_MOVE: INPUT_MOVE,
33062         INPUT_END: INPUT_END,
33063         INPUT_CANCEL: INPUT_CANCEL,
33064
33065         STATE_POSSIBLE: STATE_POSSIBLE,
33066         STATE_BEGAN: STATE_BEGAN,
33067         STATE_CHANGED: STATE_CHANGED,
33068         STATE_ENDED: STATE_ENDED,
33069         STATE_RECOGNIZED: STATE_RECOGNIZED,
33070         STATE_CANCELLED: STATE_CANCELLED,
33071         STATE_FAILED: STATE_FAILED,
33072
33073         DIRECTION_NONE: DIRECTION_NONE,
33074         DIRECTION_LEFT: DIRECTION_LEFT,
33075         DIRECTION_RIGHT: DIRECTION_RIGHT,
33076         DIRECTION_UP: DIRECTION_UP,
33077         DIRECTION_DOWN: DIRECTION_DOWN,
33078         DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
33079         DIRECTION_VERTICAL: DIRECTION_VERTICAL,
33080         DIRECTION_ALL: DIRECTION_ALL,
33081
33082         Manager: Manager,
33083         Input: Input,
33084         TouchAction: TouchAction,
33085
33086         TouchInput: TouchInput,
33087         MouseInput: MouseInput,
33088         PointerEventInput: PointerEventInput,
33089         TouchMouseInput: TouchMouseInput,
33090         SingleTouchInput: SingleTouchInput,
33091
33092         Recognizer: Recognizer,
33093         AttrRecognizer: AttrRecognizer,
33094         Tap: TapRecognizer,
33095         Pan: PanRecognizer,
33096         Swipe: SwipeRecognizer,
33097         Pinch: PinchRecognizer,
33098         Rotate: RotateRecognizer,
33099         Press: PressRecognizer,
33100
33101         on: addEventListeners,
33102         off: removeEventListeners,
33103         each: each,
33104         merge: merge,
33105         extend: extend,
33106         inherit: inherit,
33107         bindFn: bindFn,
33108         prefixed: prefixed
33109       });
33110
33111       if (typeof define == TYPE_FUNCTION && define.amd) {
33112         define(function() {
33113           return Hammer;
33114         });
33115       } else if (typeof module != 'undefined' && module.exports) {
33116         module.exports = Hammer;
33117       } else {
33118         window[exportName] = Hammer;
33119       }
33120
33121     })(window, document, 'Hammer');
33122
33123   }, {}],
33124   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js": [function(require, module, exports) {
33125     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"][0].apply(exports, arguments)
33126   }, {}],
33127   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js": [function(require, module, exports) {
33128     /**
33129      * Set attribute `name` to `val`, or get attr `name`.
33130      *
33131      * @param {Element}
33132      *            el
33133      * @param {String}
33134      *            name
33135      * @param {String}
33136      *            [val]
33137      * @api public
33138      */
33139
33140     module.exports = function(el, name, val) {
33141       // get
33142       if (arguments.length == 2) {
33143         return el.getAttribute(name);
33144       }
33145
33146       // remove
33147       if (val === null) {
33148         return el.removeAttribute(name);
33149       }
33150
33151       // set
33152       el.setAttribute(name, val);
33153
33154       return el;
33155     };
33156   }, {}],
33157   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js": [function(require, module, exports) {
33158     module.exports = require('component-classes');
33159   }, {
33160     "component-classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\index.js"
33161   }],
33162   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js": [function(require, module, exports) {
33163     module.exports = function(el) {
33164
33165       var c;
33166
33167       while (el.childNodes.length) {
33168         c = el.childNodes[0];
33169         el.removeChild(c);
33170       }
33171
33172       return el;
33173     };
33174   }, {}],
33175   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\closest.js": [function(require, module, exports) {
33176     module.exports = require('component-closest');
33177   }, {
33178     "component-closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js"
33179   }],
33180   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js": [function(require, module, exports) {
33181     module.exports = require('component-delegate');
33182   }, {
33183     "component-delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-delegate\\index.js"
33184   }],
33185   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js": [function(require, module, exports) {
33186     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js"][0].apply(exports, arguments)
33187   }, {
33188     "domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"
33189   }],
33190   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js": [function(require, module, exports) {
33191     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js"][0].apply(exports, arguments)
33192   }, {
33193     "component-event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
33194   }],
33195   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js": [function(require, module, exports) {
33196     module.exports = require('component-matches-selector');
33197   }, {
33198     "component-matches-selector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js"
33199   }],
33200   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js": [function(require, module, exports) {
33201     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js"][0].apply(exports, arguments)
33202   }, {
33203     "component-query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
33204   }],
33205   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js": [function(require, module, exports) {
33206     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"][0].apply(exports, arguments)
33207   }, {}],
33208   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\index.js": [function(require, module, exports) {
33209     /**
33210      * Module dependencies.
33211      */
33212
33213     var index = require('indexof');
33214
33215     /**
33216      * Whitespace regexp.
33217      */
33218
33219     var re = /\s+/;
33220
33221     /**
33222      * toString reference.
33223      */
33224
33225     var toString = Object.prototype.toString;
33226
33227     /**
33228      * Wrap `el` in a `ClassList`.
33229      *
33230      * @param {Element}
33231      *            el
33232      * @return {ClassList}
33233      * @api public
33234      */
33235
33236     module.exports = function(el) {
33237       return new ClassList(el);
33238     };
33239
33240     /**
33241      * Initialize a new ClassList for `el`.
33242      *
33243      * @param {Element}
33244      *            el
33245      * @api private
33246      */
33247
33248     function ClassList(el) {
33249       if (!el || !el.nodeType) {
33250         throw new Error('A DOM element reference is required');
33251       }
33252       this.el = el;
33253       this.list = el.classList;
33254     }
33255
33256     /**
33257      * Add class `name` if not already present.
33258      *
33259      * @param {String}
33260      *            name
33261      * @return {ClassList}
33262      * @api public
33263      */
33264
33265     ClassList.prototype.add = function(name) {
33266       // classList
33267       if (this.list) {
33268         this.list.add(name);
33269         return this;
33270       }
33271
33272       // fallback
33273       var arr = this.array();
33274       var i = index(arr, name);
33275       if (!~i) arr.push(name);
33276       this.el.className = arr.join(' ');
33277       return this;
33278     };
33279
33280     /**
33281      * Remove class `name` when present, or pass a regular expression to remove any
33282      * which match.
33283      *
33284      * @param {String|RegExp}
33285      *            name
33286      * @return {ClassList}
33287      * @api public
33288      */
33289
33290     ClassList.prototype.remove = function(name) {
33291       if ('[object RegExp]' == toString.call(name)) {
33292         return this.removeMatching(name);
33293       }
33294
33295       // classList
33296       if (this.list) {
33297         this.list.remove(name);
33298         return this;
33299       }
33300
33301       // fallback
33302       var arr = this.array();
33303       var i = index(arr, name);
33304       if (~i) arr.splice(i, 1);
33305       this.el.className = arr.join(' ');
33306       return this;
33307     };
33308
33309     /**
33310      * Remove all classes matching `re`.
33311      *
33312      * @param {RegExp}
33313      *            re
33314      * @return {ClassList}
33315      * @api private
33316      */
33317
33318     ClassList.prototype.removeMatching = function(re) {
33319       var arr = this.array();
33320       for (var i = 0; i < arr.length; i++) {
33321         if (re.test(arr[i])) {
33322           this.remove(arr[i]);
33323         }
33324       }
33325       return this;
33326     };
33327
33328     /**
33329      * Toggle class `name`, can force state via `force`.
33330      *
33331      * For browsers that support classList, but do not support `force` yet, the
33332      * mistake will be detected and corrected.
33333      *
33334      * @param {String}
33335      *            name
33336      * @param {Boolean}
33337      *            force
33338      * @return {ClassList}
33339      * @api public
33340      */
33341
33342     ClassList.prototype.toggle = function(name, force) {
33343       // classList
33344       if (this.list) {
33345         if ("undefined" !== typeof force) {
33346           if (force !== this.list.toggle(name, force)) {
33347             this.list.toggle(name); // toggle again to correct
33348           }
33349         } else {
33350           this.list.toggle(name);
33351         }
33352         return this;
33353       }
33354
33355       // fallback
33356       if ("undefined" !== typeof force) {
33357         if (!force) {
33358           this.remove(name);
33359         } else {
33360           this.add(name);
33361         }
33362       } else {
33363         if (this.has(name)) {
33364           this.remove(name);
33365         } else {
33366           this.add(name);
33367         }
33368       }
33369
33370       return this;
33371     };
33372
33373     /**
33374      * Return an array of classes.
33375      *
33376      * @return {Array}
33377      * @api public
33378      */
33379
33380     ClassList.prototype.array = function() {
33381       var className = this.el.getAttribute('class') || '';
33382       var str = className.replace(/^\s+|\s+$/g, '');
33383       var arr = str.split(re);
33384       if ('' === arr[0]) arr.shift();
33385       return arr;
33386     };
33387
33388     /**
33389      * Check if class `name` is present.
33390      *
33391      * @param {String}
33392      *            name
33393      * @return {ClassList}
33394      * @api public
33395      */
33396
33397     ClassList.prototype.has =
33398       ClassList.prototype.contains = function(name) {
33399         return this.list ? this.list.contains(name) : !!~index(this.array(), name);
33400       };
33401
33402   }, {
33403     "indexof": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\node_modules\\component-indexof\\index.js"
33404   }],
33405   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\node_modules\\component-indexof\\index.js": [function(require, module, exports) {
33406     module.exports = function(arr, obj) {
33407       if (arr.indexOf) return arr.indexOf(obj);
33408       for (var i = 0; i < arr.length; ++i) {
33409         if (arr[i] === obj) return i;
33410       }
33411       return -1;
33412     };
33413   }, {}],
33414   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js": [function(require, module, exports) {
33415     var matches = require('matches-selector')
33416
33417     module.exports = function(element, selector, checkYoSelf, root) {
33418       element = checkYoSelf ? {
33419         parentNode: element
33420       } : element
33421
33422       root = root || document
33423
33424       // Make sure `element !== document` and `element != null`
33425       // otherwise we get an illegal invocation
33426       while ((element = element.parentNode) && element !== document) {
33427         if (matches(element, selector))
33428           return element
33429         // After `matches` on the edge case that
33430         // the selector matches the root
33431         // (when the root is not the document)
33432         if (element === root)
33433           return
33434       }
33435     }
33436
33437   }, {
33438     "matches-selector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js"
33439   }],
33440   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-delegate\\index.js": [function(require, module, exports) {
33441     /**
33442      * Module dependencies.
33443      */
33444
33445     var closest = require('closest'),
33446       event = require('event');
33447
33448     /**
33449      * Delegate event `type` to `selector` and invoke `fn(e)`. A callback function
33450      * is returned which may be passed to `.unbind()`.
33451      *
33452      * @param {Element}
33453      *            el
33454      * @param {String}
33455      *            selector
33456      * @param {String}
33457      *            type
33458      * @param {Function}
33459      *            fn
33460      * @param {Boolean}
33461      *            capture
33462      * @return {Function}
33463      * @api public
33464      */
33465
33466     exports.bind = function(el, selector, type, fn, capture) {
33467       return event.bind(el, type, function(e) {
33468         var target = e.target || e.srcElement;
33469         e.delegateTarget = closest(target, selector, true, el);
33470         if (e.delegateTarget) fn.call(el, e);
33471       }, capture);
33472     };
33473
33474     /**
33475      * Unbind event `type`'s callback `fn`.
33476      *
33477      * @param {Element}
33478      *            el
33479      * @param {String}
33480      *            type
33481      * @param {Function}
33482      *            fn
33483      * @param {Boolean}
33484      *            capture
33485      * @api public
33486      */
33487
33488     exports.unbind = function(el, type, fn, capture) {
33489       event.unbind(el, type, fn, capture);
33490     };
33491
33492   }, {
33493     "closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js",
33494     "event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
33495   }],
33496   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js": [function(require, module, exports) {
33497     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"][0].apply(exports, arguments)
33498   }, {}],
33499   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js": [function(require, module, exports) {
33500     /**
33501      * Module dependencies.
33502      */
33503
33504     var query = require('query');
33505
33506     /**
33507      * Element prototype.
33508      */
33509
33510     var proto = Element.prototype;
33511
33512     /**
33513      * Vendor function.
33514      */
33515
33516     var vendor = proto.matches || proto.webkitMatchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector;
33517
33518     /**
33519      * Expose `match()`.
33520      */
33521
33522     module.exports = match;
33523
33524     /**
33525      * Match `el` to `selector`.
33526      *
33527      * @param {Element}
33528      *            el
33529      * @param {String}
33530      *            selector
33531      * @return {Boolean}
33532      * @api public
33533      */
33534
33535     function match(el, selector) {
33536       if (!el || el.nodeType !== 1) return false;
33537       if (vendor) return vendor.call(el, selector);
33538       var nodes = query.all(selector, el.parentNode);
33539       for (var i = 0; i < nodes.length; ++i) {
33540         if (nodes[i] == el) return true;
33541       }
33542       return false;
33543     }
33544
33545   }, {
33546     "query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
33547   }],
33548   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js": [function(require, module, exports) {
33549     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"][0].apply(exports, arguments)
33550   }, {}],
33551   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\domify\\index.js": [function(require, module, exports) {
33552     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"][0].apply(exports, arguments)
33553   }, {}],
33554   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\index.js": [function(require, module, exports) {
33555     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js"][0].apply(exports, arguments)
33556   }, {
33557     "./lib/collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js",
33558     "./lib/refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\refs.js"
33559   }],
33560   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js": [function(require, module, exports) {
33561     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js"][0].apply(exports, arguments)
33562   }, {}],
33563   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\refs.js": [function(require, module, exports) {
33564     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js"][0].apply(exports, arguments)
33565   }, {
33566     "./collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js"
33567   }],
33568   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\snapsvg\\dist\\snap.svg.js": [function(require, module, exports) {
33569     // Snap.svg 0.3.0
33570     //
33571     // Copyright (c) 2013 ÃƒÆ’¢â‚¬â€œ 2014 Adobe Systems Incorporated. All rights
33572     // reserved.
33573     //
33574     // Licensed under the Apache License, Version 2.0 (the "License");
33575     // you may not use this file except in compliance with the License.
33576     // You may obtain a copy of the License at
33577     //
33578     // http://www.apache.org/licenses/LICENSE-2.0
33579     //
33580     // Unless required by applicable law or agreed to in writing, software
33581     // distributed under the License is distributed on an "AS IS" BASIS,
33582     // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33583     // See the License for the specific language governing permissions and
33584     // limitations under the License.
33585     //
33586     // build: 2014-09-08
33587
33588     (function(glob, factory) {
33589       // AMD support
33590       if (typeof define === "function" && define.amd) {
33591         // Define as an anonymous module
33592         define(["eve"], function(eve) {
33593           return factory(glob, eve);
33594         });
33595       } else if (typeof exports !== 'undefined') {
33596         // Next for Node.js or CommonJS
33597         var eve = require('eve');
33598         module.exports = factory(glob, eve);
33599       } else {
33600         // Browser globals (glob is window)
33601         // Snap adds itself to window
33602         factory(glob, glob.eve);
33603       }
33604     }(window || this, function(window, eve) {
33605
33606       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
33607       //
33608       // Licensed under the Apache License, Version 2.0 (the "License");
33609       // you may not use this file except in compliance with the License.
33610       // You may obtain a copy of the License at
33611       //
33612       // http://www.apache.org/licenses/LICENSE-2.0
33613       //
33614       // Unless required by applicable law or agreed to in writing, software
33615       // distributed under the License is distributed on an "AS IS" BASIS,
33616       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33617       // See the License for the specific language governing permissions and
33618       // limitations under the License.
33619       var mina = (function(eve) {
33620         var animations = {},
33621           requestAnimFrame = window.requestAnimationFrame ||
33622           window.webkitRequestAnimationFrame ||
33623           window.mozRequestAnimationFrame ||
33624           window.oRequestAnimationFrame ||
33625           window.msRequestAnimationFrame ||
33626           function(callback) {
33627             setTimeout(callback, 16);
33628           },
33629           isArray = Array.isArray || function(a) {
33630             return a instanceof Array ||
33631               Object.prototype.toString.call(a) == "[object Array]";
33632           },
33633           idgen = 0,
33634           idprefix = "M" + (+new Date).toString(36),
33635           ID = function() {
33636             return idprefix + (idgen++).toString(36);
33637           },
33638           diff = function(a, b, A, B) {
33639             if (isArray(a)) {
33640               res = [];
33641               for (var i = 0, ii = a.length; i < ii; i++) {
33642                 res[i] = diff(a[i], b, A[i], B);
33643               }
33644               return res;
33645             }
33646             var dif = (A - a) / (B - b);
33647             return function(bb) {
33648               return a + dif * (bb - b);
33649             };
33650           },
33651           timer = Date.now || function() {
33652             return +new Date;
33653           },
33654           sta = function(val) {
33655             var a = this;
33656             if (val == null) {
33657               return a.s;
33658             }
33659             var ds = a.s - val;
33660             a.b += a.dur * ds;
33661             a.B += a.dur * ds;
33662             a.s = val;
33663           },
33664           speed = function(val) {
33665             var a = this;
33666             if (val == null) {
33667               return a.spd;
33668             }
33669             a.spd = val;
33670           },
33671           duration = function(val) {
33672             var a = this;
33673             if (val == null) {
33674               return a.dur;
33675             }
33676             a.s = a.s * val / a.dur;
33677             a.dur = val;
33678           },
33679           stopit = function() {
33680             var a = this;
33681             delete animations[a.id];
33682             a.update();
33683             eve("mina.stop." + a.id, a);
33684           },
33685           pause = function() {
33686             var a = this;
33687             if (a.pdif) {
33688               return;
33689             }
33690             delete animations[a.id];
33691             a.update();
33692             a.pdif = a.get() - a.b;
33693           },
33694           resume = function() {
33695             var a = this;
33696             if (!a.pdif) {
33697               return;
33698             }
33699             a.b = a.get() - a.pdif;
33700             delete a.pdif;
33701             animations[a.id] = a;
33702           },
33703           update = function() {
33704             var a = this,
33705               res;
33706             if (isArray(a.start)) {
33707               res = [];
33708               for (var j = 0, jj = a.start.length; j < jj; j++) {
33709                 res[j] = +a.start[j] +
33710                   (a.end[j] - a.start[j]) * a.easing(a.s);
33711               }
33712             } else {
33713               res = +a.start + (a.end - a.start) * a.easing(a.s);
33714             }
33715             a.set(res);
33716           },
33717           frame = function() {
33718             var len = 0;
33719             for (var i in animations)
33720               if (animations.hasOwnProperty(i)) {
33721                 var a = animations[i],
33722                   b = a.get(),
33723                   res;
33724                 len++;
33725                 a.s = (b - a.b) / (a.dur / a.spd);
33726                 if (a.s >= 1) {
33727                   delete animations[i];
33728                   a.s = 1;
33729                   len--;
33730                   (function(a) {
33731                     setTimeout(function() {
33732                       eve("mina.finish." + a.id, a);
33733                     });
33734                   }(a));
33735                 }
33736                 a.update();
33737               }
33738             len && requestAnimFrame(frame);
33739           },
33740           /*
33741            * \ mina [ method ] * Generic animation of numbers * - a (number) start
33742            * _slave_ number - A (number) end _slave_ number - b (number) start
33743            * _master_ number (start time in general case) - B (number) end _master_
33744            * number (end time in gereal case) - get (function) getter of _master_
33745            * number (see @mina.time) - set (function) setter of _slave_ number -
33746            * easing (function) #optional easing function, default is @mina.linear =
33747            * (object) animation descriptor o { o id (string) animation id, o start
33748            * (number) start _slave_ number, o end (number) end _slave_ number, o b
33749            * (number) start _master_ number, o s (number) animation status (0..1), o
33750            * dur (number) animation duration, o spd (number) animation speed, o get
33751            * (function) getter of _master_ number (see @mina.time), o set (function)
33752            * setter of _slave_ number, o easing (function) easing function, default is
33753            * @mina.linear, o status (function) status getter/setter, o speed
33754            * (function) speed getter/setter, o duration (function) duration
33755            * getter/setter, o stop (function) animation stopper o pause (function)
33756            * pauses the animation o resume (function) resumes the animation o update
33757            * (function) calles setter with the right value of the animation o } \
33758            */
33759           mina = function(a, A, b, B, get, set, easing) {
33760             var anim = {
33761               id: ID(),
33762               start: a,
33763               end: A,
33764               b: b,
33765               s: 0,
33766               dur: B - b,
33767               spd: 1,
33768               get: get,
33769               set: set,
33770               easing: easing || mina.linear,
33771               status: sta,
33772               speed: speed,
33773               duration: duration,
33774               stop: stopit,
33775               pause: pause,
33776               resume: resume,
33777               update: update
33778             };
33779             animations[anim.id] = anim;
33780             var len = 0,
33781               i;
33782             for (i in animations)
33783               if (animations.hasOwnProperty(i)) {
33784                 len++;
33785                 if (len == 2) {
33786                   break;
33787                 }
33788               }
33789             len == 1 && requestAnimFrame(frame);
33790             return anim;
33791           };
33792         /*
33793          * \ mina.time [ method ] * Returns the current time. Equivalent to: |
33794          * function () { | return (new Date).getTime(); | } \
33795          */
33796         mina.time = timer;
33797         /*
33798          * \ mina.getById [ method ] * Returns an animation by its id - id (string)
33799          * animation's id = (object) See @mina \
33800          */
33801         mina.getById = function(id) {
33802           return animations[id] || null;
33803         };
33804
33805         /*
33806          * \ mina.linear [ method ] * Default linear easing - n (number) input 0..1 =
33807          * (number) output 0..1 \
33808          */
33809         mina.linear = function(n) {
33810           return n;
33811         };
33812         /*
33813          * \ mina.easeout [ method ] * Easeout easing - n (number) input 0..1 =
33814          * (number) output 0..1 \
33815          */
33816         mina.easeout = function(n) {
33817           return Math.pow(n, 1.7);
33818         };
33819         /*
33820          * \ mina.easein [ method ] * Easein easing - n (number) input 0..1 =
33821          * (number) output 0..1 \
33822          */
33823         mina.easein = function(n) {
33824           return Math.pow(n, .48);
33825         };
33826         /*
33827          * \ mina.easeinout [ method ] * Easeinout easing - n (number) input 0..1 =
33828          * (number) output 0..1 \
33829          */
33830         mina.easeinout = function(n) {
33831           if (n == 1) {
33832             return 1;
33833           }
33834           if (n == 0) {
33835             return 0;
33836           }
33837           var q = .48 - n / 1.04,
33838             Q = Math.sqrt(.1734 + q * q),
33839             x = Q - q,
33840             X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),
33841             y = -Q - q,
33842             Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),
33843             t = X + Y + .5;
33844           return (1 - t) * 3 * t * t + t * t * t;
33845         };
33846         /*
33847          * \ mina.backin [ method ] * Backin easing - n (number) input 0..1 =
33848          * (number) output 0..1 \
33849          */
33850         mina.backin = function(n) {
33851           if (n == 1) {
33852             return 1;
33853           }
33854           var s = 1.70158;
33855           return n * n * ((s + 1) * n - s);
33856         };
33857         /*
33858          * \ mina.backout [ method ] * Backout easing - n (number) input 0..1 =
33859          * (number) output 0..1 \
33860          */
33861         mina.backout = function(n) {
33862           if (n == 0) {
33863             return 0;
33864           }
33865           n = n - 1;
33866           var s = 1.70158;
33867           return n * n * ((s + 1) * n + s) + 1;
33868         };
33869         /*
33870          * \ mina.elastic [ method ] * Elastic easing - n (number) input 0..1 =
33871          * (number) output 0..1 \
33872          */
33873         mina.elastic = function(n) {
33874           if (n == !!n) {
33875             return n;
33876           }
33877           return Math.pow(2, -10 * n) * Math.sin((n - .075) *
33878             (2 * Math.PI) / .3) + 1;
33879         };
33880         /*
33881          * \ mina.bounce [ method ] * Bounce easing - n (number) input 0..1 =
33882          * (number) output 0..1 \
33883          */
33884         mina.bounce = function(n) {
33885           var s = 7.5625,
33886             p = 2.75,
33887             l;
33888           if (n < (1 / p)) {
33889             l = s * n * n;
33890           } else {
33891             if (n < (2 / p)) {
33892               n -= (1.5 / p);
33893               l = s * n * n + .75;
33894             } else {
33895               if (n < (2.5 / p)) {
33896                 n -= (2.25 / p);
33897                 l = s * n * n + .9375;
33898               } else {
33899                 n -= (2.625 / p);
33900                 l = s * n * n + .984375;
33901               }
33902             }
33903           }
33904           return l;
33905         };
33906         window.mina = mina;
33907         return mina;
33908       })(typeof eve == "undefined" ? function() {} : eve);
33909       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
33910       //
33911       // Licensed under the Apache License, Version 2.0 (the "License");
33912       // you may not use this file except in compliance with the License.
33913       // You may obtain a copy of the License at
33914       //
33915       // http://www.apache.org/licenses/LICENSE-2.0
33916       //
33917       // Unless required by applicable law or agreed to in writing, software
33918       // distributed under the License is distributed on an "AS IS" BASIS,
33919       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33920       // See the License for the specific language governing permissions and
33921       // limitations under the License.
33922
33923       var Snap = (function(root) {
33924         Snap.version = "0.3.0";
33925         /*
33926          * \ Snap [ method ] * Creates a drawing surface or wraps existing SVG element. * -
33927          * width (number|string) width of surface - height (number|string) height of
33928          * surface or - DOM (SVGElement) element to be wrapped into Snap structure or -
33929          * array (array) array of elements (will return set of elements) or - query
33930          * (string) CSS query selector = (object) @Element \
33931          */
33932         function Snap(w, h) {
33933           if (w) {
33934             if (w.tagName) {
33935               return wrap(w);
33936             }
33937             if (is(w, "array") && Snap.set) {
33938               return Snap.set.apply(Snap, w);
33939             }
33940             if (w instanceof Element) {
33941               return w;
33942             }
33943             if (h == null) {
33944               w = glob.doc.querySelector(w);
33945               return wrap(w);
33946             }
33947           }
33948           w = w == null ? "100%" : w;
33949           h = h == null ? "100%" : h;
33950           return new Paper(w, h);
33951         }
33952         Snap.toString = function() {
33953           return "Snap v" + this.version;
33954         };
33955         Snap._ = {};
33956         var glob = {
33957           win: root.window,
33958           doc: root.window.document
33959         };
33960         Snap._.glob = glob;
33961         var has = "hasOwnProperty",
33962           Str = String,
33963           toFloat = parseFloat,
33964           toInt = parseInt,
33965           math = Math,
33966           mmax = math.max,
33967           mmin = math.min,
33968           abs = math.abs,
33969           pow = math.pow,
33970           PI = math.PI,
33971           round = math.round,
33972           E = "",
33973           S = " ",
33974           objectToString = Object.prototype.toString,
33975           ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
33976           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,
33977           bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
33978           reURLValue = /^url\(#?([^)]+)\)$/,
33979           separator = Snap._.separator = /[,\s]+/,
33980           whitespace = /[\s]/g,
33981           commaSpaces = /[\s]*,[\s]*/,
33982           hsrg = {
33983             hs: 1,
33984             rg: 1
33985           },
33986           pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
33987           tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
33988           pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
33989           idgen = 0,
33990           idprefix = "S" + (+new Date).toString(36),
33991           ID = function(el) {
33992             return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);
33993           },
33994           xlink = "http://www.w3.org/1999/xlink",
33995           xmlns = "http://www.w3.org/2000/svg",
33996           hub = {},
33997           URL = Snap.url = function(url) {
33998             return "url('#" + url + "')";
33999           };
34000
34001         function $(el, attr) {
34002           if (attr) {
34003             if (el == "#text") {
34004               el = glob.doc.createTextNode(attr.text || "");
34005             }
34006             if (typeof el == "string") {
34007               el = $(el);
34008             }
34009             if (typeof attr == "string") {
34010               if (attr.substring(0, 6) == "xlink:") {
34011                 return el.getAttributeNS(xlink, attr.substring(6));
34012               }
34013               if (attr.substring(0, 4) == "xml:") {
34014                 return el.getAttributeNS(xmlns, attr.substring(4));
34015               }
34016               return el.getAttribute(attr);
34017             }
34018             for (var key in attr)
34019               if (attr[has](key)) {
34020                 var val = Str(attr[key]);
34021                 if (val) {
34022                   if (key.substring(0, 6) == "xlink:") {
34023                     el.setAttributeNS(xlink, key.substring(6), val);
34024                   } else if (key.substring(0, 4) == "xml:") {
34025                     el.setAttributeNS(xmlns, key.substring(4), val);
34026                   } else {
34027                     el.setAttribute(key, val);
34028                   }
34029                 } else {
34030                   el.removeAttribute(key);
34031                 }
34032               }
34033           } else {
34034             el = glob.doc.createElementNS(xmlns, el);
34035           }
34036           return el;
34037         }
34038         Snap._.$ = $;
34039         Snap._.id = ID;
34040
34041         function getAttrs(el) {
34042           var attrs = el.attributes,
34043             name,
34044             out = {};
34045           for (var i = 0; i < attrs.length; i++) {
34046             if (attrs[i].namespaceURI == xlink) {
34047               name = "xlink:";
34048             } else {
34049               name = "";
34050             }
34051             name += attrs[i].name;
34052             out[name] = attrs[i].textContent;
34053           }
34054           return out;
34055         }
34056
34057         function is(o, type) {
34058           type = Str.prototype.toLowerCase.call(type);
34059           if (type == "finite") {
34060             return isFinite(o);
34061           }
34062           if (type == "array" &&
34063             (o instanceof Array || Array.isArray && Array.isArray(o))) {
34064             return true;
34065           }
34066           return (type == "null" && o === null) ||
34067             (type == typeof o && o !== null) ||
34068             (type == "object" && o === Object(o)) ||
34069             objectToString.call(o).slice(8, -1).toLowerCase() == type;
34070         }
34071         /*
34072          * \ Snap.format [ method ] * Replaces construction of type `{<name>}` to the
34073          * corresponding argument * - token (string) string to format - json (object)
34074          * object which properties are used as a replacement = (string) formatted string >
34075          * Usage | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z" |
34076          * paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative
34077          * width']}z", { | x: 10, | y: 20, | dim: { | width: 40, | height: 50, |
34078          * "negative width": -40 | } | })); \
34079          */
34080         Snap.format = (function() {
34081           var tokenRegex = /\{([^\}]+)\}/g,
34082             objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches
34083             // .xxxxx
34084             // or
34085             // ["xxxxx"]
34086             // to
34087             // run
34088             // over
34089             // object
34090             // properties
34091             replacer = function(all, key, obj) {
34092               var res = obj;
34093               key.replace(objNotationRegex, function(all, name, quote, quotedName, isFunc) {
34094                 name = name || quotedName;
34095                 if (res) {
34096                   if (name in res) {
34097                     res = res[name];
34098                   }
34099                   typeof res == "function" && isFunc && (res = res());
34100                 }
34101               });
34102               res = (res == null || res == obj ? all : res) + "";
34103               return res;
34104             };
34105           return function(str, obj) {
34106             return Str(str).replace(tokenRegex, function(all, key) {
34107               return replacer(all, key, obj);
34108             });
34109           };
34110         })();
34111
34112         function clone(obj) {
34113           if (typeof obj == "function" || Object(obj) !== obj) {
34114             return obj;
34115           }
34116           var res = new obj.constructor;
34117           for (var key in obj)
34118             if (obj[has](key)) {
34119               res[key] = clone(obj[key]);
34120             }
34121           return res;
34122         }
34123         Snap._.clone = clone;
34124
34125         function repush(array, item) {
34126           for (var i = 0, ii = array.length; i < ii; i++)
34127             if (array[i] === item) {
34128               return array.push(array.splice(i, 1)[0]);
34129             }
34130         }
34131
34132         function cacher(f, scope, postprocessor) {
34133           function newf() {
34134             var arg = Array.prototype.slice.call(arguments, 0),
34135               args = arg.join("\u2400"),
34136               cache = newf.cache = newf.cache || {},
34137               count = newf.count = newf.count || [];
34138             if (cache[has](args)) {
34139               repush(count, args);
34140               return postprocessor ? postprocessor(cache[args]) : cache[args];
34141             }
34142             count.length >= 1e3 && delete cache[count.shift()];
34143             count.push(args);
34144             cache[args] = f.apply(scope, arg);
34145             return postprocessor ? postprocessor(cache[args]) : cache[args];
34146           }
34147           return newf;
34148         }
34149         Snap._.cacher = cacher;
34150
34151         function angle(x1, y1, x2, y2, x3, y3) {
34152           if (x3 == null) {
34153             var x = x1 - x2,
34154               y = y1 - y2;
34155             if (!x && !y) {
34156               return 0;
34157             }
34158             return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
34159           } else {
34160             return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);
34161           }
34162         }
34163
34164         function rad(deg) {
34165           return deg % 360 * PI / 180;
34166         }
34167
34168         function deg(rad) {
34169           return rad * 180 / PI % 360;
34170         }
34171
34172         function x_y() {
34173           return this.x + S + this.y;
34174         }
34175
34176         function x_y_w_h() {
34177           return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
34178         }
34179
34180         /*
34181          * \ Snap.rad [ method ] * Transform angle to radians - deg (number) angle in
34182          * degrees = (number) angle in radians \
34183          */
34184         Snap.rad = rad;
34185         /*
34186          * \ Snap.deg [ method ] * Transform angle to degrees - rad (number) angle in
34187          * radians = (number) angle in degrees \
34188          */
34189         Snap.deg = deg;
34190         /*
34191          * \ Snap.angle [ method ] * Returns an angle between two or three points >
34192          * Parameters - x1 (number) x coord of first point - y1 (number) y coord of
34193          * first point - x2 (number) x coord of second point - y2 (number) y coord of
34194          * second point - x3 (number) #optional x coord of third point - y3 (number)
34195          * #optional y coord of third point = (number) angle in degrees \
34196          */
34197         Snap.angle = angle;
34198         /*
34199          * \ Snap.is [ method ] * Handy replacement for the `typeof` operator - o
34200          * (…) any object or primitive - type (string) name of the type, e.g.,
34201          * `string`, `function`, `number`, etc. = (boolean) `true` if given value is of
34202          * given type \
34203          */
34204         Snap.is = is;
34205         /*
34206          * \ Snap.snapTo [ method ] * Snaps given value to given grid - values
34207          * (array|number) given array of values or step of the grid - value (number)
34208          * value to adjust - tolerance (number) #optional maximum distance to the target
34209          * value that would trigger the snap. Default is `10`. = (number) adjusted value \
34210          */
34211         Snap.snapTo = function(values, value, tolerance) {
34212           tolerance = is(tolerance, "finite") ? tolerance : 10;
34213           if (is(values, "array")) {
34214             var i = values.length;
34215             while (i--)
34216               if (abs(values[i] - value) <= tolerance) {
34217                 return values[i];
34218               }
34219           } else {
34220             values = +values;
34221             var rem = value % values;
34222             if (rem < tolerance) {
34223               return value - rem;
34224             }
34225             if (rem > values - tolerance) {
34226               return value - rem + values;
34227             }
34228           }
34229           return value;
34230         };
34231         // Colour
34232         /*
34233          * \ Snap.getRGB [ method ] * Parses color string as RGB object - color (string)
34234          * color string in one of the following formats: # <ul> # <li>Color name (<code>red</code>,
34235          * <code>green</code>, <code>cornflowerblue</code>, etc)</li> # <li>#•••
34236          * ÃƒÆ’¢â‚¬â€� shortened HTML color: (<code>#000</code>, <code>#fc0</code>,
34237          * etc.)</li> # <li>#•••••• ÃƒÆ’¢â‚¬â€� full
34238          * length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li> #
34239          * <li>rgb(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢)
34240          * ÃƒÆ’¢â‚¬â€� red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li> #
34241          * <li>rgba(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34242          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34243          * <li>rgb(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34244          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li> #
34245          * <li>rgba(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34246          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34247          * <li>hsb(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢)
34248          * ÃƒÆ’¢â‚¬â€� hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li> #
34249          * <li>hsba(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34250          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34251          * <li>hsb(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34252          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %</li> # <li>hsba(•••%,
34253          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%)
34254          * ÃƒÆ’¢â‚¬â€� also with opacity</li> # <li>hsl(•••,
34255          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� hue, saturation and
34256          * luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li> #
34257          * <li>hsla(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34258          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34259          * <li>hsl(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34260          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %</li> # <li>hsla(•••%,
34261          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%)
34262          * ÃƒÆ’¢â‚¬â€� also with opacity</li> # </ul> Note that `%` can be used any time:
34263          * `rgb(20%, 255, 50%)`. = (object) RGB object in the following format: o { o r
34264          * (number) red, o g (number) green, o b (number) blue, o hex (string) color in
34265          * HTML/CSS format: #••••••, o error
34266          * (boolean) true if string can't be parsed o } \
34267          */
34268         Snap.getRGB = cacher(function(colour) {
34269           if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
34270             return {
34271               r: -1,
34272               g: -1,
34273               b: -1,
34274               hex: "none",
34275               error: 1,
34276               toString: rgbtoString
34277             };
34278           }
34279           if (colour == "none") {
34280             return {
34281               r: -1,
34282               g: -1,
34283               b: -1,
34284               hex: "none",
34285               toString: rgbtoString
34286             };
34287           }!(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
34288           if (!colour) {
34289             return {
34290               r: -1,
34291               g: -1,
34292               b: -1,
34293               hex: "none",
34294               error: 1,
34295               toString: rgbtoString
34296             };
34297           }
34298           var res,
34299             red,
34300             green,
34301             blue,
34302             opacity,
34303             t,
34304             values,
34305             rgb = colour.match(colourRegExp);
34306           if (rgb) {
34307             if (rgb[2]) {
34308               blue = toInt(rgb[2].substring(5), 16);
34309               green = toInt(rgb[2].substring(3, 5), 16);
34310               red = toInt(rgb[2].substring(1, 3), 16);
34311             }
34312             if (rgb[3]) {
34313               blue = toInt((t = rgb[3].charAt(3)) + t, 16);
34314               green = toInt((t = rgb[3].charAt(2)) + t, 16);
34315               red = toInt((t = rgb[3].charAt(1)) + t, 16);
34316             }
34317             if (rgb[4]) {
34318               values = rgb[4].split(commaSpaces);
34319               red = toFloat(values[0]);
34320               values[0].slice(-1) == "%" && (red *= 2.55);
34321               green = toFloat(values[1]);
34322               values[1].slice(-1) == "%" && (green *= 2.55);
34323               blue = toFloat(values[2]);
34324               values[2].slice(-1) == "%" && (blue *= 2.55);
34325               rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
34326               values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34327             }
34328             if (rgb[5]) {
34329               values = rgb[5].split(commaSpaces);
34330               red = toFloat(values[0]);
34331               values[0].slice(-1) == "%" && (red /= 100);
34332               green = toFloat(values[1]);
34333               values[1].slice(-1) == "%" && (green /= 100);
34334               blue = toFloat(values[2]);
34335               values[2].slice(-1) == "%" && (blue /= 100);
34336               (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
34337               rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
34338               values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34339               return Snap.hsb2rgb(red, green, blue, opacity);
34340             }
34341             if (rgb[6]) {
34342               values = rgb[6].split(commaSpaces);
34343               red = toFloat(values[0]);
34344               values[0].slice(-1) == "%" && (red /= 100);
34345               green = toFloat(values[1]);
34346               values[1].slice(-1) == "%" && (green /= 100);
34347               blue = toFloat(values[2]);
34348               values[2].slice(-1) == "%" && (blue /= 100);
34349               (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
34350               rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
34351               values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34352               return Snap.hsl2rgb(red, green, blue, opacity);
34353             }
34354             red = mmin(math.round(red), 255);
34355             green = mmin(math.round(green), 255);
34356             blue = mmin(math.round(blue), 255);
34357             opacity = mmin(mmax(opacity, 0), 1);
34358             rgb = {
34359               r: red,
34360               g: green,
34361               b: blue,
34362               toString: rgbtoString
34363             };
34364             rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
34365             rgb.opacity = is(opacity, "finite") ? opacity : 1;
34366             return rgb;
34367           }
34368           return {
34369             r: -1,
34370             g: -1,
34371             b: -1,
34372             hex: "none",
34373             error: 1,
34374             toString: rgbtoString
34375           };
34376         }, Snap);
34377         // SIERRA It seems odd that the following 3 conversion methods are not expressed
34378         // as .this2that(), like the others.
34379         /*
34380          * \ Snap.hsb [ method ] * Converts HSB values to a hex representation of the
34381          * color - h (number) hue - s (number) saturation - b (number) value or
34382          * brightness = (string) hex representation of the color \
34383          */
34384         Snap.hsb = cacher(function(h, s, b) {
34385           return Snap.hsb2rgb(h, s, b).hex;
34386         });
34387         /*
34388          * \ Snap.hsl [ method ] * Converts HSL values to a hex representation of the
34389          * color - h (number) hue - s (number) saturation - l (number) luminosity =
34390          * (string) hex representation of the color \
34391          */
34392         Snap.hsl = cacher(function(h, s, l) {
34393           return Snap.hsl2rgb(h, s, l).hex;
34394         });
34395         /*
34396          * \ Snap.rgb [ method ] * Converts RGB values to a hex representation of the
34397          * color - r (number) red - g (number) green - b (number) blue = (string) hex
34398          * representation of the color \
34399          */
34400         Snap.rgb = cacher(function(r, g, b, o) {
34401           if (is(o, "finite")) {
34402             var round = math.round;
34403             return "rgba(" + [round(r), round(g), round(b), +o.toFixed(2)] + ")";
34404           }
34405           return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
34406         });
34407         var toHex = function(color) {
34408             var i = glob.doc.getElementsByTagName("head")[0] || glob.doc.getElementsByTagName("svg")[0],
34409               red = "rgb(255, 0, 0)";
34410             toHex = cacher(function(color) {
34411               if (color.toLowerCase() == "red") {
34412                 return red;
34413               }
34414               i.style.color = red;
34415               i.style.color = color;
34416               var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
34417               return out == red ? null : out;
34418             });
34419             return toHex(color);
34420           },
34421           hsbtoString = function() {
34422             return "hsb(" + [this.h, this.s, this.b] + ")";
34423           },
34424           hsltoString = function() {
34425             return "hsl(" + [this.h, this.s, this.l] + ")";
34426           },
34427           rgbtoString = function() {
34428             return this.opacity == 1 || this.opacity == null ?
34429               this.hex :
34430               "rgba(" + [this.r, this.g, this.b, this.opacity] + ")";
34431           },
34432           prepareRGB = function(r, g, b) {
34433             if (g == null && is(r, "object") && "r" in r && "g" in r && "b" in r) {
34434               b = r.b;
34435               g = r.g;
34436               r = r.r;
34437             }
34438             if (g == null && is(r, string)) {
34439               var clr = Snap.getRGB(r);
34440               r = clr.r;
34441               g = clr.g;
34442               b = clr.b;
34443             }
34444             if (r > 1 || g > 1 || b > 1) {
34445               r /= 255;
34446               g /= 255;
34447               b /= 255;
34448             }
34449
34450             return [r, g, b];
34451           },
34452           packageRGB = function(r, g, b, o) {
34453             r = math.round(r * 255);
34454             g = math.round(g * 255);
34455             b = math.round(b * 255);
34456             var rgb = {
34457               r: r,
34458               g: g,
34459               b: b,
34460               opacity: is(o, "finite") ? o : 1,
34461               hex: Snap.rgb(r, g, b),
34462               toString: rgbtoString
34463             };
34464             is(o, "finite") && (rgb.opacity = o);
34465             return rgb;
34466           };
34467         // SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g.,
34468         // can you specify a semi-transparent value for Snap.filter.shadow()?
34469         /*
34470          * \ Snap.color [ method ] * Parses the color string and returns an object
34471          * featuring the color's component values - clr (string) color string in one of
34472          * the supported formats (see @Snap.getRGB) = (object) Combined RGB/HSB object
34473          * in the following format: o { o r (number) red, o g (number) green, o b
34474          * (number) blue, o hex (string) color in HTML/CSS format:
34475          * #••••••, o error (boolean) `true` if
34476          * string can't be parsed, o h (number) hue, o s (number) saturation, o v
34477          * (number) value (brightness), o l (number) lightness o } \
34478          */
34479         Snap.color = function(clr) {
34480           var rgb;
34481           if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
34482             rgb = Snap.hsb2rgb(clr);
34483             clr.r = rgb.r;
34484             clr.g = rgb.g;
34485             clr.b = rgb.b;
34486             clr.opacity = 1;
34487             clr.hex = rgb.hex;
34488           } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
34489             rgb = Snap.hsl2rgb(clr);
34490             clr.r = rgb.r;
34491             clr.g = rgb.g;
34492             clr.b = rgb.b;
34493             clr.opacity = 1;
34494             clr.hex = rgb.hex;
34495           } else {
34496             if (is(clr, "string")) {
34497               clr = Snap.getRGB(clr);
34498             }
34499             if (is(clr, "object") && "r" in clr && "g" in clr && "b" in clr && !("error" in clr)) {
34500               rgb = Snap.rgb2hsl(clr);
34501               clr.h = rgb.h;
34502               clr.s = rgb.s;
34503               clr.l = rgb.l;
34504               rgb = Snap.rgb2hsb(clr);
34505               clr.v = rgb.b;
34506             } else {
34507               clr = {
34508                 hex: "none"
34509               };
34510               clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
34511               clr.error = 1;
34512             }
34513           }
34514           clr.toString = rgbtoString;
34515           return clr;
34516         };
34517         /*
34518          * \ Snap.hsb2rgb [ method ] * Converts HSB values to an RGB object - h (number)
34519          * hue - s (number) saturation - v (number) value or brightness = (object) RGB
34520          * object in the following format: o { o r (number) red, o g (number) green, o b
34521          * (number) blue, o hex (string) color in HTML/CSS format:
34522          * #•••••• o } \
34523          */
34524         Snap.hsb2rgb = function(h, s, v, o) {
34525           if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
34526             v = h.b;
34527             s = h.s;
34528             h = h.h;
34529             o = h.o;
34530           }
34531           h *= 360;
34532           var R, G, B, X, C;
34533           h = (h % 360) / 60;
34534           C = v * s;
34535           X = C * (1 - abs(h % 2 - 1));
34536           R = G = B = v - C;
34537
34538           h = ~~h;
34539           R += [C, X, 0, 0, X, C][h];
34540           G += [X, C, C, X, 0, 0][h];
34541           B += [0, 0, X, C, C, X][h];
34542           return packageRGB(R, G, B, o);
34543         };
34544         /*
34545          * \ Snap.hsl2rgb [ method ] * Converts HSL values to an RGB object - h (number)
34546          * hue - s (number) saturation - l (number) luminosity = (object) RGB object in
34547          * the following format: o { o r (number) red, o g (number) green, o b (number)
34548          * blue, o hex (string) color in HTML/CSS format:
34549          * #•••••• o } \
34550          */
34551         Snap.hsl2rgb = function(h, s, l, o) {
34552           if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
34553             l = h.l;
34554             s = h.s;
34555             h = h.h;
34556           }
34557           if (h > 1 || s > 1 || l > 1) {
34558             h /= 360;
34559             s /= 100;
34560             l /= 100;
34561           }
34562           h *= 360;
34563           var R, G, B, X, C;
34564           h = (h % 360) / 60;
34565           C = 2 * s * (l < .5 ? l : 1 - l);
34566           X = C * (1 - abs(h % 2 - 1));
34567           R = G = B = l - C / 2;
34568
34569           h = ~~h;
34570           R += [C, X, 0, 0, X, C][h];
34571           G += [X, C, C, X, 0, 0][h];
34572           B += [0, 0, X, C, C, X][h];
34573           return packageRGB(R, G, B, o);
34574         };
34575         /*
34576          * \ Snap.rgb2hsb [ method ] * Converts RGB values to an HSB object - r (number)
34577          * red - g (number) green - b (number) blue = (object) HSB object in the
34578          * following format: o { o h (number) hue, o s (number) saturation, o b (number)
34579          * brightness o } \
34580          */
34581         Snap.rgb2hsb = function(r, g, b) {
34582           b = prepareRGB(r, g, b);
34583           r = b[0];
34584           g = b[1];
34585           b = b[2];
34586
34587           var H, S, V, C;
34588           V = mmax(r, g, b);
34589           C = V - mmin(r, g, b);
34590           H = (C == 0 ? null :
34591             V == r ? (g - b) / C :
34592             V == g ? (b - r) / C + 2 :
34593             (r - g) / C + 4
34594           );
34595           H = ((H + 360) % 6) * 60 / 360;
34596           S = C == 0 ? 0 : C / V;
34597           return {
34598             h: H,
34599             s: S,
34600             b: V,
34601             toString: hsbtoString
34602           };
34603         };
34604         /*
34605          * \ Snap.rgb2hsl [ method ] * Converts RGB values to an HSL object - r (number)
34606          * red - g (number) green - b (number) blue = (object) HSL object in the
34607          * following format: o { o h (number) hue, o s (number) saturation, o l (number)
34608          * luminosity o } \
34609          */
34610         Snap.rgb2hsl = function(r, g, b) {
34611           b = prepareRGB(r, g, b);
34612           r = b[0];
34613           g = b[1];
34614           b = b[2];
34615
34616           var H, S, L, M, m, C;
34617           M = mmax(r, g, b);
34618           m = mmin(r, g, b);
34619           C = M - m;
34620           H = (C == 0 ? null :
34621             M == r ? (g - b) / C :
34622             M == g ? (b - r) / C + 2 :
34623             (r - g) / C + 4);
34624           H = ((H + 360) % 6) * 60 / 360;
34625           L = (M + m) / 2;
34626           S = (C == 0 ? 0 :
34627             L < .5 ? C / (2 * L) :
34628             C / (2 - 2 * L));
34629           return {
34630             h: H,
34631             s: S,
34632             l: L,
34633             toString: hsltoString
34634           };
34635         };
34636
34637         // Transformations
34638         // SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a
34639         // format like this for two separate segments? [ ["M10,10","L90,90"],
34640         // ["M90,10","L10,90"] ] Otherwise how is each command structured?
34641         /*
34642          * \ Snap.parsePathString [ method ] * Utility method * Parses given path string
34643          * into an array of arrays of path segments - pathString (string|array) path
34644          * string or array of segments (in the last case it is returned straight away) =
34645          * (array) array of segments \
34646          */
34647         Snap.parsePathString = function(pathString) {
34648           if (!pathString) {
34649             return null;
34650           }
34651           var pth = Snap.path(pathString);
34652           if (pth.arr) {
34653             return Snap.path.clone(pth.arr);
34654           }
34655
34656           var paramCounts = {
34657               a: 7,
34658               c: 6,
34659               o: 2,
34660               h: 1,
34661               l: 2,
34662               m: 2,
34663               r: 4,
34664               q: 4,
34665               s: 4,
34666               t: 2,
34667               v: 1,
34668               u: 3,
34669               z: 0
34670             },
34671             data = [];
34672           if (is(pathString, "array") && is(pathString[0], "array")) { // rough
34673             // assumption
34674             data = Snap.path.clone(pathString);
34675           }
34676           if (!data.length) {
34677             Str(pathString).replace(pathCommand, function(a, b, c) {
34678               var params = [],
34679                 name = b.toLowerCase();
34680               c.replace(pathValues, function(a, b) {
34681                 b && params.push(+b);
34682               });
34683               if (name == "m" && params.length > 2) {
34684                 data.push([b].concat(params.splice(0, 2)));
34685                 name = "l";
34686                 b = b == "m" ? "l" : "L";
34687               }
34688               if (name == "o" && params.length == 1) {
34689                 data.push([b, params[0]]);
34690               }
34691               if (name == "r") {
34692                 data.push([b].concat(params));
34693               } else
34694                 while (params.length >= paramCounts[name]) {
34695                   data.push([b].concat(params.splice(0, paramCounts[name])));
34696                   if (!paramCounts[name]) {
34697                     break;
34698                   }
34699                 }
34700             });
34701           }
34702           data.toString = Snap.path.toString;
34703           pth.arr = Snap.path.clone(data);
34704           return data;
34705         };
34706         /*
34707          * \ Snap.parseTransformString [ method ] * Utility method * Parses given
34708          * transform string into an array of transformations - TString (string|array)
34709          * transform string or array of transformations (in the last case it is returned
34710          * straight away) = (array) array of transformations \
34711          */
34712         var parseTransformString = Snap.parseTransformString = function(TString) {
34713           if (!TString) {
34714             return null;
34715           }
34716           var paramCounts = {
34717               r: 3,
34718               s: 4,
34719               t: 2,
34720               m: 6
34721             },
34722             data = [];
34723           if (is(TString, "array") && is(TString[0], "array")) { // rough assumption
34724             data = Snap.path.clone(TString);
34725           }
34726           if (!data.length) {
34727             Str(TString).replace(tCommand, function(a, b, c) {
34728               var params = [],
34729                 name = b.toLowerCase();
34730               c.replace(pathValues, function(a, b) {
34731                 b && params.push(+b);
34732               });
34733               data.push([b].concat(params));
34734             });
34735           }
34736           data.toString = Snap.path.toString;
34737           return data;
34738         };
34739
34740         function svgTransform2string(tstr) {
34741           var res = [];
34742           tstr = tstr.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g, function(all, name, params) {
34743             params = params.split(/\s*,\s*|\s+/);
34744             if (name == "rotate" && params.length == 1) {
34745               params.push(0, 0);
34746             }
34747             if (name == "scale") {
34748               if (params.length > 2) {
34749                 params = params.slice(0, 2);
34750               } else if (params.length == 2) {
34751                 params.push(0, 0);
34752               }
34753               if (params.length == 1) {
34754                 params.push(params[0], 0, 0);
34755               }
34756             }
34757             if (name == "skewX") {
34758               res.push(["m", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);
34759             } else if (name == "skewY") {
34760               res.push(["m", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);
34761             } else {
34762               res.push([name.charAt(0)].concat(params));
34763             }
34764             return all;
34765           });
34766           return res;
34767         }
34768         Snap._.svgTransform2string = svgTransform2string;
34769         Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
34770
34771         function transform2matrix(tstr, bbox) {
34772           var tdata = parseTransformString(tstr),
34773             m = new Snap.Matrix;
34774           if (tdata) {
34775             for (var i = 0, ii = tdata.length; i < ii; i++) {
34776               var t = tdata[i],
34777                 tlen = t.length,
34778                 command = Str(t[0]).toLowerCase(),
34779                 absolute = t[0] != command,
34780                 inver = absolute ? m.invert() : 0,
34781                 x1,
34782                 y1,
34783                 x2,
34784                 y2,
34785                 bb;
34786               if (command == "t" && tlen == 2) {
34787                 m.translate(t[1], 0);
34788               } else if (command == "t" && tlen == 3) {
34789                 if (absolute) {
34790                   x1 = inver.x(0, 0);
34791                   y1 = inver.y(0, 0);
34792                   x2 = inver.x(t[1], t[2]);
34793                   y2 = inver.y(t[1], t[2]);
34794                   m.translate(x2 - x1, y2 - y1);
34795                 } else {
34796                   m.translate(t[1], t[2]);
34797                 }
34798               } else if (command == "r") {
34799                 if (tlen == 2) {
34800                   bb = bb || bbox;
34801                   m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
34802                 } else if (tlen == 4) {
34803                   if (absolute) {
34804                     x2 = inver.x(t[2], t[3]);
34805                     y2 = inver.y(t[2], t[3]);
34806                     m.rotate(t[1], x2, y2);
34807                   } else {
34808                     m.rotate(t[1], t[2], t[3]);
34809                   }
34810                 }
34811               } else if (command == "s") {
34812                 if (tlen == 2 || tlen == 3) {
34813                   bb = bb || bbox;
34814                   m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
34815                 } else if (tlen == 4) {
34816                   if (absolute) {
34817                     x2 = inver.x(t[2], t[3]);
34818                     y2 = inver.y(t[2], t[3]);
34819                     m.scale(t[1], t[1], x2, y2);
34820                   } else {
34821                     m.scale(t[1], t[1], t[2], t[3]);
34822                   }
34823                 } else if (tlen == 5) {
34824                   if (absolute) {
34825                     x2 = inver.x(t[3], t[4]);
34826                     y2 = inver.y(t[3], t[4]);
34827                     m.scale(t[1], t[2], x2, y2);
34828                   } else {
34829                     m.scale(t[1], t[2], t[3], t[4]);
34830                   }
34831                 }
34832               } else if (command == "m" && tlen == 7) {
34833                 m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
34834               }
34835             }
34836           }
34837           return m;
34838         }
34839         Snap._.transform2matrix = transform2matrix;
34840         Snap._unit2px = unit2px;
34841         var contains = glob.doc.contains || glob.doc.compareDocumentPosition ?
34842           function(a, b) {
34843             var adown = a.nodeType == 9 ? a.documentElement : a,
34844               bup = b && b.parentNode;
34845             return a == bup || !!(bup && bup.nodeType == 1 && (
34846               adown.contains ?
34847               adown.contains(bup) :
34848               a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
34849             ));
34850           } :
34851           function(a, b) {
34852             if (b) {
34853               while (b) {
34854                 b = b.parentNode;
34855                 if (b == a) {
34856                   return true;
34857                 }
34858               }
34859             }
34860             return false;
34861           };
34862
34863         function getSomeDefs(el) {
34864           var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
34865             (el.node.parentNode && wrap(el.node.parentNode)) ||
34866             Snap.select("svg") ||
34867             Snap(0, 0),
34868             pdefs = p.select("defs"),
34869             defs = pdefs == null ? false : pdefs.node;
34870           if (!defs) {
34871             defs = make("defs", p.node).node;
34872           }
34873           return defs;
34874         }
34875
34876         function getSomeSVG(el) {
34877           return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select("svg");
34878         }
34879         Snap._.getSomeDefs = getSomeDefs;
34880         Snap._.getSomeSVG = getSomeSVG;
34881
34882         function unit2px(el, name, value) {
34883           var svg = getSomeSVG(el).node,
34884             out = {},
34885             mgr = svg.querySelector(".svg---mgr");
34886           if (!mgr) {
34887             mgr = $("rect");
34888             $(mgr, {
34889               x: -9e9,
34890               y: -9e9,
34891               width: 10,
34892               height: 10,
34893               "class": "svg---mgr",
34894               fill: "none"
34895             });
34896             svg.appendChild(mgr);
34897           }
34898
34899           function getW(val) {
34900             if (val == null) {
34901               return E;
34902             }
34903             if (val == +val) {
34904               return val;
34905             }
34906             $(mgr, {
34907               width: val
34908             });
34909             try {
34910               return mgr.getBBox().width;
34911             } catch (e) {
34912               return 0;
34913             }
34914           }
34915
34916           function getH(val) {
34917             if (val == null) {
34918               return E;
34919             }
34920             if (val == +val) {
34921               return val;
34922             }
34923             $(mgr, {
34924               height: val
34925             });
34926             try {
34927               return mgr.getBBox().height;
34928             } catch (e) {
34929               return 0;
34930             }
34931           }
34932
34933           function set(nam, f) {
34934             if (name == null) {
34935               out[nam] = f(el.attr(nam) || 0);
34936             } else if (nam == name) {
34937               out = f(value == null ? el.attr(nam) || 0 : value);
34938             }
34939           }
34940           switch (el.type) {
34941             case "rect":
34942               set("rx", getW);
34943               set("ry", getH);
34944             case "image":
34945               set("width", getW);
34946               set("height", getH);
34947             case "text":
34948               set("x", getW);
34949               set("y", getH);
34950               break;
34951             case "circle":
34952               set("cx", getW);
34953               set("cy", getH);
34954               set("r", getW);
34955               break;
34956             case "ellipse":
34957               set("cx", getW);
34958               set("cy", getH);
34959               set("rx", getW);
34960               set("ry", getH);
34961               break;
34962             case "line":
34963               set("x1", getW);
34964               set("x2", getW);
34965               set("y1", getH);
34966               set("y2", getH);
34967               break;
34968             case "marker":
34969               set("refX", getW);
34970               set("markerWidth", getW);
34971               set("refY", getH);
34972               set("markerHeight", getH);
34973               break;
34974             case "radialGradient":
34975               set("fx", getW);
34976               set("fy", getH);
34977               break;
34978             case "tspan":
34979               set("dx", getW);
34980               set("dy", getH);
34981               break;
34982             default:
34983               set(name, getW);
34984           }
34985           svg.removeChild(mgr);
34986           return out;
34987         }
34988         /*
34989          * \ Snap.select [ method ] * Wraps a DOM element specified by CSS selector as
34990          * @Element - query (string) CSS selector of the element = (Element) the current
34991          * element \
34992          */
34993         Snap.select = function(query) {
34994           query = Str(query).replace(/([^\\]):/g, "$1\\:");
34995           return wrap(glob.doc.querySelector(query));
34996         };
34997         /*
34998          * \ Snap.selectAll [ method ] * Wraps DOM elements specified by CSS selector as
34999          * set or array of @Element - query (string) CSS selector of the element =
35000          * (Element) the current element \
35001          */
35002         Snap.selectAll = function(query) {
35003           var nodelist = glob.doc.querySelectorAll(query),
35004             set = (Snap.set || Array)();
35005           for (var i = 0; i < nodelist.length; i++) {
35006             set.push(wrap(nodelist[i]));
35007           }
35008           return set;
35009         };
35010
35011         function add2group(list) {
35012           if (!is(list, "array")) {
35013             list = Array.prototype.slice.call(arguments, 0);
35014           }
35015           var i = 0,
35016             j = 0,
35017             node = this.node;
35018           while (this[i]) delete this[i++];
35019           for (i = 0; i < list.length; i++) {
35020             if (list[i].type == "set") {
35021               list[i].forEach(function(el) {
35022                 node.appendChild(el.node);
35023               });
35024             } else {
35025               node.appendChild(list[i].node);
35026             }
35027           }
35028           var children = node.childNodes;
35029           for (i = 0; i < children.length; i++) {
35030             this[j++] = wrap(children[i]);
35031           }
35032           return this;
35033         }
35034         // Hub garbage collector every 10s
35035         setInterval(function() {
35036           for (var key in hub)
35037             if (hub[has](key)) {
35038               var el = hub[key],
35039                 node = el.node;
35040               if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement)) {
35041                 delete hub[key];
35042               }
35043             }
35044         }, 1e4);
35045
35046         function Element(el) {
35047           if (el.snap in hub) {
35048             return hub[el.snap];
35049           }
35050           var svg;
35051           try {
35052             svg = el.ownerSVGElement;
35053           } catch (e) {}
35054           /*
35055            * \ Element.node [ property (object) ] * Gives you a reference to the DOM
35056            * object, so you can assign event handlers or just mess around. > Usage | //
35057            * draw a circle at coordinate 10,10 with radius of 10 | var c =
35058            * paper.circle(10, 10, 10); | c.node.onclick = function () { |
35059            * c.attr("fill", "red"); | }; \
35060            */
35061           this.node = el;
35062           if (svg) {
35063             this.paper = new Paper(svg);
35064           }
35065           /*
35066            * \ Element.type [ property (string) ] * SVG tag name of the given element. \
35067            */
35068           this.type = el.tagName;
35069           var id = this.id = ID(this);
35070           this.anims = {};
35071           this._ = {
35072             transform: []
35073           };
35074           el.snap = id;
35075           hub[id] = this;
35076           if (this.type == "g") {
35077             this.add = add2group;
35078           }
35079           if (this.type in {
35080               g: 1,
35081               mask: 1,
35082               pattern: 1,
35083               symbol: 1
35084             }) {
35085             for (var method in Paper.prototype)
35086               if (Paper.prototype[has](method)) {
35087                 this[method] = Paper.prototype[method];
35088               }
35089           }
35090         }
35091         /*
35092          * \ Element.attr [ method ] * Gets or sets given attributes of the element. * -
35093          * params (object) contains key-value pairs of attributes you want to set or -
35094          * param (string) name of the attribute = (Element) the current element or =
35095          * (string) value of attribute > Usage | el.attr({ | fill: "#fc0", | stroke:
35096          * "#000", | strokeWidth: 2, // CamelCase... | "fill-opacity": 0.5, // or
35097          * dash-separated names | width: "*=2" // prefixed values | }); |
35098          * console.log(el.attr("fill")); // #fc0 Prefixed values in format `"+=10"`
35099          * supported. All four operations (`+`, `-`, `*` and `/`) could be used.
35100          * Optionally you can use units for `+` and `-`: `"+=2em"`. \
35101          */
35102         Element.prototype.attr = function(params, value) {
35103           var el = this,
35104             node = el.node;
35105           if (!params) {
35106             return el;
35107           }
35108           if (is(params, "string")) {
35109             if (arguments.length > 1) {
35110               var json = {};
35111               json[params] = value;
35112               params = json;
35113             } else {
35114               return eve("snap.util.getattr." + params, el).firstDefined();
35115             }
35116           }
35117           for (var att in params) {
35118             if (params[has](att)) {
35119               eve("snap.util.attr." + att, el, params[att]);
35120             }
35121           }
35122           return el;
35123         };
35124         /*
35125          * \ Snap.parse [ method ] * Parses SVG fragment and converts it into a
35126          * @Fragment * - svg (string) SVG string = (Fragment) the @Fragment \
35127          */
35128         Snap.parse = function(svg) {
35129           var f = glob.doc.createDocumentFragment(),
35130             full = true,
35131             div = glob.doc.createElement("div");
35132           svg = Str(svg);
35133           if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
35134             svg = "<svg>" + svg + "</svg>";
35135             full = false;
35136           }
35137           div.innerHTML = svg;
35138           svg = div.getElementsByTagName("svg")[0];
35139           if (svg) {
35140             if (full) {
35141               f = svg;
35142             } else {
35143               while (svg.firstChild) {
35144                 f.appendChild(svg.firstChild);
35145               }
35146               div.innerHTML = E;
35147             }
35148           }
35149           return new Fragment(f);
35150         };
35151
35152         function Fragment(frag) {
35153           this.node = frag;
35154         }
35155         // SIERRA Snap.fragment() could especially use a code example
35156         /*
35157          * \ Snap.fragment [ method ] * Creates a DOM fragment from a given list of
35158          * elements or strings * - varargs (…) SVG string = (Fragment) the
35159          * @Fragment \
35160          */
35161         Snap.fragment = function() {
35162           var args = Array.prototype.slice.call(arguments, 0),
35163             f = glob.doc.createDocumentFragment();
35164           for (var i = 0, ii = args.length; i < ii; i++) {
35165             var item = args[i];
35166             if (item.node && item.node.nodeType) {
35167               f.appendChild(item.node);
35168             }
35169             if (item.nodeType) {
35170               f.appendChild(item);
35171             }
35172             if (typeof item == "string") {
35173               f.appendChild(Snap.parse(item).node);
35174             }
35175           }
35176           return new Fragment(f);
35177         };
35178
35179         function make(name, parent) {
35180           var res = $(name);
35181           parent.appendChild(res);
35182           var el = wrap(res);
35183           return el;
35184         }
35185
35186         function Paper(w, h) {
35187           var res,
35188             desc,
35189             defs,
35190             proto = Paper.prototype;
35191           if (w && w.tagName == "svg") {
35192             if (w.snap in hub) {
35193               return hub[w.snap];
35194             }
35195             var doc = w.ownerDocument;
35196             res = new Element(w);
35197             desc = w.getElementsByTagName("desc")[0];
35198             defs = w.getElementsByTagName("defs")[0];
35199             if (!desc) {
35200               desc = $("desc");
35201               desc.appendChild(doc.createTextNode("Created with Snap"));
35202               res.node.appendChild(desc);
35203             }
35204             if (!defs) {
35205               defs = $("defs");
35206               res.node.appendChild(defs);
35207             }
35208             res.defs = defs;
35209             for (var key in proto)
35210               if (proto[has](key)) {
35211                 res[key] = proto[key];
35212               }
35213             res.paper = res.root = res;
35214           } else {
35215             res = make("svg", glob.doc.body);
35216             $(res.node, {
35217               height: h,
35218               version: 1.1,
35219               width: w,
35220               xmlns: xmlns
35221             });
35222           }
35223           return res;
35224         }
35225
35226         function wrap(dom) {
35227           if (!dom) {
35228             return dom;
35229           }
35230           if (dom instanceof Element || dom instanceof Fragment) {
35231             return dom;
35232           }
35233           if (dom.tagName && dom.tagName.toLowerCase() == "svg") {
35234             return new Paper(dom);
35235           }
35236           if (dom.tagName && dom.tagName.toLowerCase() == "object" && dom.type == "image/svg+xml") {
35237             return new Paper(dom.contentDocument.getElementsByTagName("svg")[0]);
35238           }
35239           return new Element(dom);
35240         }
35241
35242         Snap._.make = make;
35243         Snap._.wrap = wrap;
35244         /*
35245          * \ Paper.el [ method ] * Creates an element on paper with a given name and no
35246          * attributes * - name (string) tag name - attr (object) attributes = (Element)
35247          * the current element > Usage | var c = paper.circle(10, 10, 10); // is the
35248          * same as... | var c = paper.el("circle").attr({ | cx: 10, | cy: 10, | r: 10 |
35249          * }); | // and the same as | var c = paper.el("circle", { | cx: 10, | cy: 10, |
35250          * r: 10 | }); \
35251          */
35252         Paper.prototype.el = function(name, attr) {
35253           var el = make(name, this.node);
35254           attr && el.attr(attr);
35255           return el;
35256         };
35257         // default
35258         eve.on("snap.util.getattr", function() {
35259           var att = eve.nt();
35260           att = att.substring(att.lastIndexOf(".") + 1);
35261           var css = att.replace(/[A-Z]/g, function(letter) {
35262             return "-" + letter.toLowerCase();
35263           });
35264           if (cssAttr[has](css)) {
35265             return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);
35266           } else {
35267             return $(this.node, att);
35268           }
35269         });
35270         var cssAttr = {
35271           "alignment-baseline": 0,
35272           "baseline-shift": 0,
35273           "clip": 0,
35274           "clip-path": 0,
35275           "clip-rule": 0,
35276           "color": 0,
35277           "color-interpolation": 0,
35278           "color-interpolation-filters": 0,
35279           "color-profile": 0,
35280           "color-rendering": 0,
35281           "cursor": 0,
35282           "direction": 0,
35283           "display": 0,
35284           "dominant-baseline": 0,
35285           "enable-background": 0,
35286           "fill": 0,
35287           "fill-opacity": 0,
35288           "fill-rule": 0,
35289           "filter": 0,
35290           "flood-color": 0,
35291           "flood-opacity": 0,
35292           "font": 0,
35293           "font-family": 0,
35294           "font-size": 0,
35295           "font-size-adjust": 0,
35296           "font-stretch": 0,
35297           "font-style": 0,
35298           "font-variant": 0,
35299           "font-weight": 0,
35300           "glyph-orientation-horizontal": 0,
35301           "glyph-orientation-vertical": 0,
35302           "image-rendering": 0,
35303           "kerning": 0,
35304           "letter-spacing": 0,
35305           "lighting-color": 0,
35306           "marker": 0,
35307           "marker-end": 0,
35308           "marker-mid": 0,
35309           "marker-start": 0,
35310           "mask": 0,
35311           "opacity": 0,
35312           "overflow": 0,
35313           "pointer-events": 0,
35314           "shape-rendering": 0,
35315           "stop-color": 0,
35316           "stop-opacity": 0,
35317           "stroke": 0,
35318           "stroke-dasharray": 0,
35319           "stroke-dashoffset": 0,
35320           "stroke-linecap": 0,
35321           "stroke-linejoin": 0,
35322           "stroke-miterlimit": 0,
35323           "stroke-opacity": 0,
35324           "stroke-width": 0,
35325           "text-anchor": 0,
35326           "text-decoration": 0,
35327           "text-rendering": 0,
35328           "unicode-bidi": 0,
35329           "visibility": 0,
35330           "word-spacing": 0,
35331           "writing-mode": 0
35332         };
35333
35334         eve.on("snap.util.attr", function(value) {
35335           var att = eve.nt(),
35336             attr = {};
35337           att = att.substring(att.lastIndexOf(".") + 1);
35338           attr[att] = value;
35339           var style = att.replace(/-(\w)/gi, function(all, letter) {
35340               return letter.toUpperCase();
35341             }),
35342             css = att.replace(/[A-Z]/g, function(letter) {
35343               return "-" + letter.toLowerCase();
35344             });
35345           if (cssAttr[has](css)) {
35346             this.node.style[style] = value == null ? E : value;
35347           } else {
35348             $(this.node, attr);
35349           }
35350         });
35351         (function(proto) {}(Paper.prototype));
35352
35353         // simple ajax
35354         /*
35355          * \ Snap.ajax [ method ] * Simple implementation of Ajax * - url (string) URL -
35356          * postData (object|string) data for post request - callback (function) callback -
35357          * scope (object) #optional scope of callback or - url (string) URL - callback
35358          * (function) callback - scope (object) #optional scope of callback =
35359          * (XMLHttpRequest) the XMLHttpRequest object, just in case \
35360          */
35361         Snap.ajax = function(url, postData, callback, scope) {
35362           var req = new XMLHttpRequest,
35363             id = ID();
35364           if (req) {
35365             if (is(postData, "function")) {
35366               scope = callback;
35367               callback = postData;
35368               postData = null;
35369             } else if (is(postData, "object")) {
35370               var pd = [];
35371               for (var key in postData)
35372                 if (postData.hasOwnProperty(key)) {
35373                   pd.push(encodeURIComponent(key) + "=" + encodeURIComponent(postData[key]));
35374                 }
35375               postData = pd.join("&");
35376             }
35377             req.open((postData ? "POST" : "GET"), url, true);
35378             if (postData) {
35379               req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
35380               req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
35381             }
35382             if (callback) {
35383               eve.once("snap.ajax." + id + ".0", callback);
35384               eve.once("snap.ajax." + id + ".200", callback);
35385               eve.once("snap.ajax." + id + ".304", callback);
35386             }
35387             req.onreadystatechange = function() {
35388               if (req.readyState != 4) return;
35389               eve("snap.ajax." + id + "." + req.status, scope, req);
35390             };
35391             if (req.readyState == 4) {
35392               return req;
35393             }
35394             req.send(postData);
35395             return req;
35396           }
35397         };
35398         /*
35399          * \ Snap.load [ method ] * Loads external SVG file as a @Fragment (see
35400          * @Snap.ajax for more advanced AJAX) * - url (string) URL - callback (function)
35401          * callback - scope (object) #optional scope of callback \
35402          */
35403         Snap.load = function(url, callback, scope) {
35404           Snap.ajax(url, function(req) {
35405             var f = Snap.parse(req.responseText);
35406             scope ? callback.call(scope, f) : callback(f);
35407           });
35408         };
35409         var getOffset = function(elem) {
35410           var box = elem.getBoundingClientRect(),
35411             doc = elem.ownerDocument,
35412             body = doc.body,
35413             docElem = doc.documentElement,
35414             clientTop = docElem.clientTop || body.clientTop || 0,
35415             clientLeft = docElem.clientLeft || body.clientLeft || 0,
35416             top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop) - clientTop,
35417             left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
35418           return {
35419             y: top,
35420             x: left
35421           };
35422         };
35423         /*
35424          * \ Snap.getElementByPoint [ method ] * Returns you topmost element under given
35425          * point. * = (object) Snap element object - x (number) x coordinate from the
35426          * top left corner of the window - y (number) y coordinate from the top left
35427          * corner of the window > Usage | Snap.getElementByPoint(mouseX,
35428          * mouseY).attr({stroke: "#f00"}); \
35429          */
35430         Snap.getElementByPoint = function(x, y) {
35431           var paper = this,
35432             svg = paper.canvas,
35433             target = glob.doc.elementFromPoint(x, y);
35434           if (glob.win.opera && target.tagName == "svg") {
35435             var so = getOffset(target),
35436               sr = target.createSVGRect();
35437             sr.x = x - so.x;
35438             sr.y = y - so.y;
35439             sr.width = sr.height = 1;
35440             var hits = target.getIntersectionList(sr, null);
35441             if (hits.length) {
35442               target = hits[hits.length - 1];
35443             }
35444           }
35445           if (!target) {
35446             return null;
35447           }
35448           return wrap(target);
35449         };
35450         /*
35451          * \ Snap.plugin [ method ] * Let you write plugins. You pass in a function with
35452          * four arguments, like this: | Snap.plugin(function (Snap, Element, Paper,
35453          * global, Fragment) { | Snap.newmethod = function () {}; |
35454          * Element.prototype.newmethod = function () {}; | Paper.prototype.newmethod =
35455          * function () {}; | }); Inside the function you have access to all main objects
35456          * (and their prototypes). This allow you to extend anything you want. * - f
35457          * (function) your plugin body \
35458          */
35459         Snap.plugin = function(f) {
35460           f(Snap, Element, Paper, glob, Fragment);
35461         };
35462         glob.win.Snap = Snap;
35463         return Snap;
35464       }(window || this));
35465       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
35466       //
35467       // Licensed under the Apache License, Version 2.0 (the "License");
35468       // you may not use this file except in compliance with the License.
35469       // You may obtain a copy of the License at
35470       //
35471       // http://www.apache.org/licenses/LICENSE-2.0
35472       //
35473       // Unless required by applicable law or agreed to in writing, software
35474       // distributed under the License is distributed on an "AS IS" BASIS,
35475       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35476       // See the License for the specific language governing permissions and
35477       // limitations under the License.
35478       Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
35479         var elproto = Element.prototype,
35480           is = Snap.is,
35481           Str = String,
35482           unit2px = Snap._unit2px,
35483           $ = Snap._.$,
35484           make = Snap._.make,
35485           getSomeDefs = Snap._.getSomeDefs,
35486           has = "hasOwnProperty",
35487           wrap = Snap._.wrap;
35488         /*
35489          * \ Element.getBBox [ method ] * Returns the bounding box descriptor for
35490          * the given element * = (object) bounding box descriptor: o { o cx:
35491          * (number) x of the center, o cy: (number) x of the center, o h: (number)
35492          * height, o height: (number) height, o path: (string) path command for the
35493          * box, o r0: (number) radius of a circle that fully encloses the box, o r1:
35494          * (number) radius of the smallest circle that can be enclosed, o r2:
35495          * (number) radius of the largest circle that can be enclosed, o vb:
35496          * (string) box as a viewbox command, o w: (number) width, o width: (number)
35497          * width, o x2: (number) x of the right side, o x: (number) x of the left
35498          * side, o y2: (number) y of the bottom edge, o y: (number) y of the top
35499          * edge o } \
35500          */
35501         elproto.getBBox = function(isWithoutTransform) {
35502           if (!Snap.Matrix || !Snap.path) {
35503             return this.node.getBBox();
35504           }
35505           var el = this,
35506             m = new Snap.Matrix;
35507           if (el.removed) {
35508             return Snap._.box();
35509           }
35510           while (el.type == "use") {
35511             if (!isWithoutTransform) {
35512               m = m.add(el.transform().localMatrix.translate(el.attr("x") || 0, el.attr("y") || 0));
35513             }
35514             if (el.original) {
35515               el = el.original;
35516             } else {
35517               var href = el.attr("xlink:href");
35518               el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf("#") + 1));
35519             }
35520           }
35521           var _ = el._,
35522             pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;
35523           try {
35524             if (isWithoutTransform) {
35525               _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());
35526               return Snap._.box(_.bboxwt);
35527             } else {
35528               el.realPath = pathfinder(el);
35529               el.matrix = el.transform().localMatrix;
35530               _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));
35531               return Snap._.box(_.bbox);
35532             }
35533           } catch (e) {
35534             // Firefox doesn’t give you bbox of hidden element
35535             return Snap._.box();
35536           }
35537         };
35538         var propString = function() {
35539           return this.string;
35540         };
35541
35542         function extractTransform(el, tstr) {
35543           if (tstr == null) {
35544             var doReturn = true;
35545             if (el.type == "linearGradient" || el.type == "radialGradient") {
35546               tstr = el.node.getAttribute("gradientTransform");
35547             } else if (el.type == "pattern") {
35548               tstr = el.node.getAttribute("patternTransform");
35549             } else {
35550               tstr = el.node.getAttribute("transform");
35551             }
35552             if (!tstr) {
35553               return new Snap.Matrix;
35554             }
35555             tstr = Snap._.svgTransform2string(tstr);
35556           } else {
35557             if (!Snap._.rgTransform.test(tstr)) {
35558               tstr = Snap._.svgTransform2string(tstr);
35559             } else {
35560               tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E);
35561             }
35562             if (is(tstr, "array")) {
35563               tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);
35564             }
35565             el._.transform = tstr;
35566           }
35567           var m = Snap._.transform2matrix(tstr, el.getBBox(1));
35568           if (doReturn) {
35569             return m;
35570           } else {
35571             el.matrix = m;
35572           }
35573         }
35574         /*
35575          * \ Element.transform [ method ] * Gets or sets transformation of the
35576          * element * - tstr (string) transform string in Snap or SVG format =
35577          * (Element) the current element or = (object) transformation descriptor: o {
35578          * o string (string) transform string, o globalMatrix (Matrix) matrix of all
35579          * transformations applied to element or its parents, o localMatrix (Matrix)
35580          * matrix of transformations applied only to the element, o diffMatrix
35581          * (Matrix) matrix of difference between global and local transformations, o
35582          * global (string) global transformation as string, o local (string) local
35583          * transformation as string, o toString (function) returns `string` property
35584          * o } \
35585          */
35586         elproto.transform = function(tstr) {
35587           var _ = this._;
35588           if (tstr == null) {
35589             var papa = this,
35590               global = new Snap.Matrix(this.node.getCTM()),
35591               local = extractTransform(this),
35592               ms = [local],
35593               m = new Snap.Matrix,
35594               i,
35595               localString = local.toTransformString(),
35596               string = Str(local) == Str(this.matrix) ?
35597               Str(_.transform) : localString;
35598             while (papa.type != "svg" && (papa = papa.parent())) {
35599               ms.push(extractTransform(papa));
35600             }
35601             i = ms.length;
35602             while (i--) {
35603               m.add(ms[i]);
35604             }
35605             return {
35606               string: string,
35607               globalMatrix: global,
35608               totalMatrix: m,
35609               localMatrix: local,
35610               diffMatrix: global.clone().add(local.invert()),
35611               global: global.toTransformString(),
35612               total: m.toTransformString(),
35613               local: localString,
35614               toString: propString
35615             };
35616           }
35617           if (tstr instanceof Snap.Matrix) {
35618             this.matrix = tstr;
35619             this._.transform = tstr.toTransformString();
35620           } else {
35621             extractTransform(this, tstr);
35622           }
35623
35624           if (this.node) {
35625             if (this.type == "linearGradient" || this.type == "radialGradient") {
35626               $(this.node, {
35627                 gradientTransform: this.matrix
35628               });
35629             } else if (this.type == "pattern") {
35630               $(this.node, {
35631                 patternTransform: this.matrix
35632               });
35633             } else {
35634               $(this.node, {
35635                 transform: this.matrix
35636               });
35637             }
35638           }
35639
35640           return this;
35641         };
35642         /*
35643          * \ Element.parent [ method ] * Returns the element's parent * = (Element)
35644          * the parent element \
35645          */
35646         elproto.parent = function() {
35647           return wrap(this.node.parentNode);
35648         };
35649         /*
35650          * \ Element.append [ method ] * Appends the given element to current one * -
35651          * el (Element|Set) element to append = (Element) the parent element \
35652          */
35653         /*
35654          * \ Element.add [ method ] * See @Element.append \
35655          */
35656         elproto.append = elproto.add = function(el) {
35657           if (el) {
35658             if (el.type == "set") {
35659               var it = this;
35660               el.forEach(function(el) {
35661                 it.add(el);
35662               });
35663               return this;
35664             }
35665             el = wrap(el);
35666             this.node.appendChild(el.node);
35667             el.paper = this.paper;
35668           }
35669           return this;
35670         };
35671         /*
35672          * \ Element.appendTo [ method ] * Appends the current element to the given
35673          * one * - el (Element) parent element to append to = (Element) the child
35674          * element \
35675          */
35676         elproto.appendTo = function(el) {
35677           if (el) {
35678             el = wrap(el);
35679             el.append(this);
35680           }
35681           return this;
35682         };
35683         /*
35684          * \ Element.prepend [ method ] * Prepends the given element to the current
35685          * one * - el (Element) element to prepend = (Element) the parent element \
35686          */
35687         elproto.prepend = function(el) {
35688           if (el) {
35689             if (el.type == "set") {
35690               var it = this,
35691                 first;
35692               el.forEach(function(el) {
35693                 if (first) {
35694                   first.after(el);
35695                 } else {
35696                   it.prepend(el);
35697                 }
35698                 first = el;
35699               });
35700               return this;
35701             }
35702             el = wrap(el);
35703             var parent = el.parent();
35704             this.node.insertBefore(el.node, this.node.firstChild);
35705             this.add && this.add();
35706             el.paper = this.paper;
35707             this.parent() && this.parent().add();
35708             parent && parent.add();
35709           }
35710           return this;
35711         };
35712         /*
35713          * \ Element.prependTo [ method ] * Prepends the current element to the
35714          * given one * - el (Element) parent element to prepend to = (Element) the
35715          * child element \
35716          */
35717         elproto.prependTo = function(el) {
35718           el = wrap(el);
35719           el.prepend(this);
35720           return this;
35721         };
35722         /*
35723          * \ Element.before [ method ] * Inserts given element before the current
35724          * one * - el (Element) element to insert = (Element) the parent element \
35725          */
35726         elproto.before = function(el) {
35727           if (el.type == "set") {
35728             var it = this;
35729             el.forEach(function(el) {
35730               var parent = el.parent();
35731               it.node.parentNode.insertBefore(el.node, it.node);
35732               parent && parent.add();
35733             });
35734             this.parent().add();
35735             return this;
35736           }
35737           el = wrap(el);
35738           var parent = el.parent();
35739           this.node.parentNode.insertBefore(el.node, this.node);
35740           this.parent() && this.parent().add();
35741           parent && parent.add();
35742           el.paper = this.paper;
35743           return this;
35744         };
35745         /*
35746          * \ Element.after [ method ] * Inserts given element after the current one * -
35747          * el (Element) element to insert = (Element) the parent element \
35748          */
35749         elproto.after = function(el) {
35750           el = wrap(el);
35751           var parent = el.parent();
35752           if (this.node.nextSibling) {
35753             this.node.parentNode.insertBefore(el.node, this.node.nextSibling);
35754           } else {
35755             this.node.parentNode.appendChild(el.node);
35756           }
35757           this.parent() && this.parent().add();
35758           parent && parent.add();
35759           el.paper = this.paper;
35760           return this;
35761         };
35762         /*
35763          * \ Element.insertBefore [ method ] * Inserts the element after the given
35764          * one * - el (Element) element next to whom insert to = (Element) the
35765          * parent element \
35766          */
35767         elproto.insertBefore = function(el) {
35768           el = wrap(el);
35769           var parent = this.parent();
35770           el.node.parentNode.insertBefore(this.node, el.node);
35771           this.paper = el.paper;
35772           parent && parent.add();
35773           el.parent() && el.parent().add();
35774           return this;
35775         };
35776         /*
35777          * \ Element.insertAfter [ method ] * Inserts the element after the given
35778          * one * - el (Element) element next to whom insert to = (Element) the
35779          * parent element \
35780          */
35781         elproto.insertAfter = function(el) {
35782           el = wrap(el);
35783           var parent = this.parent();
35784           el.node.parentNode.insertBefore(this.node, el.node.nextSibling);
35785           this.paper = el.paper;
35786           parent && parent.add();
35787           el.parent() && el.parent().add();
35788           return this;
35789         };
35790         /*
35791          * \ Element.remove [ method ] * Removes element from the DOM = (Element)
35792          * the detached element \
35793          */
35794         elproto.remove = function() {
35795           var parent = this.parent();
35796           this.node.parentNode && this.node.parentNode.removeChild(this.node);
35797           delete this.paper;
35798           this.removed = true;
35799           parent && parent.add();
35800           return this;
35801         };
35802         /*
35803          * \ Element.select [ method ] * Gathers the nested @Element matching the
35804          * given set of CSS selectors * - query (string) CSS selector = (Element)
35805          * result of query selection \
35806          */
35807         elproto.select = function(query) {
35808           query = Str(query).replace(/([^\\]):/g, "$1\\:");
35809           return wrap(this.node.querySelector(query));
35810         };
35811         /*
35812          * \ Element.selectAll [ method ] * Gathers nested @Element objects matching
35813          * the given set of CSS selectors * - query (string) CSS selector =
35814          * (Set|array) result of query selection \
35815          */
35816         elproto.selectAll = function(query) {
35817           var nodelist = this.node.querySelectorAll(query),
35818             set = (Snap.set || Array)();
35819           for (var i = 0; i < nodelist.length; i++) {
35820             set.push(wrap(nodelist[i]));
35821           }
35822           return set;
35823         };
35824         /*
35825          * \ Element.asPX [ method ] * Returns given attribute of the element as a
35826          * `px` value (not %, em, etc.) * - attr (string) attribute name - value
35827          * (string) #optional attribute value = (Element) result of query selection \
35828          */
35829         elproto.asPX = function(attr, value) {
35830           if (value == null) {
35831             value = this.attr(attr);
35832           }
35833           return +unit2px(this, attr, value);
35834         };
35835         // SIERRA Element.use(): I suggest adding a note about how to access the
35836         // original element the returned <use> instantiates. It's a part of SVG with
35837         // which ordinary web developers may be least familiar.
35838         /*
35839          * \ Element.use [ method ] * Creates a `<use>` element linked to the
35840          * current element * = (Element) the `<use>` element \
35841          */
35842         elproto.use = function() {
35843           var use,
35844             id = this.node.id;
35845           if (!id) {
35846             id = this.id;
35847             $(this.node, {
35848               id: id
35849             });
35850           }
35851           if (this.type == "linearGradient" || this.type == "radialGradient" ||
35852             this.type == "pattern") {
35853             use = make(this.type, this.node.parentNode);
35854           } else {
35855             use = make("use", this.node.parentNode);
35856           }
35857           $(use.node, {
35858             "xlink:href": "#" + id
35859           });
35860           use.original = this;
35861           return use;
35862         };
35863
35864         function fixids(el) {
35865           var els = el.selectAll("*"),
35866             it,
35867             url = /^\s*url\(("|'|)(.*)\1\)\s*$/,
35868             ids = [],
35869             uses = {};
35870
35871           function urltest(it, name) {
35872             var val = $(it.node, name);
35873             val = val && val.match(url);
35874             val = val && val[2];
35875             if (val && val.charAt() == "#") {
35876               val = val.substring(1);
35877             } else {
35878               return;
35879             }
35880             if (val) {
35881               uses[val] = (uses[val] || []).concat(function(id) {
35882                 var attr = {};
35883                 attr[name] = URL(id);
35884                 $(it.node, attr);
35885               });
35886             }
35887           }
35888
35889           function linktest(it) {
35890             var val = $(it.node, "xlink:href");
35891             if (val && val.charAt() == "#") {
35892               val = val.substring(1);
35893             } else {
35894               return;
35895             }
35896             if (val) {
35897               uses[val] = (uses[val] || []).concat(function(id) {
35898                 it.attr("xlink:href", "#" + id);
35899               });
35900             }
35901           }
35902           for (var i = 0, ii = els.length; i < ii; i++) {
35903             it = els[i];
35904             urltest(it, "fill");
35905             urltest(it, "stroke");
35906             urltest(it, "filter");
35907             urltest(it, "mask");
35908             urltest(it, "clip-path");
35909             linktest(it);
35910             var oldid = $(it.node, "id");
35911             if (oldid) {
35912               $(it.node, {
35913                 id: it.id
35914               });
35915               ids.push({
35916                 old: oldid,
35917                 id: it.id
35918               });
35919             }
35920           }
35921           for (i = 0, ii = ids.length; i < ii; i++) {
35922             var fs = uses[ids[i].old];
35923             if (fs) {
35924               for (var j = 0, jj = fs.length; j < jj; j++) {
35925                 fs[j](ids[i].id);
35926               }
35927             }
35928           }
35929         }
35930         /*
35931          * \ Element.clone [ method ] * Creates a clone of the element and inserts
35932          * it after the element * = (Element) the clone \
35933          */
35934         elproto.clone = function() {
35935           var clone = wrap(this.node.cloneNode(true));
35936           if ($(clone.node, "id")) {
35937             $(clone.node, {
35938               id: clone.id
35939             });
35940           }
35941           fixids(clone);
35942           clone.insertAfter(this);
35943           return clone;
35944         };
35945         /*
35946          * \ Element.toDefs [ method ] * Moves element to the shared `<defs>` area * =
35947          * (Element) the element \
35948          */
35949         elproto.toDefs = function() {
35950           var defs = getSomeDefs(this);
35951           defs.appendChild(this.node);
35952           return this;
35953         };
35954         /*
35955          * \ Element.toPattern [ method ] * Creates a `<pattern>` element from the
35956          * current element * To create a pattern you have to specify the pattern
35957          * rect: - x (string|number) - y (string|number) - width (string|number) -
35958          * height (string|number) = (Element) the `<pattern>` element You can use
35959          * pattern later on as an argument for `fill` attribute: | var p =
35960          * paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({ | fill: "none", |
35961          * stroke: "#bada55", | strokeWidth: 5 | }).pattern(0, 0, 10, 10), | c =
35962          * paper.circle(200, 200, 100); | c.attr({ | fill: p | }); \
35963          */
35964         elproto.pattern = elproto.toPattern = function(x, y, width, height) {
35965           var p = make("pattern", getSomeDefs(this));
35966           if (x == null) {
35967             x = this.getBBox();
35968           }
35969           if (is(x, "object") && "x" in x) {
35970             y = x.y;
35971             width = x.width;
35972             height = x.height;
35973             x = x.x;
35974           }
35975           $(p.node, {
35976             x: x,
35977             y: y,
35978             width: width,
35979             height: height,
35980             patternUnits: "userSpaceOnUse",
35981             id: p.id,
35982             viewBox: [x, y, width, height].join(" ")
35983           });
35984           p.node.appendChild(this.node);
35985           return p;
35986         };
35987         // SIERRA Element.marker(): clarify what a reference point is. E.g., helps you
35988         // offset the object from its edge such as when centering it over a path.
35989         // SIERRA Element.marker(): I suggest the method should accept default reference
35990         // point values. Perhaps centered with (refX = width/2) and (refY = height/2)?
35991         // Also, couldn't it assume the element's current _width_ and _height_? And
35992         // please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't
35993         // they also be assigned default values?
35994         /*
35995          * \ Element.marker [ method ] * Creates a `<marker>` element from the
35996          * current element * To create a marker you have to specify the bounding
35997          * rect and reference point: - x (number) - y (number) - width (number) -
35998          * height (number) - refX (number) - refY (number) = (Element) the `<marker>`
35999          * element You can specify the marker later as an argument for
36000          * `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The
36001          * `marker` attribute places the marker at every point along the path, and
36002          * `marker-mid` places them at every point except the start and end. \
36003          */
36004         // TODO add usage for markers
36005         elproto.marker = function(x, y, width, height, refX, refY) {
36006           var p = make("marker", getSomeDefs(this));
36007           if (x == null) {
36008             x = this.getBBox();
36009           }
36010           if (is(x, "object") && "x" in x) {
36011             y = x.y;
36012             width = x.width;
36013             height = x.height;
36014             refX = x.refX || x.cx;
36015             refY = x.refY || x.cy;
36016             x = x.x;
36017           }
36018           $(p.node, {
36019             viewBox: [x, y, width, height].join(" "),
36020             markerWidth: width,
36021             markerHeight: height,
36022             orient: "auto",
36023             refX: refX || 0,
36024             refY: refY || 0,
36025             id: p.id
36026           });
36027           p.node.appendChild(this.node);
36028           return p;
36029         };
36030         // animation
36031         function slice(from, to, f) {
36032           return function(arr) {
36033             var res = arr.slice(from, to);
36034             if (res.length == 1) {
36035               res = res[0];
36036             }
36037             return f ? f(res) : res;
36038           };
36039         }
36040         var Animation = function(attr, ms, easing, callback) {
36041           if (typeof easing == "function" && !easing.length) {
36042             callback = easing;
36043             easing = mina.linear;
36044           }
36045           this.attr = attr;
36046           this.dur = ms;
36047           easing && (this.easing = easing);
36048           callback && (this.callback = callback);
36049         };
36050         Snap._.Animation = Animation;
36051         /*
36052          * \ Snap.animation [ method ] * Creates an animation object * - attr
36053          * (object) attributes of final destination - duration (number) duration of
36054          * the animation, in milliseconds - easing (function) #optional one of
36055          * easing functions of @mina or custom one - callback (function) #optional
36056          * callback function that fires when animation ends = (object) animation
36057          * object \
36058          */
36059         Snap.animation = function(attr, ms, easing, callback) {
36060           return new Animation(attr, ms, easing, callback);
36061         };
36062         /*
36063          * \ Element.inAnim [ method ] * Returns a set of animations that may be
36064          * able to manipulate the current element * = (object) in format: o { o anim
36065          * (object) animation object, o mina (object) @mina object, o curStatus
36066          * (number) 0..1 ÃƒÆ’¢â‚¬â€� status of the animation: 0 ÃƒÆ’¢â‚¬â€� just started,
36067          * 1 ÃƒÆ’¢â‚¬â€� just finished, o status (function) gets or sets the status of
36068          * the animation, o stop (function) stops the animation o } \
36069          */
36070         elproto.inAnim = function() {
36071           var el = this,
36072             res = [];
36073           for (var id in el.anims)
36074             if (el.anims[has](id)) {
36075               (function(a) {
36076                 res.push({
36077                   anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
36078                   mina: a,
36079                   curStatus: a.status(),
36080                   status: function(val) {
36081                     return a.status(val);
36082                   },
36083                   stop: function() {
36084                     a.stop();
36085                   }
36086                 });
36087               }(el.anims[id]));
36088             }
36089           return res;
36090         };
36091         /*
36092          * \ Snap.animate [ method ] * Runs generic animation of one number into
36093          * another with a caring function * - from (number|array) number or array of
36094          * numbers - to (number|array) number or array of numbers - setter
36095          * (function) caring function that accepts one number argument - duration
36096          * (number) duration, in milliseconds - easing (function) #optional easing
36097          * function from @mina or custom - callback (function) #optional callback
36098          * function to execute when animation ends = (object) animation object in
36099          * @mina format o { o id (string) animation id, consider it read-only, o
36100          * duration (function) gets or sets the duration of the animation, o easing
36101          * (function) easing, o speed (function) gets or sets the speed of the
36102          * animation, o status (function) gets or sets the status of the animation,
36103          * o stop (function) stops the animation o } | var rect = Snap().rect(0, 0,
36104          * 10, 10); | Snap.animate(0, 10, function (val) { | rect.attr({ | x: val |
36105          * }); | }, 1000); | // in given context is equivalent to | rect.animate({x:
36106          * 10}, 1000); \
36107          */
36108         Snap.animate = function(from, to, setter, ms, easing, callback) {
36109           if (typeof easing == "function" && !easing.length) {
36110             callback = easing;
36111             easing = mina.linear;
36112           }
36113           var now = mina.time(),
36114             anim = mina(from, to, now, now + ms, mina.time, setter, easing);
36115           callback && eve.once("mina.finish." + anim.id, callback);
36116           return anim;
36117         };
36118         /*
36119          * \ Element.stop [ method ] * Stops all the animations for the current
36120          * element * = (Element) the current element \
36121          */
36122         elproto.stop = function() {
36123           var anims = this.inAnim();
36124           for (var i = 0, ii = anims.length; i < ii; i++) {
36125             anims[i].stop();
36126           }
36127           return this;
36128         };
36129         /*
36130          * \ Element.animate [ method ] * Animates the given attributes of the
36131          * element * - attrs (object) key-value pairs of destination attributes -
36132          * duration (number) duration of the animation in milliseconds - easing
36133          * (function) #optional easing function from @mina or custom - callback
36134          * (function) #optional callback function that executes when the animation
36135          * ends = (Element) the current element \
36136          */
36137         elproto.animate = function(attrs, ms, easing, callback) {
36138           if (typeof easing == "function" && !easing.length) {
36139             callback = easing;
36140             easing = mina.linear;
36141           }
36142           if (attrs instanceof Animation) {
36143             callback = attrs.callback;
36144             easing = attrs.easing;
36145             ms = easing.dur;
36146             attrs = attrs.attr;
36147           }
36148           var fkeys = [],
36149             tkeys = [],
36150             keys = {},
36151             from, to, f, eq,
36152             el = this;
36153           for (var key in attrs)
36154             if (attrs[has](key)) {
36155               if (el.equal) {
36156                 eq = el.equal(key, Str(attrs[key]));
36157                 from = eq.from;
36158                 to = eq.to;
36159                 f = eq.f;
36160               } else {
36161                 from = +el.attr(key);
36162                 to = +attrs[key];
36163               }
36164               var len = is(from, "array") ? from.length : 1;
36165               keys[key] = slice(fkeys.length, fkeys.length + len, f);
36166               fkeys = fkeys.concat(from);
36167               tkeys = tkeys.concat(to);
36168             }
36169           var now = mina.time(),
36170             anim = mina(fkeys, tkeys, now, now + ms, mina.time, function(val) {
36171               var attr = {};
36172               for (var key in keys)
36173                 if (keys[has](key)) {
36174                   attr[key] = keys[key](val);
36175                 }
36176               el.attr(attr);
36177             }, easing);
36178           el.anims[anim.id] = anim;
36179           anim._attrs = attrs;
36180           anim._callback = callback;
36181           eve("snap.animcreated." + el.id, anim);
36182           eve.once("mina.finish." + anim.id, function() {
36183             delete el.anims[anim.id];
36184             callback && callback.call(el);
36185           });
36186           eve.once("mina.stop." + anim.id, function() {
36187             delete el.anims[anim.id];
36188           });
36189           return el;
36190         };
36191         var eldata = {};
36192         /*
36193          * \ Element.data [ method ] * Adds or retrieves given value associated with
36194          * given key. (Don’t confuse with `data-` attributes)
36195          *
36196          * See also @Element.removeData - key (string) key to store data - value
36197          * (any) #optional value to store = (object) @Element or, if value is not
36198          * specified: = (any) value > Usage | for (var i = 0, i < 5, i++) { |
36199          * paper.circle(10 + 15 * i, 10, 10) | .attr({fill: "#000"}) | .data("i", i) |
36200          * .click(function () { | alert(this.data("i")); | }); | } \
36201          */
36202         elproto.data = function(key, value) {
36203           var data = eldata[this.id] = eldata[this.id] || {};
36204           if (arguments.length == 0) {
36205             eve("snap.data.get." + this.id, this, data, null);
36206             return data;
36207           }
36208           if (arguments.length == 1) {
36209             if (Snap.is(key, "object")) {
36210               for (var i in key)
36211                 if (key[has](i)) {
36212                   this.data(i, key[i]);
36213                 }
36214               return this;
36215             }
36216             eve("snap.data.get." + this.id, this, data[key], key);
36217             return data[key];
36218           }
36219           data[key] = value;
36220           eve("snap.data.set." + this.id, this, value, key);
36221           return this;
36222         };
36223         /*
36224          * \ Element.removeData [ method ] * Removes value associated with an
36225          * element by given key. If key is not provided, removes all the data of the
36226          * element. - key (string) #optional key = (object) @Element \
36227          */
36228         elproto.removeData = function(key) {
36229           if (key == null) {
36230             eldata[this.id] = {};
36231           } else {
36232             eldata[this.id] && delete eldata[this.id][key];
36233           }
36234           return this;
36235         };
36236         /*
36237          * \ Element.outerSVG [ method ] * Returns SVG code for the element,
36238          * equivalent to HTML's `outerHTML`.
36239          *
36240          * See also @Element.innerSVG = (string) SVG code for the element \
36241          */
36242         /*
36243          * \ Element.toString [ method ] * See @Element.outerSVG \
36244          */
36245         elproto.outerSVG = elproto.toString = toString(1);
36246         /*
36247          * \ Element.innerSVG [ method ] * Returns SVG code for the element's
36248          * contents, equivalent to HTML's `innerHTML` = (string) SVG code for the
36249          * element \
36250          */
36251         elproto.innerSVG = toString();
36252
36253         function toString(type) {
36254           return function() {
36255             var res = type ? "<" + this.type : "",
36256               attr = this.node.attributes,
36257               chld = this.node.childNodes;
36258             if (type) {
36259               for (var i = 0, ii = attr.length; i < ii; i++) {
36260                 res += " " + attr[i].name + '="' +
36261                   attr[i].value.replace(/"/g, '\\"') + '"';
36262               }
36263             }
36264             if (chld.length) {
36265               type && (res += ">");
36266               for (i = 0, ii = chld.length; i < ii; i++) {
36267                 if (chld[i].nodeType == 3) {
36268                   res += chld[i].nodeValue;
36269                 } else if (chld[i].nodeType == 1) {
36270                   res += wrap(chld[i]).toString();
36271                 }
36272               }
36273               type && (res += "</" + this.type + ">");
36274             } else {
36275               type && (res += "/>");
36276             }
36277             return res;
36278           };
36279         }
36280         elproto.toDataURL = function() {
36281           if (window && window.btoa) {
36282             var bb = this.getBBox(),
36283               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>', {
36284                 x: +bb.x.toFixed(3),
36285                 y: +bb.y.toFixed(3),
36286                 width: +bb.width.toFixed(3),
36287                 height: +bb.height.toFixed(3),
36288                 contents: this.outerSVG()
36289               });
36290             return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svg)));
36291           }
36292         };
36293         /*
36294          * \ Fragment.select [ method ] * See @Element.select \
36295          */
36296         Fragment.prototype.select = elproto.select;
36297         /*
36298          * \ Fragment.selectAll [ method ] * See @Element.selectAll \
36299          */
36300         Fragment.prototype.selectAll = elproto.selectAll;
36301       });
36302
36303       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
36304       //
36305       // Licensed under the Apache License, Version 2.0 (the "License");
36306       // you may not use this file except in compliance with the License.
36307       // You may obtain a copy of the License at
36308       //
36309       // http://www.apache.org/licenses/LICENSE-2.0
36310       //
36311       // Unless required by applicable law or agreed to in writing, software
36312       // distributed under the License is distributed on an "AS IS" BASIS,
36313       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36314       // See the License for the specific language governing permissions and
36315       // limitations under the License.
36316       Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
36317         var objectToString = Object.prototype.toString,
36318           Str = String,
36319           math = Math,
36320           E = "";
36321
36322         function Matrix(a, b, c, d, e, f) {
36323           if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
36324             this.a = a.a;
36325             this.b = a.b;
36326             this.c = a.c;
36327             this.d = a.d;
36328             this.e = a.e;
36329             this.f = a.f;
36330             return;
36331           }
36332           if (a != null) {
36333             this.a = +a;
36334             this.b = +b;
36335             this.c = +c;
36336             this.d = +d;
36337             this.e = +e;
36338             this.f = +f;
36339           } else {
36340             this.a = 1;
36341             this.b = 0;
36342             this.c = 0;
36343             this.d = 1;
36344             this.e = 0;
36345             this.f = 0;
36346           }
36347         }
36348         (function(matrixproto) {
36349           /*
36350            * \ Matrix.add [ method ] * Adds the given matrix to existing one - a
36351            * (number) - b (number) - c (number) - d (number) - e (number) - f
36352            * (number) or - matrix (object) @Matrix \
36353            */
36354           matrixproto.add = function(a, b, c, d, e, f) {
36355             var out = [
36356                 [],
36357                 [],
36358                 []
36359               ],
36360               m = [
36361                 [this.a, this.c, this.e],
36362                 [this.b, this.d, this.f],
36363                 [0, 0, 1]
36364               ],
36365               matrix = [
36366                 [a, c, e],
36367                 [b, d, f],
36368                 [0, 0, 1]
36369               ],
36370               x, y, z, res;
36371
36372             if (a && a instanceof Matrix) {
36373               matrix = [
36374                 [a.a, a.c, a.e],
36375                 [a.b, a.d, a.f],
36376                 [0, 0, 1]
36377               ];
36378             }
36379
36380             for (x = 0; x < 3; x++) {
36381               for (y = 0; y < 3; y++) {
36382                 res = 0;
36383                 for (z = 0; z < 3; z++) {
36384                   res += m[x][z] * matrix[z][y];
36385                 }
36386                 out[x][y] = res;
36387               }
36388             }
36389             this.a = out[0][0];
36390             this.b = out[1][0];
36391             this.c = out[0][1];
36392             this.d = out[1][1];
36393             this.e = out[0][2];
36394             this.f = out[1][2];
36395             return this;
36396           };
36397           /*
36398            * \ Matrix.invert [ method ] * Returns an inverted version of the
36399            * matrix = (object) @Matrix \
36400            */
36401           matrixproto.invert = function() {
36402             var me = this,
36403               x = me.a * me.d - me.b * me.c;
36404             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);
36405           };
36406           /*
36407            * \ Matrix.clone [ method ] * Returns a copy of the matrix = (object)
36408            * @Matrix \
36409            */
36410           matrixproto.clone = function() {
36411             return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
36412           };
36413           /*
36414            * \ Matrix.translate [ method ] * Translate the matrix - x (number)
36415            * horizontal offset distance - y (number) vertical offset distance \
36416            */
36417           matrixproto.translate = function(x, y) {
36418             return this.add(1, 0, 0, 1, x, y);
36419           };
36420           /*
36421            * \ Matrix.scale [ method ] * Scales the matrix - x (number) amount to
36422            * be scaled, with `1` resulting in no change - y (number) #optional
36423            * amount to scale along the vertical axis. (Otherwise `x` applies to
36424            * both axes.) - cx (number) #optional horizontal origin point from
36425            * which to scale - cy (number) #optional vertical origin point from
36426            * which to scale Default cx, cy is the middle point of the element. \
36427            */
36428           matrixproto.scale = function(x, y, cx, cy) {
36429             y == null && (y = x);
36430             (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
36431             this.add(x, 0, 0, y, 0, 0);
36432             (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
36433             return this;
36434           };
36435           /*
36436            * \ Matrix.rotate [ method ] * Rotates the matrix - a (number) angle of
36437            * rotation, in degrees - x (number) horizontal origin point from which
36438            * to rotate - y (number) vertical origin point from which to rotate \
36439            */
36440           matrixproto.rotate = function(a, x, y) {
36441             a = Snap.rad(a);
36442             x = x || 0;
36443             y = y || 0;
36444             var cos = +math.cos(a).toFixed(9),
36445               sin = +math.sin(a).toFixed(9);
36446             this.add(cos, sin, -sin, cos, x, y);
36447             return this.add(1, 0, 0, 1, -x, -y);
36448           };
36449           /*
36450            * \ Matrix.x [ method ] * Returns x coordinate for given point after
36451            * transformation described by the matrix. See also @Matrix.y - x
36452            * (number) - y (number) = (number) x \
36453            */
36454           matrixproto.x = function(x, y) {
36455             return x * this.a + y * this.c + this.e;
36456           };
36457           /*
36458            * \ Matrix.y [ method ] * Returns y coordinate for given point after
36459            * transformation described by the matrix. See also @Matrix.x - x
36460            * (number) - y (number) = (number) y \
36461            */
36462           matrixproto.y = function(x, y) {
36463             return x * this.b + y * this.d + this.f;
36464           };
36465           matrixproto.get = function(i) {
36466             return +this[Str.fromCharCode(97 + i)].toFixed(4);
36467           };
36468           matrixproto.toString = function() {
36469             return "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")";
36470           };
36471           matrixproto.offset = function() {
36472             return [this.e.toFixed(4), this.f.toFixed(4)];
36473           };
36474
36475           function norm(a) {
36476             return a[0] * a[0] + a[1] * a[1];
36477           }
36478
36479           function normalize(a) {
36480             var mag = math.sqrt(norm(a));
36481             a[0] && (a[0] /= mag);
36482             a[1] && (a[1] /= mag);
36483           }
36484           /*
36485            * \ Matrix.determinant [ method ] * Finds determinant of the given
36486            * matrix. = (number) determinant \
36487            */
36488           matrixproto.determinant = function() {
36489             return this.a * this.d - this.b * this.c;
36490           };
36491           /*
36492            * \ Matrix.split [ method ] * Splits matrix into primitive
36493            * transformations = (object) in format: o dx (number) translation by x
36494            * o dy (number) translation by y o scalex (number) scale by x o scaley
36495            * (number) scale by y o shear (number) shear o rotate (number) rotation
36496            * in deg o isSimple (boolean) could it be represented via simple
36497            * transformations \
36498            */
36499           matrixproto.split = function() {
36500             var out = {};
36501             // translation
36502             out.dx = this.e;
36503             out.dy = this.f;
36504
36505             // scale and shear
36506             var row = [
36507               [this.a, this.c],
36508               [this.b, this.d]
36509             ];
36510             out.scalex = math.sqrt(norm(row[0]));
36511             normalize(row[0]);
36512
36513             out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
36514             row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
36515
36516             out.scaley = math.sqrt(norm(row[1]));
36517             normalize(row[1]);
36518             out.shear /= out.scaley;
36519
36520             if (this.determinant() < 0) {
36521               out.scalex = -out.scalex;
36522             }
36523
36524             // rotation
36525             var sin = -row[0][1],
36526               cos = row[1][1];
36527             if (cos < 0) {
36528               out.rotate = Snap.deg(math.acos(cos));
36529               if (sin < 0) {
36530                 out.rotate = 360 - out.rotate;
36531               }
36532             } else {
36533               out.rotate = Snap.deg(math.asin(sin));
36534             }
36535
36536             out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
36537             out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
36538             out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
36539             return out;
36540           };
36541           /*
36542            * \ Matrix.toTransformString [ method ] * Returns transform string that
36543            * represents given matrix = (string) transform string \
36544            */
36545           matrixproto.toTransformString = function(shorter) {
36546             var s = shorter || this.split();
36547             if (!+s.shear.toFixed(9)) {
36548               s.scalex = +s.scalex.toFixed(4);
36549               s.scaley = +s.scaley.toFixed(4);
36550               s.rotate = +s.rotate.toFixed(4);
36551               return (s.dx || s.dy ? "t" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) +
36552                 (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
36553                 (s.rotate ? "r" + [+s.rotate.toFixed(4), 0, 0] : E);
36554             } else {
36555               return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
36556             }
36557           };
36558         })(Matrix.prototype);
36559         /*
36560          * \ Snap.Matrix [ method ] * Matrix constructor, extend on your own risk.
36561          * To create matrices use @Snap.matrix. \
36562          */
36563         Snap.Matrix = Matrix;
36564         /*
36565          * \ Snap.matrix [ method ] * Utility method * Returns a matrix based on the
36566          * given parameters - a (number) - b (number) - c (number) - d (number) - e
36567          * (number) - f (number) or - svgMatrix (SVGMatrix) = (object) @Matrix \
36568          */
36569         Snap.matrix = function(a, b, c, d, e, f) {
36570           return new Matrix(a, b, c, d, e, f);
36571         };
36572       });
36573       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
36574       //
36575       // Licensed under the Apache License, Version 2.0 (the "License");
36576       // you may not use this file except in compliance with the License.
36577       // You may obtain a copy of the License at
36578       //
36579       // http://www.apache.org/licenses/LICENSE-2.0
36580       //
36581       // Unless required by applicable law or agreed to in writing, software
36582       // distributed under the License is distributed on an "AS IS" BASIS,
36583       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36584       // See the License for the specific language governing permissions and
36585       // limitations under the License.
36586       Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
36587         var has = "hasOwnProperty",
36588           make = Snap._.make,
36589           wrap = Snap._.wrap,
36590           is = Snap.is,
36591           getSomeDefs = Snap._.getSomeDefs,
36592           reURLValue = /^url\(#?([^)]+)\)$/,
36593           $ = Snap._.$,
36594           URL = Snap.url,
36595           Str = String,
36596           separator = Snap._.separator,
36597           E = "";
36598         // Attributes event handlers
36599         eve.on("snap.util.attr.mask", function(value) {
36600           if (value instanceof Element || value instanceof Fragment) {
36601             eve.stop();
36602             if (value instanceof Fragment && value.node.childNodes.length == 1) {
36603               value = value.node.firstChild;
36604               getSomeDefs(this).appendChild(value);
36605               value = wrap(value);
36606             }
36607             if (value.type == "mask") {
36608               var mask = value;
36609             } else {
36610               mask = make("mask", getSomeDefs(this));
36611               mask.node.appendChild(value.node);
36612             }!mask.node.id && $(mask.node, {
36613               id: mask.id
36614             });
36615             $(this.node, {
36616               mask: URL(mask.id)
36617             });
36618           }
36619         });
36620         (function(clipIt) {
36621           eve.on("snap.util.attr.clip", clipIt);
36622           eve.on("snap.util.attr.clip-path", clipIt);
36623           eve.on("snap.util.attr.clipPath", clipIt);
36624         }(function(value) {
36625           if (value instanceof Element || value instanceof Fragment) {
36626             eve.stop();
36627             if (value.type == "clipPath") {
36628               var clip = value;
36629             } else {
36630               clip = make("clipPath", getSomeDefs(this));
36631               clip.node.appendChild(value.node);
36632               !clip.node.id && $(clip.node, {
36633                 id: clip.id
36634               });
36635             }
36636             $(this.node, {
36637               "clip-path": URL(clip.node.id || clip.id)
36638             });
36639           }
36640         }));
36641
36642         function fillStroke(name) {
36643           return function(value) {
36644             eve.stop();
36645             if (value instanceof Fragment && value.node.childNodes.length == 1 &&
36646               (value.node.firstChild.tagName == "radialGradient" ||
36647                 value.node.firstChild.tagName == "linearGradient" ||
36648                 value.node.firstChild.tagName == "pattern")) {
36649               value = value.node.firstChild;
36650               getSomeDefs(this).appendChild(value);
36651               value = wrap(value);
36652             }
36653             if (value instanceof Element) {
36654               if (value.type == "radialGradient" || value.type == "linearGradient" || value.type == "pattern") {
36655                 if (!value.node.id) {
36656                   $(value.node, {
36657                     id: value.id
36658                   });
36659                 }
36660                 var fill = URL(value.node.id);
36661               } else {
36662                 fill = value.attr(name);
36663               }
36664             } else {
36665               fill = Snap.color(value);
36666               if (fill.error) {
36667                 var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);
36668                 if (grad) {
36669                   if (!grad.node.id) {
36670                     $(grad.node, {
36671                       id: grad.id
36672                     });
36673                   }
36674                   fill = URL(grad.node.id);
36675                 } else {
36676                   fill = value;
36677                 }
36678               } else {
36679                 fill = Str(fill);
36680               }
36681             }
36682             var attrs = {};
36683             attrs[name] = fill;
36684             $(this.node, attrs);
36685             this.node.style[name] = E;
36686           };
36687         }
36688         eve.on("snap.util.attr.fill", fillStroke("fill"));
36689         eve.on("snap.util.attr.stroke", fillStroke("stroke"));
36690         var gradrg = /^([lr])(?:\(([^)]*)\))?(.*)$/i;
36691         eve.on("snap.util.grad.parse", function parseGrad(string) {
36692           string = Str(string);
36693           var tokens = string.match(gradrg);
36694           if (!tokens) {
36695             return null;
36696           }
36697           var type = tokens[1],
36698             params = tokens[2],
36699             stops = tokens[3];
36700           params = params.split(/\s*,\s*/).map(function(el) {
36701             return +el == el ? +el : el;
36702           });
36703           if (params.length == 1 && params[0] == 0) {
36704             params = [];
36705           }
36706           stops = stops.split("-");
36707           stops = stops.map(function(el) {
36708             el = el.split(":");
36709             var out = {
36710               color: el[0]
36711             };
36712             if (el[1]) {
36713               out.offset = parseFloat(el[1]);
36714             }
36715             return out;
36716           });
36717           return {
36718             type: type,
36719             params: params,
36720             stops: stops
36721           };
36722         });
36723
36724         eve.on("snap.util.attr.d", function(value) {
36725           eve.stop();
36726           if (is(value, "array") && is(value[0], "array")) {
36727             value = Snap.path.toString.call(value);
36728           }
36729           value = Str(value);
36730           if (value.match(/[ruo]/i)) {
36731             value = Snap.path.toAbsolute(value);
36732           }
36733           $(this.node, {
36734             d: value
36735           });
36736         })(-1);
36737         eve.on("snap.util.attr.#text", function(value) {
36738           eve.stop();
36739           value = Str(value);
36740           var txt = glob.doc.createTextNode(value);
36741           while (this.node.firstChild) {
36742             this.node.removeChild(this.node.firstChild);
36743           }
36744           this.node.appendChild(txt);
36745         })(-1);
36746         eve.on("snap.util.attr.path", function(value) {
36747           eve.stop();
36748           this.attr({
36749             d: value
36750           });
36751         })(-1);
36752         eve.on("snap.util.attr.class", function(value) {
36753           eve.stop();
36754           this.node.className.baseVal = value;
36755         })(-1);
36756         eve.on("snap.util.attr.viewBox", function(value) {
36757           var vb;
36758           if (is(value, "object") && "x" in value) {
36759             vb = [value.x, value.y, value.width, value.height].join(" ");
36760           } else if (is(value, "array")) {
36761             vb = value.join(" ");
36762           } else {
36763             vb = value;
36764           }
36765           $(this.node, {
36766             viewBox: vb
36767           });
36768           eve.stop();
36769         })(-1);
36770         eve.on("snap.util.attr.transform", function(value) {
36771           this.transform(value);
36772           eve.stop();
36773         })(-1);
36774         eve.on("snap.util.attr.r", function(value) {
36775           if (this.type == "rect") {
36776             eve.stop();
36777             $(this.node, {
36778               rx: value,
36779               ry: value
36780             });
36781           }
36782         })(-1);
36783         eve.on("snap.util.attr.textpath", function(value) {
36784           eve.stop();
36785           if (this.type == "text") {
36786             var id, tp, node;
36787             if (!value && this.textPath) {
36788               tp = this.textPath;
36789               while (tp.node.firstChild) {
36790                 this.node.appendChild(tp.node.firstChild);
36791               }
36792               tp.remove();
36793               delete this.textPath;
36794               return;
36795             }
36796             if (is(value, "string")) {
36797               var defs = getSomeDefs(this),
36798                 path = wrap(defs.parentNode).path(value);
36799               defs.appendChild(path.node);
36800               id = path.id;
36801               path.attr({
36802                 id: id
36803               });
36804             } else {
36805               value = wrap(value);
36806               if (value instanceof Element) {
36807                 id = value.attr("id");
36808                 if (!id) {
36809                   id = value.id;
36810                   value.attr({
36811                     id: id
36812                   });
36813                 }
36814               }
36815             }
36816             if (id) {
36817               tp = this.textPath;
36818               node = this.node;
36819               if (tp) {
36820                 tp.attr({
36821                   "xlink:href": "#" + id
36822                 });
36823               } else {
36824                 tp = $("textPath", {
36825                   "xlink:href": "#" + id
36826                 });
36827                 while (node.firstChild) {
36828                   tp.appendChild(node.firstChild);
36829                 }
36830                 node.appendChild(tp);
36831                 this.textPath = wrap(tp);
36832               }
36833             }
36834           }
36835         })(-1);
36836         eve.on("snap.util.attr.text", function(value) {
36837           if (this.type == "text") {
36838             var i = 0,
36839               node = this.node,
36840               tuner = function(chunk) {
36841                 var out = $("tspan");
36842                 if (is(chunk, "array")) {
36843                   for (var i = 0; i < chunk.length; i++) {
36844                     out.appendChild(tuner(chunk[i]));
36845                   }
36846                 } else {
36847                   out.appendChild(glob.doc.createTextNode(chunk));
36848                 }
36849                 out.normalize && out.normalize();
36850                 return out;
36851               };
36852             while (node.firstChild) {
36853               node.removeChild(node.firstChild);
36854             }
36855             var tuned = tuner(value);
36856             while (tuned.firstChild) {
36857               node.appendChild(tuned.firstChild);
36858             }
36859           }
36860           eve.stop();
36861         })(-1);
36862
36863         function setFontSize(value) {
36864           eve.stop();
36865           if (value == +value) {
36866             value += "px";
36867           }
36868           this.node.style.fontSize = value;
36869         }
36870         eve.on("snap.util.attr.fontSize", setFontSize)(-1);
36871         eve.on("snap.util.attr.font-size", setFontSize)(-1);
36872
36873
36874         eve.on("snap.util.getattr.transform", function() {
36875           eve.stop();
36876           return this.transform();
36877         })(-1);
36878         eve.on("snap.util.getattr.textpath", function() {
36879           eve.stop();
36880           return this.textPath;
36881         })(-1);
36882         // Markers
36883         (function() {
36884           function getter(end) {
36885             return function() {
36886               eve.stop();
36887               var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue("marker-" + end);
36888               if (style == "none") {
36889                 return style;
36890               } else {
36891                 return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));
36892               }
36893             };
36894           }
36895
36896           function setter(end) {
36897             return function(value) {
36898               eve.stop();
36899               var name = "marker" + end.charAt(0).toUpperCase() + end.substring(1);
36900               if (value == "" || !value) {
36901                 this.node.style[name] = "none";
36902                 return;
36903               }
36904               if (value.type == "marker") {
36905                 var id = value.node.id;
36906                 if (!id) {
36907                   $(value.node, {
36908                     id: value.id
36909                   });
36910                 }
36911                 this.node.style[name] = URL(id);
36912                 return;
36913               }
36914             };
36915           }
36916           eve.on("snap.util.getattr.marker-end", getter("end"))(-1);
36917           eve.on("snap.util.getattr.markerEnd", getter("end"))(-1);
36918           eve.on("snap.util.getattr.marker-start", getter("start"))(-1);
36919           eve.on("snap.util.getattr.markerStart", getter("start"))(-1);
36920           eve.on("snap.util.getattr.marker-mid", getter("mid"))(-1);
36921           eve.on("snap.util.getattr.markerMid", getter("mid"))(-1);
36922           eve.on("snap.util.attr.marker-end", setter("end"))(-1);
36923           eve.on("snap.util.attr.markerEnd", setter("end"))(-1);
36924           eve.on("snap.util.attr.marker-start", setter("start"))(-1);
36925           eve.on("snap.util.attr.markerStart", setter("start"))(-1);
36926           eve.on("snap.util.attr.marker-mid", setter("mid"))(-1);
36927           eve.on("snap.util.attr.markerMid", setter("mid"))(-1);
36928         }());
36929         eve.on("snap.util.getattr.r", function() {
36930           if (this.type == "rect" && $(this.node, "rx") == $(this.node, "ry")) {
36931             eve.stop();
36932             return $(this.node, "rx");
36933           }
36934         })(-1);
36935
36936         function textExtract(node) {
36937           var out = [];
36938           var children = node.childNodes;
36939           for (var i = 0, ii = children.length; i < ii; i++) {
36940             var chi = children[i];
36941             if (chi.nodeType == 3) {
36942               out.push(chi.nodeValue);
36943             }
36944             if (chi.tagName == "tspan") {
36945               if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {
36946                 out.push(chi.firstChild.nodeValue);
36947               } else {
36948                 out.push(textExtract(chi));
36949               }
36950             }
36951           }
36952           return out;
36953         }
36954         eve.on("snap.util.getattr.text", function() {
36955           if (this.type == "text" || this.type == "tspan") {
36956             eve.stop();
36957             var out = textExtract(this.node);
36958             return out.length == 1 ? out[0] : out;
36959           }
36960         })(-1);
36961         eve.on("snap.util.getattr.#text", function() {
36962           return this.node.textContent;
36963         })(-1);
36964         eve.on("snap.util.getattr.viewBox", function() {
36965           eve.stop();
36966           var vb = $(this.node, "viewBox");
36967           if (vb) {
36968             vb = vb.split(separator);
36969             return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);
36970           } else {
36971             return;
36972           }
36973         })(-1);
36974         eve.on("snap.util.getattr.points", function() {
36975           var p = $(this.node, "points");
36976           eve.stop();
36977           if (p) {
36978             return p.split(separator);
36979           } else {
36980             return;
36981           }
36982         })(-1);
36983         eve.on("snap.util.getattr.path", function() {
36984           var p = $(this.node, "d");
36985           eve.stop();
36986           return p;
36987         })(-1);
36988         eve.on("snap.util.getattr.class", function() {
36989           return this.node.className.baseVal;
36990         })(-1);
36991
36992         function getFontSize() {
36993           eve.stop();
36994           return this.node.style.fontSize;
36995         }
36996         eve.on("snap.util.getattr.fontSize", getFontSize)(-1);
36997         eve.on("snap.util.getattr.font-size", getFontSize)(-1);
36998       });
36999
37000       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
37001       //
37002       // Licensed under the Apache License, Version 2.0 (the "License");
37003       // you may not use this file except in compliance with the License.
37004       // You may obtain a copy of the License at
37005       //
37006       // http://www.apache.org/licenses/LICENSE-2.0
37007       //
37008       // Unless required by applicable law or agreed to in writing, software
37009       // distributed under the License is distributed on an "AS IS" BASIS,
37010       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37011       // See the License for the specific language governing permissions and
37012       // limitations under the License.
37013       Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
37014         var proto = Paper.prototype,
37015           is = Snap.is;
37016         /*
37017          * \ Paper.rect [ method ]
37018          *
37019          * Draws a rectangle * - x (number) x coordinate of the top left corner - y
37020          * (number) y coordinate of the top left corner - width (number) width -
37021          * height (number) height - rx (number) #optional horizontal radius for
37022          * rounded corners, default is 0 - ry (number) #optional vertical radius for
37023          * rounded corners, default is rx or 0 = (object) the `rect` element * >
37024          * Usage | // regular rectangle | var c = paper.rect(10, 10, 50, 50); | //
37025          * rectangle with rounded corners | var c = paper.rect(40, 40, 50, 50, 10); \
37026          */
37027         proto.rect = function(x, y, w, h, rx, ry) {
37028           var attr;
37029           if (ry == null) {
37030             ry = rx;
37031           }
37032           if (is(x, "object") && x == "[object Object]") {
37033             attr = x;
37034           } else if (x != null) {
37035             attr = {
37036               x: x,
37037               y: y,
37038               width: w,
37039               height: h
37040             };
37041             if (rx != null) {
37042               attr.rx = rx;
37043               attr.ry = ry;
37044             }
37045           }
37046           return this.el("rect", attr);
37047         };
37048         /*
37049          * \ Paper.circle [ method ] * Draws a circle * - x (number) x coordinate of
37050          * the centre - y (number) y coordinate of the centre - r (number) radius =
37051          * (object) the `circle` element * > Usage | var c = paper.circle(50, 50,
37052          * 40); \
37053          */
37054         proto.circle = function(cx, cy, r) {
37055           var attr;
37056           if (is(cx, "object") && cx == "[object Object]") {
37057             attr = cx;
37058           } else if (cx != null) {
37059             attr = {
37060               cx: cx,
37061               cy: cy,
37062               r: r
37063             };
37064           }
37065           return this.el("circle", attr);
37066         };
37067
37068         var preload = (function() {
37069           function onerror() {
37070             this.parentNode.removeChild(this);
37071           }
37072           return function(src, f) {
37073             var img = glob.doc.createElement("img"),
37074               body = glob.doc.body;
37075             img.style.cssText = "position:absolute;left:-9999em;top:-9999em";
37076             img.onload = function() {
37077               f.call(img);
37078               img.onload = img.onerror = null;
37079               body.removeChild(img);
37080             };
37081             img.onerror = onerror;
37082             body.appendChild(img);
37083             img.src = src;
37084           };
37085         }());
37086
37087         /*
37088          * \ Paper.image [ method ] * Places an image on the surface * - src
37089          * (string) URI of the source image - x (number) x offset position - y
37090          * (number) y offset position - width (number) width of the image - height
37091          * (number) height of the image = (object) the `image` element or = (object)
37092          * Snap element object with type `image` * > Usage | var c =
37093          * paper.image("apple.png", 10, 10, 80, 80); \
37094          */
37095         proto.image = function(src, x, y, width, height) {
37096           var el = this.el("image");
37097           if (is(src, "object") && "src" in src) {
37098             el.attr(src);
37099           } else if (src != null) {
37100             var set = {
37101               "xlink:href": src,
37102               preserveAspectRatio: "none"
37103             };
37104             if (x != null && y != null) {
37105               set.x = x;
37106               set.y = y;
37107             }
37108             if (width != null && height != null) {
37109               set.width = width;
37110               set.height = height;
37111             } else {
37112               preload(src, function() {
37113                 Snap._.$(el.node, {
37114                   width: this.offsetWidth,
37115                   height: this.offsetHeight
37116                 });
37117               });
37118             }
37119             Snap._.$(el.node, set);
37120           }
37121           return el;
37122         };
37123         /*
37124          * \ Paper.ellipse [ method ] * Draws an ellipse * - x (number) x coordinate
37125          * of the centre - y (number) y coordinate of the centre - rx (number)
37126          * horizontal radius - ry (number) vertical radius = (object) the `ellipse`
37127          * element * > Usage | var c = paper.ellipse(50, 50, 40, 20); \
37128          */
37129         proto.ellipse = function(cx, cy, rx, ry) {
37130           var attr;
37131           if (is(cx, "object") && cx == "[object Object]") {
37132             attr = cx;
37133           } else if (cx != null) {
37134             attr = {
37135               cx: cx,
37136               cy: cy,
37137               rx: rx,
37138               ry: ry
37139             };
37140           }
37141           return this.el("ellipse", attr);
37142         };
37143         // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is,
37144         // and why it would make life any easier.
37145         /*
37146          * \ Paper.path [ method ] * Creates a `<path>` element using the given
37147          * string as the path's definition - pathString (string) #optional path
37148          * string in SVG format Path string consists of one-letter commands,
37149          * followed by comma seprarated arguments in numerical form. Example: |
37150          * "M10,20L30,40" This example features two commands: `M`, with arguments
37151          * `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands
37152          * express coordinates in absolute terms, while lowercase commands express
37153          * them in relative terms from the most recently declared coordinates.
37154          *  # <p>Here is short list of commands available, for more details see <a
37155          * href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a
37156          * path's data attribute's format are described in the SVG
37157          * specification.">SVG path string format</a> or <a
37158          * href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about
37159          * path strings at MDN</a>.</p> # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody> #
37160          * <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr> # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr> #
37161          * <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr> # <tr><td>H</td><td>horizontal
37162          * lineto</td><td>x+</td></tr> # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr> #
37163          * <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr> #
37164          * <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr> #
37165          * <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x
37166          * y)+</td></tr> # <tr><td>T</td><td>smooth quadratic Bézier
37167          * curveto</td><td>(x y)+</td></tr> # <tr><td>A</td><td>elliptical
37168          * arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr> #
37169          * <tr><td>R</td><td><a
37170          * href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom
37171          * curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table> *
37172          * _Catmull-Rom curveto_ is a not standard SVG command and added to make
37173          * life easier. Note: there is a special case when a path consists of only
37174          * three commands: `M10,10R…z`. In this case the path connects back to
37175          * its starting point. > Usage | var c = paper.path("M10 10L90 90"); | //
37176          * draw a diagonal line: | // move to 10,10, line to 90,90 \
37177          */
37178         proto.path = function(d) {
37179           var attr;
37180           if (is(d, "object") && !is(d, "array")) {
37181             attr = d;
37182           } else if (d) {
37183             attr = {
37184               d: d
37185             };
37186           }
37187           return this.el("path", attr);
37188         };
37189         /*
37190          * \ Paper.g [ method ] * Creates a group element * - varargs (…)
37191          * #optional elements to nest within the group = (object) the `g` element * >
37192          * Usage | var c1 = paper.circle(), | c2 = paper.rect(), | g = paper.g(c2,
37193          * c1); // note that the order of elements is different or | var c1 =
37194          * paper.circle(), | c2 = paper.rect(), | g = paper.g(); | g.add(c2, c1); \
37195          */
37196         /*
37197          * \ Paper.group [ method ] * See @Paper.g \
37198          */
37199         proto.group = proto.g = function(first) {
37200           var attr,
37201             el = this.el("g");
37202           if (arguments.length == 1 && first && !first.type) {
37203             el.attr(first);
37204           } else if (arguments.length) {
37205             el.add(Array.prototype.slice.call(arguments, 0));
37206           }
37207           return el;
37208         };
37209         /*
37210          * \ Paper.svg [ method ] * Creates a nested SVG element. - x (number)
37211          * @optional X of the element - y (number) @optional Y of the element -
37212          * width (number) @optional width of the element - height (number) @optional
37213          * height of the element - vbx (number) @optional viewbox X - vby (number)
37214          * @optional viewbox Y - vbw (number) @optional viewbox width - vbh (number)
37215          * @optional viewbox height * = (object) the `svg` element * \
37216          */
37217         proto.svg = function(x, y, width, height, vbx, vby, vbw, vbh) {
37218           var attrs = {};
37219           if (is(x, "object") && y == null) {
37220             attrs = x;
37221           } else {
37222             if (x != null) {
37223               attrs.x = x;
37224             }
37225             if (y != null) {
37226               attrs.y = y;
37227             }
37228             if (width != null) {
37229               attrs.width = width;
37230             }
37231             if (height != null) {
37232               attrs.height = height;
37233             }
37234             if (vbx != null && vby != null && vbw != null && vbh != null) {
37235               attrs.viewBox = [vbx, vby, vbw, vbh];
37236             }
37237           }
37238           return this.el("svg", attrs);
37239         };
37240         /*
37241          * \ Paper.mask [ method ] * Equivalent in behaviour to @Paper.g, except
37242          * it’s a mask. * = (object) the `mask` element * \
37243          */
37244         proto.mask = function(first) {
37245           var attr,
37246             el = this.el("mask");
37247           if (arguments.length == 1 && first && !first.type) {
37248             el.attr(first);
37249           } else if (arguments.length) {
37250             el.add(Array.prototype.slice.call(arguments, 0));
37251           }
37252           return el;
37253         };
37254         /*
37255          * \ Paper.ptrn [ method ] * Equivalent in behaviour to @Paper.g, except
37256          * it’s a pattern. - x (number) @optional X of the element - y
37257          * (number) @optional Y of the element - width (number) @optional width of
37258          * the element - height (number) @optional height of the element - vbx
37259          * (number) @optional viewbox X - vby (number) @optional viewbox Y - vbw
37260          * (number) @optional viewbox width - vbh (number) @optional viewbox height * =
37261          * (object) the `pattern` element * \
37262          */
37263         proto.ptrn = function(x, y, width, height, vx, vy, vw, vh) {
37264           if (is(x, "object")) {
37265             var attr = x;
37266           } else {
37267             attr = {
37268               patternUnits: "userSpaceOnUse"
37269             };
37270             if (x) {
37271               attr.x = x;
37272             }
37273             if (y) {
37274               attr.y = y;
37275             }
37276             if (width != null) {
37277               attr.width = width;
37278             }
37279             if (height != null) {
37280               attr.height = height;
37281             }
37282             if (vx != null && vy != null && vw != null && vh != null) {
37283               attr.viewBox = [vx, vy, vw, vh];
37284             }
37285           }
37286           return this.el("pattern", attr);
37287         };
37288         /*
37289          * \ Paper.use [ method ] * Creates a <use> element. - id (string) @optional
37290          * id of element to link or - id (Element) @optional element to link * =
37291          * (object) the `use` element * \
37292          */
37293         proto.use = function(id) {
37294           if (id != null) {
37295             if (id instanceof Element) {
37296               if (!id.attr("id")) {
37297                 id.attr({
37298                   id: Snap._.id(id)
37299                 });
37300               }
37301               id = id.attr("id");
37302             }
37303             if (String(id).charAt() == "#") {
37304               id = id.substring(1);
37305             }
37306             return this.el("use", {
37307               "xlink:href": "#" + id
37308             });
37309           } else {
37310             return Element.prototype.use.call(this);
37311           }
37312         };
37313         /*
37314          * \ Paper.symbol [ method ] * Creates a <symbol> element. - vbx (number)
37315          * @optional viewbox X - vby (number) @optional viewbox Y - vbw (number)
37316          * @optional viewbox width - vbh (number) @optional viewbox height =
37317          * (object) the `symbol` element * \
37318          */
37319         proto.symbol = function(vx, vy, vw, vh) {
37320           var attr = {};
37321           if (vx != null && vy != null && vw != null && vh != null) {
37322             attr.viewBox = [vx, vy, vw, vh];
37323           }
37324
37325           return this.el("symbol", attr);
37326         };
37327         /*
37328          * \ Paper.text [ method ] * Draws a text string * - x (number) x coordinate
37329          * position - y (number) y coordinate position - text (string|array) The
37330          * text string to draw or array of strings to nest within separate `<tspan>`
37331          * elements = (object) the `text` element * > Usage | var t1 =
37332          * paper.text(50, 50, "Snap"); | var t2 = paper.text(50, 50,
37333          * ["S","n","a","p"]); | // Text path usage | t1.attr({textpath:
37334          * "M10,10L100,100"}); | // or | var pth = paper.path("M10,10L100,100"); |
37335          * t1.attr({textpath: pth}); \
37336          */
37337         proto.text = function(x, y, text) {
37338           var attr = {};
37339           if (is(x, "object")) {
37340             attr = x;
37341           } else if (x != null) {
37342             attr = {
37343               x: x,
37344               y: y,
37345               text: text || ""
37346             };
37347           }
37348           return this.el("text", attr);
37349         };
37350         /*
37351          * \ Paper.line [ method ] * Draws a line * - x1 (number) x coordinate
37352          * position of the start - y1 (number) y coordinate position of the start -
37353          * x2 (number) x coordinate position of the end - y2 (number) y coordinate
37354          * position of the end = (object) the `line` element * > Usage | var t1 =
37355          * paper.line(50, 50, 100, 100); \
37356          */
37357         proto.line = function(x1, y1, x2, y2) {
37358           var attr = {};
37359           if (is(x1, "object")) {
37360             attr = x1;
37361           } else if (x1 != null) {
37362             attr = {
37363               x1: x1,
37364               x2: x2,
37365               y1: y1,
37366               y2: y2
37367             };
37368           }
37369           return this.el("line", attr);
37370         };
37371         /*
37372          * \ Paper.polyline [ method ] * Draws a polyline * - points (array) array
37373          * of points or - varargs (…) points = (object) the `polyline` element * >
37374          * Usage | var p1 = paper.polyline([10, 10, 100, 100]); | var p2 =
37375          * paper.polyline(10, 10, 100, 100); \
37376          */
37377         proto.polyline = function(points) {
37378           if (arguments.length > 1) {
37379             points = Array.prototype.slice.call(arguments, 0);
37380           }
37381           var attr = {};
37382           if (is(points, "object") && !is(points, "array")) {
37383             attr = points;
37384           } else if (points != null) {
37385             attr = {
37386               points: points
37387             };
37388           }
37389           return this.el("polyline", attr);
37390         };
37391         /*
37392          * \ Paper.polygon [ method ] * Draws a polygon. See @Paper.polyline \
37393          */
37394         proto.polygon = function(points) {
37395           if (arguments.length > 1) {
37396             points = Array.prototype.slice.call(arguments, 0);
37397           }
37398           var attr = {};
37399           if (is(points, "object") && !is(points, "array")) {
37400             attr = points;
37401           } else if (points != null) {
37402             attr = {
37403               points: points
37404             };
37405           }
37406           return this.el("polygon", attr);
37407         };
37408         // gradients
37409         (function() {
37410           var $ = Snap._.$;
37411           // gradients' helpers
37412           function Gstops() {
37413             return this.selectAll("stop");
37414           }
37415
37416           function GaddStop(color, offset) {
37417             var stop = $("stop"),
37418               attr = {
37419                 offset: +offset + "%"
37420               };
37421             color = Snap.color(color);
37422             attr["stop-color"] = color.hex;
37423             if (color.opacity < 1) {
37424               attr["stop-opacity"] = color.opacity;
37425             }
37426             $(stop, attr);
37427             this.node.appendChild(stop);
37428             return this;
37429           }
37430
37431           function GgetBBox() {
37432             if (this.type == "linearGradient") {
37433               var x1 = $(this.node, "x1") || 0,
37434                 x2 = $(this.node, "x2") || 1,
37435                 y1 = $(this.node, "y1") || 0,
37436                 y2 = $(this.node, "y2") || 0;
37437               return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
37438             } else {
37439               var cx = this.node.cx || .5,
37440                 cy = this.node.cy || .5,
37441                 r = this.node.r || 0;
37442               return Snap._.box(cx - r, cy - r, r * 2, r * 2);
37443             }
37444           }
37445
37446           function gradient(defs, str) {
37447             var grad = eve("snap.util.grad.parse", null, str).firstDefined(),
37448               el;
37449             if (!grad) {
37450               return null;
37451             }
37452             grad.params.unshift(defs);
37453             if (grad.type.toLowerCase() == "l") {
37454               el = gradientLinear.apply(0, grad.params);
37455             } else {
37456               el = gradientRadial.apply(0, grad.params);
37457             }
37458             if (grad.type != grad.type.toLowerCase()) {
37459               $(el.node, {
37460                 gradientUnits: "userSpaceOnUse"
37461               });
37462             }
37463             var stops = grad.stops,
37464               len = stops.length,
37465               start = 0,
37466               j = 0;
37467
37468             function seed(i, end) {
37469               var step = (end - start) / (i - j);
37470               for (var k = j; k < i; k++) {
37471                 stops[k].offset = +(+start + step * (k - j)).toFixed(2);
37472               }
37473               j = i;
37474               start = end;
37475             }
37476             len--;
37477             for (var i = 0; i < len; i++)
37478               if ("offset" in stops[i]) {
37479                 seed(i, stops[i].offset);
37480               }
37481             stops[len].offset = stops[len].offset || 100;
37482             seed(len, stops[len].offset);
37483             for (i = 0; i <= len; i++) {
37484               var stop = stops[i];
37485               el.addStop(stop.color, stop.offset);
37486             }
37487             return el;
37488           }
37489
37490           function gradientLinear(defs, x1, y1, x2, y2) {
37491             var el = Snap._.make("linearGradient", defs);
37492             el.stops = Gstops;
37493             el.addStop = GaddStop;
37494             el.getBBox = GgetBBox;
37495             if (x1 != null) {
37496               $(el.node, {
37497                 x1: x1,
37498                 y1: y1,
37499                 x2: x2,
37500                 y2: y2
37501               });
37502             }
37503             return el;
37504           }
37505
37506           function gradientRadial(defs, cx, cy, r, fx, fy) {
37507             var el = Snap._.make("radialGradient", defs);
37508             el.stops = Gstops;
37509             el.addStop = GaddStop;
37510             el.getBBox = GgetBBox;
37511             if (cx != null) {
37512               $(el.node, {
37513                 cx: cx,
37514                 cy: cy,
37515                 r: r
37516               });
37517             }
37518             if (fx != null && fy != null) {
37519               $(el.node, {
37520                 fx: fx,
37521                 fy: fy
37522               });
37523             }
37524             return el;
37525           }
37526           /*
37527            * \ Paper.gradient [ method ] * Creates a gradient element * - gradient
37528            * (string) gradient descriptor > Gradient Descriptor The gradient
37529            * descriptor is an expression formatted as follows: `<type>(<coords>)<colors>`.
37530            * The `<type>` can be either linear or radial. The uppercase `L` or
37531            * `R` letters indicate absolute coordinates offset from the SVG
37532            * surface. Lowercase `l` or `r` letters indicate coordinates calculated
37533            * relative to the element to which the gradient is applied. Coordinates
37534            * specify a linear gradient vector as `x1`, `y1`, `x2`, `y2`, or a
37535            * radial gradient as `cx`, `cy`, `r` and optional `fx`, `fy` specifying
37536            * a focal point away from the center of the circle. Specify `<colors>`
37537            * as a list of dash-separated CSS color values. Each color may be
37538            * followed by a custom offset value, separated with a colon character. >
37539            * Examples Linear gradient, relative from top-left corner to
37540            * bottom-right corner, from black through red to white: | var g =
37541            * paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff"); Linear gradient,
37542            * absolute from (0, 0) to (100, 100), from black through red at 25% to
37543            * white: | var g = paper.gradient("L(0, 0, 100,
37544            * 100)#000-#f00:25-#fff"); Radial gradient, relative from the center of
37545            * the element with radius half the width, from black to white: | var g =
37546            * paper.gradient("r(0.5, 0.5, 0.5)#000-#fff"); To apply the gradient: |
37547            * paper.circle(50, 50, 40).attr({ | fill: g | }); = (object) the
37548            * `gradient` element \
37549            */
37550           proto.gradient = function(str) {
37551             return gradient(this.defs, str);
37552           };
37553           proto.gradientLinear = function(x1, y1, x2, y2) {
37554             return gradientLinear(this.defs, x1, y1, x2, y2);
37555           };
37556           proto.gradientRadial = function(cx, cy, r, fx, fy) {
37557             return gradientRadial(this.defs, cx, cy, r, fx, fy);
37558           };
37559           /*
37560            * \ Paper.toString [ method ] * Returns SVG code for the @Paper =
37561            * (string) SVG code for the @Paper \
37562            */
37563           proto.toString = function() {
37564             var doc = this.node.ownerDocument,
37565               f = doc.createDocumentFragment(),
37566               d = doc.createElement("div"),
37567               svg = this.node.cloneNode(true),
37568               res;
37569             f.appendChild(d);
37570             d.appendChild(svg);
37571             Snap._.$(svg, {
37572               xmlns: "http://www.w3.org/2000/svg"
37573             });
37574             res = d.innerHTML;
37575             f.removeChild(f.firstChild);
37576             return res;
37577           };
37578           /*
37579            * \ Paper.toDataURL [ method ] * Returns SVG code for the @Paper as
37580            * Data URI string. = (string) Data URI string \
37581            */
37582           proto.toDataURL = function() {
37583             if (window && window.btoa) {
37584               return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(this)));
37585             }
37586           };
37587           /*
37588            * \ Paper.clear [ method ] * Removes all child nodes of the paper,
37589            * except <defs>. \
37590            */
37591           proto.clear = function() {
37592             var node = this.node.firstChild,
37593               next;
37594             while (node) {
37595               next = node.nextSibling;
37596               if (node.tagName != "defs") {
37597                 node.parentNode.removeChild(node);
37598               } else {
37599                 proto.clear.call({
37600                   node: node
37601                 });
37602               }
37603               node = next;
37604             }
37605           };
37606         }());
37607       });
37608
37609       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
37610       //
37611       // Licensed under the Apache License, Version 2.0 (the "License");
37612       // you may not use this file except in compliance with the License.
37613       // You may obtain a copy of the License at
37614       //
37615       // http://www.apache.org/licenses/LICENSE-2.0
37616       //
37617       // Unless required by applicable law or agreed to in writing, software
37618       // distributed under the License is distributed on an "AS IS" BASIS,
37619       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37620       // See the License for the specific language governing permissions and
37621       // limitations under the License.
37622       Snap.plugin(function(Snap, Element, Paper, glob) {
37623         var elproto = Element.prototype,
37624           is = Snap.is,
37625           clone = Snap._.clone,
37626           has = "hasOwnProperty",
37627           p2s = /,?([a-z]),?/gi,
37628           toFloat = parseFloat,
37629           math = Math,
37630           PI = math.PI,
37631           mmin = math.min,
37632           mmax = math.max,
37633           pow = math.pow,
37634           abs = math.abs;
37635
37636         function paths(ps) {
37637           var p = paths.ps = paths.ps || {};
37638           if (p[ps]) {
37639             p[ps].sleep = 100;
37640           } else {
37641             p[ps] = {
37642               sleep: 100
37643             };
37644           }
37645           setTimeout(function() {
37646             for (var key in p)
37647               if (p[has](key) && key != ps) {
37648                 p[key].sleep--;
37649                 !p[key].sleep && delete p[key];
37650               }
37651           });
37652           return p[ps];
37653         }
37654
37655         function box(x, y, width, height) {
37656           if (x == null) {
37657             x = y = width = height = 0;
37658           }
37659           if (y == null) {
37660             y = x.y;
37661             width = x.width;
37662             height = x.height;
37663             x = x.x;
37664           }
37665           return {
37666             x: x,
37667             y: y,
37668             width: width,
37669             w: width,
37670             height: height,
37671             h: height,
37672             x2: x + width,
37673             y2: y + height,
37674             cx: x + width / 2,
37675             cy: y + height / 2,
37676             r1: math.min(width, height) / 2,
37677             r2: math.max(width, height) / 2,
37678             r0: math.sqrt(width * width + height * height) / 2,
37679             path: rectPath(x, y, width, height),
37680             vb: [x, y, width, height].join(" ")
37681           };
37682         }
37683
37684         function toString() {
37685           return this.join(",").replace(p2s, "$1");
37686         }
37687
37688         function pathClone(pathArray) {
37689           var res = clone(pathArray);
37690           res.toString = toString;
37691           return res;
37692         }
37693
37694         function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
37695           if (length == null) {
37696             return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
37697           } else {
37698             return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,
37699               getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
37700           }
37701         }
37702
37703         function getLengthFactory(istotal, subpath) {
37704           function O(val) {
37705             return +(+val).toFixed(3);
37706           }
37707           return Snap._.cacher(function(path, length, onlystart) {
37708             if (path instanceof Element) {
37709               path = path.attr("d");
37710             }
37711             path = path2curve(path);
37712             var x, y, p, l, sp = "",
37713               subpaths = {},
37714               point,
37715               len = 0;
37716             for (var i = 0, ii = path.length; i < ii; i++) {
37717               p = path[i];
37718               if (p[0] == "M") {
37719                 x = +p[1];
37720                 y = +p[2];
37721               } else {
37722                 l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
37723                 if (len + l > length) {
37724                   if (subpath && !subpaths.start) {
37725                     point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
37726                     sp += [
37727                       "C" + O(point.start.x),
37728                       O(point.start.y),
37729                       O(point.m.x),
37730                       O(point.m.y),
37731                       O(point.x),
37732                       O(point.y)
37733                     ];
37734                     if (onlystart) {
37735                       return sp;
37736                     }
37737                     subpaths.start = sp;
37738                     sp = [
37739                       "M" + O(point.x),
37740                       O(point.y) + "C" + O(point.n.x),
37741                       O(point.n.y),
37742                       O(point.end.x),
37743                       O(point.end.y),
37744                       O(p[5]),
37745                       O(p[6])
37746                     ].join();
37747                     len += l;
37748                     x = +p[5];
37749                     y = +p[6];
37750                     continue;
37751                   }
37752                   if (!istotal && !subpath) {
37753                     point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
37754                     return point;
37755                   }
37756                 }
37757                 len += l;
37758                 x = +p[5];
37759                 y = +p[6];
37760               }
37761               sp += p.shift() + p;
37762             }
37763             subpaths.end = sp;
37764             point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
37765             return point;
37766           }, null, Snap._.clone);
37767         }
37768         var getTotalLength = getLengthFactory(1),
37769           getPointAtLength = getLengthFactory(),
37770           getSubpathsAtLength = getLengthFactory(0, 1);
37771
37772         function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
37773           var t1 = 1 - t,
37774             t13 = pow(t1, 3),
37775             t12 = pow(t1, 2),
37776             t2 = t * t,
37777             t3 = t2 * t,
37778             x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
37779             y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
37780             mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
37781             my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
37782             nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
37783             ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
37784             ax = t1 * p1x + t * c1x,
37785             ay = t1 * p1y + t * c1y,
37786             cx = t1 * c2x + t * p2x,
37787             cy = t1 * c2y + t * p2y,
37788             alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
37789           // (mx > nx || my < ny) && (alpha += 180);
37790           return {
37791             x: x,
37792             y: y,
37793             m: {
37794               x: mx,
37795               y: my
37796             },
37797             n: {
37798               x: nx,
37799               y: ny
37800             },
37801             start: {
37802               x: ax,
37803               y: ay
37804             },
37805             end: {
37806               x: cx,
37807               y: cy
37808             },
37809             alpha: alpha
37810           };
37811         }
37812
37813         function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
37814           if (!Snap.is(p1x, "array")) {
37815             p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
37816           }
37817           var bbox = curveDim.apply(null, p1x);
37818           return box(
37819             bbox.min.x,
37820             bbox.min.y,
37821             bbox.max.x - bbox.min.x,
37822             bbox.max.y - bbox.min.y
37823           );
37824         }
37825
37826         function isPointInsideBBox(bbox, x, y) {
37827           return x >= bbox.x &&
37828             x <= bbox.x + bbox.width &&
37829             y >= bbox.y &&
37830             y <= bbox.y + bbox.height;
37831         }
37832
37833         function isBBoxIntersect(bbox1, bbox2) {
37834           bbox1 = box(bbox1);
37835           bbox2 = box(bbox2);
37836           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);
37837         }
37838
37839         function base3(t, p1, p2, p3, p4) {
37840           var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
37841             t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
37842           return t * t2 - 3 * p1 + 3 * p2;
37843         }
37844
37845         function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
37846           if (z == null) {
37847             z = 1;
37848           }
37849           z = z > 1 ? 1 : z < 0 ? 0 : z;
37850           var z2 = z / 2,
37851             n = 12,
37852             Tvalues = [-.1252, .1252, -.3678, .3678, -.5873, .5873, -.7699, .7699, -.9041, .9041, -.9816, .9816],
37853             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],
37854             sum = 0;
37855           for (var i = 0; i < n; i++) {
37856             var ct = z2 * Tvalues[i] + z2,
37857               xbase = base3(ct, x1, x2, x3, x4),
37858               ybase = base3(ct, y1, y2, y3, y4),
37859               comb = xbase * xbase + ybase * ybase;
37860             sum += Cvalues[i] * math.sqrt(comb);
37861           }
37862           return z2 * sum;
37863         }
37864
37865         function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
37866           if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
37867             return;
37868           }
37869           var t = 1,
37870             step = t / 2,
37871             t2 = t - step,
37872             l,
37873             e = .01;
37874           l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
37875           while (abs(l - ll) > e) {
37876             step /= 2;
37877             t2 += (l < ll ? 1 : -1) * step;
37878             l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
37879           }
37880           return t2;
37881         }
37882
37883         function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
37884           if (
37885             mmax(x1, x2) < mmin(x3, x4) ||
37886             mmin(x1, x2) > mmax(x3, x4) ||
37887             mmax(y1, y2) < mmin(y3, y4) ||
37888             mmin(y1, y2) > mmax(y3, y4)
37889           ) {
37890             return;
37891           }
37892           var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
37893             ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
37894             denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
37895
37896           if (!denominator) {
37897             return;
37898           }
37899           var px = nx / denominator,
37900             py = ny / denominator,
37901             px2 = +px.toFixed(2),
37902             py2 = +py.toFixed(2);
37903           if (
37904             px2 < +mmin(x1, x2).toFixed(2) ||
37905             px2 > +mmax(x1, x2).toFixed(2) ||
37906             px2 < +mmin(x3, x4).toFixed(2) ||
37907             px2 > +mmax(x3, x4).toFixed(2) ||
37908             py2 < +mmin(y1, y2).toFixed(2) ||
37909             py2 > +mmax(y1, y2).toFixed(2) ||
37910             py2 < +mmin(y3, y4).toFixed(2) ||
37911             py2 > +mmax(y3, y4).toFixed(2)
37912           ) {
37913             return;
37914           }
37915           return {
37916             x: px,
37917             y: py
37918           };
37919         }
37920
37921         function inter(bez1, bez2) {
37922           return interHelper(bez1, bez2);
37923         }
37924
37925         function interCount(bez1, bez2) {
37926           return interHelper(bez1, bez2, 1);
37927         }
37928
37929         function interHelper(bez1, bez2, justCount) {
37930           var bbox1 = bezierBBox(bez1),
37931             bbox2 = bezierBBox(bez2);
37932           if (!isBBoxIntersect(bbox1, bbox2)) {
37933             return justCount ? 0 : [];
37934           }
37935           var l1 = bezlen.apply(0, bez1),
37936             l2 = bezlen.apply(0, bez2),
37937             n1 = ~~(l1 / 8),
37938             n2 = ~~(l2 / 8),
37939             dots1 = [],
37940             dots2 = [],
37941             xy = {},
37942             res = justCount ? 0 : [];
37943           for (var i = 0; i < n1 + 1; i++) {
37944             var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
37945             dots1.push({
37946               x: p.x,
37947               y: p.y,
37948               t: i / n1
37949             });
37950           }
37951           for (i = 0; i < n2 + 1; i++) {
37952             p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
37953             dots2.push({
37954               x: p.x,
37955               y: p.y,
37956               t: i / n2
37957             });
37958           }
37959           for (i = 0; i < n1; i++) {
37960             for (var j = 0; j < n2; j++) {
37961               var di = dots1[i],
37962                 di1 = dots1[i + 1],
37963                 dj = dots2[j],
37964                 dj1 = dots2[j + 1],
37965                 ci = abs(di1.x - di.x) < .001 ? "y" : "x",
37966                 cj = abs(dj1.x - dj.x) < .001 ? "y" : "x",
37967                 is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
37968               if (is) {
37969                 if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {
37970                   continue;
37971                 }
37972                 xy[is.x.toFixed(4)] = is.y.toFixed(4);
37973                 var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
37974                   t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
37975                 if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
37976                   if (justCount) {
37977                     res++;
37978                   } else {
37979                     res.push({
37980                       x: is.x,
37981                       y: is.y,
37982                       t1: t1,
37983                       t2: t2
37984                     });
37985                   }
37986                 }
37987               }
37988             }
37989           }
37990           return res;
37991         }
37992
37993         function pathIntersection(path1, path2) {
37994           return interPathHelper(path1, path2);
37995         }
37996
37997         function pathIntersectionNumber(path1, path2) {
37998           return interPathHelper(path1, path2, 1);
37999         }
38000
38001         function interPathHelper(path1, path2, justCount) {
38002           path1 = path2curve(path1);
38003           path2 = path2curve(path2);
38004           var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
38005             res = justCount ? 0 : [];
38006           for (var i = 0, ii = path1.length; i < ii; i++) {
38007             var pi = path1[i];
38008             if (pi[0] == "M") {
38009               x1 = x1m = pi[1];
38010               y1 = y1m = pi[2];
38011             } else {
38012               if (pi[0] == "C") {
38013                 bez1 = [x1, y1].concat(pi.slice(1));
38014                 x1 = bez1[6];
38015                 y1 = bez1[7];
38016               } else {
38017                 bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
38018                 x1 = x1m;
38019                 y1 = y1m;
38020               }
38021               for (var j = 0, jj = path2.length; j < jj; j++) {
38022                 var pj = path2[j];
38023                 if (pj[0] == "M") {
38024                   x2 = x2m = pj[1];
38025                   y2 = y2m = pj[2];
38026                 } else {
38027                   if (pj[0] == "C") {
38028                     bez2 = [x2, y2].concat(pj.slice(1));
38029                     x2 = bez2[6];
38030                     y2 = bez2[7];
38031                   } else {
38032                     bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
38033                     x2 = x2m;
38034                     y2 = y2m;
38035                   }
38036                   var intr = interHelper(bez1, bez2, justCount);
38037                   if (justCount) {
38038                     res += intr;
38039                   } else {
38040                     for (var k = 0, kk = intr.length; k < kk; k++) {
38041                       intr[k].segment1 = i;
38042                       intr[k].segment2 = j;
38043                       intr[k].bez1 = bez1;
38044                       intr[k].bez2 = bez2;
38045                     }
38046                     res = res.concat(intr);
38047                   }
38048                 }
38049               }
38050             }
38051           }
38052           return res;
38053         }
38054
38055         function isPointInsidePath(path, x, y) {
38056           var bbox = pathBBox(path);
38057           return isPointInsideBBox(bbox, x, y) &&
38058             interPathHelper(path, [
38059               ["M", x, y],
38060               ["H", bbox.x2 + 10]
38061             ], 1) % 2 == 1;
38062         }
38063
38064         function pathBBox(path) {
38065           var pth = paths(path);
38066           if (pth.bbox) {
38067             return clone(pth.bbox);
38068           }
38069           if (!path) {
38070             return box();
38071           }
38072           path = path2curve(path);
38073           var x = 0,
38074             y = 0,
38075             X = [],
38076             Y = [],
38077             p;
38078           for (var i = 0, ii = path.length; i < ii; i++) {
38079             p = path[i];
38080             if (p[0] == "M") {
38081               x = p[1];
38082               y = p[2];
38083               X.push(x);
38084               Y.push(y);
38085             } else {
38086               var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
38087               X = X.concat(dim.min.x, dim.max.x);
38088               Y = Y.concat(dim.min.y, dim.max.y);
38089               x = p[5];
38090               y = p[6];
38091             }
38092           }
38093           var xmin = mmin.apply(0, X),
38094             ymin = mmin.apply(0, Y),
38095             xmax = mmax.apply(0, X),
38096             ymax = mmax.apply(0, Y),
38097             bb = box(xmin, ymin, xmax - xmin, ymax - ymin);
38098           pth.bbox = clone(bb);
38099           return bb;
38100         }
38101
38102         function rectPath(x, y, w, h, r) {
38103           if (r) {
38104             return [
38105               ["M", +x + (+r), y],
38106               ["l", w - r * 2, 0],
38107               ["a", r, r, 0, 0, 1, r, r],
38108               ["l", 0, h - r * 2],
38109               ["a", r, r, 0, 0, 1, -r, r],
38110               ["l", r * 2 - w, 0],
38111               ["a", r, r, 0, 0, 1, -r, -r],
38112               ["l", 0, r * 2 - h],
38113               ["a", r, r, 0, 0, 1, r, -r],
38114               ["z"]
38115             ];
38116           }
38117           var res = [
38118             ["M", x, y],
38119             ["l", w, 0],
38120             ["l", 0, h],
38121             ["l", -w, 0],
38122             ["z"]
38123           ];
38124           res.toString = toString;
38125           return res;
38126         }
38127
38128         function ellipsePath(x, y, rx, ry, a) {
38129           if (a == null && ry == null) {
38130             ry = rx;
38131           }
38132           x = +x;
38133           y = +y;
38134           rx = +rx;
38135           ry = +ry;
38136           if (a != null) {
38137             var rad = Math.PI / 180,
38138               x1 = x + rx * Math.cos(-ry * rad),
38139               x2 = x + rx * Math.cos(-a * rad),
38140               y1 = y + rx * Math.sin(-ry * rad),
38141               y2 = y + rx * Math.sin(-a * rad),
38142               res = [
38143                 ["M", x1, y1],
38144                 ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]
38145               ];
38146           } else {
38147             res = [
38148               ["M", x, y],
38149               ["m", 0, -ry],
38150               ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
38151               ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
38152               ["z"]
38153             ];
38154           }
38155           res.toString = toString;
38156           return res;
38157         }
38158         var unit2px = Snap._unit2px,
38159           getPath = {
38160             path: function(el) {
38161               return el.attr("path");
38162             },
38163             circle: function(el) {
38164               var attr = unit2px(el);
38165               return ellipsePath(attr.cx, attr.cy, attr.r);
38166             },
38167             ellipse: function(el) {
38168               var attr = unit2px(el);
38169               return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);
38170             },
38171             rect: function(el) {
38172               var attr = unit2px(el);
38173               return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);
38174             },
38175             image: function(el) {
38176               var attr = unit2px(el);
38177               return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);
38178             },
38179             line: function(el) {
38180               return "M" + [el.attr("x1") || 0, el.attr("y1") || 0, el.attr("x2"), el.attr("y2")];
38181             },
38182             polyline: function(el) {
38183               return "M" + el.attr("points");
38184             },
38185             polygon: function(el) {
38186               return "M" + el.attr("points") + "z";
38187             },
38188             deflt: function(el) {
38189               var bbox = el.node.getBBox();
38190               return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
38191             }
38192           };
38193
38194         function pathToRelative(pathArray) {
38195           var pth = paths(pathArray),
38196             lowerCase = String.prototype.toLowerCase;
38197           if (pth.rel) {
38198             return pathClone(pth.rel);
38199           }
38200           if (!Snap.is(pathArray, "array") || !Snap.is(pathArray && pathArray[0], "array")) {
38201             pathArray = Snap.parsePathString(pathArray);
38202           }
38203           var res = [],
38204             x = 0,
38205             y = 0,
38206             mx = 0,
38207             my = 0,
38208             start = 0;
38209           if (pathArray[0][0] == "M") {
38210             x = pathArray[0][1];
38211             y = pathArray[0][2];
38212             mx = x;
38213             my = y;
38214             start++;
38215             res.push(["M", x, y]);
38216           }
38217           for (var i = start, ii = pathArray.length; i < ii; i++) {
38218             var r = res[i] = [],
38219               pa = pathArray[i];
38220             if (pa[0] != lowerCase.call(pa[0])) {
38221               r[0] = lowerCase.call(pa[0]);
38222               switch (r[0]) {
38223                 case "a":
38224                   r[1] = pa[1];
38225                   r[2] = pa[2];
38226                   r[3] = pa[3];
38227                   r[4] = pa[4];
38228                   r[5] = pa[5];
38229                   r[6] = +(pa[6] - x).toFixed(3);
38230                   r[7] = +(pa[7] - y).toFixed(3);
38231                   break;
38232                 case "v":
38233                   r[1] = +(pa[1] - y).toFixed(3);
38234                   break;
38235                 case "m":
38236                   mx = pa[1];
38237                   my = pa[2];
38238                 default:
38239                   for (var j = 1, jj = pa.length; j < jj; j++) {
38240                     r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
38241                   }
38242               }
38243             } else {
38244               r = res[i] = [];
38245               if (pa[0] == "m") {
38246                 mx = pa[1] + x;
38247                 my = pa[2] + y;
38248               }
38249               for (var k = 0, kk = pa.length; k < kk; k++) {
38250                 res[i][k] = pa[k];
38251               }
38252             }
38253             var len = res[i].length;
38254             switch (res[i][0]) {
38255               case "z":
38256                 x = mx;
38257                 y = my;
38258                 break;
38259               case "h":
38260                 x += +res[i][len - 1];
38261                 break;
38262               case "v":
38263                 y += +res[i][len - 1];
38264                 break;
38265               default:
38266                 x += +res[i][len - 2];
38267                 y += +res[i][len - 1];
38268             }
38269           }
38270           res.toString = toString;
38271           pth.rel = pathClone(res);
38272           return res;
38273         }
38274
38275         function pathToAbsolute(pathArray) {
38276           var pth = paths(pathArray);
38277           if (pth.abs) {
38278             return pathClone(pth.abs);
38279           }
38280           if (!is(pathArray, "array") || !is(pathArray && pathArray[0], "array")) { // rough
38281             // assumption
38282             pathArray = Snap.parsePathString(pathArray);
38283           }
38284           if (!pathArray || !pathArray.length) {
38285             return [
38286               ["M", 0, 0]
38287             ];
38288           }
38289           var res = [],
38290             x = 0,
38291             y = 0,
38292             mx = 0,
38293             my = 0,
38294             start = 0,
38295             pa0;
38296           if (pathArray[0][0] == "M") {
38297             x = +pathArray[0][1];
38298             y = +pathArray[0][2];
38299             mx = x;
38300             my = y;
38301             start++;
38302             res[0] = ["M", x, y];
38303           }
38304           var crz = pathArray.length == 3 &&
38305             pathArray[0][0] == "M" &&
38306             pathArray[1][0].toUpperCase() == "R" &&
38307             pathArray[2][0].toUpperCase() == "Z";
38308           for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
38309             res.push(r = []);
38310             pa = pathArray[i];
38311             pa0 = pa[0];
38312             if (pa0 != pa0.toUpperCase()) {
38313               r[0] = pa0.toUpperCase();
38314               switch (r[0]) {
38315                 case "A":
38316                   r[1] = pa[1];
38317                   r[2] = pa[2];
38318                   r[3] = pa[3];
38319                   r[4] = pa[4];
38320                   r[5] = pa[5];
38321                   r[6] = +pa[6] + x;
38322                   r[7] = +pa[7] + y;
38323                   break;
38324                 case "V":
38325                   r[1] = +pa[1] + y;
38326                   break;
38327                 case "H":
38328                   r[1] = +pa[1] + x;
38329                   break;
38330                 case "R":
38331                   var dots = [x, y].concat(pa.slice(1));
38332                   for (var j = 2, jj = dots.length; j < jj; j++) {
38333                     dots[j] = +dots[j] + x;
38334                     dots[++j] = +dots[j] + y;
38335                   }
38336                   res.pop();
38337                   res = res.concat(catmullRom2bezier(dots, crz));
38338                   break;
38339                 case "O":
38340                   res.pop();
38341                   dots = ellipsePath(x, y, pa[1], pa[2]);
38342                   dots.push(dots[0]);
38343                   res = res.concat(dots);
38344                   break;
38345                 case "U":
38346                   res.pop();
38347                   res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
38348                   r = ["U"].concat(res[res.length - 1].slice(-2));
38349                   break;
38350                 case "M":
38351                   mx = +pa[1] + x;
38352                   my = +pa[2] + y;
38353                 default:
38354                   for (j = 1, jj = pa.length; j < jj; j++) {
38355                     r[j] = +pa[j] + ((j % 2) ? x : y);
38356                   }
38357               }
38358             } else if (pa0 == "R") {
38359               dots = [x, y].concat(pa.slice(1));
38360               res.pop();
38361               res = res.concat(catmullRom2bezier(dots, crz));
38362               r = ["R"].concat(pa.slice(-2));
38363             } else if (pa0 == "O") {
38364               res.pop();
38365               dots = ellipsePath(x, y, pa[1], pa[2]);
38366               dots.push(dots[0]);
38367               res = res.concat(dots);
38368             } else if (pa0 == "U") {
38369               res.pop();
38370               res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
38371               r = ["U"].concat(res[res.length - 1].slice(-2));
38372             } else {
38373               for (var k = 0, kk = pa.length; k < kk; k++) {
38374                 r[k] = pa[k];
38375               }
38376             }
38377             pa0 = pa0.toUpperCase();
38378             if (pa0 != "O") {
38379               switch (r[0]) {
38380                 case "Z":
38381                   x = +mx;
38382                   y = +my;
38383                   break;
38384                 case "H":
38385                   x = r[1];
38386                   break;
38387                 case "V":
38388                   y = r[1];
38389                   break;
38390                 case "M":
38391                   mx = r[r.length - 2];
38392                   my = r[r.length - 1];
38393                 default:
38394                   x = r[r.length - 2];
38395                   y = r[r.length - 1];
38396               }
38397             }
38398           }
38399           res.toString = toString;
38400           pth.abs = pathClone(res);
38401           return res;
38402         }
38403
38404         function l2c(x1, y1, x2, y2) {
38405           return [x1, y1, x2, y2, x2, y2];
38406         }
38407
38408         function q2c(x1, y1, ax, ay, x2, y2) {
38409           var _13 = 1 / 3,
38410             _23 = 2 / 3;
38411           return [
38412             _13 * x1 + _23 * ax,
38413             _13 * y1 + _23 * ay,
38414             _13 * x2 + _23 * ax,
38415             _13 * y2 + _23 * ay,
38416             x2,
38417             y2
38418           ];
38419         }
38420
38421         function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
38422           // for more information of where this math came from visit:
38423           // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
38424           var _120 = PI * 120 / 180,
38425             rad = PI / 180 * (+angle || 0),
38426             res = [],
38427             xy,
38428             rotate = Snap._.cacher(function(x, y, rad) {
38429               var X = x * math.cos(rad) - y * math.sin(rad),
38430                 Y = x * math.sin(rad) + y * math.cos(rad);
38431               return {
38432                 x: X,
38433                 y: Y
38434               };
38435             });
38436           if (!recursive) {
38437             xy = rotate(x1, y1, -rad);
38438             x1 = xy.x;
38439             y1 = xy.y;
38440             xy = rotate(x2, y2, -rad);
38441             x2 = xy.x;
38442             y2 = xy.y;
38443             var cos = math.cos(PI / 180 * angle),
38444               sin = math.sin(PI / 180 * angle),
38445               x = (x1 - x2) / 2,
38446               y = (y1 - y2) / 2;
38447             var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
38448             if (h > 1) {
38449               h = math.sqrt(h);
38450               rx = h * rx;
38451               ry = h * ry;
38452             }
38453             var rx2 = rx * rx,
38454               ry2 = ry * ry,
38455               k = (large_arc_flag == sweep_flag ? -1 : 1) *
38456               math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
38457               cx = k * rx * y / ry + (x1 + x2) / 2,
38458               cy = k * -ry * x / rx + (y1 + y2) / 2,
38459               f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
38460               f2 = math.asin(((y2 - cy) / ry).toFixed(9));
38461
38462             f1 = x1 < cx ? PI - f1 : f1;
38463             f2 = x2 < cx ? PI - f2 : f2;
38464             f1 < 0 && (f1 = PI * 2 + f1);
38465             f2 < 0 && (f2 = PI * 2 + f2);
38466             if (sweep_flag && f1 > f2) {
38467               f1 = f1 - PI * 2;
38468             }
38469             if (!sweep_flag && f2 > f1) {
38470               f2 = f2 - PI * 2;
38471             }
38472           } else {
38473             f1 = recursive[0];
38474             f2 = recursive[1];
38475             cx = recursive[2];
38476             cy = recursive[3];
38477           }
38478           var df = f2 - f1;
38479           if (abs(df) > _120) {
38480             var f2old = f2,
38481               x2old = x2,
38482               y2old = y2;
38483             f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
38484             x2 = cx + rx * math.cos(f2);
38485             y2 = cy + ry * math.sin(f2);
38486             res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
38487           }
38488           df = f2 - f1;
38489           var c1 = math.cos(f1),
38490             s1 = math.sin(f1),
38491             c2 = math.cos(f2),
38492             s2 = math.sin(f2),
38493             t = math.tan(df / 4),
38494             hx = 4 / 3 * rx * t,
38495             hy = 4 / 3 * ry * t,
38496             m1 = [x1, y1],
38497             m2 = [x1 + hx * s1, y1 - hy * c1],
38498             m3 = [x2 + hx * s2, y2 - hy * c2],
38499             m4 = [x2, y2];
38500           m2[0] = 2 * m1[0] - m2[0];
38501           m2[1] = 2 * m1[1] - m2[1];
38502           if (recursive) {
38503             return [m2, m3, m4].concat(res);
38504           } else {
38505             res = [m2, m3, m4].concat(res).join().split(",");
38506             var newres = [];
38507             for (var i = 0, ii = res.length; i < ii; i++) {
38508               newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
38509             }
38510             return newres;
38511           }
38512         }
38513
38514         function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
38515           var t1 = 1 - t;
38516           return {
38517             x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
38518             y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
38519           };
38520         }
38521
38522         // Returns bounding box of cubic bezier curve.
38523         // Source:
38524         // http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
38525         // Original version: NISHIO Hirokazu
38526         // Modifications: https://github.com/timo22345
38527         function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {
38528           var tvalues = [],
38529             bounds = [
38530               [],
38531               []
38532             ],
38533             a, b, c, t, t1, t2, b2ac, sqrtb2ac;
38534           for (var i = 0; i < 2; ++i) {
38535             if (i == 0) {
38536               b = 6 * x0 - 12 * x1 + 6 * x2;
38537               a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
38538               c = 3 * x1 - 3 * x0;
38539             } else {
38540               b = 6 * y0 - 12 * y1 + 6 * y2;
38541               a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
38542               c = 3 * y1 - 3 * y0;
38543             }
38544             if (abs(a) < 1e-12) {
38545               if (abs(b) < 1e-12) {
38546                 continue;
38547               }
38548               t = -c / b;
38549               if (0 < t && t < 1) {
38550                 tvalues.push(t);
38551               }
38552               continue;
38553             }
38554             b2ac = b * b - 4 * c * a;
38555             sqrtb2ac = math.sqrt(b2ac);
38556             if (b2ac < 0) {
38557               continue;
38558             }
38559             t1 = (-b + sqrtb2ac) / (2 * a);
38560             if (0 < t1 && t1 < 1) {
38561               tvalues.push(t1);
38562             }
38563             t2 = (-b - sqrtb2ac) / (2 * a);
38564             if (0 < t2 && t2 < 1) {
38565               tvalues.push(t2);
38566             }
38567           }
38568
38569           var x, y, j = tvalues.length,
38570             jlen = j,
38571             mt;
38572           while (j--) {
38573             t = tvalues[j];
38574             mt = 1 - t;
38575             bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);
38576             bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);
38577           }
38578
38579           bounds[0][jlen] = x0;
38580           bounds[1][jlen] = y0;
38581           bounds[0][jlen + 1] = x3;
38582           bounds[1][jlen + 1] = y3;
38583           bounds[0].length = bounds[1].length = jlen + 2;
38584
38585
38586           return {
38587             min: {
38588               x: mmin.apply(0, bounds[0]),
38589               y: mmin.apply(0, bounds[1])
38590             },
38591             max: {
38592               x: mmax.apply(0, bounds[0]),
38593               y: mmax.apply(0, bounds[1])
38594             }
38595           };
38596         }
38597
38598         function path2curve(path, path2) {
38599           var pth = !path2 && paths(path);
38600           if (!path2 && pth.curve) {
38601             return pathClone(pth.curve);
38602           }
38603           var p = pathToAbsolute(path),
38604             p2 = path2 && pathToAbsolute(path2),
38605             attrs = {
38606               x: 0,
38607               y: 0,
38608               bx: 0,
38609               by: 0,
38610               X: 0,
38611               Y: 0,
38612               qx: null,
38613               qy: null
38614             },
38615             attrs2 = {
38616               x: 0,
38617               y: 0,
38618               bx: 0,
38619               by: 0,
38620               X: 0,
38621               Y: 0,
38622               qx: null,
38623               qy: null
38624             },
38625             processPath = function(path, d, pcom) {
38626               var nx, ny;
38627               if (!path) {
38628                 return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
38629               }!(path[0] in {
38630                 T: 1,
38631                 Q: 1
38632               }) && (d.qx = d.qy = null);
38633               switch (path[0]) {
38634                 case "M":
38635                   d.X = path[1];
38636                   d.Y = path[2];
38637                   break;
38638                 case "A":
38639                   path = ["C"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
38640                   break;
38641                 case "S":
38642                   if (pcom == "C" || pcom == "S") { // In "S" case we
38643                     // have to take into
38644                     // account, if the
38645                     // previous command
38646                     // is C/S.
38647                     nx = d.x * 2 - d.bx; // And reflect the
38648                     // previous
38649                     ny = d.y * 2 - d.by; // command's control
38650                     // point relative to
38651                     // the current
38652                     // point.
38653                   } else { // or some else or
38654                     // nothing
38655                     nx = d.x;
38656                     ny = d.y;
38657                   }
38658                   path = ["C", nx, ny].concat(path.slice(1));
38659                   break;
38660                 case "T":
38661                   if (pcom == "Q" || pcom == "T") { // In "T" case we
38662                     // have to take into
38663                     // account, if the
38664                     // previous command
38665                     // is Q/T.
38666                     d.qx = d.x * 2 - d.qx; // And make a
38667                     // reflection
38668                     // similar
38669                     d.qy = d.y * 2 - d.qy; // to case "S".
38670                   } else { // or something else
38671                     // or nothing
38672                     d.qx = d.x;
38673                     d.qy = d.y;
38674                   }
38675                   path = ["C"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
38676                   break;
38677                 case "Q":
38678                   d.qx = path[1];
38679                   d.qy = path[2];
38680                   path = ["C"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
38681                   break;
38682                 case "L":
38683                   path = ["C"].concat(l2c(d.x, d.y, path[1], path[2]));
38684                   break;
38685                 case "H":
38686                   path = ["C"].concat(l2c(d.x, d.y, path[1], d.y));
38687                   break;
38688                 case "V":
38689                   path = ["C"].concat(l2c(d.x, d.y, d.x, path[1]));
38690                   break;
38691                 case "Z":
38692                   path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y));
38693                   break;
38694               }
38695               return path;
38696             },
38697             fixArc = function(pp, i) {
38698               if (pp[i].length > 7) {
38699                 pp[i].shift();
38700                 var pi = pp[i];
38701                 while (pi.length) {
38702                   pcoms1[i] = "A"; // if created multiple C:s, their
38703                   // original seg is saved
38704                   p2 && (pcoms2[i] = "A"); // the same as above
38705                   pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6)));
38706                 }
38707                 pp.splice(i, 1);
38708                 ii = mmax(p.length, p2 && p2.length || 0);
38709               }
38710             },
38711             fixM = function(path1, path2, a1, a2, i) {
38712               if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
38713                 path2.splice(i, 0, ["M", a2.x, a2.y]);
38714                 a1.bx = 0;
38715                 a1.by = 0;
38716                 a1.x = path1[i][1];
38717                 a1.y = path1[i][2];
38718                 ii = mmax(p.length, p2 && p2.length || 0);
38719               }
38720             },
38721             pcoms1 = [], // path commands of original path p
38722             pcoms2 = [], // path commands of original path p2
38723             pfirst = "", // temporary holder for original path command
38724             pcom = ""; // holder for previous path command of original path
38725           for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
38726             p[i] && (pfirst = p[i][0]); // save current path command
38727
38728             if (pfirst != "C") // C is not saved yet, because it may be result
38729             // of conversion
38730             {
38731               pcoms1[i] = pfirst; // Save current path command
38732               i && (pcom = pcoms1[i - 1]); // Get previous path command
38733               // pcom
38734             }
38735             p[i] = processPath(p[i], attrs, pcom); // Previous path command is
38736             // inputted to processPath
38737
38738             if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the
38739             // only
38740             // command
38741             // which may produce multiple C:s
38742             // so we have to make sure that C is also C in original path
38743
38744             fixArc(p, i); // fixArc adds also the right amount of A:s to
38745             // pcoms1
38746
38747             if (p2) { // the same procedures is done to p2
38748               p2[i] && (pfirst = p2[i][0]);
38749               if (pfirst != "C") {
38750                 pcoms2[i] = pfirst;
38751                 i && (pcom = pcoms2[i - 1]);
38752               }
38753               p2[i] = processPath(p2[i], attrs2, pcom);
38754
38755               if (pcoms2[i] != "A" && pfirst == "C") {
38756                 pcoms2[i] = "C";
38757               }
38758
38759               fixArc(p2, i);
38760             }
38761             fixM(p, p2, attrs, attrs2, i);
38762             fixM(p2, p, attrs2, attrs, i);
38763             var seg = p[i],
38764               seg2 = p2 && p2[i],
38765               seglen = seg.length,
38766               seg2len = p2 && seg2.length;
38767             attrs.x = seg[seglen - 2];
38768             attrs.y = seg[seglen - 1];
38769             attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
38770             attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
38771             attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
38772             attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
38773             attrs2.x = p2 && seg2[seg2len - 2];
38774             attrs2.y = p2 && seg2[seg2len - 1];
38775           }
38776           if (!p2) {
38777             pth.curve = pathClone(p);
38778           }
38779           return p2 ? [p, p2] : p;
38780         }
38781
38782         function mapPath(path, matrix) {
38783           if (!matrix) {
38784             return path;
38785           }
38786           var x, y, i, j, ii, jj, pathi;
38787           path = path2curve(path);
38788           for (i = 0, ii = path.length; i < ii; i++) {
38789             pathi = path[i];
38790             for (j = 1, jj = pathi.length; j < jj; j += 2) {
38791               x = matrix.x(pathi[j], pathi[j + 1]);
38792               y = matrix.y(pathi[j], pathi[j + 1]);
38793               pathi[j] = x;
38794               pathi[j + 1] = y;
38795             }
38796           }
38797           return path;
38798         }
38799
38800         // http://schepers.cc/getting-to-the-point
38801         function catmullRom2bezier(crp, z) {
38802           var d = [];
38803           for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
38804             var p = [{
38805               x: +crp[i - 2],
38806               y: +crp[i - 1]
38807             }, {
38808               x: +crp[i],
38809               y: +crp[i + 1]
38810             }, {
38811               x: +crp[i + 2],
38812               y: +crp[i + 3]
38813             }, {
38814               x: +crp[i + 4],
38815               y: +crp[i + 5]
38816             }];
38817             if (z) {
38818               if (!i) {
38819                 p[0] = {
38820                   x: +crp[iLen - 2],
38821                   y: +crp[iLen - 1]
38822                 };
38823               } else if (iLen - 4 == i) {
38824                 p[3] = {
38825                   x: +crp[0],
38826                   y: +crp[1]
38827                 };
38828               } else if (iLen - 2 == i) {
38829                 p[2] = {
38830                   x: +crp[0],
38831                   y: +crp[1]
38832                 };
38833                 p[3] = {
38834                   x: +crp[2],
38835                   y: +crp[3]
38836                 };
38837               }
38838             } else {
38839               if (iLen - 4 == i) {
38840                 p[3] = p[2];
38841               } else if (!i) {
38842                 p[0] = {
38843                   x: +crp[i],
38844                   y: +crp[i + 1]
38845                 };
38846               }
38847             }
38848             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,
38849               p[2].x,
38850               p[2].y
38851             ]);
38852           }
38853
38854           return d;
38855         }
38856
38857         // export
38858         Snap.path = paths;
38859
38860         /*
38861          * \ Snap.path.getTotalLength [ method ] * Returns the length of the given
38862          * path in pixels * - path (string) SVG path string * = (number) length \
38863          */
38864         Snap.path.getTotalLength = getTotalLength;
38865         /*
38866          * \ Snap.path.getPointAtLength [ method ] * Returns the coordinates of the
38867          * point located at the given length along the given path * - path (string)
38868          * SVG path string - length (number) length, in pixels, from the start of
38869          * the path, excluding non-rendering jumps * = (object) representation of
38870          * the point: o { o x: (number) x coordinate, o y: (number) y coordinate, o
38871          * alpha: (number) angle of derivative o } \
38872          */
38873         Snap.path.getPointAtLength = getPointAtLength;
38874         /*
38875          * \ Snap.path.getSubpath [ method ] * Returns the subpath of a given path
38876          * between given start and end lengths * - path (string) SVG path string -
38877          * from (number) length, in pixels, from the start of the path to the start
38878          * of the segment - to (number) length, in pixels, from the start of the
38879          * path to the end of the segment * = (string) path string definition for
38880          * the segment \
38881          */
38882         Snap.path.getSubpath = function(path, from, to) {
38883           if (this.getTotalLength(path) - to < 1e-6) {
38884             return getSubpathsAtLength(path, from).end;
38885           }
38886           var a = getSubpathsAtLength(path, to, 1);
38887           return from ? getSubpathsAtLength(a, from).end : a;
38888         };
38889         /*
38890          * \ Element.getTotalLength [ method ] * Returns the length of the path in
38891          * pixels (only works for `path` elements) = (number) length \
38892          */
38893         elproto.getTotalLength = function() {
38894           if (this.node.getTotalLength) {
38895             return this.node.getTotalLength();
38896           }
38897         };
38898         // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path>
38899         // is broken into different segments, is the jump distance to the new
38900         // coordinates set by the _M_ or _m_ commands calculated as part of the
38901         // path's total length?
38902         /*
38903          * \ Element.getPointAtLength [ method ] * Returns coordinates of the point
38904          * located at the given length on the given path (only works for `path`
38905          * elements) * - length (number) length, in pixels, from the start of the
38906          * path, excluding non-rendering jumps * = (object) representation of the
38907          * point: o { o x: (number) x coordinate, o y: (number) y coordinate, o
38908          * alpha: (number) angle of derivative o } \
38909          */
38910         elproto.getPointAtLength = function(length) {
38911           return getPointAtLength(this.attr("d"), length);
38912         };
38913         // SIERRA Element.getSubpath(): Similar to the problem for
38914         // Element.getPointAtLength(). Unclear how this would work for a segmented
38915         // path. Overall, the concept of _subpath_ and what I'm calling a _segment_
38916         // (series of non-_M_ or _Z_ commands) is unclear.
38917         /*
38918          * \ Element.getSubpath [ method ] * Returns subpath of a given element from
38919          * given start and end lengths (only works for `path` elements) * - from
38920          * (number) length, in pixels, from the start of the path to the start of
38921          * the segment - to (number) length, in pixels, from the start of the path
38922          * to the end of the segment * = (string) path string definition for the
38923          * segment \
38924          */
38925         elproto.getSubpath = function(from, to) {
38926           return Snap.path.getSubpath(this.attr("d"), from, to);
38927         };
38928         Snap._.box = box;
38929         /*
38930          * \ Snap.path.findDotsAtSegment [ method ] * Utility method * Finds dot
38931          * coordinates on the given cubic beziér curve at the given t - p1x
38932          * (number) x of the first point of the curve - p1y (number) y of the first
38933          * point of the curve - c1x (number) x of the first anchor of the curve -
38934          * c1y (number) y of the first anchor of the curve - c2x (number) x of the
38935          * second anchor of the curve - c2y (number) y of the second anchor of the
38936          * curve - p2x (number) x of the second point of the curve - p2y (number) y
38937          * of the second point of the curve - t (number) position on the curve
38938          * (0..1) = (object) point information in format: o { o x: (number) x
38939          * coordinate of the point, o y: (number) y coordinate of the point, o m: {
38940          * o x: (number) x coordinate of the left anchor, o y: (number) y coordinate
38941          * of the left anchor o }, o n: { o x: (number) x coordinate of the right
38942          * anchor, o y: (number) y coordinate of the right anchor o }, o start: { o
38943          * x: (number) x coordinate of the start of the curve, o y: (number) y
38944          * coordinate of the start of the curve o }, o end: { o x: (number) x
38945          * coordinate of the end of the curve, o y: (number) y coordinate of the end
38946          * of the curve o }, o alpha: (number) angle of the curve derivative at the
38947          * point o } \
38948          */
38949         Snap.path.findDotsAtSegment = findDotsAtSegment;
38950         /*
38951          * \ Snap.path.bezierBBox [ method ] * Utility method * Returns the bounding
38952          * box of a given cubic beziér curve - p1x (number) x of the first point
38953          * of the curve - p1y (number) y of the first point of the curve - c1x
38954          * (number) x of the first anchor of the curve - c1y (number) y of the first
38955          * anchor of the curve - c2x (number) x of the second anchor of the curve -
38956          * c2y (number) y of the second anchor of the curve - p2x (number) x of the
38957          * second point of the curve - p2y (number) y of the second point of the
38958          * curve or - bez (array) array of six points for beziér curve = (object)
38959          * bounding box o { o x: (number) x coordinate of the left top point of the
38960          * box, o y: (number) y coordinate of the left top point of the box, o x2:
38961          * (number) x coordinate of the right bottom point of the box, o y2:
38962          * (number) y coordinate of the right bottom point of the box, o width:
38963          * (number) width of the box, o height: (number) height of the box o } \
38964          */
38965         Snap.path.bezierBBox = bezierBBox;
38966         /*
38967          * \ Snap.path.isPointInsideBBox [ method ] * Utility method * Returns
38968          * `true` if given point is inside bounding box - bbox (string) bounding box -
38969          * x (string) x coordinate of the point - y (string) y coordinate of the
38970          * point = (boolean) `true` if point is inside \
38971          */
38972         Snap.path.isPointInsideBBox = isPointInsideBBox;
38973         /*
38974          * \ Snap.path.isBBoxIntersect [ method ] * Utility method * Returns `true`
38975          * if two bounding boxes intersect - bbox1 (string) first bounding box -
38976          * bbox2 (string) second bounding box = (boolean) `true` if bounding boxes
38977          * intersect \
38978          */
38979         Snap.path.isBBoxIntersect = isBBoxIntersect;
38980         /*
38981          * \ Snap.path.intersection [ method ] * Utility method * Finds
38982          * intersections of two paths - path1 (string) path string - path2 (string)
38983          * path string = (array) dots of intersection o [ o { o x: (number) x
38984          * coordinate of the point, o y: (number) y coordinate of the point, o t1:
38985          * (number) t value for segment of path1, o t2: (number) t value for segment
38986          * of path2, o segment1: (number) order number for segment of path1, o
38987          * segment2: (number) order number for segment of path2, o bez1: (array)
38988          * eight coordinates representing beziér curve for the segment of path1,
38989          * o bez2: (array) eight coordinates representing beziér curve for the
38990          * segment of path2 o } o ] \
38991          */
38992         Snap.path.intersection = pathIntersection;
38993         Snap.path.intersectionNumber = pathIntersectionNumber;
38994         /*
38995          * \ Snap.path.isPointInside [ method ] * Utility method * Returns `true` if
38996          * given point is inside a given closed path.
38997          *
38998          * Note: fill mode doesn’t affect the result of this method. - path
38999          * (string) path string - x (number) x of the point - y (number) y of the
39000          * point = (boolean) `true` if point is inside the path \
39001          */
39002         Snap.path.isPointInside = isPointInsidePath;
39003         /*
39004          * \ Snap.path.getBBox [ method ] * Utility method * Returns the bounding
39005          * box of a given path - path (string) path string = (object) bounding box o {
39006          * o x: (number) x coordinate of the left top point of the box, o y:
39007          * (number) y coordinate of the left top point of the box, o x2: (number) x
39008          * coordinate of the right bottom point of the box, o y2: (number) y
39009          * coordinate of the right bottom point of the box, o width: (number) width
39010          * of the box, o height: (number) height of the box o } \
39011          */
39012         Snap.path.getBBox = pathBBox;
39013         Snap.path.get = getPath;
39014         /*
39015          * \ Snap.path.toRelative [ method ] * Utility method * Converts path
39016          * coordinates into relative values - path (string) path string = (array)
39017          * path string \
39018          */
39019         Snap.path.toRelative = pathToRelative;
39020         /*
39021          * \ Snap.path.toAbsolute [ method ] * Utility method * Converts path
39022          * coordinates into absolute values - path (string) path string = (array)
39023          * path string \
39024          */
39025         Snap.path.toAbsolute = pathToAbsolute;
39026         /*
39027          * \ Snap.path.toCubic [ method ] * Utility method * Converts path to a new
39028          * path where all segments are cubic beziér curves - pathString
39029          * (string|array) path string or array of segments = (array) array of
39030          * segments \
39031          */
39032         Snap.path.toCubic = path2curve;
39033         /*
39034          * \ Snap.path.map [ method ] * Transform the path string with the given
39035          * matrix - path (string) path string - matrix (object) see @Matrix =
39036          * (string) transformed path string \
39037          */
39038         Snap.path.map = mapPath;
39039         Snap.path.toString = toString;
39040         Snap.path.clone = pathClone;
39041       });
39042       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
39043       //
39044       // Licensed under the Apache License, Version 2.0 (the "License");
39045       // you may not use this file except in compliance with the License.
39046       // You may obtain a copy of the License at
39047       //
39048       // http://www.apache.org/licenses/LICENSE-2.0
39049       //
39050       // Unless required by applicable law or agreed to in writing, software
39051       // distributed under the License is distributed on an "AS IS" BASIS,
39052       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39053       // See the License for the specific language governing permissions and
39054       // limitations under the License.
39055       Snap.plugin(function(Snap, Element, Paper, glob) {
39056         var elproto = Element.prototype,
39057           has = "hasOwnProperty",
39058           supportsTouch = "createTouch" in glob.doc,
39059           events = [
39060             "click", "dblclick", "mousedown", "mousemove", "mouseout",
39061             "mouseover", "mouseup", "touchstart", "touchmove", "touchend",
39062             "touchcancel", "keyup"
39063           ],
39064           touchMap = {
39065             mousedown: "touchstart",
39066             mousemove: "touchmove",
39067             mouseup: "touchend"
39068           },
39069           getScroll = function(xy, el) {
39070             var name = xy == "y" ? "scrollTop" : "scrollLeft",
39071               doc = el && el.node ? el.node.ownerDocument : glob.doc;
39072             return doc[name in doc.documentElement ? "documentElement" : "body"][name];
39073           },
39074           preventDefault = function() {
39075             this.returnValue = false;
39076           },
39077           preventTouch = function() {
39078             return this.originalEvent.preventDefault();
39079           },
39080           stopPropagation = function() {
39081             this.cancelBubble = true;
39082           },
39083           stopTouch = function() {
39084             return this.originalEvent.stopPropagation();
39085           },
39086           addEvent = (function() {
39087             if (glob.doc.addEventListener) {
39088               return function(obj, type, fn, element) {
39089                 var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
39090                   f = function(e) {
39091                     var scrollY = getScroll("y", element),
39092                       scrollX = getScroll("x", element);
39093                     if (supportsTouch && touchMap[has](type)) {
39094                       for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
39095                         if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {
39096                           var olde = e;
39097                           e = e.targetTouches[i];
39098                           e.originalEvent = olde;
39099                           e.preventDefault = preventTouch;
39100                           e.stopPropagation = stopTouch;
39101                           break;
39102                         }
39103                       }
39104                     }
39105                     var x = e.clientX + scrollX,
39106                       y = e.clientY + scrollY;
39107                     return fn.call(element, e, x, y);
39108                   };
39109
39110                 if (type !== realName) {
39111                   obj.addEventListener(type, f, false);
39112                 }
39113
39114                 obj.addEventListener(realName, f, false);
39115
39116                 return function() {
39117                   if (type !== realName) {
39118                     obj.removeEventListener(type, f, false);
39119                   }
39120
39121                   obj.removeEventListener(realName, f, false);
39122                   return true;
39123                 };
39124               };
39125             } else if (glob.doc.attachEvent) {
39126               return function(obj, type, fn, element) {
39127                 var f = function(e) {
39128                   e = e || element.node.ownerDocument.window.event;
39129                   var scrollY = getScroll("y", element),
39130                     scrollX = getScroll("x", element),
39131                     x = e.clientX + scrollX,
39132                     y = e.clientY + scrollY;
39133                   e.preventDefault = e.preventDefault || preventDefault;
39134                   e.stopPropagation = e.stopPropagation || stopPropagation;
39135                   return fn.call(element, e, x, y);
39136                 };
39137                 obj.attachEvent("on" + type, f);
39138                 var detacher = function() {
39139                   obj.detachEvent("on" + type, f);
39140                   return true;
39141                 };
39142                 return detacher;
39143               };
39144             }
39145           })(),
39146           drag = [],
39147           dragMove = function(e) {
39148             var x = e.clientX,
39149               y = e.clientY,
39150               scrollY = getScroll("y"),
39151               scrollX = getScroll("x"),
39152               dragi,
39153               j = drag.length;
39154             while (j--) {
39155               dragi = drag[j];
39156               if (supportsTouch) {
39157                 var i = e.touches && e.touches.length,
39158                   touch;
39159                 while (i--) {
39160                   touch = e.touches[i];
39161                   if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
39162                     x = touch.clientX;
39163                     y = touch.clientY;
39164                     (e.originalEvent ? e.originalEvent : e).preventDefault();
39165                     break;
39166                   }
39167                 }
39168               } else {
39169                 e.preventDefault();
39170               }
39171               var node = dragi.el.node,
39172                 o,
39173                 next = node.nextSibling,
39174                 parent = node.parentNode,
39175                 display = node.style.display;
39176               // glob.win.opera && parent.removeChild(node);
39177               // node.style.display = "none";
39178               // o = dragi.el.paper.getElementByPoint(x, y);
39179               // node.style.display = display;
39180               // glob.win.opera && (next ? parent.insertBefore(node, next) :
39181               // parent.appendChild(node));
39182               // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
39183               x += scrollX;
39184               y += scrollY;
39185               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);
39186             }
39187           },
39188           dragUp = function(e) {
39189             Snap.unmousemove(dragMove).unmouseup(dragUp);
39190             var i = drag.length,
39191               dragi;
39192             while (i--) {
39193               dragi = drag[i];
39194               dragi.el._drag = {};
39195               eve("snap.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
39196             }
39197             drag = [];
39198           };
39199         /*
39200          * \ Element.click [ method ] * Adds a click event handler to the element -
39201          * handler (function) handler for the event = (object) @Element \
39202          */
39203         /*
39204          * \ Element.unclick [ method ] * Removes a click event handler from the
39205          * element - handler (function) handler for the event = (object) @Element \
39206          */
39207
39208         /*
39209          * \ Element.dblclick [ method ] * Adds a double click event handler to the
39210          * element - handler (function) handler for the event = (object) @Element \
39211          */
39212         /*
39213          * \ Element.undblclick [ method ] * Removes a double click event handler
39214          * from the element - handler (function) handler for the event = (object)
39215          * @Element \
39216          */
39217
39218         /*
39219          * \ Element.mousedown [ method ] * Adds a mousedown event handler to the
39220          * element - handler (function) handler for the event = (object) @Element \
39221          */
39222         /*
39223          * \ Element.unmousedown [ method ] * Removes a mousedown event handler from
39224          * the element - handler (function) handler for the event = (object)
39225          * @Element \
39226          */
39227
39228         /*
39229          * \ Element.mousemove [ method ] * Adds a mousemove event handler to the
39230          * element - handler (function) handler for the event = (object) @Element \
39231          */
39232         /*
39233          * \ Element.unmousemove [ method ] * Removes a mousemove event handler from
39234          * the element - handler (function) handler for the event = (object)
39235          * @Element \
39236          */
39237
39238         /*
39239          * \ Element.mouseout [ method ] * Adds a mouseout event handler to the
39240          * element - handler (function) handler for the event = (object) @Element \
39241          */
39242         /*
39243          * \ Element.unmouseout [ method ] * Removes a mouseout event handler from
39244          * the element - handler (function) handler for the event = (object)
39245          * @Element \
39246          */
39247
39248         /*
39249          * \ Element.mouseover [ method ] * Adds a mouseover event handler to the
39250          * element - handler (function) handler for the event = (object) @Element \
39251          */
39252         /*
39253          * \ Element.unmouseover [ method ] * Removes a mouseover event handler from
39254          * the element - handler (function) handler for the event = (object)
39255          * @Element \
39256          */
39257
39258         /*
39259          * \ Element.mouseup [ method ] * Adds a mouseup event handler to the
39260          * element - handler (function) handler for the event = (object) @Element \
39261          */
39262         /*
39263          * \ Element.unmouseup [ method ] * Removes a mouseup event handler from the
39264          * element - handler (function) handler for the event = (object) @Element \
39265          */
39266
39267         /*
39268          * \ Element.touchstart [ method ] * Adds a touchstart event handler to the
39269          * element - handler (function) handler for the event = (object) @Element \
39270          */
39271         /*
39272          * \ Element.untouchstart [ method ] * Removes a touchstart event handler
39273          * from the element - handler (function) handler for the event = (object)
39274          * @Element \
39275          */
39276
39277         /*
39278          * \ Element.touchmove [ method ] * Adds a touchmove event handler to the
39279          * element - handler (function) handler for the event = (object) @Element \
39280          */
39281         /*
39282          * \ Element.untouchmove [ method ] * Removes a touchmove event handler from
39283          * the element - handler (function) handler for the event = (object)
39284          * @Element \
39285          */
39286
39287         /*
39288          * \ Element.touchend [ method ] * Adds a touchend event handler to the
39289          * element - handler (function) handler for the event = (object) @Element \
39290          */
39291         /*
39292          * \ Element.untouchend [ method ] * Removes a touchend event handler from
39293          * the element - handler (function) handler for the event = (object)
39294          * @Element \
39295          */
39296
39297         /*
39298          * \ Element.touchcancel [ method ] * Adds a touchcancel event handler to
39299          * the element - handler (function) handler for the event = (object)
39300          * @Element \
39301          */
39302         /*
39303          * \ Element.untouchcancel [ method ] * Removes a touchcancel event handler
39304          * from the element - handler (function) handler for the event = (object)
39305          * @Element \
39306          */
39307         for (var i = events.length; i--;) {
39308           (function(eventName) {
39309             Snap[eventName] = elproto[eventName] = function(fn, scope) {
39310               if (Snap.is(fn, "function")) {
39311                 this.events = this.events || [];
39312                 this.events.push({
39313                   name: eventName,
39314                   f: fn,
39315                   unbind: addEvent(this.node || document, eventName, fn, scope || this)
39316                 });
39317               }
39318               return this;
39319             };
39320             Snap["un" + eventName] =
39321               elproto["un" + eventName] = function(fn) {
39322                 var events = this.events || [],
39323                   l = events.length;
39324                 while (l--)
39325                   if (events[l].name == eventName &&
39326                     (events[l].f == fn || !fn)) {
39327                     events[l].unbind();
39328                     events.splice(l, 1);
39329                     !events.length && delete this.events;
39330                     return this;
39331                   }
39332                 return this;
39333               };
39334           })(events[i]);
39335         }
39336         /*
39337          * \ Element.hover [ method ] * Adds hover event handlers to the element -
39338          * f_in (function) handler for hover in - f_out (function) handler for hover
39339          * out - icontext (object) #optional context for hover in handler - ocontext
39340          * (object) #optional context for hover out handler = (object) @Element \
39341          */
39342         elproto.hover = function(f_in, f_out, scope_in, scope_out) {
39343           return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
39344         };
39345         /*
39346          * \ Element.unhover [ method ] * Removes hover event handlers from the
39347          * element - f_in (function) handler for hover in - f_out (function) handler
39348          * for hover out = (object) @Element \
39349          */
39350         elproto.unhover = function(f_in, f_out) {
39351           return this.unmouseover(f_in).unmouseout(f_out);
39352         };
39353         var draggable = [];
39354         // SIERRA unclear what _context_ refers to for starting, ending, moving the
39355         // drag gesture.
39356         // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y
39357         // values offset from?
39358         // SIERRA Element.drag(): much of this member's doc appears to be duplicated
39359         // for some reason.
39360         // SIERRA Unclear about this sentence: _Additionally following drag events
39361         // will be triggered: drag.start.<id> on start, drag.end.<id> on end and
39362         // drag.move.<id> on every move._ Is there a global _drag_ object to which
39363         // you can assign handlers keyed by an element's ID?
39364         /*
39365          * \ Element.drag [ method ] * Adds event handlers for an element's drag
39366          * gesture * - onmove (function) handler for moving - onstart (function)
39367          * handler for drag start - onend (function) handler for drag end - mcontext
39368          * (object) #optional context for moving handler - scontext (object)
39369          * #optional context for drag start handler - econtext (object) #optional
39370          * context for drag end handler Additionaly following `drag` events are
39371          * triggered: `drag.start.<id>` on start, `drag.end.<id>` on end and
39372          * `drag.move.<id>` on every move. When element is dragged over another
39373          * element `drag.over.<id>` fires as well.
39374          *
39375          * Start event and start handler are called in specified context or in
39376          * context of the element with following parameters: o x (number) x position
39377          * of the mouse o y (number) y position of the mouse o event (object) DOM
39378          * event object Move event and move handler are called in specified context
39379          * or in context of the element with following parameters: o dx (number)
39380          * shift by x from the start point o dy (number) shift by y from the start
39381          * point o x (number) x position of the mouse o y (number) y position of the
39382          * mouse o event (object) DOM event object End event and end handler are
39383          * called in specified context or in context of the element with following
39384          * parameters: o event (object) DOM event object = (object) @Element \
39385          */
39386         elproto.drag = function(onmove, onstart, onend, move_scope, start_scope, end_scope) {
39387           if (!arguments.length) {
39388             var origTransform;
39389             return this.drag(function(dx, dy) {
39390               this.attr({
39391                 transform: origTransform + (origTransform ? "T" : "t") + [dx, dy]
39392               });
39393             }, function() {
39394               origTransform = this.transform().local;
39395             });
39396           }
39397
39398           function start(e, x, y) {
39399             (e.originalEvent || e).preventDefault();
39400             this._drag.x = x;
39401             this._drag.y = y;
39402             this._drag.id = e.identifier;
39403             !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);
39404             drag.push({
39405               el: this,
39406               move_scope: move_scope,
39407               start_scope: start_scope,
39408               end_scope: end_scope
39409             });
39410             onstart && eve.on("snap.drag.start." + this.id, onstart);
39411             onmove && eve.on("snap.drag.move." + this.id, onmove);
39412             onend && eve.on("snap.drag.end." + this.id, onend);
39413             eve("snap.drag.start." + this.id, start_scope || move_scope || this, x, y, e);
39414           }
39415           this._drag = {};
39416           draggable.push({
39417             el: this,
39418             start: start
39419           });
39420           this.mousedown(start);
39421           return this;
39422         };
39423         /*
39424          * Element.onDragOver [ method ] * Shortcut to assign event handler for
39425          * `drag.over.<id>` event, where `id` is the element's `id` (see
39426          * @Element.id) - f (function) handler for event, first argument would be
39427          * the element you are dragging over \
39428          */
39429         // elproto.onDragOver = function (f) {
39430         // f ? eve.on("snap.drag.over." + this.id, f) : eve.unbind("snap.drag.over."
39431         // + this.id);
39432         // };
39433         /*
39434          * \ Element.undrag [ method ] * Removes all drag event handlers from the
39435          * given element \
39436          */
39437         elproto.undrag = function() {
39438           var i = draggable.length;
39439           while (i--)
39440             if (draggable[i].el == this) {
39441               this.unmousedown(draggable[i].start);
39442               draggable.splice(i, 1);
39443               eve.unbind("snap.drag.*." + this.id);
39444             }!draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);
39445           return this;
39446         };
39447       });
39448       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
39449       //
39450       // Licensed under the Apache License, Version 2.0 (the "License");
39451       // you may not use this file except in compliance with the License.
39452       // You may obtain a copy of the License at
39453       //
39454       // http://www.apache.org/licenses/LICENSE-2.0
39455       //
39456       // Unless required by applicable law or agreed to in writing, software
39457       // distributed under the License is distributed on an "AS IS" BASIS,
39458       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39459       // See the License for the specific language governing permissions and
39460       // limitations under the License.
39461       Snap.plugin(function(Snap, Element, Paper, glob) {
39462         var elproto = Element.prototype,
39463           pproto = Paper.prototype,
39464           rgurl = /^\s*url\((.+)\)/,
39465           Str = String,
39466           $ = Snap._.$;
39467         Snap.filter = {};
39468         /*
39469          * \ Paper.filter [ method ] * Creates a `<filter>` element * - filstr
39470          * (string) SVG fragment of filter provided as a string = (object) @Element
39471          * Note: It is recommended to use filters embedded into the page inside an
39472          * empty SVG element. > Usage | var f = paper.filter('<feGaussianBlur
39473          * stdDeviation="2"/>'), | c = paper.circle(10, 10, 10).attr({ | filter: f |
39474          * }); \
39475          */
39476         pproto.filter = function(filstr) {
39477           var paper = this;
39478           if (paper.type != "svg") {
39479             paper = paper.paper;
39480           }
39481           var f = Snap.parse(Str(filstr)),
39482             id = Snap._.id(),
39483             width = paper.node.offsetWidth,
39484             height = paper.node.offsetHeight,
39485             filter = $("filter");
39486           $(filter, {
39487             id: id,
39488             filterUnits: "userSpaceOnUse"
39489           });
39490           filter.appendChild(f.node);
39491           paper.defs.appendChild(filter);
39492           return new Element(filter);
39493         };
39494
39495         eve.on("snap.util.getattr.filter", function() {
39496           eve.stop();
39497           var p = $(this.node, "filter");
39498           if (p) {
39499             var match = Str(p).match(rgurl);
39500             return match && Snap.select(match[1]);
39501           }
39502         });
39503         eve.on("snap.util.attr.filter", function(value) {
39504           if (value instanceof Element && value.type == "filter") {
39505             eve.stop();
39506             var id = value.node.id;
39507             if (!id) {
39508               $(value.node, {
39509                 id: value.id
39510               });
39511               id = value.id;
39512             }
39513             $(this.node, {
39514               filter: Snap.url(id)
39515             });
39516           }
39517           if (!value || value == "none") {
39518             eve.stop();
39519             this.node.removeAttribute("filter");
39520           }
39521         });
39522         /*
39523          * \ Snap.filter.blur [ method ] * Returns an SVG markup string for the blur
39524          * filter * - x (number) amount of horizontal blur, in pixels - y (number)
39525          * #optional amount of vertical blur, in pixels = (string) filter
39526          * representation > Usage | var f = paper.filter(Snap.filter.blur(5, 10)), |
39527          * c = paper.circle(10, 10, 10).attr({ | filter: f | }); \
39528          */
39529         Snap.filter.blur = function(x, y) {
39530           if (x == null) {
39531             x = 2;
39532           }
39533           var def = y == null ? x : [x, y];
39534           return Snap.format('\<feGaussianBlur stdDeviation="{def}"/>', {
39535             def: def
39536           });
39537         };
39538         Snap.filter.blur.toString = function() {
39539           return this();
39540         };
39541         /*
39542          * \ Snap.filter.shadow [ method ] * Returns an SVG markup string for the
39543          * shadow filter * - dx (number) #optional horizontal shift of the shadow,
39544          * in pixels - dy (number) #optional vertical shift of the shadow, in pixels -
39545          * blur (number) #optional amount of blur - color (string) #optional color
39546          * of the shadow - opacity (number) #optional `0..1` opacity of the shadow
39547          * or - dx (number) #optional horizontal shift of the shadow, in pixels - dy
39548          * (number) #optional vertical shift of the shadow, in pixels - color
39549          * (string) #optional color of the shadow - opacity (number) #optional
39550          * `0..1` opacity of the shadow which makes blur default to `4`. Or - dx
39551          * (number) #optional horizontal shift of the shadow, in pixels - dy
39552          * (number) #optional vertical shift of the shadow, in pixels - opacity
39553          * (number) #optional `0..1` opacity of the shadow = (string) filter
39554          * representation > Usage | var f = paper.filter(Snap.filter.shadow(0, 2,
39555          * 3)), | c = paper.circle(10, 10, 10).attr({ | filter: f | }); \
39556          */
39557         Snap.filter.shadow = function(dx, dy, blur, color, opacity) {
39558           if (typeof blur == "string") {
39559             color = blur;
39560             opacity = color;
39561             blur = 4;
39562           }
39563           if (typeof color != "string") {
39564             opacity = color;
39565             color = "#000";
39566           }
39567           color = color || "#000";
39568           if (blur == null) {
39569             blur = 4;
39570           }
39571           if (opacity == null) {
39572             opacity = 1;
39573           }
39574           if (dx == null) {
39575             dx = 0;
39576             dy = 2;
39577           }
39578           if (dy == null) {
39579             dy = dx;
39580           }
39581           color = Snap.color(color);
39582           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>', {
39583             color: color,
39584             dx: dx,
39585             dy: dy,
39586             blur: blur,
39587             opacity: opacity
39588           });
39589         };
39590         Snap.filter.shadow.toString = function() {
39591           return this();
39592         };
39593         /*
39594          * \ Snap.filter.grayscale [ method ] * Returns an SVG markup string for the
39595          * grayscale filter * - amount (number) amount of filter (`0..1`) = (string)
39596          * filter representation \
39597          */
39598         Snap.filter.grayscale = function(amount) {
39599           if (amount == null) {
39600             amount = 1;
39601           }
39602           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"/>', {
39603             a: 0.2126 + 0.7874 * (1 - amount),
39604             b: 0.7152 - 0.7152 * (1 - amount),
39605             c: 0.0722 - 0.0722 * (1 - amount),
39606             d: 0.2126 - 0.2126 * (1 - amount),
39607             e: 0.7152 + 0.2848 * (1 - amount),
39608             f: 0.0722 - 0.0722 * (1 - amount),
39609             g: 0.2126 - 0.2126 * (1 - amount),
39610             h: 0.0722 + 0.9278 * (1 - amount)
39611           });
39612         };
39613         Snap.filter.grayscale.toString = function() {
39614           return this();
39615         };
39616         /*
39617          * \ Snap.filter.sepia [ method ] * Returns an SVG markup string for the
39618          * sepia filter * - amount (number) amount of filter (`0..1`) = (string)
39619          * filter representation \
39620          */
39621         Snap.filter.sepia = function(amount) {
39622           if (amount == null) {
39623             amount = 1;
39624           }
39625           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"/>', {
39626             a: 0.393 + 0.607 * (1 - amount),
39627             b: 0.769 - 0.769 * (1 - amount),
39628             c: 0.189 - 0.189 * (1 - amount),
39629             d: 0.349 - 0.349 * (1 - amount),
39630             e: 0.686 + 0.314 * (1 - amount),
39631             f: 0.168 - 0.168 * (1 - amount),
39632             g: 0.272 - 0.272 * (1 - amount),
39633             h: 0.534 - 0.534 * (1 - amount),
39634             i: 0.131 + 0.869 * (1 - amount)
39635           });
39636         };
39637         Snap.filter.sepia.toString = function() {
39638           return this();
39639         };
39640         /*
39641          * \ Snap.filter.saturate [ method ] * Returns an SVG markup string for the
39642          * saturate filter * - amount (number) amount of filter (`0..1`) = (string)
39643          * filter representation \
39644          */
39645         Snap.filter.saturate = function(amount) {
39646           if (amount == null) {
39647             amount = 1;
39648           }
39649           return Snap.format('<feColorMatrix type="saturate" values="{amount}"/>', {
39650             amount: 1 - amount
39651           });
39652         };
39653         Snap.filter.saturate.toString = function() {
39654           return this();
39655         };
39656         /*
39657          * \ Snap.filter.hueRotate [ method ] * Returns an SVG markup string for the
39658          * hue-rotate filter * - angle (number) angle of rotation = (string) filter
39659          * representation \
39660          */
39661         Snap.filter.hueRotate = function(angle) {
39662           angle = angle || 0;
39663           return Snap.format('<feColorMatrix type="hueRotate" values="{angle}"/>', {
39664             angle: angle
39665           });
39666         };
39667         Snap.filter.hueRotate.toString = function() {
39668           return this();
39669         };
39670         /*
39671          * \ Snap.filter.invert [ method ] * Returns an SVG markup string for the
39672          * invert filter * - amount (number) amount of filter (`0..1`) = (string)
39673          * filter representation \
39674          */
39675         Snap.filter.invert = function(amount) {
39676           if (amount == null) {
39677             amount = 1;
39678           }
39679           return Snap.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>', {
39680             amount: amount,
39681             amount2: 1 - amount
39682           });
39683         };
39684         Snap.filter.invert.toString = function() {
39685           return this();
39686         };
39687         /*
39688          * \ Snap.filter.brightness [ method ] * Returns an SVG markup string for
39689          * the brightness filter * - amount (number) amount of filter (`0..1`) =
39690          * (string) filter representation \
39691          */
39692         Snap.filter.brightness = function(amount) {
39693           if (amount == null) {
39694             amount = 1;
39695           }
39696           return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>', {
39697             amount: amount
39698           });
39699         };
39700         Snap.filter.brightness.toString = function() {
39701           return this();
39702         };
39703         /*
39704          * \ Snap.filter.contrast [ method ] * Returns an SVG markup string for the
39705          * contrast filter * - amount (number) amount of filter (`0..1`) = (string)
39706          * filter representation \
39707          */
39708         Snap.filter.contrast = function(amount) {
39709           if (amount == null) {
39710             amount = 1;
39711           }
39712           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>', {
39713             amount: amount,
39714             amount2: .5 - amount / 2
39715           });
39716         };
39717         Snap.filter.contrast.toString = function() {
39718           return this();
39719         };
39720       });
39721
39722       return Snap;
39723     }));
39724   }, {
39725     "eve": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\eve\\eve.js"
39726   }],
39727   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js": [function(require, module, exports) {
39728     'use strict';
39729
39730     var snapsvg = module.exports = require('snapsvg');
39731
39732     snapsvg.plugin(function(Snap, Element) {
39733
39734       /*
39735        * \ Element.children [ method ] * Returns array of all the children of the
39736        * element. = (array) array of Elements \
39737        */
39738       Element.prototype.children = function() {
39739         var out = [],
39740           ch = this.node.childNodes;
39741         for (var i = 0, ii = ch.length; i < ii; i++) {
39742           out[i] = new Snap(ch[i]);
39743         }
39744         return out;
39745       };
39746     });
39747
39748
39749     /**
39750      * @class ClassPlugin
39751      *
39752      * Extends snapsvg with methods to add and remove classes
39753      */
39754     snapsvg.plugin(function(Snap, Element, Paper, global) {
39755
39756       function split(str) {
39757         return str.split(/\s+/);
39758       }
39759
39760       function join(array) {
39761         return array.join(' ');
39762       }
39763
39764       function getClasses(e) {
39765         return split(e.attr('class') || '');
39766       }
39767
39768       function setClasses(e, classes) {
39769         e.attr('class', join(classes));
39770       }
39771
39772       /**
39773        * @method snapsvg.Element#addClass
39774        *
39775        * @example
39776        *
39777        * e.attr('class', 'selector');
39778        *
39779        * e.addClass('foo bar'); // adds classes foo and bar e.attr('class'); // ->
39780        * 'selector foo bar'
39781        *
39782        * e.addClass('fooBar'); e.attr('class'); // -> 'selector foo bar fooBar'
39783        *
39784        * @param {String}
39785        *            cls classes to be added to the element
39786        *
39787        * @return {snapsvg.Element} the element (this)
39788        */
39789       Element.prototype.addClass = function(cls) {
39790         var current = getClasses(this),
39791           add = split(cls),
39792           i, e;
39793
39794         for (i = 0, e; !!(e = add[i]); i++) {
39795           if (current.indexOf(e) === -1) {
39796             current.push(e);
39797           }
39798         }
39799
39800         setClasses(this, current);
39801
39802         return this;
39803       };
39804
39805       /**
39806        * @method snapsvg.Element#hasClass
39807        *
39808        * @param {String}
39809        *            cls the class to query for
39810        * @return {Boolean} returns true if the element has the given class
39811        */
39812       Element.prototype.hasClass = function(cls) {
39813         if (!cls) {
39814           throw new Error('[snapsvg] syntax: hasClass(clsStr)');
39815         }
39816
39817         return getClasses(this).indexOf(cls) !== -1;
39818       };
39819
39820       /**
39821        * @method snapsvg.Element#removeClass
39822        *
39823        * @example
39824        *
39825        * e.attr('class', 'foo bar');
39826        *
39827        * e.removeClass('foo'); e.attr('class'); // -> 'bar'
39828        *
39829        * e.removeClass('foo bar'); // removes classes foo and bar e.attr('class'); // -> ''
39830        *
39831        * @param {String}
39832        *            cls classes to be removed from element
39833        *
39834        * @return {snapsvg.Element} the element (this)
39835        */
39836       Element.prototype.removeClass = function(cls) {
39837         var current = getClasses(this),
39838           remove = split(cls),
39839           i, e, idx;
39840
39841         for (i = 0, e; !!(e = remove[i]); i++) {
39842           idx = current.indexOf(e);
39843
39844           if (idx !== -1) {
39845             // remove element from array
39846             current.splice(idx, 1);
39847           }
39848         }
39849
39850         setClasses(this, current);
39851
39852         return this;
39853       };
39854
39855     });
39856
39857     /**
39858      * @class TranslatePlugin
39859      *
39860      * Extends snapsvg with methods to translate elements
39861      */
39862     snapsvg.plugin(function(Snap, Element, Paper, global) {
39863
39864       /*
39865        * @method snapsvg.Element#translate
39866        *
39867        * @example
39868        *
39869        * e.translate(10, 20);
39870        *  // sets transform matrix to translate(10, 20)
39871        *
39872        * @param {Number} x translation @param {Number} y translation
39873        *
39874        * @return {snapsvg.Element} the element (this)
39875        */
39876       Element.prototype.translate = function(x, y) {
39877         var matrix = new Snap.Matrix();
39878         matrix.translate(x, y);
39879         return this.transform(matrix);
39880       };
39881     });
39882
39883
39884     /**
39885      * @class CreatePlugin
39886      *
39887      * Create an svg element without attaching it to the dom
39888      */
39889     snapsvg.plugin(function(Snap) {
39890
39891       Snap.create = function(name, attrs) {
39892         return Snap._.wrap(Snap._.$(name, attrs));
39893       };
39894     });
39895
39896
39897     /**
39898      * @class CreatSnapAtPlugin
39899      *
39900      * Extends snap.svg with a method to create a SVG element at a specific position
39901      * in the DOM.
39902      */
39903     snapsvg.plugin(function(Snap, Element, Paper, global) {
39904
39905       /*
39906        * @method snapsvg.createSnapAt
39907        *
39908        * @example
39909        *
39910        * snapsvg.createSnapAt(parentNode, 200, 200);
39911        *
39912        * @param {Number} width of svg @param {Number} height of svg @param
39913        * {Object} parentNode svg Element will be child of this
39914        *
39915        * @return {snapsvg.Element} the newly created wrapped SVG element instance
39916        */
39917       Snap.createSnapAt = function(width, height, parentNode) {
39918
39919         var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
39920         svg.setAttribute('width', width);
39921         svg.setAttribute('height', height);
39922         if (!parentNode) {
39923           parentNode = document.body;
39924         }
39925         parentNode.appendChild(svg);
39926
39927         return new Snap(svg);
39928       };
39929     });
39930   }, {
39931     "snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\snapsvg\\dist\\snap.svg.js"
39932   }],
39933   "\\bpmn-js-examples-master\\modeler\\node_modules\\jquery\\dist\\jquery.js": [function(require, module, exports) {
39934     /*
39935      * ! jQuery JavaScript Library v2.1.4 http://jquery.com/
39936      *
39937      * Includes Sizzle.js http://sizzlejs.com/
39938      *
39939      * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors Released
39940      * under the MIT license http://jquery.org/license
39941      *
39942      * Date: 2015-04-28T16:01Z
39943      */
39944
39945     (function(global, factory) {
39946
39947       if (typeof module === "object" && typeof module.exports === "object") {
39948         // For CommonJS and CommonJS-like environments where a proper `window`
39949         // is present, execute the factory and get jQuery.
39950         // For environments that do not have a `window` with a `document`
39951         // (such as Node.js), expose a factory as module.exports.
39952         // This accentuates the need for the creation of a real `window`.
39953         // e.g. var jQuery = require("jquery")(window);
39954         // See ticket #14549 for more info.
39955         module.exports = global.document ?
39956           factory(global, true) :
39957           function(w) {
39958             if (!w.document) {
39959               throw new Error("jQuery requires a window with a document");
39960             }
39961             return factory(w);
39962           };
39963       } else {
39964         factory(global);
39965       }
39966
39967       // Pass this if window is not defined yet
39968     }(typeof window !== "undefined" ? window : this, function(window, noGlobal) {
39969
39970       // Support: Firefox 18+
39971       // Can't be in strict mode, several libs including ASP.NET trace
39972       // the stack via arguments.caller.callee and Firefox dies if
39973       // you try to trace through "use strict" call chains. (#13335)
39974       //
39975
39976       var arr = [];
39977
39978       var slice = arr.slice;
39979
39980       var concat = arr.concat;
39981
39982       var push = arr.push;
39983
39984       var indexOf = arr.indexOf;
39985
39986       var class2type = {};
39987
39988       var toString = class2type.toString;
39989
39990       var hasOwn = class2type.hasOwnProperty;
39991
39992       var support = {};
39993
39994
39995
39996       var
39997         // Use the correct document accordingly with window argument (sandbox)
39998         document = window.document,
39999
40000         version = "2.1.4",
40001
40002         // Define a local copy of jQuery
40003         jQuery = function(selector, context) {
40004           // The jQuery object is actually just the init constructor 'enhanced'
40005           // Need init if jQuery is called (just allow error to be thrown if not
40006           // included)
40007           return new jQuery.fn.init(selector, context);
40008         },
40009
40010         // Support: Android<4.1
40011         // Make sure we trim BOM and NBSP
40012         rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
40013
40014         // Matches dashed string for camelizing
40015         rmsPrefix = /^-ms-/,
40016         rdashAlpha = /-([\da-z])/gi,
40017
40018         // Used by jQuery.camelCase as callback to replace()
40019         fcamelCase = function(all, letter) {
40020           return letter.toUpperCase();
40021         };
40022
40023       jQuery.fn = jQuery.prototype = {
40024         // The current version of jQuery being used
40025         jquery: version,
40026
40027         constructor: jQuery,
40028
40029         // Start with an empty selector
40030         selector: "",
40031
40032         // The default length of a jQuery object is 0
40033         length: 0,
40034
40035         toArray: function() {
40036           return slice.call(this);
40037         },
40038
40039         // Get the Nth element in the matched element set OR
40040         // Get the whole matched element set as a clean array
40041         get: function(num) {
40042           return num != null ?
40043
40044             // Return just the one element from the set
40045             (num < 0 ? this[num + this.length] : this[num]) :
40046
40047             // Return all the elements in a clean array
40048             slice.call(this);
40049         },
40050
40051         // Take an array of elements and push it onto the stack
40052         // (returning the new matched element set)
40053         pushStack: function(elems) {
40054
40055           // Build a new jQuery matched element set
40056           var ret = jQuery.merge(this.constructor(), elems);
40057
40058           // Add the old object onto the stack (as a reference)
40059           ret.prevObject = this;
40060           ret.context = this.context;
40061
40062           // Return the newly-formed element set
40063           return ret;
40064         },
40065
40066         // Execute a callback for every element in the matched set.
40067         // (You can seed the arguments with an array of args, but this is
40068         // only used internally.)
40069         each: function(callback, args) {
40070           return jQuery.each(this, callback, args);
40071         },
40072
40073         map: function(callback) {
40074           return this.pushStack(jQuery.map(this, function(elem, i) {
40075             return callback.call(elem, i, elem);
40076           }));
40077         },
40078
40079         slice: function() {
40080           return this.pushStack(slice.apply(this, arguments));
40081         },
40082
40083         first: function() {
40084           return this.eq(0);
40085         },
40086
40087         last: function() {
40088           return this.eq(-1);
40089         },
40090
40091         eq: function(i) {
40092           var len = this.length,
40093             j = +i + (i < 0 ? len : 0);
40094           return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
40095         },
40096
40097         end: function() {
40098           return this.prevObject || this.constructor(null);
40099         },
40100
40101         // For internal use only.
40102         // Behaves like an Array's method, not like a jQuery method.
40103         push: push,
40104         sort: arr.sort,
40105         splice: arr.splice
40106       };
40107
40108       jQuery.extend = jQuery.fn.extend = function() {
40109         var options, name, src, copy, copyIsArray, clone,
40110           target = arguments[0] || {},
40111           i = 1,
40112           length = arguments.length,
40113           deep = false;
40114
40115         // Handle a deep copy situation
40116         if (typeof target === "boolean") {
40117           deep = target;
40118
40119           // Skip the boolean and the target
40120           target = arguments[i] || {};
40121           i++;
40122         }
40123
40124         // Handle case when target is a string or something (possible in deep copy)
40125         if (typeof target !== "object" && !jQuery.isFunction(target)) {
40126           target = {};
40127         }
40128
40129         // Extend jQuery itself if only one argument is passed
40130         if (i === length) {
40131           target = this;
40132           i--;
40133         }
40134
40135         for (; i < length; i++) {
40136           // Only deal with non-null/undefined values
40137           if ((options = arguments[i]) != null) {
40138             // Extend the base object
40139             for (name in options) {
40140               src = target[name];
40141               copy = options[name];
40142
40143               // Prevent never-ending loop
40144               if (target === copy) {
40145                 continue;
40146               }
40147
40148               // Recurse if we're merging plain objects or arrays
40149               if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
40150                 if (copyIsArray) {
40151                   copyIsArray = false;
40152                   clone = src && jQuery.isArray(src) ? src : [];
40153
40154                 } else {
40155                   clone = src && jQuery.isPlainObject(src) ? src : {};
40156                 }
40157
40158                 // Never move original objects, clone them
40159                 target[name] = jQuery.extend(deep, clone, copy);
40160
40161                 // Don't bring in undefined values
40162               } else if (copy !== undefined) {
40163                 target[name] = copy;
40164               }
40165             }
40166           }
40167         }
40168
40169         // Return the modified object
40170         return target;
40171       };
40172
40173       jQuery.extend({
40174         // Unique for each copy of jQuery on the page
40175         expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
40176
40177         // Assume jQuery is ready without the ready module
40178         isReady: true,
40179
40180         error: function(msg) {
40181           throw new Error(msg);
40182         },
40183
40184         noop: function() {},
40185
40186         isFunction: function(obj) {
40187           return jQuery.type(obj) === "function";
40188         },
40189
40190         isArray: Array.isArray,
40191
40192         isWindow: function(obj) {
40193           return obj != null && obj === obj.window;
40194         },
40195
40196         isNumeric: function(obj) {
40197           // parseFloat NaNs numeric-cast false positives (null|true|false|"")
40198           // ...but misinterprets leading-number strings, particularly hex
40199           // literals ("0x...")
40200           // subtraction forces infinities to NaN
40201           // adding 1 corrects loss of precision from parseFloat (#15100)
40202           return !jQuery.isArray(obj) && (obj - parseFloat(obj) + 1) >= 0;
40203         },
40204
40205         isPlainObject: function(obj) {
40206           // Not plain objects:
40207           // - Any object or value whose internal [[Class]] property is not
40208           // "[object Object]"
40209           // - DOM nodes
40210           // - window
40211           if (jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) {
40212             return false;
40213           }
40214
40215           if (obj.constructor &&
40216             !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
40217             return false;
40218           }
40219
40220           // If the function hasn't returned already, we're confident that
40221           // |obj| is a plain object, created by {} or constructed with new Object
40222           return true;
40223         },
40224
40225         isEmptyObject: function(obj) {
40226           var name;
40227           for (name in obj) {
40228             return false;
40229           }
40230           return true;
40231         },
40232
40233         type: function(obj) {
40234           if (obj == null) {
40235             return obj + "";
40236           }
40237           // Support: Android<4.0, iOS<6 (functionish RegExp)
40238           return typeof obj === "object" || typeof obj === "function" ?
40239             class2type[toString.call(obj)] || "object" :
40240             typeof obj;
40241         },
40242
40243         // Evaluates a script in a global context
40244         globalEval: function(code) {
40245           var script,
40246             indirect = eval;
40247
40248           code = jQuery.trim(code);
40249
40250           if (code) {
40251             // If the code includes a valid, prologue position
40252             // strict mode pragma, execute code by injecting a
40253             // script tag into the document.
40254             if (code.indexOf("use strict") === 1) {
40255               script = document.createElement("script");
40256               script.text = code;
40257               document.head.appendChild(script).parentNode.removeChild(script);
40258             } else {
40259               // Otherwise, avoid the DOM node creation, insertion
40260               // and removal by using an indirect global eval
40261               indirect(code);
40262             }
40263           }
40264         },
40265
40266         // Convert dashed to camelCase; used by the css and data modules
40267         // Support: IE9-11+
40268         // Microsoft forgot to hump their vendor prefix (#9572)
40269         camelCase: function(string) {
40270           return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
40271         },
40272
40273         nodeName: function(elem, name) {
40274           return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
40275         },
40276
40277         // args is for internal usage only
40278         each: function(obj, callback, args) {
40279           var value,
40280             i = 0,
40281             length = obj.length,
40282             isArray = isArraylike(obj);
40283
40284           if (args) {
40285             if (isArray) {
40286               for (; i < length; i++) {
40287                 value = callback.apply(obj[i], args);
40288
40289                 if (value === false) {
40290                   break;
40291                 }
40292               }
40293             } else {
40294               for (i in obj) {
40295                 value = callback.apply(obj[i], args);
40296
40297                 if (value === false) {
40298                   break;
40299                 }
40300               }
40301             }
40302
40303             // A special, fast, case for the most common use of each
40304           } else {
40305             if (isArray) {
40306               for (; i < length; i++) {
40307                 value = callback.call(obj[i], i, obj[i]);
40308
40309                 if (value === false) {
40310                   break;
40311                 }
40312               }
40313             } else {
40314               for (i in obj) {
40315                 value = callback.call(obj[i], i, obj[i]);
40316
40317                 if (value === false) {
40318                   break;
40319                 }
40320               }
40321             }
40322           }
40323
40324           return obj;
40325         },
40326
40327         // Support: Android<4.1
40328         trim: function(text) {
40329           return text == null ?
40330             "" :
40331             (text + "").replace(rtrim, "");
40332         },
40333
40334         // results is for internal usage only
40335         makeArray: function(arr, results) {
40336           var ret = results || [];
40337
40338           if (arr != null) {
40339             if (isArraylike(Object(arr))) {
40340               jQuery.merge(ret,
40341                 typeof arr === "string" ? [arr] : arr
40342               );
40343             } else {
40344               push.call(ret, arr);
40345             }
40346           }
40347
40348           return ret;
40349         },
40350
40351         inArray: function(elem, arr, i) {
40352           return arr == null ? -1 : indexOf.call(arr, elem, i);
40353         },
40354
40355         merge: function(first, second) {
40356           var len = +second.length,
40357             j = 0,
40358             i = first.length;
40359
40360           for (; j < len; j++) {
40361             first[i++] = second[j];
40362           }
40363
40364           first.length = i;
40365
40366           return first;
40367         },
40368
40369         grep: function(elems, callback, invert) {
40370           var callbackInverse,
40371             matches = [],
40372             i = 0,
40373             length = elems.length,
40374             callbackExpect = !invert;
40375
40376           // Go through the array, only saving the items
40377           // that pass the validator function
40378           for (; i < length; i++) {
40379             callbackInverse = !callback(elems[i], i);
40380             if (callbackInverse !== callbackExpect) {
40381               matches.push(elems[i]);
40382             }
40383           }
40384
40385           return matches;
40386         },
40387
40388         // arg is for internal usage only
40389         map: function(elems, callback, arg) {
40390           var value,
40391             i = 0,
40392             length = elems.length,
40393             isArray = isArraylike(elems),
40394             ret = [];
40395
40396           // Go through the array, translating each of the items to their new
40397           // values
40398           if (isArray) {
40399             for (; i < length; i++) {
40400               value = callback(elems[i], i, arg);
40401
40402               if (value != null) {
40403                 ret.push(value);
40404               }
40405             }
40406
40407             // Go through every key on the object,
40408           } else {
40409             for (i in elems) {
40410               value = callback(elems[i], i, arg);
40411
40412               if (value != null) {
40413                 ret.push(value);
40414               }
40415             }
40416           }
40417
40418           // Flatten any nested arrays
40419           return concat.apply([], ret);
40420         },
40421
40422         // A global GUID counter for objects
40423         guid: 1,
40424
40425         // Bind a function to a context, optionally partially applying any
40426         // arguments.
40427         proxy: function(fn, context) {
40428           var tmp, args, proxy;
40429
40430           if (typeof context === "string") {
40431             tmp = fn[context];
40432             context = fn;
40433             fn = tmp;
40434           }
40435
40436           // Quick check to determine if target is callable, in the spec
40437           // this throws a TypeError, but we will just return undefined.
40438           if (!jQuery.isFunction(fn)) {
40439             return undefined;
40440           }
40441
40442           // Simulated bind
40443           args = slice.call(arguments, 2);
40444           proxy = function() {
40445             return fn.apply(context || this, args.concat(slice.call(arguments)));
40446           };
40447
40448           // Set the guid of unique handler to the same of original handler, so it
40449           // can be removed
40450           proxy.guid = fn.guid = fn.guid || jQuery.guid++;
40451
40452           return proxy;
40453         },
40454
40455         now: Date.now,
40456
40457         // jQuery.support is not used in Core but other projects attach their
40458         // properties to it so it needs to exist.
40459         support: support
40460       });
40461
40462       // Populate the class2type map
40463       jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
40464         class2type["[object " + name + "]"] = name.toLowerCase();
40465       });
40466
40467       function isArraylike(obj) {
40468
40469         // Support: iOS 8.2 (not reproducible in simulator)
40470         // `in` check used to prevent JIT error (gh-2145)
40471         // hasOwn isn't used here due to false negatives
40472         // regarding Nodelist length in IE
40473         var length = "length" in obj && obj.length,
40474           type = jQuery.type(obj);
40475
40476         if (type === "function" || jQuery.isWindow(obj)) {
40477           return false;
40478         }
40479
40480         if (obj.nodeType === 1 && length) {
40481           return true;
40482         }
40483
40484         return type === "array" || length === 0 ||
40485           typeof length === "number" && length > 0 && (length - 1) in obj;
40486       }
40487       var Sizzle =
40488         /*
40489          * ! Sizzle CSS Selector Engine v2.2.0-pre http://sizzlejs.com/
40490          *
40491          * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors Released
40492          * under the MIT license http://jquery.org/license
40493          *
40494          * Date: 2014-12-16
40495          */
40496         (function(window) {
40497
40498           var i,
40499             support,
40500             Expr,
40501             getText,
40502             isXML,
40503             tokenize,
40504             compile,
40505             select,
40506             outermostContext,
40507             sortInput,
40508             hasDuplicate,
40509
40510             // Local document vars
40511             setDocument,
40512             document,
40513             docElem,
40514             documentIsHTML,
40515             rbuggyQSA,
40516             rbuggyMatches,
40517             matches,
40518             contains,
40519
40520             // Instance-specific data
40521             expando = "sizzle" + 1 * new Date(),
40522             preferredDoc = window.document,
40523             dirruns = 0,
40524             done = 0,
40525             classCache = createCache(),
40526             tokenCache = createCache(),
40527             compilerCache = createCache(),
40528             sortOrder = function(a, b) {
40529               if (a === b) {
40530                 hasDuplicate = true;
40531               }
40532               return 0;
40533             },
40534
40535             // General-purpose constants
40536             MAX_NEGATIVE = 1 << 31,
40537
40538             // Instance methods
40539             hasOwn = ({}).hasOwnProperty,
40540             arr = [],
40541             pop = arr.pop,
40542             push_native = arr.push,
40543             push = arr.push,
40544             slice = arr.slice,
40545             // Use a stripped-down indexOf as it's faster than native
40546             // http://jsperf.com/thor-indexof-vs-for/5
40547             indexOf = function(list, elem) {
40548               var i = 0,
40549                 len = list.length;
40550               for (; i < len; i++) {
40551                 if (list[i] === elem) {
40552                   return i;
40553                 }
40554               }
40555               return -1;
40556             },
40557
40558             booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
40559
40560             // Regular expressions
40561
40562             // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
40563             whitespace = "[\\x20\\t\\r\\n\\f]",
40564             // http://www.w3.org/TR/css3-syntax/#characters
40565             characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
40566
40567             // Loosely modeled on CSS identifier characters
40568             // An unquoted value should be a CSS identifier
40569             // http://www.w3.org/TR/css3-selectors/#attribute-selectors
40570             // Proper syntax:
40571             // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
40572             identifier = characterEncoding.replace("w", "w#"),
40573
40574             // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
40575             attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
40576             // Operator (capture 2)
40577             "*([*^$|!~]?=)" + whitespace +
40578             // "Attribute values must be CSS identifiers [capture 5] or strings
40579             // [capture 3 or capture 4]"
40580             "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
40581             "*\\]",
40582
40583             pseudos = ":(" + characterEncoding + ")(?:\\((" +
40584             // To reduce the number of selectors needing tokenize in the preFilter,
40585             // prefer arguments:
40586             // 1. quoted (capture 3; capture 4 or capture 5)
40587             "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
40588             // 2. simple (capture 6)
40589             "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
40590             // 3. anything else (capture 2)
40591             ".*" +
40592             ")\\)|)",
40593
40594             // Leading and non-escaped trailing whitespace, capturing some
40595             // non-whitespace characters preceding the latter
40596             rwhitespace = new RegExp(whitespace + "+", "g"),
40597             rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"),
40598
40599             rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"),
40600             rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"),
40601
40602             rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g"),
40603
40604             rpseudo = new RegExp(pseudos),
40605             ridentifier = new RegExp("^" + identifier + "$"),
40606
40607             matchExpr = {
40608               "ID": new RegExp("^#(" + characterEncoding + ")"),
40609               "CLASS": new RegExp("^\\.(" + characterEncoding + ")"),
40610               "TAG": new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"),
40611               "ATTR": new RegExp("^" + attributes),
40612               "PSEUDO": new RegExp("^" + pseudos),
40613               "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
40614                 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
40615                 "*(\\d+)|))" + whitespace + "*\\)|)", "i"),
40616               "bool": new RegExp("^(?:" + booleans + ")$", "i"),
40617               // For use in libraries implementing .is()
40618               // We use this for POS matching in `select`
40619               "needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
40620                 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
40621             },
40622
40623             rinputs = /^(?:input|select|textarea|button)$/i,
40624             rheader = /^h\d$/i,
40625
40626             rnative = /^[^{]+\{\s*\[native \w/,
40627
40628             // Easily-parseable/retrievable ID or TAG or CLASS selectors
40629             rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
40630
40631             rsibling = /[+~]/,
40632             rescape = /'|\\/g,
40633
40634             // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
40635             runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig"),
40636             funescape = function(_, escaped, escapedWhitespace) {
40637               var high = "0x" + escaped - 0x10000;
40638               // NaN means non-codepoint
40639               // Support: Firefox<24
40640               // Workaround erroneous numeric interpretation of +"0x"
40641               return high !== high || escapedWhitespace ?
40642                 escaped :
40643                 high < 0 ?
40644                 // BMP codepoint
40645                 String.fromCharCode(high + 0x10000) :
40646                 // Supplemental Plane codepoint (surrogate pair)
40647                 String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);
40648             },
40649
40650             // Used for iframes
40651             // See setDocument()
40652             // Removing the function wrapper causes a "Permission Denied"
40653             // error in IE
40654             unloadHandler = function() {
40655               setDocument();
40656             };
40657
40658           // Optimize for push.apply( _, NodeList )
40659           try {
40660             push.apply(
40661               (arr = slice.call(preferredDoc.childNodes)),
40662               preferredDoc.childNodes
40663             );
40664             // Support: Android<4.0
40665             // Detect silently failing push.apply
40666             arr[preferredDoc.childNodes.length].nodeType;
40667           } catch (e) {
40668             push = {
40669               apply: arr.length ?
40670
40671                 // Leverage slice if possible
40672                 function(target, els) {
40673                   push_native.apply(target, slice.call(els));
40674                 } :
40675
40676                 // Support: IE<9
40677                 // Otherwise append directly
40678                 function(target, els) {
40679                   var j = target.length,
40680                     i = 0;
40681                   // Can't trust NodeList.length
40682                   while ((target[j++] = els[i++])) {}
40683                   target.length = j - 1;
40684                 }
40685             };
40686           }
40687
40688           function Sizzle(selector, context, results, seed) {
40689             var match, elem, m, nodeType,
40690               // QSA vars
40691               i, groups, old, nid, newContext, newSelector;
40692
40693             if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
40694               setDocument(context);
40695             }
40696
40697             context = context || document;
40698             results = results || [];
40699             nodeType = context.nodeType;
40700
40701             if (typeof selector !== "string" || !selector ||
40702               nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
40703
40704               return results;
40705             }
40706
40707             if (!seed && documentIsHTML) {
40708
40709               // Try to shortcut find operations when possible (e.g., not under
40710               // DocumentFragment)
40711               if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {
40712                 // Speed-up: Sizzle("#ID")
40713                 if ((m = match[1])) {
40714                   if (nodeType === 9) {
40715                     elem = context.getElementById(m);
40716                     // Check parentNode to catch when Blackberry 4.6 returns
40717                     // nodes that are no longer in the document (jQuery #6963)
40718                     if (elem && elem.parentNode) {
40719                       // Handle the case where IE, Opera, and Webkit return
40720                       // items
40721                       // by name instead of ID
40722                       if (elem.id === m) {
40723                         results.push(elem);
40724                         return results;
40725                       }
40726                     } else {
40727                       return results;
40728                     }
40729                   } else {
40730                     // Context is not a document
40731                     if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) &&
40732                       contains(context, elem) && elem.id === m) {
40733                       results.push(elem);
40734                       return results;
40735                     }
40736                   }
40737
40738                   // Speed-up: Sizzle("TAG")
40739                 } else if (match[2]) {
40740                   push.apply(results, context.getElementsByTagName(selector));
40741                   return results;
40742
40743                   // Speed-up: Sizzle(".CLASS")
40744                 } else if ((m = match[3]) && support.getElementsByClassName) {
40745                   push.apply(results, context.getElementsByClassName(m));
40746                   return results;
40747                 }
40748               }
40749
40750               // QSA path
40751               if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
40752                 nid = old = expando;
40753                 newContext = context;
40754                 newSelector = nodeType !== 1 && selector;
40755
40756                 // qSA works strangely on Element-rooted queries
40757                 // We can work around this by specifying an extra ID on the root
40758                 // and working up from there (Thanks to Andrew Dupont for the
40759                 // technique)
40760                 // IE 8 doesn't work on object elements
40761                 if (nodeType === 1 && context.nodeName.toLowerCase() !== "object") {
40762                   groups = tokenize(selector);
40763
40764                   if ((old = context.getAttribute("id"))) {
40765                     nid = old.replace(rescape, "\\$&");
40766                   } else {
40767                     context.setAttribute("id", nid);
40768                   }
40769                   nid = "[id='" + nid + "'] ";
40770
40771                   i = groups.length;
40772                   while (i--) {
40773                     groups[i] = nid + toSelector(groups[i]);
40774                   }
40775                   newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
40776                   newSelector = groups.join(",");
40777                 }
40778
40779                 if (newSelector) {
40780                   try {
40781                     push.apply(results,
40782                       newContext.querySelectorAll(newSelector)
40783                     );
40784                     return results;
40785                   } catch (qsaError) {} finally {
40786                     if (!old) {
40787                       context.removeAttribute("id");
40788                     }
40789                   }
40790                 }
40791               }
40792             }
40793
40794             // All others
40795             return select(selector.replace(rtrim, "$1"), context, results, seed);
40796           }
40797
40798           /**
40799            * Create key-value caches of limited size
40800            *
40801            * @returns {Function(string, Object)} Returns the Object data after storing it
40802            *          on itself with property name the (space-suffixed) string and (if the
40803            *          cache is larger than Expr.cacheLength) deleting the oldest entry
40804            */
40805           function createCache() {
40806             var keys = [];
40807
40808             function cache(key, value) {
40809               // Use (key + " ") to avoid collision with native prototype properties
40810               // (see Issue #157)
40811               if (keys.push(key + " ") > Expr.cacheLength) {
40812                 // Only keep the most recent entries
40813                 delete cache[keys.shift()];
40814               }
40815               return (cache[key + " "] = value);
40816             }
40817             return cache;
40818           }
40819
40820           /**
40821            * Mark a function for special use by Sizzle
40822            *
40823            * @param {Function}
40824            *            fn The function to mark
40825            */
40826           function markFunction(fn) {
40827             fn[expando] = true;
40828             return fn;
40829           }
40830
40831           /**
40832            * Support testing using an element
40833            *
40834            * @param {Function}
40835            *            fn Passed the created div and expects a boolean result
40836            */
40837           function assert(fn) {
40838             var div = document.createElement("div");
40839
40840             try {
40841               return !!fn(div);
40842             } catch (e) {
40843               return false;
40844             } finally {
40845               // Remove from its parent by default
40846               if (div.parentNode) {
40847                 div.parentNode.removeChild(div);
40848               }
40849               // release memory in IE
40850               div = null;
40851             }
40852           }
40853
40854           /**
40855            * Adds the same handler for all of the specified attrs
40856            *
40857            * @param {String}
40858            *            attrs Pipe-separated list of attributes
40859            * @param {Function}
40860            *            handler The method that will be applied
40861            */
40862           function addHandle(attrs, handler) {
40863             var arr = attrs.split("|"),
40864               i = attrs.length;
40865
40866             while (i--) {
40867               Expr.attrHandle[arr[i]] = handler;
40868             }
40869           }
40870
40871           /**
40872            * Checks document order of two siblings
40873            *
40874            * @param {Element}
40875            *            a
40876            * @param {Element}
40877            *            b
40878            * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a
40879            *          follows b
40880            */
40881           function siblingCheck(a, b) {
40882             var cur = b && a,
40883               diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
40884               (~b.sourceIndex || MAX_NEGATIVE) -
40885               (~a.sourceIndex || MAX_NEGATIVE);
40886
40887             // Use IE sourceIndex if available on both nodes
40888             if (diff) {
40889               return diff;
40890             }
40891
40892             // Check if b follows a
40893             if (cur) {
40894               while ((cur = cur.nextSibling)) {
40895                 if (cur === b) {
40896                   return -1;
40897                 }
40898               }
40899             }
40900
40901             return a ? 1 : -1;
40902           }
40903
40904           /**
40905            * Returns a function to use in pseudos for input types
40906            *
40907            * @param {String}
40908            *            type
40909            */
40910           function createInputPseudo(type) {
40911             return function(elem) {
40912               var name = elem.nodeName.toLowerCase();
40913               return name === "input" && elem.type === type;
40914             };
40915           }
40916
40917           /**
40918            * Returns a function to use in pseudos for buttons
40919            *
40920            * @param {String}
40921            *            type
40922            */
40923           function createButtonPseudo(type) {
40924             return function(elem) {
40925               var name = elem.nodeName.toLowerCase();
40926               return (name === "input" || name === "button") && elem.type === type;
40927             };
40928           }
40929
40930           /**
40931            * Returns a function to use in pseudos for positionals
40932            *
40933            * @param {Function}
40934            *            fn
40935            */
40936           function createPositionalPseudo(fn) {
40937             return markFunction(function(argument) {
40938               argument = +argument;
40939               return markFunction(function(seed, matches) {
40940                 var j,
40941                   matchIndexes = fn([], seed.length, argument),
40942                   i = matchIndexes.length;
40943
40944                 // Match elements found at the specified indexes
40945                 while (i--) {
40946                   if (seed[(j = matchIndexes[i])]) {
40947                     seed[j] = !(matches[j] = seed[j]);
40948                   }
40949                 }
40950               });
40951             });
40952           }
40953
40954           /**
40955            * Checks a node for validity as a Sizzle context
40956            *
40957            * @param {Element|Object=}
40958            *            context
40959            * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a
40960            *          falsy value
40961            */
40962           function testContext(context) {
40963             return context && typeof context.getElementsByTagName !== "undefined" && context;
40964           }
40965
40966           // Expose support vars for convenience
40967           support = Sizzle.support = {};
40968
40969           /**
40970            * Detects XML nodes
40971            *
40972            * @param {Element|Object}
40973            *            elem An element or a document
40974            * @returns {Boolean} True iff elem is a non-HTML XML node
40975            */
40976           isXML = Sizzle.isXML = function(elem) {
40977             // documentElement is verified for cases where it doesn't yet exist
40978             // (such as loading iframes in IE - #4833)
40979             var documentElement = elem && (elem.ownerDocument || elem).documentElement;
40980             return documentElement ? documentElement.nodeName !== "HTML" : false;
40981           };
40982
40983           /**
40984            * Sets document-related variables once based on the current document
40985            *
40986            * @param {Element|Object}
40987            *            [doc] An element or document object to use to set the document
40988            * @returns {Object} Returns the current document
40989            */
40990           setDocument = Sizzle.setDocument = function(node) {
40991             var hasCompare, parent,
40992               doc = node ? node.ownerDocument || node : preferredDoc;
40993
40994             // If no document and documentElement is available, return
40995             if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {
40996               return document;
40997             }
40998
40999             // Set our document
41000             document = doc;
41001             docElem = doc.documentElement;
41002             parent = doc.defaultView;
41003
41004             // Support: IE>8
41005             // If iframe document is assigned to "document" variable and if iframe has
41006             // been reloaded,
41007             // IE will throw "permission denied" error when accessing "document"
41008             // variable, see jQuery #13936
41009             // IE6-8 do not support the defaultView property so parent will be undefined
41010             if (parent && parent !== parent.top) {
41011               // IE11 does not have attachEvent, so all must suffer
41012               if (parent.addEventListener) {
41013                 parent.addEventListener("unload", unloadHandler, false);
41014               } else if (parent.attachEvent) {
41015                 parent.attachEvent("onunload", unloadHandler);
41016               }
41017             }
41018
41019             /*
41020              * Support tests
41021              * ----------------------------------------------------------------------
41022              */
41023             documentIsHTML = !isXML(doc);
41024
41025             /*
41026              * Attributes
41027              * ----------------------------------------------------------------------
41028              */
41029
41030             // Support: IE<8
41031             // Verify that getAttribute really returns attributes and not properties
41032             // (excepting IE8 booleans)
41033             support.attributes = assert(function(div) {
41034               div.className = "i";
41035               return !div.getAttribute("className");
41036             });
41037
41038             /***************************************************************************
41039              * getElement(s)By
41040              * ----------------------------------------------------------------------
41041              */
41042
41043             // Check if getElementsByTagName("*") returns only elements
41044             support.getElementsByTagName = assert(function(div) {
41045               div.appendChild(doc.createComment(""));
41046               return !div.getElementsByTagName("*").length;
41047             });
41048
41049             // Support: IE<9
41050             support.getElementsByClassName = rnative.test(doc.getElementsByClassName);
41051
41052             // Support: IE<10
41053             // Check if getElementById returns elements by name
41054             // The broken getElementById methods don't pick up programatically-set
41055             // names,
41056             // so use a roundabout getElementsByName test
41057             support.getById = assert(function(div) {
41058               docElem.appendChild(div).id = expando;
41059               return !doc.getElementsByName || !doc.getElementsByName(expando).length;
41060             });
41061
41062             // ID find and filter
41063             if (support.getById) {
41064               Expr.find["ID"] = function(id, context) {
41065                 if (typeof context.getElementById !== "undefined" && documentIsHTML) {
41066                   var m = context.getElementById(id);
41067                   // Check parentNode to catch when Blackberry 4.6 returns
41068                   // nodes that are no longer in the document #6963
41069                   return m && m.parentNode ? [m] : [];
41070                 }
41071               };
41072               Expr.filter["ID"] = function(id) {
41073                 var attrId = id.replace(runescape, funescape);
41074                 return function(elem) {
41075                   return elem.getAttribute("id") === attrId;
41076                 };
41077               };
41078             } else {
41079               // Support: IE6/7
41080               // getElementById is not reliable as a find shortcut
41081               delete Expr.find["ID"];
41082
41083               Expr.filter["ID"] = function(id) {
41084                 var attrId = id.replace(runescape, funescape);
41085                 return function(elem) {
41086                   var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
41087                   return node && node.value === attrId;
41088                 };
41089               };
41090             }
41091
41092             // Tag
41093             Expr.find["TAG"] = support.getElementsByTagName ?
41094               function(tag, context) {
41095                 if (typeof context.getElementsByTagName !== "undefined") {
41096                   return context.getElementsByTagName(tag);
41097
41098                   // DocumentFragment nodes don't have gEBTN
41099                 } else if (support.qsa) {
41100                   return context.querySelectorAll(tag);
41101                 }
41102               } :
41103
41104               function(tag, context) {
41105                 var elem,
41106                   tmp = [],
41107                   i = 0,
41108                   // By happy coincidence, a (broken) gEBTN appears on
41109                   // DocumentFragment nodes too
41110                   results = context.getElementsByTagName(tag);
41111
41112                 // Filter out possible comments
41113                 if (tag === "*") {
41114                   while ((elem = results[i++])) {
41115                     if (elem.nodeType === 1) {
41116                       tmp.push(elem);
41117                     }
41118                   }
41119
41120                   return tmp;
41121                 }
41122                 return results;
41123               };
41124
41125             // Class
41126             Expr.find["CLASS"] = support.getElementsByClassName && function(className, context) {
41127               if (documentIsHTML) {
41128                 return context.getElementsByClassName(className);
41129               }
41130             };
41131
41132             /*
41133              * QSA/matchesSelector
41134              * ----------------------------------------------------------------------
41135              */
41136
41137             // QSA and matchesSelector support
41138
41139             // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
41140             rbuggyMatches = [];
41141
41142             // qSa(:focus) reports false when true (Chrome 21)
41143             // We allow this because of a bug in IE8/9 that throws an error
41144             // whenever `document.activeElement` is accessed on an iframe
41145             // So, we allow :focus to pass through QSA all the time to avoid the IE
41146             // error
41147             // See http://bugs.jquery.com/ticket/13378
41148             rbuggyQSA = [];
41149
41150             if ((support.qsa = rnative.test(doc.querySelectorAll))) {
41151               // Build QSA regex
41152               // Regex strategy adopted from Diego Perini
41153               assert(function(div) {
41154                 // Select is set to empty string on purpose
41155                 // This is to test IE's treatment of not explicitly
41156                 // setting a boolean content attribute,
41157                 // since its presence should be enough
41158                 // http://bugs.jquery.com/ticket/12359
41159                 docElem.appendChild(div).innerHTML = "<a id='" + expando + "'></a>" +
41160                   "<select id='" + expando + "-\f]' msallowcapture=''>" +
41161                   "<option selected=''></option></select>";
41162
41163                 // Support: IE8, Opera 11-12.16
41164                 // Nothing should be selected when empty strings follow ^= or $= or
41165                 // *=
41166                 // The test attribute must be unknown in Opera but "safe" for WinRT
41167                 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
41168                 if (div.querySelectorAll("[msallowcapture^='']").length) {
41169                   rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")");
41170                 }
41171
41172                 // Support: IE8
41173                 // Boolean attributes and "value" are not treated correctly
41174                 if (!div.querySelectorAll("[selected]").length) {
41175                   rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
41176                 }
41177
41178                 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+,
41179                 // PhantomJS<1.9.7+
41180                 if (!div.querySelectorAll("[id~=" + expando + "-]").length) {
41181                   rbuggyQSA.push("~=");
41182                 }
41183
41184                 // Webkit/Opera - :checked should return selected option elements
41185                 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
41186                 // IE8 throws error here and will not see later tests
41187                 if (!div.querySelectorAll(":checked").length) {
41188                   rbuggyQSA.push(":checked");
41189                 }
41190
41191                 // Support: Safari 8+, iOS 8+
41192                 // https://bugs.webkit.org/show_bug.cgi?id=136851
41193                 // In-page `selector#id sibing-combinator selector` fails
41194                 if (!div.querySelectorAll("a#" + expando + "+*").length) {
41195                   rbuggyQSA.push(".#.+[+~]");
41196                 }
41197               });
41198
41199               assert(function(div) {
41200                 // Support: Windows 8 Native Apps
41201                 // The type and name attributes are restricted during .innerHTML
41202                 // assignment
41203                 var input = doc.createElement("input");
41204                 input.setAttribute("type", "hidden");
41205                 div.appendChild(input).setAttribute("name", "D");
41206
41207                 // Support: IE8
41208                 // Enforce case-sensitivity of name attribute
41209                 if (div.querySelectorAll("[name=d]").length) {
41210                   rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=");
41211                 }
41212
41213                 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements
41214                 // are still enabled)
41215                 // IE8 throws error here and will not see later tests
41216                 if (!div.querySelectorAll(":enabled").length) {
41217                   rbuggyQSA.push(":enabled", ":disabled");
41218                 }
41219
41220                 // Opera 10-11 does not throw on post-comma invalid pseudos
41221                 div.querySelectorAll("*,:x");
41222                 rbuggyQSA.push(",.*:");
41223               });
41224             }
41225
41226             if ((support.matchesSelector = rnative.test((matches = docElem.matches ||
41227                 docElem.webkitMatchesSelector ||
41228                 docElem.mozMatchesSelector ||
41229                 docElem.oMatchesSelector ||
41230                 docElem.msMatchesSelector)))) {
41231
41232               assert(function(div) {
41233                 // Check to see if it's possible to do matchesSelector
41234                 // on a disconnected node (IE 9)
41235                 support.disconnectedMatch = matches.call(div, "div");
41236
41237                 // This should fail with an exception
41238                 // Gecko does not error, returns false instead
41239                 matches.call(div, "[s!='']:x");
41240                 rbuggyMatches.push("!=", pseudos);
41241               });
41242             }
41243
41244             rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
41245             rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|"));
41246
41247             /*
41248              * Contains
41249              * ----------------------------------------------------------------------
41250              */
41251             hasCompare = rnative.test(docElem.compareDocumentPosition);
41252
41253             // Element contains another
41254             // Purposefully does not implement inclusive descendent
41255             // As in, an element does not contain itself
41256             contains = hasCompare || rnative.test(docElem.contains) ?
41257               function(a, b) {
41258                 var adown = a.nodeType === 9 ? a.documentElement : a,
41259                   bup = b && b.parentNode;
41260                 return a === bup || !!(bup && bup.nodeType === 1 && (
41261                   adown.contains ?
41262                   adown.contains(bup) :
41263                   a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
41264                 ));
41265               } :
41266               function(a, b) {
41267                 if (b) {
41268                   while ((b = b.parentNode)) {
41269                     if (b === a) {
41270                       return true;
41271                     }
41272                   }
41273                 }
41274                 return false;
41275               };
41276
41277             /*
41278              * Sorting
41279              * ----------------------------------------------------------------------
41280              */
41281
41282             // Document order sorting
41283             sortOrder = hasCompare ?
41284               function(a, b) {
41285
41286                 // Flag for duplicate removal
41287                 if (a === b) {
41288                   hasDuplicate = true;
41289                   return 0;
41290                 }
41291
41292                 // Sort on method existence if only one input has
41293                 // compareDocumentPosition
41294                 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
41295                 if (compare) {
41296                   return compare;
41297                 }
41298
41299                 // Calculate position if both inputs belong to the same document
41300                 compare = (a.ownerDocument || a) === (b.ownerDocument || b) ?
41301                   a.compareDocumentPosition(b) :
41302
41303                   // Otherwise we know they are disconnected
41304                   1;
41305
41306                 // Disconnected nodes
41307                 if (compare & 1 ||
41308                   (!support.sortDetached && b.compareDocumentPosition(a) === compare)) {
41309
41310                   // Choose the first element that is related to our preferred
41311                   // document
41312                   if (a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) {
41313                     return -1;
41314                   }
41315                   if (b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) {
41316                     return 1;
41317                   }
41318
41319                   // Maintain original order
41320                   return sortInput ?
41321                     (indexOf(sortInput, a) - indexOf(sortInput, b)) :
41322                     0;
41323                 }
41324
41325                 return compare & 4 ? -1 : 1;
41326               } :
41327               function(a, b) {
41328                 // Exit early if the nodes are identical
41329                 if (a === b) {
41330                   hasDuplicate = true;
41331                   return 0;
41332                 }
41333
41334                 var cur,
41335                   i = 0,
41336                   aup = a.parentNode,
41337                   bup = b.parentNode,
41338                   ap = [a],
41339                   bp = [b];
41340
41341                 // Parentless nodes are either documents or disconnected
41342                 if (!aup || !bup) {
41343                   return a === doc ? -1 :
41344                     b === doc ? 1 :
41345                     aup ? -1 :
41346                     bup ? 1 :
41347                     sortInput ?
41348                     (indexOf(sortInput, a) - indexOf(sortInput, b)) :
41349                     0;
41350
41351                   // If the nodes are siblings, we can do a quick check
41352                 } else if (aup === bup) {
41353                   return siblingCheck(a, b);
41354                 }
41355
41356                 // Otherwise we need full lists of their ancestors for comparison
41357                 cur = a;
41358                 while ((cur = cur.parentNode)) {
41359                   ap.unshift(cur);
41360                 }
41361                 cur = b;
41362                 while ((cur = cur.parentNode)) {
41363                   bp.unshift(cur);
41364                 }
41365
41366                 // Walk down the tree looking for a discrepancy
41367                 while (ap[i] === bp[i]) {
41368                   i++;
41369                 }
41370
41371                 return i ?
41372                   // Do a sibling check if the nodes have a common ancestor
41373                   siblingCheck(ap[i], bp[i]) :
41374
41375                   // Otherwise nodes in our document sort first
41376                   ap[i] === preferredDoc ? -1 :
41377                   bp[i] === preferredDoc ? 1 :
41378                   0;
41379               };
41380
41381             return doc;
41382           };
41383
41384           Sizzle.matches = function(expr, elements) {
41385             return Sizzle(expr, null, null, elements);
41386           };
41387
41388           Sizzle.matchesSelector = function(elem, expr) {
41389             // Set document vars if needed
41390             if ((elem.ownerDocument || elem) !== document) {
41391               setDocument(elem);
41392             }
41393
41394             // Make sure that attribute selectors are quoted
41395             expr = expr.replace(rattributeQuotes, "='$1']");
41396
41397             if (support.matchesSelector && documentIsHTML &&
41398               (!rbuggyMatches || !rbuggyMatches.test(expr)) &&
41399               (!rbuggyQSA || !rbuggyQSA.test(expr))) {
41400
41401               try {
41402                 var ret = matches.call(elem, expr);
41403
41404                 // IE 9's matchesSelector returns false on disconnected nodes
41405                 if (ret || support.disconnectedMatch ||
41406                   // As well, disconnected nodes are said to be in a document
41407                   // fragment in IE 9
41408                   elem.document && elem.document.nodeType !== 11) {
41409                   return ret;
41410                 }
41411               } catch (e) {}
41412             }
41413
41414             return Sizzle(expr, document, null, [elem]).length > 0;
41415           };
41416
41417           Sizzle.contains = function(context, elem) {
41418             // Set document vars if needed
41419             if ((context.ownerDocument || context) !== document) {
41420               setDocument(context);
41421             }
41422             return contains(context, elem);
41423           };
41424
41425           Sizzle.attr = function(elem, name) {
41426             // Set document vars if needed
41427             if ((elem.ownerDocument || elem) !== document) {
41428               setDocument(elem);
41429             }
41430
41431             var fn = Expr.attrHandle[name.toLowerCase()],
41432               // Don't get fooled by Object.prototype properties (jQuery #13807)
41433               val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ?
41434               fn(elem, name, !documentIsHTML) :
41435               undefined;
41436
41437             return val !== undefined ?
41438               val :
41439               support.attributes || !documentIsHTML ?
41440               elem.getAttribute(name) :
41441               (val = elem.getAttributeNode(name)) && val.specified ?
41442               val.value :
41443               null;
41444           };
41445
41446           Sizzle.error = function(msg) {
41447             throw new Error("Syntax error, unrecognized expression: " + msg);
41448           };
41449
41450           /**
41451            * Document sorting and removing duplicates
41452            *
41453            * @param {ArrayLike}
41454            *            results
41455            */
41456           Sizzle.uniqueSort = function(results) {
41457             var elem,
41458               duplicates = [],
41459               j = 0,
41460               i = 0;
41461
41462             // Unless we *know* we can detect duplicates, assume their presence
41463             hasDuplicate = !support.detectDuplicates;
41464             sortInput = !support.sortStable && results.slice(0);
41465             results.sort(sortOrder);
41466
41467             if (hasDuplicate) {
41468               while ((elem = results[i++])) {
41469                 if (elem === results[i]) {
41470                   j = duplicates.push(i);
41471                 }
41472               }
41473               while (j--) {
41474                 results.splice(duplicates[j], 1);
41475               }
41476             }
41477
41478             // Clear input after sorting to release objects
41479             // See https://github.com/jquery/sizzle/pull/225
41480             sortInput = null;
41481
41482             return results;
41483           };
41484
41485           /**
41486            * Utility function for retrieving the text value of an array of DOM nodes
41487            *
41488            * @param {Array|Element}
41489            *            elem
41490            */
41491           getText = Sizzle.getText = function(elem) {
41492             var node,
41493               ret = "",
41494               i = 0,
41495               nodeType = elem.nodeType;
41496
41497             if (!nodeType) {
41498               // If no nodeType, this is expected to be an array
41499               while ((node = elem[i++])) {
41500                 // Do not traverse comment nodes
41501                 ret += getText(node);
41502               }
41503             } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
41504               // Use textContent for elements
41505               // innerText usage removed for consistency of new lines (jQuery #11153)
41506               if (typeof elem.textContent === "string") {
41507                 return elem.textContent;
41508               } else {
41509                 // Traverse its children
41510                 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
41511                   ret += getText(elem);
41512                 }
41513               }
41514             } else if (nodeType === 3 || nodeType === 4) {
41515               return elem.nodeValue;
41516             }
41517             // Do not include comment or processing instruction nodes
41518
41519             return ret;
41520           };
41521
41522           Expr = Sizzle.selectors = {
41523
41524             // Can be adjusted by the user
41525             cacheLength: 50,
41526
41527             createPseudo: markFunction,
41528
41529             match: matchExpr,
41530
41531             attrHandle: {},
41532
41533             find: {},
41534
41535             relative: {
41536               ">": {
41537                 dir: "parentNode",
41538                 first: true
41539               },
41540               " ": {
41541                 dir: "parentNode"
41542               },
41543               "+": {
41544                 dir: "previousSibling",
41545                 first: true
41546               },
41547               "~": {
41548                 dir: "previousSibling"
41549               }
41550             },
41551
41552             preFilter: {
41553               "ATTR": function(match) {
41554                 match[1] = match[1].replace(runescape, funescape);
41555
41556                 // Move the given value to match[3] whether quoted or unquoted
41557                 match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
41558
41559                 if (match[2] === "~=") {
41560                   match[3] = " " + match[3] + " ";
41561                 }
41562
41563                 return match.slice(0, 4);
41564               },
41565
41566               "CHILD": function(match) {
41567                 /*
41568                  * matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what
41569                  * (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4
41570                  * xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component
41571                  * 6 x of xn-component 7 sign of y-component 8 y of y-component
41572                  */
41573                 match[1] = match[1].toLowerCase();
41574
41575                 if (match[1].slice(0, 3) === "nth") {
41576                   // nth-* requires argument
41577                   if (!match[3]) {
41578                     Sizzle.error(match[0]);
41579                   }
41580
41581                   // numeric x and y parameters for Expr.filter.CHILD
41582                   // remember that false/true cast respectively to 0/1
41583                   match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
41584                   match[5] = +((match[7] + match[8]) || match[3] === "odd");
41585
41586                   // other types prohibit arguments
41587                 } else if (match[3]) {
41588                   Sizzle.error(match[0]);
41589                 }
41590
41591                 return match;
41592               },
41593
41594               "PSEUDO": function(match) {
41595                 var excess,
41596                   unquoted = !match[6] && match[2];
41597
41598                 if (matchExpr["CHILD"].test(match[0])) {
41599                   return null;
41600                 }
41601
41602                 // Accept quoted arguments as-is
41603                 if (match[3]) {
41604                   match[2] = match[4] || match[5] || "";
41605
41606                   // Strip excess characters from unquoted arguments
41607                 } else if (unquoted && rpseudo.test(unquoted) &&
41608                   // Get excess from tokenize (recursively)
41609                   (excess = tokenize(unquoted, true)) &&
41610                   // advance to the next closing parenthesis
41611                   (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
41612
41613                   // excess is a negative index
41614                   match[0] = match[0].slice(0, excess);
41615                   match[2] = unquoted.slice(0, excess);
41616                 }
41617
41618                 // Return only captures needed by the pseudo filter method (type and
41619                 // argument)
41620                 return match.slice(0, 3);
41621               }
41622             },
41623
41624             filter: {
41625
41626               "TAG": function(nodeNameSelector) {
41627                 var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
41628                 return nodeNameSelector === "*" ?
41629                   function() {
41630                     return true;
41631                   } :
41632                   function(elem) {
41633                     return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
41634                   };
41635               },
41636
41637               "CLASS": function(className) {
41638                 var pattern = classCache[className + " "];
41639
41640                 return pattern ||
41641                   (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) &&
41642                   classCache(className, function(elem) {
41643                     return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "");
41644                   });
41645               },
41646
41647               "ATTR": function(name, operator, check) {
41648                 return function(elem) {
41649                   var result = Sizzle.attr(elem, name);
41650
41651                   if (result == null) {
41652                     return operator === "!=";
41653                   }
41654                   if (!operator) {
41655                     return true;
41656                   }
41657
41658                   result += "";
41659
41660                   return operator === "=" ? result === check :
41661                     operator === "!=" ? result !== check :
41662                     operator === "^=" ? check && result.indexOf(check) === 0 :
41663                     operator === "*=" ? check && result.indexOf(check) > -1 :
41664                     operator === "$=" ? check && result.slice(-check.length) === check :
41665                     operator === "~=" ? (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1 :
41666                     operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" :
41667                     false;
41668                 };
41669               },
41670
41671               "CHILD": function(type, what, argument, first, last) {
41672                 var simple = type.slice(0, 3) !== "nth",
41673                   forward = type.slice(-4) !== "last",
41674                   ofType = what === "of-type";
41675
41676                 return first === 1 && last === 0 ?
41677
41678                   // Shortcut for :nth-*(n)
41679                   function(elem) {
41680                     return !!elem.parentNode;
41681                   } :
41682
41683                   function(elem, context, xml) {
41684                     var cache, outerCache, node, diff, nodeIndex, start,
41685                       dir = simple !== forward ? "nextSibling" : "previousSibling",
41686                       parent = elem.parentNode,
41687                       name = ofType && elem.nodeName.toLowerCase(),
41688                       useCache = !xml && !ofType;
41689
41690                     if (parent) {
41691
41692                       // :(first|last|only)-(child|of-type)
41693                       if (simple) {
41694                         while (dir) {
41695                           node = elem;
41696                           while ((node = node[dir])) {
41697                             if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
41698                               return false;
41699                             }
41700                           }
41701                           // Reverse direction for :only-* (if we haven't
41702                           // yet done so)
41703                           start = dir = type === "only" && !start && "nextSibling";
41704                         }
41705                         return true;
41706                       }
41707
41708                       start = [forward ? parent.firstChild : parent.lastChild];
41709
41710                       // non-xml :nth-child(...) stores cache data on `parent`
41711                       if (forward && useCache) {
41712                         // Seek `elem` from a previously-cached index
41713                         outerCache = parent[expando] || (parent[expando] = {});
41714                         cache = outerCache[type] || [];
41715                         nodeIndex = cache[0] === dirruns && cache[1];
41716                         diff = cache[0] === dirruns && cache[2];
41717                         node = nodeIndex && parent.childNodes[nodeIndex];
41718
41719                         while ((node = ++nodeIndex && node && node[dir] ||
41720
41721                             // Fallback to seeking `elem` from the start
41722                             (diff = nodeIndex = 0) || start.pop())) {
41723
41724                           // When found, cache indexes on `parent` and
41725                           // break
41726                           if (node.nodeType === 1 && ++diff && node === elem) {
41727                             outerCache[type] = [dirruns, nodeIndex, diff];
41728                             break;
41729                           }
41730                         }
41731
41732                         // Use previously-cached element index if available
41733                       } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
41734                         diff = cache[1];
41735
41736                         // xml :nth-child(...) or :nth-last-child(...) or
41737                         // :nth(-last)?-of-type(...)
41738                       } else {
41739                         // Use the same loop as above to seek `elem` from
41740                         // the start
41741                         while ((node = ++nodeIndex && node && node[dir] ||
41742                             (diff = nodeIndex = 0) || start.pop())) {
41743
41744                           if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
41745                             // Cache the index of each encountered
41746                             // element
41747                             if (useCache) {
41748                               (node[expando] || (node[expando] = {}))[type] = [dirruns, diff];
41749                             }
41750
41751                             if (node === elem) {
41752                               break;
41753                             }
41754                           }
41755                         }
41756                       }
41757
41758                       // Incorporate the offset, then check against cycle size
41759                       diff -= last;
41760                       return diff === first || (diff % first === 0 && diff / first >= 0);
41761                     }
41762                   };
41763               },
41764
41765               "PSEUDO": function(pseudo, argument) {
41766                 // pseudo-class names are case-insensitive
41767                 // http://www.w3.org/TR/selectors/#pseudo-classes
41768                 // Prioritize by case sensitivity in case custom pseudos are added
41769                 // with uppercase letters
41770                 // Remember that setFilters inherits from pseudos
41771                 var args,
41772                   fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] ||
41773                   Sizzle.error("unsupported pseudo: " + pseudo);
41774
41775                 // The user may use createPseudo to indicate that
41776                 // arguments are needed to create the filter function
41777                 // just as Sizzle does
41778                 if (fn[expando]) {
41779                   return fn(argument);
41780                 }
41781
41782                 // But maintain support for old signatures
41783                 if (fn.length > 1) {
41784                   args = [pseudo, pseudo, "", argument];
41785                   return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ?
41786                     markFunction(function(seed, matches) {
41787                       var idx,
41788                         matched = fn(seed, argument),
41789                         i = matched.length;
41790                       while (i--) {
41791                         idx = indexOf(seed, matched[i]);
41792                         seed[idx] = !(matches[idx] = matched[i]);
41793                       }
41794                     }) :
41795                     function(elem) {
41796                       return fn(elem, 0, args);
41797                     };
41798                 }
41799
41800                 return fn;
41801               }
41802             },
41803
41804             pseudos: {
41805               // Potentially complex pseudos
41806               "not": markFunction(function(selector) {
41807                 // Trim the selector passed to compile
41808                 // to avoid treating leading and trailing
41809                 // spaces as combinators
41810                 var input = [],
41811                   results = [],
41812                   matcher = compile(selector.replace(rtrim, "$1"));
41813
41814                 return matcher[expando] ?
41815                   markFunction(function(seed, matches, context, xml) {
41816                     var elem,
41817                       unmatched = matcher(seed, null, xml, []),
41818                       i = seed.length;
41819
41820                     // Match elements unmatched by `matcher`
41821                     while (i--) {
41822                       if ((elem = unmatched[i])) {
41823                         seed[i] = !(matches[i] = elem);
41824                       }
41825                     }
41826                   }) :
41827                   function(elem, context, xml) {
41828                     input[0] = elem;
41829                     matcher(input, null, xml, results);
41830                     // Don't keep the element (issue #299)
41831                     input[0] = null;
41832                     return !results.pop();
41833                   };
41834               }),
41835
41836               "has": markFunction(function(selector) {
41837                 return function(elem) {
41838                   return Sizzle(selector, elem).length > 0;
41839                 };
41840               }),
41841
41842               "contains": markFunction(function(text) {
41843                 text = text.replace(runescape, funescape);
41844                 return function(elem) {
41845                   return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
41846                 };
41847               }),
41848
41849               // "Whether an element is represented by a :lang() selector
41850               // is based solely on the element's language value
41851               // being equal to the identifier C,
41852               // or beginning with the identifier C immediately followed by "-".
41853               // The matching of C against the element's language value is performed
41854               // case-insensitively.
41855               // The identifier C does not have to be a valid language name."
41856               // http://www.w3.org/TR/selectors/#lang-pseudo
41857               "lang": markFunction(function(lang) {
41858                 // lang value must be a valid identifier
41859                 if (!ridentifier.test(lang || "")) {
41860                   Sizzle.error("unsupported lang: " + lang);
41861                 }
41862                 lang = lang.replace(runescape, funescape).toLowerCase();
41863                 return function(elem) {
41864                   var elemLang;
41865                   do {
41866                     if ((elemLang = documentIsHTML ?
41867                         elem.lang :
41868                         elem.getAttribute("xml:lang") || elem.getAttribute("lang"))) {
41869
41870                       elemLang = elemLang.toLowerCase();
41871                       return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
41872                     }
41873                   } while ((elem = elem.parentNode) && elem.nodeType === 1);
41874                   return false;
41875                 };
41876               }),
41877
41878               // Miscellaneous
41879               "target": function(elem) {
41880                 var hash = window.location && window.location.hash;
41881                 return hash && hash.slice(1) === elem.id;
41882               },
41883
41884               "root": function(elem) {
41885                 return elem === docElem;
41886               },
41887
41888               "focus": function(elem) {
41889                 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
41890               },
41891
41892               // Boolean properties
41893               "enabled": function(elem) {
41894                 return elem.disabled === false;
41895               },
41896
41897               "disabled": function(elem) {
41898                 return elem.disabled === true;
41899               },
41900
41901               "checked": function(elem) {
41902                 // In CSS3, :checked should return both checked and selected
41903                 // elements
41904                 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
41905                 var nodeName = elem.nodeName.toLowerCase();
41906                 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
41907               },
41908
41909               "selected": function(elem) {
41910                 // Accessing this property makes selected-by-default
41911                 // options in Safari work properly
41912                 if (elem.parentNode) {
41913                   elem.parentNode.selectedIndex;
41914                 }
41915
41916                 return elem.selected === true;
41917               },
41918
41919               // Contents
41920               "empty": function(elem) {
41921                 // http://www.w3.org/TR/selectors/#empty-pseudo
41922                 // :empty is negated by element (1) or content nodes (text: 3;
41923                 // cdata: 4; entity ref: 5),
41924                 // but not by others (comment: 8; processing instruction: 7; etc.)
41925                 // nodeType < 6 works because attributes (2) do not appear as
41926                 // children
41927                 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
41928                   if (elem.nodeType < 6) {
41929                     return false;
41930                   }
41931                 }
41932                 return true;
41933               },
41934
41935               "parent": function(elem) {
41936                 return !Expr.pseudos["empty"](elem);
41937               },
41938
41939               // Element/input types
41940               "header": function(elem) {
41941                 return rheader.test(elem.nodeName);
41942               },
41943
41944               "input": function(elem) {
41945                 return rinputs.test(elem.nodeName);
41946               },
41947
41948               "button": function(elem) {
41949                 var name = elem.nodeName.toLowerCase();
41950                 return name === "input" && elem.type === "button" || name === "button";
41951               },
41952
41953               "text": function(elem) {
41954                 var attr;
41955                 return elem.nodeName.toLowerCase() === "input" &&
41956                   elem.type === "text" &&
41957
41958                   // Support: IE<8
41959                   // New HTML5 attribute values (e.g., "search") appear with
41960                   // elem.type === "text"
41961                   ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
41962               },
41963
41964               // Position-in-collection
41965               "first": createPositionalPseudo(function() {
41966                 return [0];
41967               }),
41968
41969               "last": createPositionalPseudo(function(matchIndexes, length) {
41970                 return [length - 1];
41971               }),
41972
41973               "eq": createPositionalPseudo(function(matchIndexes, length, argument) {
41974                 return [argument < 0 ? argument + length : argument];
41975               }),
41976
41977               "even": createPositionalPseudo(function(matchIndexes, length) {
41978                 var i = 0;
41979                 for (; i < length; i += 2) {
41980                   matchIndexes.push(i);
41981                 }
41982                 return matchIndexes;
41983               }),
41984
41985               "odd": createPositionalPseudo(function(matchIndexes, length) {
41986                 var i = 1;
41987                 for (; i < length; i += 2) {
41988                   matchIndexes.push(i);
41989                 }
41990                 return matchIndexes;
41991               }),
41992
41993               "lt": createPositionalPseudo(function(matchIndexes, length, argument) {
41994                 var i = argument < 0 ? argument + length : argument;
41995                 for (; --i >= 0;) {
41996                   matchIndexes.push(i);
41997                 }
41998                 return matchIndexes;
41999               }),
42000
42001               "gt": createPositionalPseudo(function(matchIndexes, length, argument) {
42002                 var i = argument < 0 ? argument + length : argument;
42003                 for (; ++i < length;) {
42004                   matchIndexes.push(i);
42005                 }
42006                 return matchIndexes;
42007               })
42008             }
42009           };
42010
42011           Expr.pseudos["nth"] = Expr.pseudos["eq"];
42012
42013           // Add button/input type pseudos
42014           for (i in {
42015               radio: true,
42016               checkbox: true,
42017               file: true,
42018               password: true,
42019               image: true
42020             }) {
42021             Expr.pseudos[i] = createInputPseudo(i);
42022           }
42023           for (i in {
42024               submit: true,
42025               reset: true
42026             }) {
42027             Expr.pseudos[i] = createButtonPseudo(i);
42028           }
42029
42030           // Easy API for creating new setFilters
42031           function setFilters() {}
42032           setFilters.prototype = Expr.filters = Expr.pseudos;
42033           Expr.setFilters = new setFilters();
42034
42035           tokenize = Sizzle.tokenize = function(selector, parseOnly) {
42036             var matched, match, tokens, type,
42037               soFar, groups, preFilters,
42038               cached = tokenCache[selector + " "];
42039
42040             if (cached) {
42041               return parseOnly ? 0 : cached.slice(0);
42042             }
42043
42044             soFar = selector;
42045             groups = [];
42046             preFilters = Expr.preFilter;
42047
42048             while (soFar) {
42049
42050               // Comma and first run
42051               if (!matched || (match = rcomma.exec(soFar))) {
42052                 if (match) {
42053                   // Don't consume trailing commas as valid
42054                   soFar = soFar.slice(match[0].length) || soFar;
42055                 }
42056                 groups.push((tokens = []));
42057               }
42058
42059               matched = false;
42060
42061               // Combinators
42062               if ((match = rcombinators.exec(soFar))) {
42063                 matched = match.shift();
42064                 tokens.push({
42065                   value: matched,
42066                   // Cast descendant combinators to space
42067                   type: match[0].replace(rtrim, " ")
42068                 });
42069                 soFar = soFar.slice(matched.length);
42070               }
42071
42072               // Filters
42073               for (type in Expr.filter) {
42074                 if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] ||
42075                     (match = preFilters[type](match)))) {
42076                   matched = match.shift();
42077                   tokens.push({
42078                     value: matched,
42079                     type: type,
42080                     matches: match
42081                   });
42082                   soFar = soFar.slice(matched.length);
42083                 }
42084               }
42085
42086               if (!matched) {
42087                 break;
42088               }
42089             }
42090
42091             // Return the length of the invalid excess
42092             // if we're just parsing
42093             // Otherwise, throw an error or return tokens
42094             return parseOnly ?
42095               soFar.length :
42096               soFar ?
42097               Sizzle.error(selector) :
42098               // Cache the tokens
42099               tokenCache(selector, groups).slice(0);
42100           };
42101
42102           function toSelector(tokens) {
42103             var i = 0,
42104               len = tokens.length,
42105               selector = "";
42106             for (; i < len; i++) {
42107               selector += tokens[i].value;
42108             }
42109             return selector;
42110           }
42111
42112           function addCombinator(matcher, combinator, base) {
42113             var dir = combinator.dir,
42114               checkNonElements = base && dir === "parentNode",
42115               doneName = done++;
42116
42117             return combinator.first ?
42118               // Check against closest ancestor/preceding element
42119               function(elem, context, xml) {
42120                 while ((elem = elem[dir])) {
42121                   if (elem.nodeType === 1 || checkNonElements) {
42122                     return matcher(elem, context, xml);
42123                   }
42124                 }
42125               } :
42126
42127               // Check against all ancestor/preceding elements
42128               function(elem, context, xml) {
42129                 var oldCache, outerCache,
42130                   newCache = [dirruns, doneName];
42131
42132                 // We can't set arbitrary data on XML nodes, so they don't benefit
42133                 // from dir caching
42134                 if (xml) {
42135                   while ((elem = elem[dir])) {
42136                     if (elem.nodeType === 1 || checkNonElements) {
42137                       if (matcher(elem, context, xml)) {
42138                         return true;
42139                       }
42140                     }
42141                   }
42142                 } else {
42143                   while ((elem = elem[dir])) {
42144                     if (elem.nodeType === 1 || checkNonElements) {
42145                       outerCache = elem[expando] || (elem[expando] = {});
42146                       if ((oldCache = outerCache[dir]) &&
42147                         oldCache[0] === dirruns && oldCache[1] === doneName) {
42148
42149                         // Assign to newCache so results back-propagate to
42150                         // previous elements
42151                         return (newCache[2] = oldCache[2]);
42152                       } else {
42153                         // Reuse newcache so results back-propagate to
42154                         // previous elements
42155                         outerCache[dir] = newCache;
42156
42157                         // A match means we're done; a fail means we have to
42158                         // keep checking
42159                         if ((newCache[2] = matcher(elem, context, xml))) {
42160                           return true;
42161                         }
42162                       }
42163                     }
42164                   }
42165                 }
42166               };
42167           }
42168
42169           function elementMatcher(matchers) {
42170             return matchers.length > 1 ?
42171               function(elem, context, xml) {
42172                 var i = matchers.length;
42173                 while (i--) {
42174                   if (!matchers[i](elem, context, xml)) {
42175                     return false;
42176                   }
42177                 }
42178                 return true;
42179               } :
42180               matchers[0];
42181           }
42182
42183           function multipleContexts(selector, contexts, results) {
42184             var i = 0,
42185               len = contexts.length;
42186             for (; i < len; i++) {
42187               Sizzle(selector, contexts[i], results);
42188             }
42189             return results;
42190           }
42191
42192           function condense(unmatched, map, filter, context, xml) {
42193             var elem,
42194               newUnmatched = [],
42195               i = 0,
42196               len = unmatched.length,
42197               mapped = map != null;
42198
42199             for (; i < len; i++) {
42200               if ((elem = unmatched[i])) {
42201                 if (!filter || filter(elem, context, xml)) {
42202                   newUnmatched.push(elem);
42203                   if (mapped) {
42204                     map.push(i);
42205                   }
42206                 }
42207               }
42208             }
42209
42210             return newUnmatched;
42211           }
42212
42213           function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
42214             if (postFilter && !postFilter[expando]) {
42215               postFilter = setMatcher(postFilter);
42216             }
42217             if (postFinder && !postFinder[expando]) {
42218               postFinder = setMatcher(postFinder, postSelector);
42219             }
42220             return markFunction(function(seed, results, context, xml) {
42221               var temp, i, elem,
42222                 preMap = [],
42223                 postMap = [],
42224                 preexisting = results.length,
42225
42226                 // Get initial elements from seed or context
42227                 elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []),
42228
42229                 // Prefilter to get matcher input, preserving a map for seed-results
42230                 // synchronization
42231                 matcherIn = preFilter && (seed || !selector) ?
42232                 condense(elems, preMap, preFilter, context, xml) :
42233                 elems,
42234
42235                 matcherOut = matcher ?
42236                 // If we have a postFinder, or filtered seed, or non-seed
42237                 // postFilter or preexisting results,
42238                 postFinder || (seed ? preFilter : preexisting || postFilter) ?
42239
42240                 // ...intermediate processing is necessary
42241                 [] :
42242
42243                 // ...otherwise use results directly
42244                 results :
42245                 matcherIn;
42246
42247               // Find primary matches
42248               if (matcher) {
42249                 matcher(matcherIn, matcherOut, context, xml);
42250               }
42251
42252               // Apply postFilter
42253               if (postFilter) {
42254                 temp = condense(matcherOut, postMap);
42255                 postFilter(temp, [], context, xml);
42256
42257                 // Un-match failing elements by moving them back to matcherIn
42258                 i = temp.length;
42259                 while (i--) {
42260                   if ((elem = temp[i])) {
42261                     matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
42262                   }
42263                 }
42264               }
42265
42266               if (seed) {
42267                 if (postFinder || preFilter) {
42268                   if (postFinder) {
42269                     // Get the final matcherOut by condensing this intermediate
42270                     // into postFinder contexts
42271                     temp = [];
42272                     i = matcherOut.length;
42273                     while (i--) {
42274                       if ((elem = matcherOut[i])) {
42275                         // Restore matcherIn since elem is not yet a final
42276                         // match
42277                         temp.push((matcherIn[i] = elem));
42278                       }
42279                     }
42280                     postFinder(null, (matcherOut = []), temp, xml);
42281                   }
42282
42283                   // Move matched elements from seed to results to keep them
42284                   // synchronized
42285                   i = matcherOut.length;
42286                   while (i--) {
42287                     if ((elem = matcherOut[i]) &&
42288                       (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) {
42289
42290                       seed[temp] = !(results[temp] = elem);
42291                     }
42292                   }
42293                 }
42294
42295                 // Add elements to results, through postFinder if defined
42296               } else {
42297                 matcherOut = condense(
42298                   matcherOut === results ?
42299                   matcherOut.splice(preexisting, matcherOut.length) :
42300                   matcherOut
42301                 );
42302                 if (postFinder) {
42303                   postFinder(null, results, matcherOut, xml);
42304                 } else {
42305                   push.apply(results, matcherOut);
42306                 }
42307               }
42308             });
42309           }
42310
42311           function matcherFromTokens(tokens) {
42312             var checkContext, matcher, j,
42313               len = tokens.length,
42314               leadingRelative = Expr.relative[tokens[0].type],
42315               implicitRelative = leadingRelative || Expr.relative[" "],
42316               i = leadingRelative ? 1 : 0,
42317
42318               // The foundational matcher ensures that elements are reachable from
42319               // top-level context(s)
42320               matchContext = addCombinator(function(elem) {
42321                 return elem === checkContext;
42322               }, implicitRelative, true),
42323               matchAnyContext = addCombinator(function(elem) {
42324                 return indexOf(checkContext, elem) > -1;
42325               }, implicitRelative, true),
42326               matchers = [function(elem, context, xml) {
42327                 var ret = (!leadingRelative && (xml || context !== outermostContext)) || (
42328                   (checkContext = context).nodeType ?
42329                   matchContext(elem, context, xml) :
42330                   matchAnyContext(elem, context, xml));
42331                 // Avoid hanging onto element (issue #299)
42332                 checkContext = null;
42333                 return ret;
42334               }];
42335
42336             for (; i < len; i++) {
42337               if ((matcher = Expr.relative[tokens[i].type])) {
42338                 matchers = [addCombinator(elementMatcher(matchers), matcher)];
42339               } else {
42340                 matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
42341
42342                 // Return special upon seeing a positional matcher
42343                 if (matcher[expando]) {
42344                   // Find the next relative operator (if any) for proper handling
42345                   j = ++i;
42346                   for (; j < len; j++) {
42347                     if (Expr.relative[tokens[j].type]) {
42348                       break;
42349                     }
42350                   }
42351                   return setMatcher(
42352                     i > 1 && elementMatcher(matchers),
42353                     i > 1 && toSelector(
42354                       // If the preceding token was a descendant combinator,
42355                       // insert an implicit any-element `*`
42356                       tokens.slice(0, i - 1).concat({
42357                         value: tokens[i - 2].type === " " ? "*" : ""
42358                       })
42359                     ).replace(rtrim, "$1"),
42360                     matcher,
42361                     i < j && matcherFromTokens(tokens.slice(i, j)),
42362                     j < len && matcherFromTokens((tokens = tokens.slice(j))),
42363                     j < len && toSelector(tokens)
42364                   );
42365                 }
42366                 matchers.push(matcher);
42367               }
42368             }
42369
42370             return elementMatcher(matchers);
42371           }
42372
42373           function matcherFromGroupMatchers(elementMatchers, setMatchers) {
42374             var bySet = setMatchers.length > 0,
42375               byElement = elementMatchers.length > 0,
42376               superMatcher = function(seed, context, xml, results, outermost) {
42377                 var elem, j, matcher,
42378                   matchedCount = 0,
42379                   i = "0",
42380                   unmatched = seed && [],
42381                   setMatched = [],
42382                   contextBackup = outermostContext,
42383                   // We must always have either seed elements or outermost context
42384                   elems = seed || byElement && Expr.find["TAG"]("*", outermost),
42385                   // Use integer dirruns iff this is the outermost matcher
42386                   dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
42387                   len = elems.length;
42388
42389                 if (outermost) {
42390                   outermostContext = context !== document && context;
42391                 }
42392
42393                 // Add elements passing elementMatchers directly to results
42394                 // Keep `i` a string if there are no elements so `matchedCount` will
42395                 // be "00" below
42396                 // Support: IE<9, Safari
42397                 // Tolerate NodeList properties (IE: "length"; Safari: <number>)
42398                 // matching elements by id
42399                 for (; i !== len && (elem = elems[i]) != null; i++) {
42400                   if (byElement && elem) {
42401                     j = 0;
42402                     while ((matcher = elementMatchers[j++])) {
42403                       if (matcher(elem, context, xml)) {
42404                         results.push(elem);
42405                         break;
42406                       }
42407                     }
42408                     if (outermost) {
42409                       dirruns = dirrunsUnique;
42410                     }
42411                   }
42412
42413                   // Track unmatched elements for set filters
42414                   if (bySet) {
42415                     // They will have gone through all possible matchers
42416                     if ((elem = !matcher && elem)) {
42417                       matchedCount--;
42418                     }
42419
42420                     // Lengthen the array for every element, matched or not
42421                     if (seed) {
42422                       unmatched.push(elem);
42423                     }
42424                   }
42425                 }
42426
42427                 // Apply set filters to unmatched elements
42428                 matchedCount += i;
42429                 if (bySet && i !== matchedCount) {
42430                   j = 0;
42431                   while ((matcher = setMatchers[j++])) {
42432                     matcher(unmatched, setMatched, context, xml);
42433                   }
42434
42435                   if (seed) {
42436                     // Reintegrate element matches to eliminate the need for
42437                     // sorting
42438                     if (matchedCount > 0) {
42439                       while (i--) {
42440                         if (!(unmatched[i] || setMatched[i])) {
42441                           setMatched[i] = pop.call(results);
42442                         }
42443                       }
42444                     }
42445
42446                     // Discard index placeholder values to get only actual
42447                     // matches
42448                     setMatched = condense(setMatched);
42449                   }
42450
42451                   // Add matches to results
42452                   push.apply(results, setMatched);
42453
42454                   // Seedless set matches succeeding multiple successful matchers
42455                   // stipulate sorting
42456                   if (outermost && !seed && setMatched.length > 0 &&
42457                     (matchedCount + setMatchers.length) > 1) {
42458
42459                     Sizzle.uniqueSort(results);
42460                   }
42461                 }
42462
42463                 // Override manipulation of globals by nested matchers
42464                 if (outermost) {
42465                   dirruns = dirrunsUnique;
42466                   outermostContext = contextBackup;
42467                 }
42468
42469                 return unmatched;
42470               };
42471
42472             return bySet ?
42473               markFunction(superMatcher) :
42474               superMatcher;
42475           }
42476
42477           compile = Sizzle.compile = function(selector, match /* Internal Use Only */ ) {
42478             var i,
42479               setMatchers = [],
42480               elementMatchers = [],
42481               cached = compilerCache[selector + " "];
42482
42483             if (!cached) {
42484               // Generate a function of recursive functions that can be used to check
42485               // each element
42486               if (!match) {
42487                 match = tokenize(selector);
42488               }
42489               i = match.length;
42490               while (i--) {
42491                 cached = matcherFromTokens(match[i]);
42492                 if (cached[expando]) {
42493                   setMatchers.push(cached);
42494                 } else {
42495                   elementMatchers.push(cached);
42496                 }
42497               }
42498
42499               // Cache the compiled function
42500               cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
42501
42502               // Save selector and tokenization
42503               cached.selector = selector;
42504             }
42505             return cached;
42506           };
42507
42508           /**
42509            * A low-level selection function that works with Sizzle's compiled selector
42510            * functions
42511            *
42512            * @param {String|Function}
42513            *            selector A selector or a pre-compiled selector function built with
42514            *            Sizzle.compile
42515            * @param {Element}
42516            *            context
42517            * @param {Array}
42518            *            [results]
42519            * @param {Array}
42520            *            [seed] A set of elements to match against
42521            */
42522           select = Sizzle.select = function(selector, context, results, seed) {
42523             var i, tokens, token, type, find,
42524               compiled = typeof selector === "function" && selector,
42525               match = !seed && tokenize((selector = compiled.selector || selector));
42526
42527             results = results || [];
42528
42529             // Try to minimize operations if there is no seed and only one group
42530             if (match.length === 1) {
42531
42532               // Take a shortcut and set the context if the root selector is an ID
42533               tokens = match[0] = match[0].slice(0);
42534               if (tokens.length > 2 && (token = tokens[0]).type === "ID" &&
42535                 support.getById && context.nodeType === 9 && documentIsHTML &&
42536                 Expr.relative[tokens[1].type]) {
42537
42538                 context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0];
42539                 if (!context) {
42540                   return results;
42541
42542                   // Precompiled matchers will still verify ancestry, so step up a
42543                   // level
42544                 } else if (compiled) {
42545                   context = context.parentNode;
42546                 }
42547
42548                 selector = selector.slice(tokens.shift().value.length);
42549               }
42550
42551               // Fetch a seed set for right-to-left matching
42552               i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
42553               while (i--) {
42554                 token = tokens[i];
42555
42556                 // Abort if we hit a combinator
42557                 if (Expr.relative[(type = token.type)]) {
42558                   break;
42559                 }
42560                 if ((find = Expr.find[type])) {
42561                   // Search, expanding context for leading sibling combinators
42562                   if ((seed = find(
42563                       token.matches[0].replace(runescape, funescape),
42564                       rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
42565                     ))) {
42566
42567                     // If seed is empty or no tokens remain, we can return early
42568                     tokens.splice(i, 1);
42569                     selector = seed.length && toSelector(tokens);
42570                     if (!selector) {
42571                       push.apply(results, seed);
42572                       return results;
42573                     }
42574
42575                     break;
42576                   }
42577                 }
42578               }
42579             }
42580
42581             // Compile and execute a filtering function if one is not provided
42582             // Provide `match` to avoid retokenization if we modified the selector above
42583             (compiled || compile(selector, match))(
42584               seed,
42585               context, !documentIsHTML,
42586               results,
42587               rsibling.test(selector) && testContext(context.parentNode) || context
42588             );
42589             return results;
42590           };
42591
42592           // One-time assignments
42593
42594           // Sort stability
42595           support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
42596
42597           // Support: Chrome 14-35+
42598           // Always assume duplicates if they aren't passed to the comparison function
42599           support.detectDuplicates = !!hasDuplicate;
42600
42601           // Initialize against the default document
42602           setDocument();
42603
42604           // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
42605           // Detached nodes confoundingly follow *each other*
42606           support.sortDetached = assert(function(div1) {
42607             // Should return 1, but returns 4 (following)
42608             return div1.compareDocumentPosition(document.createElement("div")) & 1;
42609           });
42610
42611           // Support: IE<8
42612           // Prevent attribute/property "interpolation"
42613           // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
42614           if (!assert(function(div) {
42615               div.innerHTML = "<a href='#'></a>";
42616               return div.firstChild.getAttribute("href") === "#";
42617             })) {
42618             addHandle("type|href|height|width", function(elem, name, isXML) {
42619               if (!isXML) {
42620                 return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2);
42621               }
42622             });
42623           }
42624
42625           // Support: IE<9
42626           // Use defaultValue in place of getAttribute("value")
42627           if (!support.attributes || !assert(function(div) {
42628               div.innerHTML = "<input/>";
42629               div.firstChild.setAttribute("value", "");
42630               return div.firstChild.getAttribute("value") === "";
42631             })) {
42632             addHandle("value", function(elem, name, isXML) {
42633               if (!isXML && elem.nodeName.toLowerCase() === "input") {
42634                 return elem.defaultValue;
42635               }
42636             });
42637           }
42638
42639           // Support: IE<9
42640           // Use getAttributeNode to fetch booleans when getAttribute lies
42641           if (!assert(function(div) {
42642               return div.getAttribute("disabled") == null;
42643             })) {
42644             addHandle(booleans, function(elem, name, isXML) {
42645               var val;
42646               if (!isXML) {
42647                 return elem[name] === true ? name.toLowerCase() :
42648                   (val = elem.getAttributeNode(name)) && val.specified ?
42649                   val.value :
42650                   null;
42651               }
42652             });
42653           }
42654
42655           return Sizzle;
42656
42657         })(window);
42658
42659
42660
42661       jQuery.find = Sizzle;
42662       jQuery.expr = Sizzle.selectors;
42663       jQuery.expr[":"] = jQuery.expr.pseudos;
42664       jQuery.unique = Sizzle.uniqueSort;
42665       jQuery.text = Sizzle.getText;
42666       jQuery.isXMLDoc = Sizzle.isXML;
42667       jQuery.contains = Sizzle.contains;
42668
42669
42670
42671       var rneedsContext = jQuery.expr.match.needsContext;
42672
42673       var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
42674
42675
42676
42677       var risSimple = /^.[^:#\[\.,]*$/;
42678
42679       // Implement the identical functionality for filter and not
42680       function winnow(elements, qualifier, not) {
42681         if (jQuery.isFunction(qualifier)) {
42682           return jQuery.grep(elements, function(elem, i) {
42683             /* jshint -W018 */
42684             return !!qualifier.call(elem, i, elem) !== not;
42685           });
42686
42687         }
42688
42689         if (qualifier.nodeType) {
42690           return jQuery.grep(elements, function(elem) {
42691             return (elem === qualifier) !== not;
42692           });
42693
42694         }
42695
42696         if (typeof qualifier === "string") {
42697           if (risSimple.test(qualifier)) {
42698             return jQuery.filter(qualifier, elements, not);
42699           }
42700
42701           qualifier = jQuery.filter(qualifier, elements);
42702         }
42703
42704         return jQuery.grep(elements, function(elem) {
42705           return (indexOf.call(qualifier, elem) >= 0) !== not;
42706         });
42707       }
42708
42709       jQuery.filter = function(expr, elems, not) {
42710         var elem = elems[0];
42711
42712         if (not) {
42713           expr = ":not(" + expr + ")";
42714         }
42715
42716         return elems.length === 1 && elem.nodeType === 1 ?
42717           jQuery.find.matchesSelector(elem, expr) ? [elem] : [] :
42718           jQuery.find.matches(expr, jQuery.grep(elems, function(elem) {
42719             return elem.nodeType === 1;
42720           }));
42721       };
42722
42723       jQuery.fn.extend({
42724         find: function(selector) {
42725           var i,
42726             len = this.length,
42727             ret = [],
42728             self = this;
42729
42730           if (typeof selector !== "string") {
42731             return this.pushStack(jQuery(selector).filter(function() {
42732               for (i = 0; i < len; i++) {
42733                 if (jQuery.contains(self[i], this)) {
42734                   return true;
42735                 }
42736               }
42737             }));
42738           }
42739
42740           for (i = 0; i < len; i++) {
42741             jQuery.find(selector, self[i], ret);
42742           }
42743
42744           // Needed because $( selector, context ) becomes $( context ).find(
42745           // selector )
42746           ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);
42747           ret.selector = this.selector ? this.selector + " " + selector : selector;
42748           return ret;
42749         },
42750         filter: function(selector) {
42751           return this.pushStack(winnow(this, selector || [], false));
42752         },
42753         not: function(selector) {
42754           return this.pushStack(winnow(this, selector || [], true));
42755         },
42756         is: function(selector) {
42757           return !!winnow(
42758             this,
42759
42760             // If this is a positional/relative selector, check membership in
42761             // the returned set
42762             // so $("p:first").is("p:last") won't return true for a doc with two
42763             // "p".
42764             typeof selector === "string" && rneedsContext.test(selector) ?
42765             jQuery(selector) :
42766             selector || [],
42767             false
42768           ).length;
42769         }
42770       });
42771
42772
42773       // Initialize a jQuery object
42774
42775
42776       // A central reference to the root jQuery(document)
42777       var rootjQuery,
42778
42779         // A simple way to check for HTML strings
42780         // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
42781         // Strict HTML recognition (#11290: must start with <)
42782         rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
42783
42784         init = jQuery.fn.init = function(selector, context) {
42785           var match, elem;
42786
42787           // HANDLE: $(""), $(null), $(undefined), $(false)
42788           if (!selector) {
42789             return this;
42790           }
42791
42792           // Handle HTML strings
42793           if (typeof selector === "string") {
42794             if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
42795               // Assume that strings that start and end with <> are HTML and
42796               // skip the regex check
42797               match = [null, selector, null];
42798
42799             } else {
42800               match = rquickExpr.exec(selector);
42801             }
42802
42803             // Match html or make sure no context is specified for #id
42804             if (match && (match[1] || !context)) {
42805
42806               // HANDLE: $(html) -> $(array)
42807               if (match[1]) {
42808                 context = context instanceof jQuery ? context[0] : context;
42809
42810                 // Option to run scripts is true for back-compat
42811                 // Intentionally let the error be thrown if parseHTML is not
42812                 // present
42813                 jQuery.merge(this, jQuery.parseHTML(
42814                   match[1],
42815                   context && context.nodeType ? context.ownerDocument || context : document,
42816                   true
42817                 ));
42818
42819                 // HANDLE: $(html, props)
42820                 if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
42821                   for (match in context) {
42822                     // Properties of context are called as methods if
42823                     // possible
42824                     if (jQuery.isFunction(this[match])) {
42825                       this[match](context[match]);
42826
42827                       // ...and otherwise set as attributes
42828                     } else {
42829                       this.attr(match, context[match]);
42830                     }
42831                   }
42832                 }
42833
42834                 return this;
42835
42836                 // HANDLE: $(#id)
42837               } else {
42838                 elem = document.getElementById(match[2]);
42839
42840                 // Support: Blackberry 4.6
42841                 // gEBID returns nodes no longer in the document (#6963)
42842                 if (elem && elem.parentNode) {
42843                   // Inject the element directly into the jQuery object
42844                   this.length = 1;
42845                   this[0] = elem;
42846                 }
42847
42848                 this.context = document;
42849                 this.selector = selector;
42850                 return this;
42851               }
42852
42853               // HANDLE: $(expr, $(...))
42854             } else if (!context || context.jquery) {
42855               return (context || rootjQuery).find(selector);
42856
42857               // HANDLE: $(expr, context)
42858               // (which is just equivalent to: $(context).find(expr)
42859             } else {
42860               return this.constructor(context).find(selector);
42861             }
42862
42863             // HANDLE: $(DOMElement)
42864           } else if (selector.nodeType) {
42865             this.context = this[0] = selector;
42866             this.length = 1;
42867             return this;
42868
42869             // HANDLE: $(function)
42870             // Shortcut for document ready
42871           } else if (jQuery.isFunction(selector)) {
42872             return typeof rootjQuery.ready !== "undefined" ?
42873               rootjQuery.ready(selector) :
42874               // Execute immediately if ready is not present
42875               selector(jQuery);
42876           }
42877
42878           if (selector.selector !== undefined) {
42879             this.selector = selector.selector;
42880             this.context = selector.context;
42881           }
42882
42883           return jQuery.makeArray(selector, this);
42884         };
42885
42886       // Give the init function the jQuery prototype for later instantiation
42887       init.prototype = jQuery.fn;
42888
42889       // Initialize central reference
42890       rootjQuery = jQuery(document);
42891
42892
42893       var rparentsprev = /^(?:parents|prev(?:Until|All))/,
42894         // Methods guaranteed to produce a unique set when starting from a unique
42895         // set
42896         guaranteedUnique = {
42897           children: true,
42898           contents: true,
42899           next: true,
42900           prev: true
42901         };
42902
42903       jQuery.extend({
42904         dir: function(elem, dir, until) {
42905           var matched = [],
42906             truncate = until !== undefined;
42907
42908           while ((elem = elem[dir]) && elem.nodeType !== 9) {
42909             if (elem.nodeType === 1) {
42910               if (truncate && jQuery(elem).is(until)) {
42911                 break;
42912               }
42913               matched.push(elem);
42914             }
42915           }
42916           return matched;
42917         },
42918
42919         sibling: function(n, elem) {
42920           var matched = [];
42921
42922           for (; n; n = n.nextSibling) {
42923             if (n.nodeType === 1 && n !== elem) {
42924               matched.push(n);
42925             }
42926           }
42927
42928           return matched;
42929         }
42930       });
42931
42932       jQuery.fn.extend({
42933         has: function(target) {
42934           var targets = jQuery(target, this),
42935             l = targets.length;
42936
42937           return this.filter(function() {
42938             var i = 0;
42939             for (; i < l; i++) {
42940               if (jQuery.contains(this, targets[i])) {
42941                 return true;
42942               }
42943             }
42944           });
42945         },
42946
42947         closest: function(selectors, context) {
42948           var cur,
42949             i = 0,
42950             l = this.length,
42951             matched = [],
42952             pos = rneedsContext.test(selectors) || typeof selectors !== "string" ?
42953             jQuery(selectors, context || this.context) :
42954             0;
42955
42956           for (; i < l; i++) {
42957             for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
42958               // Always skip document fragments
42959               if (cur.nodeType < 11 && (pos ?
42960                   pos.index(cur) > -1 :
42961
42962                   // Don't pass non-elements to Sizzle
42963                   cur.nodeType === 1 &&
42964                   jQuery.find.matchesSelector(cur, selectors))) {
42965
42966                 matched.push(cur);
42967                 break;
42968               }
42969             }
42970           }
42971
42972           return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched);
42973         },
42974
42975         // Determine the position of an element within the set
42976         index: function(elem) {
42977
42978           // No argument, return index in parent
42979           if (!elem) {
42980             return (this[0] && this[0].parentNode) ? this.first().prevAll().length : -1;
42981           }
42982
42983           // Index in selector
42984           if (typeof elem === "string") {
42985             return indexOf.call(jQuery(elem), this[0]);
42986           }
42987
42988           // Locate the position of the desired element
42989           return indexOf.call(this,
42990
42991             // If it receives a jQuery object, the first element is used
42992             elem.jquery ? elem[0] : elem
42993           );
42994         },
42995
42996         add: function(selector, context) {
42997           return this.pushStack(
42998             jQuery.unique(
42999               jQuery.merge(this.get(), jQuery(selector, context))
43000             )
43001           );
43002         },
43003
43004         addBack: function(selector) {
43005           return this.add(selector == null ?
43006             this.prevObject : this.prevObject.filter(selector)
43007           );
43008         }
43009       });
43010
43011       function sibling(cur, dir) {
43012         while ((cur = cur[dir]) && cur.nodeType !== 1) {}
43013         return cur;
43014       }
43015
43016       jQuery.each({
43017         parent: function(elem) {
43018           var parent = elem.parentNode;
43019           return parent && parent.nodeType !== 11 ? parent : null;
43020         },
43021         parents: function(elem) {
43022           return jQuery.dir(elem, "parentNode");
43023         },
43024         parentsUntil: function(elem, i, until) {
43025           return jQuery.dir(elem, "parentNode", until);
43026         },
43027         next: function(elem) {
43028           return sibling(elem, "nextSibling");
43029         },
43030         prev: function(elem) {
43031           return sibling(elem, "previousSibling");
43032         },
43033         nextAll: function(elem) {
43034           return jQuery.dir(elem, "nextSibling");
43035         },
43036         prevAll: function(elem) {
43037           return jQuery.dir(elem, "previousSibling");
43038         },
43039         nextUntil: function(elem, i, until) {
43040           return jQuery.dir(elem, "nextSibling", until);
43041         },
43042         prevUntil: function(elem, i, until) {
43043           return jQuery.dir(elem, "previousSibling", until);
43044         },
43045         siblings: function(elem) {
43046           return jQuery.sibling((elem.parentNode || {}).firstChild, elem);
43047         },
43048         children: function(elem) {
43049           return jQuery.sibling(elem.firstChild);
43050         },
43051         contents: function(elem) {
43052           return elem.contentDocument || jQuery.merge([], elem.childNodes);
43053         }
43054       }, function(name, fn) {
43055         jQuery.fn[name] = function(until, selector) {
43056           var matched = jQuery.map(this, fn, until);
43057
43058           if (name.slice(-5) !== "Until") {
43059             selector = until;
43060           }
43061
43062           if (selector && typeof selector === "string") {
43063             matched = jQuery.filter(selector, matched);
43064           }
43065
43066           if (this.length > 1) {
43067             // Remove duplicates
43068             if (!guaranteedUnique[name]) {
43069               jQuery.unique(matched);
43070             }
43071
43072             // Reverse order for parents* and prev-derivatives
43073             if (rparentsprev.test(name)) {
43074               matched.reverse();
43075             }
43076           }
43077
43078           return this.pushStack(matched);
43079         };
43080       });
43081       var rnotwhite = (/\S+/g);
43082
43083
43084
43085       // String to Object options format cache
43086       var optionsCache = {};
43087
43088       // Convert String-formatted options into Object-formatted ones and store in
43089       // cache
43090       function createOptions(options) {
43091         var object = optionsCache[options] = {};
43092         jQuery.each(options.match(rnotwhite) || [], function(_, flag) {
43093           object[flag] = true;
43094         });
43095         return object;
43096       }
43097
43098       /*
43099        * Create a callback list using the following parameters:
43100        *
43101        * options: an optional list of space-separated options that will change how the
43102        * callback list behaves or a more traditional option object
43103        *
43104        * By default a callback list will act like an event callback list and can be
43105        * "fired" multiple times.
43106        *
43107        * Possible options:
43108        *
43109        * once: will ensure the callback list can only be fired once (like a Deferred)
43110        *
43111        * memory: will keep track of previous values and will call any callback added
43112        * after the list has been fired right away with the latest "memorized" values
43113        * (like a Deferred)
43114        *
43115        * unique: will ensure a callback can only be added once (no duplicate in the
43116        * list)
43117        *
43118        * stopOnFalse: interrupt callings when a callback returns false
43119        *
43120        */
43121       jQuery.Callbacks = function(options) {
43122
43123         // Convert options from String-formatted to Object-formatted if needed
43124         // (we check in cache first)
43125         options = typeof options === "string" ?
43126           (optionsCache[options] || createOptions(options)) :
43127           jQuery.extend({}, options);
43128
43129         var // Last fire value (for non-forgettable lists)
43130           memory,
43131           // Flag to know if list was already fired
43132           fired,
43133           // Flag to know if list is currently firing
43134           firing,
43135           // First callback to fire (used internally by add and fireWith)
43136           firingStart,
43137           // End of the loop when firing
43138           firingLength,
43139           // Index of currently firing callback (modified by remove if needed)
43140           firingIndex,
43141           // Actual callback list
43142           list = [],
43143           // Stack of fire calls for repeatable lists
43144           stack = !options.once && [],
43145           // Fire callbacks
43146           fire = function(data) {
43147             memory = options.memory && data;
43148             fired = true;
43149             firingIndex = firingStart || 0;
43150             firingStart = 0;
43151             firingLength = list.length;
43152             firing = true;
43153             for (; list && firingIndex < firingLength; firingIndex++) {
43154               if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
43155                 memory = false; // To prevent further calls using add
43156                 break;
43157               }
43158             }
43159             firing = false;
43160             if (list) {
43161               if (stack) {
43162                 if (stack.length) {
43163                   fire(stack.shift());
43164                 }
43165               } else if (memory) {
43166                 list = [];
43167               } else {
43168                 self.disable();
43169               }
43170             }
43171           },
43172           // Actual Callbacks object
43173           self = {
43174             // Add a callback or a collection of callbacks to the list
43175             add: function() {
43176               if (list) {
43177                 // First, we save the current length
43178                 var start = list.length;
43179                 (function add(args) {
43180                   jQuery.each(args, function(_, arg) {
43181                     var type = jQuery.type(arg);
43182                     if (type === "function") {
43183                       if (!options.unique || !self.has(arg)) {
43184                         list.push(arg);
43185                       }
43186                     } else if (arg && arg.length && type !== "string") {
43187                       // Inspect recursively
43188                       add(arg);
43189                     }
43190                   });
43191                 })(arguments);
43192                 // Do we need to add the callbacks to the
43193                 // current firing batch?
43194                 if (firing) {
43195                   firingLength = list.length;
43196                   // With memory, if we're not firing then
43197                   // we should call right away
43198                 } else if (memory) {
43199                   firingStart = start;
43200                   fire(memory);
43201                 }
43202               }
43203               return this;
43204             },
43205             // Remove a callback from the list
43206             remove: function() {
43207               if (list) {
43208                 jQuery.each(arguments, function(_, arg) {
43209                   var index;
43210                   while ((index = jQuery.inArray(arg, list, index)) > -1) {
43211                     list.splice(index, 1);
43212                     // Handle firing indexes
43213                     if (firing) {
43214                       if (index <= firingLength) {
43215                         firingLength--;
43216                       }
43217                       if (index <= firingIndex) {
43218                         firingIndex--;
43219                       }
43220                     }
43221                   }
43222                 });
43223               }
43224               return this;
43225             },
43226             // Check if a given callback is in the list.
43227             // If no argument is given, return whether or not list has callbacks
43228             // attached.
43229             has: function(fn) {
43230               return fn ? jQuery.inArray(fn, list) > -1 : !!(list && list.length);
43231             },
43232             // Remove all callbacks from the list
43233             empty: function() {
43234               list = [];
43235               firingLength = 0;
43236               return this;
43237             },
43238             // Have the list do nothing anymore
43239             disable: function() {
43240               list = stack = memory = undefined;
43241               return this;
43242             },
43243             // Is it disabled?
43244             disabled: function() {
43245               return !list;
43246             },
43247             // Lock the list in its current state
43248             lock: function() {
43249               stack = undefined;
43250               if (!memory) {
43251                 self.disable();
43252               }
43253               return this;
43254             },
43255             // Is it locked?
43256             locked: function() {
43257               return !stack;
43258             },
43259             // Call all callbacks with the given context and arguments
43260             fireWith: function(context, args) {
43261               if (list && (!fired || stack)) {
43262                 args = args || [];
43263                 args = [context, args.slice ? args.slice() : args];
43264                 if (firing) {
43265                   stack.push(args);
43266                 } else {
43267                   fire(args);
43268                 }
43269               }
43270               return this;
43271             },
43272             // Call all the callbacks with the given arguments
43273             fire: function() {
43274               self.fireWith(this, arguments);
43275               return this;
43276             },
43277             // To know if the callbacks have already been called at least once
43278             fired: function() {
43279               return !!fired;
43280             }
43281           };
43282
43283         return self;
43284       };
43285
43286
43287       jQuery.extend({
43288
43289         Deferred: function(func) {
43290           var tuples = [
43291               // action, add listener, listener list, final state
43292               ["resolve", "done", jQuery.Callbacks("once memory"), "resolved"],
43293               ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"],
43294               ["notify", "progress", jQuery.Callbacks("memory")]
43295             ],
43296             state = "pending",
43297             promise = {
43298               state: function() {
43299                 return state;
43300               },
43301               always: function() {
43302                 deferred.done(arguments).fail(arguments);
43303                 return this;
43304               },
43305               then: function( /* fnDone, fnFail, fnProgress */ ) {
43306                 var fns = arguments;
43307                 return jQuery.Deferred(function(newDefer) {
43308                   jQuery.each(tuples, function(i, tuple) {
43309                     var fn = jQuery.isFunction(fns[i]) && fns[i];
43310                     // deferred[ done | fail | progress ] for forwarding
43311                     // actions to newDefer
43312                     deferred[tuple[1]](function() {
43313                       var returned = fn && fn.apply(this, arguments);
43314                       if (returned && jQuery.isFunction(returned.promise)) {
43315                         returned.promise()
43316                           .done(newDefer.resolve)
43317                           .fail(newDefer.reject)
43318                           .progress(newDefer.notify);
43319                       } else {
43320                         newDefer[tuple[0] + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);
43321                       }
43322                     });
43323                   });
43324                   fns = null;
43325                 }).promise();
43326               },
43327               // Get a promise for this deferred
43328               // If obj is provided, the promise aspect is added to the object
43329               promise: function(obj) {
43330                 return obj != null ? jQuery.extend(obj, promise) : promise;
43331               }
43332             },
43333             deferred = {};
43334
43335           // Keep pipe for back-compat
43336           promise.pipe = promise.then;
43337
43338           // Add list-specific methods
43339           jQuery.each(tuples, function(i, tuple) {
43340             var list = tuple[2],
43341               stateString = tuple[3];
43342
43343             // promise[ done | fail | progress ] = list.add
43344             promise[tuple[1]] = list.add;
43345
43346             // Handle state
43347             if (stateString) {
43348               list.add(function() {
43349                 // state = [ resolved | rejected ]
43350                 state = stateString;
43351
43352                 // [ reject_list | resolve_list ].disable; progress_list.lock
43353               }, tuples[i ^ 1][2].disable, tuples[2][2].lock);
43354             }
43355
43356             // deferred[ resolve | reject | notify ]
43357             deferred[tuple[0]] = function() {
43358               deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments);
43359               return this;
43360             };
43361             deferred[tuple[0] + "With"] = list.fireWith;
43362           });
43363
43364           // Make the deferred a promise
43365           promise.promise(deferred);
43366
43367           // Call given func if any
43368           if (func) {
43369             func.call(deferred, deferred);
43370           }
43371
43372           // All done!
43373           return deferred;
43374         },
43375
43376         // Deferred helper
43377         when: function(subordinate /* , ..., subordinateN */ ) {
43378           var i = 0,
43379             resolveValues = slice.call(arguments),
43380             length = resolveValues.length,
43381
43382             // the count of uncompleted subordinates
43383             remaining = length !== 1 || (subordinate && jQuery.isFunction(subordinate.promise)) ? length : 0,
43384
43385             // the master Deferred. If resolveValues consist of only a single
43386             // Deferred, just use that.
43387             deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
43388
43389             // Update function for both resolve and progress values
43390             updateFunc = function(i, contexts, values) {
43391               return function(value) {
43392                 contexts[i] = this;
43393                 values[i] = arguments.length > 1 ? slice.call(arguments) : value;
43394                 if (values === progressValues) {
43395                   deferred.notifyWith(contexts, values);
43396                 } else if (!(--remaining)) {
43397                   deferred.resolveWith(contexts, values);
43398                 }
43399               };
43400             },
43401
43402             progressValues, progressContexts, resolveContexts;
43403
43404           // Add listeners to Deferred subordinates; treat others as resolved
43405           if (length > 1) {
43406             progressValues = new Array(length);
43407             progressContexts = new Array(length);
43408             resolveContexts = new Array(length);
43409             for (; i < length; i++) {
43410               if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
43411                 resolveValues[i].promise()
43412                   .done(updateFunc(i, resolveContexts, resolveValues))
43413                   .fail(deferred.reject)
43414                   .progress(updateFunc(i, progressContexts, progressValues));
43415               } else {
43416                 --remaining;
43417               }
43418             }
43419           }
43420
43421           // If we're not waiting on anything, resolve the master
43422           if (!remaining) {
43423             deferred.resolveWith(resolveContexts, resolveValues);
43424           }
43425
43426           return deferred.promise();
43427         }
43428       });
43429
43430
43431       // The deferred used on DOM ready
43432       var readyList;
43433
43434       jQuery.fn.ready = function(fn) {
43435         // Add the callback
43436         jQuery.ready.promise().done(fn);
43437
43438         return this;
43439       };
43440
43441       jQuery.extend({
43442         // Is the DOM ready to be used? Set to true once it occurs.
43443         isReady: false,
43444
43445         // A counter to track how many items to wait for before
43446         // the ready event fires. See #6781
43447         readyWait: 1,
43448
43449         // Hold (or release) the ready event
43450         holdReady: function(hold) {
43451           if (hold) {
43452             jQuery.readyWait++;
43453           } else {
43454             jQuery.ready(true);
43455           }
43456         },
43457
43458         // Handle when the DOM is ready
43459         ready: function(wait) {
43460
43461           // Abort if there are pending holds or we're already ready
43462           if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
43463             return;
43464           }
43465
43466           // Remember that the DOM is ready
43467           jQuery.isReady = true;
43468
43469           // If a normal DOM Ready event fired, decrement, and wait if need be
43470           if (wait !== true && --jQuery.readyWait > 0) {
43471             return;
43472           }
43473
43474           // If there are functions bound, to execute
43475           readyList.resolveWith(document, [jQuery]);
43476
43477           // Trigger any bound ready events
43478           if (jQuery.fn.triggerHandler) {
43479             jQuery(document).triggerHandler("ready");
43480             jQuery(document).off("ready");
43481           }
43482         }
43483       });
43484
43485       /**
43486        * The ready event handler and self cleanup method
43487        */
43488       function completed() {
43489         document.removeEventListener("DOMContentLoaded", completed, false);
43490         window.removeEventListener("load", completed, false);
43491         jQuery.ready();
43492       }
43493
43494       jQuery.ready.promise = function(obj) {
43495         if (!readyList) {
43496
43497           readyList = jQuery.Deferred();
43498
43499           // Catch cases where $(document).ready() is called after the browser
43500           // event has already occurred.
43501           // We once tried to use readyState "interactive" here, but it caused
43502           // issues like the one
43503           // discovered by ChrisS here:
43504           // http://bugs.jquery.com/ticket/12282#comment:15
43505           if (document.readyState === "complete") {
43506             // Handle it asynchronously to allow scripts the opportunity to
43507             // delay ready
43508             setTimeout(jQuery.ready);
43509
43510           } else {
43511
43512             // Use the handy event callback
43513             document.addEventListener("DOMContentLoaded", completed, false);
43514
43515             // A fallback to window.onload, that will always work
43516             window.addEventListener("load", completed, false);
43517           }
43518         }
43519         return readyList.promise(obj);
43520       };
43521
43522       // Kick off the DOM ready check even if the user does not
43523       jQuery.ready.promise();
43524
43525
43526
43527
43528       // Multifunctional method to get and set values of a collection
43529       // The value/s can optionally be executed if it's a function
43530       var access = jQuery.access = function(elems, fn, key, value, chainable, emptyGet, raw) {
43531         var i = 0,
43532           len = elems.length,
43533           bulk = key == null;
43534
43535         // Sets many values
43536         if (jQuery.type(key) === "object") {
43537           chainable = true;
43538           for (i in key) {
43539             jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);
43540           }
43541
43542           // Sets one value
43543         } else if (value !== undefined) {
43544           chainable = true;
43545
43546           if (!jQuery.isFunction(value)) {
43547             raw = true;
43548           }
43549
43550           if (bulk) {
43551             // Bulk operations run against the entire set
43552             if (raw) {
43553               fn.call(elems, value);
43554               fn = null;
43555
43556               // ...except when executing function values
43557             } else {
43558               bulk = fn;
43559               fn = function(elem, key, value) {
43560                 return bulk.call(jQuery(elem), value);
43561               };
43562             }
43563           }
43564
43565           if (fn) {
43566             for (; i < len; i++) {
43567               fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
43568             }
43569           }
43570         }
43571
43572         return chainable ?
43573           elems :
43574
43575           // Gets
43576           bulk ?
43577           fn.call(elems) :
43578           len ? fn(elems[0], key) : emptyGet;
43579       };
43580
43581
43582       /**
43583        * Determines whether an object can have data
43584        */
43585       jQuery.acceptData = function(owner) {
43586         // Accepts only:
43587         // - Node
43588         // - Node.ELEMENT_NODE
43589         // - Node.DOCUMENT_NODE
43590         // - Object
43591         // - Any
43592         /* jshint -W018 */
43593         return owner.nodeType === 1 || owner.nodeType === 9 || !(+owner.nodeType);
43594       };
43595
43596
43597       function Data() {
43598         // Support: Android<4,
43599         // Old WebKit does not have Object.preventExtensions/freeze method,
43600         // return new empty object instead with no [[set]] accessor
43601         Object.defineProperty(this.cache = {}, 0, {
43602           get: function() {
43603             return {};
43604           }
43605         });
43606
43607         this.expando = jQuery.expando + Data.uid++;
43608       }
43609
43610       Data.uid = 1;
43611       Data.accepts = jQuery.acceptData;
43612
43613       Data.prototype = {
43614         key: function(owner) {
43615           // We can accept data for non-element nodes in modern browsers,
43616           // but we should not, see #8335.
43617           // Always return the key for a frozen object.
43618           if (!Data.accepts(owner)) {
43619             return 0;
43620           }
43621
43622           var descriptor = {},
43623             // Check if the owner object already has a cache key
43624             unlock = owner[this.expando];
43625
43626           // If not, create one
43627           if (!unlock) {
43628             unlock = Data.uid++;
43629
43630             // Secure it in a non-enumerable, non-writable property
43631             try {
43632               descriptor[this.expando] = {
43633                 value: unlock
43634               };
43635               Object.defineProperties(owner, descriptor);
43636
43637               // Support: Android<4
43638               // Fallback to a less secure definition
43639             } catch (e) {
43640               descriptor[this.expando] = unlock;
43641               jQuery.extend(owner, descriptor);
43642             }
43643           }
43644
43645           // Ensure the cache object
43646           if (!this.cache[unlock]) {
43647             this.cache[unlock] = {};
43648           }
43649
43650           return unlock;
43651         },
43652         set: function(owner, data, value) {
43653           var prop,
43654             // There may be an unlock assigned to this node,
43655             // if there is no entry for this "owner", create one inline
43656             // and set the unlock as though an owner entry had always existed
43657             unlock = this.key(owner),
43658             cache = this.cache[unlock];
43659
43660           // Handle: [ owner, key, value ] args
43661           if (typeof data === "string") {
43662             cache[data] = value;
43663
43664             // Handle: [ owner, { properties } ] args
43665           } else {
43666             // Fresh assignments by object are shallow copied
43667             if (jQuery.isEmptyObject(cache)) {
43668               jQuery.extend(this.cache[unlock], data);
43669               // Otherwise, copy the properties one-by-one to the cache object
43670             } else {
43671               for (prop in data) {
43672                 cache[prop] = data[prop];
43673               }
43674             }
43675           }
43676           return cache;
43677         },
43678         get: function(owner, key) {
43679           // Either a valid cache is found, or will be created.
43680           // New caches will be created and the unlock returned,
43681           // allowing direct access to the newly created
43682           // empty data object. A valid owner object must be provided.
43683           var cache = this.cache[this.key(owner)];
43684
43685           return key === undefined ?
43686             cache : cache[key];
43687         },
43688         access: function(owner, key, value) {
43689           var stored;
43690           // In cases where either:
43691           //
43692           // 1. No key was specified
43693           // 2. A string key was specified, but no value provided
43694           //
43695           // Take the "read" path and allow the get method to determine
43696           // which value to return, respectively either:
43697           //
43698           // 1. The entire cache object
43699           // 2. The data stored at the key
43700           //
43701           if (key === undefined ||
43702             ((key && typeof key === "string") && value === undefined)) {
43703
43704             stored = this.get(owner, key);
43705
43706             return stored !== undefined ?
43707               stored : this.get(owner, jQuery.camelCase(key));
43708           }
43709
43710           // [*]When the key is not a string, or both a key and value
43711           // are specified, set or extend (existing objects) with either:
43712           //
43713           // 1. An object of properties
43714           // 2. A key and value
43715           //
43716           this.set(owner, key, value);
43717
43718           // Since the "set" path can have two possible entry points
43719           // return the expected data based on which path was taken[*]
43720           return value !== undefined ? value : key;
43721         },
43722         remove: function(owner, key) {
43723           var i, name, camel,
43724             unlock = this.key(owner),
43725             cache = this.cache[unlock];
43726
43727           if (key === undefined) {
43728             this.cache[unlock] = {};
43729
43730           } else {
43731             // Support array or space separated string of keys
43732             if (jQuery.isArray(key)) {
43733               // If "name" is an array of keys...
43734               // When data is initially created, via ("key", "val") signature,
43735               // keys will be converted to camelCase.
43736               // Since there is no way to tell _how_ a key was added, remove
43737               // both plain key and camelCase key. #12786
43738               // This will only penalize the array argument path.
43739               name = key.concat(key.map(jQuery.camelCase));
43740             } else {
43741               camel = jQuery.camelCase(key);
43742               // Try the string as a key before any manipulation
43743               if (key in cache) {
43744                 name = [key, camel];
43745               } else {
43746                 // If a key with the spaces exists, use it.
43747                 // Otherwise, create an array by matching non-whitespace
43748                 name = camel;
43749                 name = name in cache ? [name] : (name.match(rnotwhite) || []);
43750               }
43751             }
43752
43753             i = name.length;
43754             while (i--) {
43755               delete cache[name[i]];
43756             }
43757           }
43758         },
43759         hasData: function(owner) {
43760           return !jQuery.isEmptyObject(
43761             this.cache[owner[this.expando]] || {}
43762           );
43763         },
43764         discard: function(owner) {
43765           if (owner[this.expando]) {
43766             delete this.cache[owner[this.expando]];
43767           }
43768         }
43769       };
43770       var data_priv = new Data();
43771
43772       var data_user = new Data();
43773
43774
43775
43776       // Implementation Summary
43777       //
43778       // 1. Enforce API surface and semantic compatibility with 1.9.x branch
43779       // 2. Improve the module's maintainability by reducing the storage
43780       // paths to a single mechanism.
43781       // 3. Use the same single mechanism to support "private" and "user" data.
43782       // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
43783       // 5. Avoid exposing implementation details on user objects (eg. expando
43784       // properties)
43785       // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
43786
43787       var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
43788         rmultiDash = /([A-Z])/g;
43789
43790       function dataAttr(elem, key, data) {
43791         var name;
43792
43793         // If nothing was found internally, try to fetch any
43794         // data from the HTML5 data-* attribute
43795         if (data === undefined && elem.nodeType === 1) {
43796           name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase();
43797           data = elem.getAttribute(name);
43798
43799           if (typeof data === "string") {
43800             try {
43801               data = data === "true" ? true :
43802                 data === "false" ? false :
43803                 data === "null" ? null :
43804                 // Only convert to a number if it doesn't change the string
43805                 +data + "" === data ? +data :
43806                 rbrace.test(data) ? jQuery.parseJSON(data) :
43807                 data;
43808             } catch (e) {}
43809
43810             // Make sure we set the data so it isn't changed later
43811             data_user.set(elem, key, data);
43812           } else {
43813             data = undefined;
43814           }
43815         }
43816         return data;
43817       }
43818
43819       jQuery.extend({
43820         hasData: function(elem) {
43821           return data_user.hasData(elem) || data_priv.hasData(elem);
43822         },
43823
43824         data: function(elem, name, data) {
43825           return data_user.access(elem, name, data);
43826         },
43827
43828         removeData: function(elem, name) {
43829           data_user.remove(elem, name);
43830         },
43831
43832         // TODO: Now that all calls to _data and _removeData have been replaced
43833         // with direct calls to data_priv methods, these can be deprecated.
43834         _data: function(elem, name, data) {
43835           return data_priv.access(elem, name, data);
43836         },
43837
43838         _removeData: function(elem, name) {
43839           data_priv.remove(elem, name);
43840         }
43841       });
43842
43843       jQuery.fn.extend({
43844         data: function(key, value) {
43845           var i, name, data,
43846             elem = this[0],
43847             attrs = elem && elem.attributes;
43848
43849           // Gets all values
43850           if (key === undefined) {
43851             if (this.length) {
43852               data = data_user.get(elem);
43853
43854               if (elem.nodeType === 1 && !data_priv.get(elem, "hasDataAttrs")) {
43855                 i = attrs.length;
43856                 while (i--) {
43857
43858                   // Support: IE11+
43859                   // The attrs elements can be null (#14894)
43860                   if (attrs[i]) {
43861                     name = attrs[i].name;
43862                     if (name.indexOf("data-") === 0) {
43863                       name = jQuery.camelCase(name.slice(5));
43864                       dataAttr(elem, name, data[name]);
43865                     }
43866                   }
43867                 }
43868                 data_priv.set(elem, "hasDataAttrs", true);
43869               }
43870             }
43871
43872             return data;
43873           }
43874
43875           // Sets multiple values
43876           if (typeof key === "object") {
43877             return this.each(function() {
43878               data_user.set(this, key);
43879             });
43880           }
43881
43882           return access(this, function(value) {
43883             var data,
43884               camelKey = jQuery.camelCase(key);
43885
43886             // The calling jQuery object (element matches) is not empty
43887             // (and therefore has an element appears at this[ 0 ]) and the
43888             // `value` parameter was not undefined. An empty jQuery object
43889             // will result in `undefined` for elem = this[ 0 ] which will
43890             // throw an exception if an attempt to read a data cache is made.
43891             if (elem && value === undefined) {
43892               // Attempt to get data from the cache
43893               // with the key as-is
43894               data = data_user.get(elem, key);
43895               if (data !== undefined) {
43896                 return data;
43897               }
43898
43899               // Attempt to get data from the cache
43900               // with the key camelized
43901               data = data_user.get(elem, camelKey);
43902               if (data !== undefined) {
43903                 return data;
43904               }
43905
43906               // Attempt to "discover" the data in
43907               // HTML5 custom data-* attrs
43908               data = dataAttr(elem, camelKey, undefined);
43909               if (data !== undefined) {
43910                 return data;
43911               }
43912
43913               // We tried really hard, but the data doesn't exist.
43914               return;
43915             }
43916
43917             // Set the data...
43918             this.each(function() {
43919               // First, attempt to store a copy or reference of any
43920               // data that might've been store with a camelCased key.
43921               var data = data_user.get(this, camelKey);
43922
43923               // For HTML5 data-* attribute interop, we have to
43924               // store property names with dashes in a camelCase form.
43925               // This might not apply to all properties...*
43926               data_user.set(this, camelKey, value);
43927
43928               // *... In the case of properties that might _actually_
43929               // have dashes, we need to also store a copy of that
43930               // unchanged property.
43931               if (key.indexOf("-") !== -1 && data !== undefined) {
43932                 data_user.set(this, key, value);
43933               }
43934             });
43935           }, null, value, arguments.length > 1, null, true);
43936         },
43937
43938         removeData: function(key) {
43939           return this.each(function() {
43940             data_user.remove(this, key);
43941           });
43942         }
43943       });
43944
43945
43946       jQuery.extend({
43947         queue: function(elem, type, data) {
43948           var queue;
43949
43950           if (elem) {
43951             type = (type || "fx") + "queue";
43952             queue = data_priv.get(elem, type);
43953
43954             // Speed up dequeue by getting out quickly if this is just a lookup
43955             if (data) {
43956               if (!queue || jQuery.isArray(data)) {
43957                 queue = data_priv.access(elem, type, jQuery.makeArray(data));
43958               } else {
43959                 queue.push(data);
43960               }
43961             }
43962             return queue || [];
43963           }
43964         },
43965
43966         dequeue: function(elem, type) {
43967           type = type || "fx";
43968
43969           var queue = jQuery.queue(elem, type),
43970             startLength = queue.length,
43971             fn = queue.shift(),
43972             hooks = jQuery._queueHooks(elem, type),
43973             next = function() {
43974               jQuery.dequeue(elem, type);
43975             };
43976
43977           // If the fx queue is dequeued, always remove the progress sentinel
43978           if (fn === "inprogress") {
43979             fn = queue.shift();
43980             startLength--;
43981           }
43982
43983           if (fn) {
43984
43985             // Add a progress sentinel to prevent the fx queue from being
43986             // automatically dequeued
43987             if (type === "fx") {
43988               queue.unshift("inprogress");
43989             }
43990
43991             // Clear up the last queue stop function
43992             delete hooks.stop;
43993             fn.call(elem, next, hooks);
43994           }
43995
43996           if (!startLength && hooks) {
43997             hooks.empty.fire();
43998           }
43999         },
44000
44001         // Not public - generate a queueHooks object, or return the current one
44002         _queueHooks: function(elem, type) {
44003           var key = type + "queueHooks";
44004           return data_priv.get(elem, key) || data_priv.access(elem, key, {
44005             empty: jQuery.Callbacks("once memory").add(function() {
44006               data_priv.remove(elem, [type + "queue", key]);
44007             })
44008           });
44009         }
44010       });
44011
44012       jQuery.fn.extend({
44013         queue: function(type, data) {
44014           var setter = 2;
44015
44016           if (typeof type !== "string") {
44017             data = type;
44018             type = "fx";
44019             setter--;
44020           }
44021
44022           if (arguments.length < setter) {
44023             return jQuery.queue(this[0], type);
44024           }
44025
44026           return data === undefined ?
44027             this :
44028             this.each(function() {
44029               var queue = jQuery.queue(this, type, data);
44030
44031               // Ensure a hooks for this queue
44032               jQuery._queueHooks(this, type);
44033
44034               if (type === "fx" && queue[0] !== "inprogress") {
44035                 jQuery.dequeue(this, type);
44036               }
44037             });
44038         },
44039         dequeue: function(type) {
44040           return this.each(function() {
44041             jQuery.dequeue(this, type);
44042           });
44043         },
44044         clearQueue: function(type) {
44045           return this.queue(type || "fx", []);
44046         },
44047         // Get a promise resolved when queues of a certain type
44048         // are emptied (fx is the type by default)
44049         promise: function(type, obj) {
44050           var tmp,
44051             count = 1,
44052             defer = jQuery.Deferred(),
44053             elements = this,
44054             i = this.length,
44055             resolve = function() {
44056               if (!(--count)) {
44057                 defer.resolveWith(elements, [elements]);
44058               }
44059             };
44060
44061           if (typeof type !== "string") {
44062             obj = type;
44063             type = undefined;
44064           }
44065           type = type || "fx";
44066
44067           while (i--) {
44068             tmp = data_priv.get(elements[i], type + "queueHooks");
44069             if (tmp && tmp.empty) {
44070               count++;
44071               tmp.empty.add(resolve);
44072             }
44073           }
44074           resolve();
44075           return defer.promise(obj);
44076         }
44077       });
44078       var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
44079
44080       var cssExpand = ["Top", "Right", "Bottom", "Left"];
44081
44082       var isHidden = function(elem, el) {
44083         // isHidden might be called from jQuery#filter function;
44084         // in that case, element will be second argument
44085         elem = el || elem;
44086         return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem);
44087       };
44088
44089       var rcheckableType = (/^(?:checkbox|radio)$/i);
44090
44091
44092
44093       (function() {
44094         var fragment = document.createDocumentFragment(),
44095           div = fragment.appendChild(document.createElement("div")),
44096           input = document.createElement("input");
44097
44098         // Support: Safari<=5.1
44099         // Check state lost if the name is set (#11217)
44100         // Support: Windows Web Apps (WWA)
44101         // `name` and `type` must use .setAttribute for WWA (#14901)
44102         input.setAttribute("type", "radio");
44103         input.setAttribute("checked", "checked");
44104         input.setAttribute("name", "t");
44105
44106         div.appendChild(input);
44107
44108         // Support: Safari<=5.1, Android<4.2
44109         // Older WebKit doesn't clone checked state correctly in fragments
44110         support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
44111
44112         // Support: IE<=11+
44113         // Make sure textarea (and checkbox) defaultValue is properly cloned
44114         div.innerHTML = "<textarea>x</textarea>";
44115         support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
44116       })();
44117       var strundefined = typeof undefined;
44118
44119
44120
44121       support.focusinBubbles = "onfocusin" in window;
44122
44123
44124       var
44125         rkeyEvent = /^key/,
44126         rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
44127         rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
44128         rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
44129
44130       function returnTrue() {
44131         return true;
44132       }
44133
44134       function returnFalse() {
44135         return false;
44136       }
44137
44138       function safeActiveElement() {
44139         try {
44140           return document.activeElement;
44141         } catch (err) {}
44142       }
44143
44144       /*
44145        * Helper functions for managing events -- not part of the public interface.
44146        * Props to Dean Edwards' addEvent library for many of the ideas.
44147        */
44148       jQuery.event = {
44149
44150         global: {},
44151
44152         add: function(elem, types, handler, data, selector) {
44153
44154           var handleObjIn, eventHandle, tmp,
44155             events, t, handleObj,
44156             special, handlers, type, namespaces, origType,
44157             elemData = data_priv.get(elem);
44158
44159           // Don't attach events to noData or text/comment nodes (but allow plain
44160           // objects)
44161           if (!elemData) {
44162             return;
44163           }
44164
44165           // Caller can pass in an object of custom data in lieu of the handler
44166           if (handler.handler) {
44167             handleObjIn = handler;
44168             handler = handleObjIn.handler;
44169             selector = handleObjIn.selector;
44170           }
44171
44172           // Make sure that the handler has a unique ID, used to find/remove it
44173           // later
44174           if (!handler.guid) {
44175             handler.guid = jQuery.guid++;
44176           }
44177
44178           // Init the element's event structure and main handler, if this is the
44179           // first
44180           if (!(events = elemData.events)) {
44181             events = elemData.events = {};
44182           }
44183           if (!(eventHandle = elemData.handle)) {
44184             eventHandle = elemData.handle = function(e) {
44185               // Discard the second event of a jQuery.event.trigger() and
44186               // when an event is called after a page has unloaded
44187               return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
44188                 jQuery.event.dispatch.apply(elem, arguments) : undefined;
44189             };
44190           }
44191
44192           // Handle multiple events separated by a space
44193           types = (types || "").match(rnotwhite) || [""];
44194           t = types.length;
44195           while (t--) {
44196             tmp = rtypenamespace.exec(types[t]) || [];
44197             type = origType = tmp[1];
44198             namespaces = (tmp[2] || "").split(".").sort();
44199
44200             // There *must* be a type, no attaching namespace-only handlers
44201             if (!type) {
44202               continue;
44203             }
44204
44205             // If event changes its type, use the special event handlers for the
44206             // changed type
44207             special = jQuery.event.special[type] || {};
44208
44209             // If selector defined, determine special event api type, otherwise
44210             // given type
44211             type = (selector ? special.delegateType : special.bindType) || type;
44212
44213             // Update special based on newly reset type
44214             special = jQuery.event.special[type] || {};
44215
44216             // handleObj is passed to all event handlers
44217             handleObj = jQuery.extend({
44218               type: type,
44219               origType: origType,
44220               data: data,
44221               handler: handler,
44222               guid: handler.guid,
44223               selector: selector,
44224               needsContext: selector && jQuery.expr.match.needsContext.test(selector),
44225               namespace: namespaces.join(".")
44226             }, handleObjIn);
44227
44228             // Init the event handler queue if we're the first
44229             if (!(handlers = events[type])) {
44230               handlers = events[type] = [];
44231               handlers.delegateCount = 0;
44232
44233               // Only use addEventListener if the special events handler
44234               // returns false
44235               if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
44236                 if (elem.addEventListener) {
44237                   elem.addEventListener(type, eventHandle, false);
44238                 }
44239               }
44240             }
44241
44242             if (special.add) {
44243               special.add.call(elem, handleObj);
44244
44245               if (!handleObj.handler.guid) {
44246                 handleObj.handler.guid = handler.guid;
44247               }
44248             }
44249
44250             // Add to the element's handler list, delegates in front
44251             if (selector) {
44252               handlers.splice(handlers.delegateCount++, 0, handleObj);
44253             } else {
44254               handlers.push(handleObj);
44255             }
44256
44257             // Keep track of which events have ever been used, for event
44258             // optimization
44259             jQuery.event.global[type] = true;
44260           }
44261
44262         },
44263
44264         // Detach an event or set of events from an element
44265         remove: function(elem, types, handler, selector, mappedTypes) {
44266
44267           var j, origCount, tmp,
44268             events, t, handleObj,
44269             special, handlers, type, namespaces, origType,
44270             elemData = data_priv.hasData(elem) && data_priv.get(elem);
44271
44272           if (!elemData || !(events = elemData.events)) {
44273             return;
44274           }
44275
44276           // Once for each type.namespace in types; type may be omitted
44277           types = (types || "").match(rnotwhite) || [""];
44278           t = types.length;
44279           while (t--) {
44280             tmp = rtypenamespace.exec(types[t]) || [];
44281             type = origType = tmp[1];
44282             namespaces = (tmp[2] || "").split(".").sort();
44283
44284             // Unbind all events (on this namespace, if provided) for the
44285             // element
44286             if (!type) {
44287               for (type in events) {
44288                 jQuery.event.remove(elem, type + types[t], handler, selector, true);
44289               }
44290               continue;
44291             }
44292
44293             special = jQuery.event.special[type] || {};
44294             type = (selector ? special.delegateType : special.bindType) || type;
44295             handlers = events[type] || [];
44296             tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
44297
44298             // Remove matching events
44299             origCount = j = handlers.length;
44300             while (j--) {
44301               handleObj = handlers[j];
44302
44303               if ((mappedTypes || origType === handleObj.origType) &&
44304                 (!handler || handler.guid === handleObj.guid) &&
44305                 (!tmp || tmp.test(handleObj.namespace)) &&
44306                 (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
44307                 handlers.splice(j, 1);
44308
44309                 if (handleObj.selector) {
44310                   handlers.delegateCount--;
44311                 }
44312                 if (special.remove) {
44313                   special.remove.call(elem, handleObj);
44314                 }
44315               }
44316             }
44317
44318             // Remove generic event handler if we removed something and no more
44319             // handlers exist
44320             // (avoids potential for endless recursion during removal of special
44321             // event handlers)
44322             if (origCount && !handlers.length) {
44323               if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
44324                 jQuery.removeEvent(elem, type, elemData.handle);
44325               }
44326
44327               delete events[type];
44328             }
44329           }
44330
44331           // Remove the expando if it's no longer used
44332           if (jQuery.isEmptyObject(events)) {
44333             delete elemData.handle;
44334             data_priv.remove(elem, "events");
44335           }
44336         },
44337
44338         trigger: function(event, data, elem, onlyHandlers) {
44339
44340           var i, cur, tmp, bubbleType, ontype, handle, special,
44341             eventPath = [elem || document],
44342             type = hasOwn.call(event, "type") ? event.type : event,
44343             namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
44344
44345           cur = tmp = elem = elem || document;
44346
44347           // Don't do events on text and comment nodes
44348           if (elem.nodeType === 3 || elem.nodeType === 8) {
44349             return;
44350           }
44351
44352           // focus/blur morphs to focusin/out; ensure we're not firing them right
44353           // now
44354           if (rfocusMorph.test(type + jQuery.event.triggered)) {
44355             return;
44356           }
44357
44358           if (type.indexOf(".") >= 0) {
44359             // Namespaced trigger; create a regexp to match event type in
44360             // handle()
44361             namespaces = type.split(".");
44362             type = namespaces.shift();
44363             namespaces.sort();
44364           }
44365           ontype = type.indexOf(":") < 0 && "on" + type;
44366
44367           // Caller can pass in a jQuery.Event object, Object, or just an event
44368           // type string
44369           event = event[jQuery.expando] ?
44370             event :
44371             new jQuery.Event(type, typeof event === "object" && event);
44372
44373           // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always
44374           // true)
44375           event.isTrigger = onlyHandlers ? 2 : 3;
44376           event.namespace = namespaces.join(".");
44377           event.namespace_re = event.namespace ?
44378             new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") :
44379             null;
44380
44381           // Clean up the event in case it is being reused
44382           event.result = undefined;
44383           if (!event.target) {
44384             event.target = elem;
44385           }
44386
44387           // Clone any incoming data and prepend the event, creating the handler
44388           // arg list
44389           data = data == null ? [event] :
44390             jQuery.makeArray(data, [event]);
44391
44392           // Allow special events to draw outside the lines
44393           special = jQuery.event.special[type] || {};
44394           if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
44395             return;
44396           }
44397
44398           // Determine event propagation path in advance, per W3C events spec
44399           // (#9951)
44400           // Bubble up to document, then to window; watch for a global
44401           // ownerDocument var (#9724)
44402           if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {
44403
44404             bubbleType = special.delegateType || type;
44405             if (!rfocusMorph.test(bubbleType + type)) {
44406               cur = cur.parentNode;
44407             }
44408             for (; cur; cur = cur.parentNode) {
44409               eventPath.push(cur);
44410               tmp = cur;
44411             }
44412
44413             // Only add window if we got to document (e.g., not plain obj or
44414             // detached DOM)
44415             if (tmp === (elem.ownerDocument || document)) {
44416               eventPath.push(tmp.defaultView || tmp.parentWindow || window);
44417             }
44418           }
44419
44420           // Fire handlers on the event path
44421           i = 0;
44422           while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
44423
44424             event.type = i > 1 ?
44425               bubbleType :
44426               special.bindType || type;
44427
44428             // jQuery handler
44429             handle = (data_priv.get(cur, "events") || {})[event.type] && data_priv.get(cur, "handle");
44430             if (handle) {
44431               handle.apply(cur, data);
44432             }
44433
44434             // Native handler
44435             handle = ontype && cur[ontype];
44436             if (handle && handle.apply && jQuery.acceptData(cur)) {
44437               event.result = handle.apply(cur, data);
44438               if (event.result === false) {
44439                 event.preventDefault();
44440               }
44441             }
44442           }
44443           event.type = type;
44444
44445           // If nobody prevented the default action, do it now
44446           if (!onlyHandlers && !event.isDefaultPrevented()) {
44447
44448             if ((!special._default || special._default.apply(eventPath.pop(), data) === false) &&
44449               jQuery.acceptData(elem)) {
44450
44451               // Call a native DOM method on the target with the same name
44452               // name as the event.
44453               // Don't do default actions on window, that's where global
44454               // variables be (#6170)
44455               if (ontype && jQuery.isFunction(elem[type]) && !jQuery.isWindow(elem)) {
44456
44457                 // Don't re-trigger an onFOO event when we call its FOO()
44458                 // method
44459                 tmp = elem[ontype];
44460
44461                 if (tmp) {
44462                   elem[ontype] = null;
44463                 }
44464
44465                 // Prevent re-triggering of the same event, since we already
44466                 // bubbled it above
44467                 jQuery.event.triggered = type;
44468                 elem[type]();
44469                 jQuery.event.triggered = undefined;
44470
44471                 if (tmp) {
44472                   elem[ontype] = tmp;
44473                 }
44474               }
44475             }
44476           }
44477
44478           return event.result;
44479         },
44480
44481         dispatch: function(event) {
44482
44483           // Make a writable jQuery.Event from the native event object
44484           event = jQuery.event.fix(event);
44485
44486           var i, j, ret, matched, handleObj,
44487             handlerQueue = [],
44488             args = slice.call(arguments),
44489             handlers = (data_priv.get(this, "events") || {})[event.type] || [],
44490             special = jQuery.event.special[event.type] || {};
44491
44492           // Use the fix-ed jQuery.Event rather than the (read-only) native event
44493           args[0] = event;
44494           event.delegateTarget = this;
44495
44496           // Call the preDispatch hook for the mapped type, and let it bail if
44497           // desired
44498           if (special.preDispatch && special.preDispatch.call(this, event) === false) {
44499             return;
44500           }
44501
44502           // Determine handlers
44503           handlerQueue = jQuery.event.handlers.call(this, event, handlers);
44504
44505           // Run delegates first; they may want to stop propagation beneath us
44506           i = 0;
44507           while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
44508             event.currentTarget = matched.elem;
44509
44510             j = 0;
44511             while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
44512
44513               // Triggered event must either 1) have no namespace, or 2) have
44514               // namespace(s)
44515               // a subset or equal to those in the bound event (both can have
44516               // no namespace).
44517               if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {
44518
44519                 event.handleObj = handleObj;
44520                 event.data = handleObj.data;
44521
44522                 ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler)
44523                   .apply(matched.elem, args);
44524
44525                 if (ret !== undefined) {
44526                   if ((event.result = ret) === false) {
44527                     event.preventDefault();
44528                     event.stopPropagation();
44529                   }
44530                 }
44531               }
44532             }
44533           }
44534
44535           // Call the postDispatch hook for the mapped type
44536           if (special.postDispatch) {
44537             special.postDispatch.call(this, event);
44538           }
44539
44540           return event.result;
44541         },
44542
44543         handlers: function(event, handlers) {
44544           var i, matches, sel, handleObj,
44545             handlerQueue = [],
44546             delegateCount = handlers.delegateCount,
44547             cur = event.target;
44548
44549           // Find delegate handlers
44550           // Black-hole SVG <use> instance trees (#13180)
44551           // Avoid non-left-click bubbling in Firefox (#3861)
44552           if (delegateCount && cur.nodeType && (!event.button || event.type !== "click")) {
44553
44554             for (; cur !== this; cur = cur.parentNode || this) {
44555
44556               // Don't process clicks on disabled elements (#6911, #8165,
44557               // #11382, #11764)
44558               if (cur.disabled !== true || event.type !== "click") {
44559                 matches = [];
44560                 for (i = 0; i < delegateCount; i++) {
44561                   handleObj = handlers[i];
44562
44563                   // Don't conflict with Object.prototype properties
44564                   // (#13203)
44565                   sel = handleObj.selector + " ";
44566
44567                   if (matches[sel] === undefined) {
44568                     matches[sel] = handleObj.needsContext ?
44569                       jQuery(sel, this).index(cur) >= 0 :
44570                       jQuery.find(sel, this, null, [cur]).length;
44571                   }
44572                   if (matches[sel]) {
44573                     matches.push(handleObj);
44574                   }
44575                 }
44576                 if (matches.length) {
44577                   handlerQueue.push({
44578                     elem: cur,
44579                     handlers: matches
44580                   });
44581                 }
44582               }
44583             }
44584           }
44585
44586           // Add the remaining (directly-bound) handlers
44587           if (delegateCount < handlers.length) {
44588             handlerQueue.push({
44589               elem: this,
44590               handlers: handlers.slice(delegateCount)
44591             });
44592           }
44593
44594           return handlerQueue;
44595         },
44596
44597         // Includes some event props shared by KeyEvent and MouseEvent
44598         props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
44599
44600         fixHooks: {},
44601
44602         keyHooks: {
44603           props: "char charCode key keyCode".split(" "),
44604           filter: function(event, original) {
44605
44606             // Add which for key events
44607             if (event.which == null) {
44608               event.which = original.charCode != null ? original.charCode : original.keyCode;
44609             }
44610
44611             return event;
44612           }
44613         },
44614
44615         mouseHooks: {
44616           props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
44617           filter: function(event, original) {
44618             var eventDoc, doc, body,
44619               button = original.button;
44620
44621             // Calculate pageX/Y if missing and clientX/Y available
44622             if (event.pageX == null && original.clientX != null) {
44623               eventDoc = event.target.ownerDocument || document;
44624               doc = eventDoc.documentElement;
44625               body = eventDoc.body;
44626
44627               event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
44628               event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
44629             }
44630
44631             // Add which for click: 1 === left; 2 === middle; 3 === right
44632             // Note: button is not normalized, so don't use it
44633             if (!event.which && button !== undefined) {
44634               event.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));
44635             }
44636
44637             return event;
44638           }
44639         },
44640
44641         fix: function(event) {
44642           if (event[jQuery.expando]) {
44643             return event;
44644           }
44645
44646           // Create a writable copy of the event object and normalize some
44647           // properties
44648           var i, prop, copy,
44649             type = event.type,
44650             originalEvent = event,
44651             fixHook = this.fixHooks[type];
44652
44653           if (!fixHook) {
44654             this.fixHooks[type] = fixHook =
44655               rmouseEvent.test(type) ? this.mouseHooks :
44656               rkeyEvent.test(type) ? this.keyHooks : {};
44657           }
44658           copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
44659
44660           event = new jQuery.Event(originalEvent);
44661
44662           i = copy.length;
44663           while (i--) {
44664             prop = copy[i];
44665             event[prop] = originalEvent[prop];
44666           }
44667
44668           // Support: Cordova 2.5 (WebKit) (#13255)
44669           // All events should have a target; Cordova deviceready doesn't
44670           if (!event.target) {
44671             event.target = document;
44672           }
44673
44674           // Support: Safari 6.0+, Chrome<28
44675           // Target should not be a text node (#504, #13143)
44676           if (event.target.nodeType === 3) {
44677             event.target = event.target.parentNode;
44678           }
44679
44680           return fixHook.filter ? fixHook.filter(event, originalEvent) : event;
44681         },
44682
44683         special: {
44684           load: {
44685             // Prevent triggered image.load events from bubbling to window.load
44686             noBubble: true
44687           },
44688           focus: {
44689             // Fire native event if possible so blur/focus sequence is correct
44690             trigger: function() {
44691               if (this !== safeActiveElement() && this.focus) {
44692                 this.focus();
44693                 return false;
44694               }
44695             },
44696             delegateType: "focusin"
44697           },
44698           blur: {
44699             trigger: function() {
44700               if (this === safeActiveElement() && this.blur) {
44701                 this.blur();
44702                 return false;
44703               }
44704             },
44705             delegateType: "focusout"
44706           },
44707           click: {
44708             // For checkbox, fire native event so checked state will be right
44709             trigger: function() {
44710               if (this.type === "checkbox" && this.click && jQuery.nodeName(this, "input")) {
44711                 this.click();
44712                 return false;
44713               }
44714             },
44715
44716             // For cross-browser consistency, don't fire native .click() on
44717             // links
44718             _default: function(event) {
44719               return jQuery.nodeName(event.target, "a");
44720             }
44721           },
44722
44723           beforeunload: {
44724             postDispatch: function(event) {
44725
44726               // Support: Firefox 20+
44727               // Firefox doesn't alert if the returnValue field is not set.
44728               if (event.result !== undefined && event.originalEvent) {
44729                 event.originalEvent.returnValue = event.result;
44730               }
44731             }
44732           }
44733         },
44734
44735         simulate: function(type, elem, event, bubble) {
44736           // Piggyback on a donor event to simulate a different one.
44737           // Fake originalEvent to avoid donor's stopPropagation, but if the
44738           // simulated event prevents default then we do the same on the donor.
44739           var e = jQuery.extend(
44740             new jQuery.Event(),
44741             event, {
44742               type: type,
44743               isSimulated: true,
44744               originalEvent: {}
44745             }
44746           );
44747           if (bubble) {
44748             jQuery.event.trigger(e, null, elem);
44749           } else {
44750             jQuery.event.dispatch.call(elem, e);
44751           }
44752           if (e.isDefaultPrevented()) {
44753             event.preventDefault();
44754           }
44755         }
44756       };
44757
44758       jQuery.removeEvent = function(elem, type, handle) {
44759         if (elem.removeEventListener) {
44760           elem.removeEventListener(type, handle, false);
44761         }
44762       };
44763
44764       jQuery.Event = function(src, props) {
44765         // Allow instantiation without the 'new' keyword
44766         if (!(this instanceof jQuery.Event)) {
44767           return new jQuery.Event(src, props);
44768         }
44769
44770         // Event object
44771         if (src && src.type) {
44772           this.originalEvent = src;
44773           this.type = src.type;
44774
44775           // Events bubbling up the document may have been marked as prevented
44776           // by a handler lower down the tree; reflect the correct value.
44777           this.isDefaultPrevented = src.defaultPrevented ||
44778             src.defaultPrevented === undefined &&
44779             // Support: Android<4.0
44780             src.returnValue === false ?
44781             returnTrue :
44782             returnFalse;
44783
44784           // Event type
44785         } else {
44786           this.type = src;
44787         }
44788
44789         // Put explicitly provided properties onto the event object
44790         if (props) {
44791           jQuery.extend(this, props);
44792         }
44793
44794         // Create a timestamp if incoming event doesn't have one
44795         this.timeStamp = src && src.timeStamp || jQuery.now();
44796
44797         // Mark it as fixed
44798         this[jQuery.expando] = true;
44799       };
44800
44801       // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language
44802       // Binding
44803       // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
44804       jQuery.Event.prototype = {
44805         isDefaultPrevented: returnFalse,
44806         isPropagationStopped: returnFalse,
44807         isImmediatePropagationStopped: returnFalse,
44808
44809         preventDefault: function() {
44810           var e = this.originalEvent;
44811
44812           this.isDefaultPrevented = returnTrue;
44813
44814           if (e && e.preventDefault) {
44815             e.preventDefault();
44816           }
44817         },
44818         stopPropagation: function() {
44819           var e = this.originalEvent;
44820
44821           this.isPropagationStopped = returnTrue;
44822
44823           if (e && e.stopPropagation) {
44824             e.stopPropagation();
44825           }
44826         },
44827         stopImmediatePropagation: function() {
44828           var e = this.originalEvent;
44829
44830           this.isImmediatePropagationStopped = returnTrue;
44831
44832           if (e && e.stopImmediatePropagation) {
44833             e.stopImmediatePropagation();
44834           }
44835
44836           this.stopPropagation();
44837         }
44838       };
44839
44840       // Create mouseenter/leave events using mouseover/out and event-time checks
44841       // Support: Chrome 15+
44842       jQuery.each({
44843         mouseenter: "mouseover",
44844         mouseleave: "mouseout",
44845         pointerenter: "pointerover",
44846         pointerleave: "pointerout"
44847       }, function(orig, fix) {
44848         jQuery.event.special[orig] = {
44849           delegateType: fix,
44850           bindType: fix,
44851
44852           handle: function(event) {
44853             var ret,
44854               target = this,
44855               related = event.relatedTarget,
44856               handleObj = event.handleObj;
44857
44858             // For mousenter/leave call the handler if related is outside the
44859             // target.
44860             // NB: No relatedTarget if the mouse left/entered the browser window
44861             if (!related || (related !== target && !jQuery.contains(target, related))) {
44862               event.type = handleObj.origType;
44863               ret = handleObj.handler.apply(this, arguments);
44864               event.type = fix;
44865             }
44866             return ret;
44867           }
44868         };
44869       });
44870
44871       // Support: Firefox, Chrome, Safari
44872       // Create "bubbling" focus and blur events
44873       if (!support.focusinBubbles) {
44874         jQuery.each({
44875           focus: "focusin",
44876           blur: "focusout"
44877         }, function(orig, fix) {
44878
44879           // Attach a single capturing handler on the document while someone wants
44880           // focusin/focusout
44881           var handler = function(event) {
44882             jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true);
44883           };
44884
44885           jQuery.event.special[fix] = {
44886             setup: function() {
44887               var doc = this.ownerDocument || this,
44888                 attaches = data_priv.access(doc, fix);
44889
44890               if (!attaches) {
44891                 doc.addEventListener(orig, handler, true);
44892               }
44893               data_priv.access(doc, fix, (attaches || 0) + 1);
44894             },
44895             teardown: function() {
44896               var doc = this.ownerDocument || this,
44897                 attaches = data_priv.access(doc, fix) - 1;
44898
44899               if (!attaches) {
44900                 doc.removeEventListener(orig, handler, true);
44901                 data_priv.remove(doc, fix);
44902
44903               } else {
44904                 data_priv.access(doc, fix, attaches);
44905               }
44906             }
44907           };
44908         });
44909       }
44910
44911       jQuery.fn.extend({
44912
44913         on: function(types, selector, data, fn, /* INTERNAL */ one) {
44914           var origFn, type;
44915
44916           // Types can be a map of types/handlers
44917           if (typeof types === "object") {
44918             // ( types-Object, selector, data )
44919             if (typeof selector !== "string") {
44920               // ( types-Object, data )
44921               data = data || selector;
44922               selector = undefined;
44923             }
44924             for (type in types) {
44925               this.on(type, selector, data, types[type], one);
44926             }
44927             return this;
44928           }
44929
44930           if (data == null && fn == null) {
44931             // ( types, fn )
44932             fn = selector;
44933             data = selector = undefined;
44934           } else if (fn == null) {
44935             if (typeof selector === "string") {
44936               // ( types, selector, fn )
44937               fn = data;
44938               data = undefined;
44939             } else {
44940               // ( types, data, fn )
44941               fn = data;
44942               data = selector;
44943               selector = undefined;
44944             }
44945           }
44946           if (fn === false) {
44947             fn = returnFalse;
44948           } else if (!fn) {
44949             return this;
44950           }
44951
44952           if (one === 1) {
44953             origFn = fn;
44954             fn = function(event) {
44955               // Can use an empty set, since event contains the info
44956               jQuery().off(event);
44957               return origFn.apply(this, arguments);
44958             };
44959             // Use same guid so caller can remove using origFn
44960             fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
44961           }
44962           return this.each(function() {
44963             jQuery.event.add(this, types, fn, data, selector);
44964           });
44965         },
44966         one: function(types, selector, data, fn) {
44967           return this.on(types, selector, data, fn, 1);
44968         },
44969         off: function(types, selector, fn) {
44970           var handleObj, type;
44971           if (types && types.preventDefault && types.handleObj) {
44972             // ( event ) dispatched jQuery.Event
44973             handleObj = types.handleObj;
44974             jQuery(types.delegateTarget).off(
44975               handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
44976               handleObj.selector,
44977               handleObj.handler
44978             );
44979             return this;
44980           }
44981           if (typeof types === "object") {
44982             // ( types-object [, selector] )
44983             for (type in types) {
44984               this.off(type, selector, types[type]);
44985             }
44986             return this;
44987           }
44988           if (selector === false || typeof selector === "function") {
44989             // ( types [, fn] )
44990             fn = selector;
44991             selector = undefined;
44992           }
44993           if (fn === false) {
44994             fn = returnFalse;
44995           }
44996           return this.each(function() {
44997             jQuery.event.remove(this, types, fn, selector);
44998           });
44999         },
45000
45001         trigger: function(type, data) {
45002           return this.each(function() {
45003             jQuery.event.trigger(type, data, this);
45004           });
45005         },
45006         triggerHandler: function(type, data) {
45007           var elem = this[0];
45008           if (elem) {
45009             return jQuery.event.trigger(type, data, elem, true);
45010           }
45011         }
45012       });
45013
45014
45015       var
45016         rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
45017         rtagName = /<([\w:]+)/,
45018         rhtml = /<|&#?\w+;/,
45019         rnoInnerhtml = /<(?:script|style|link)/i,
45020         // checked="checked" or checked
45021         rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
45022         rscriptType = /^$|\/(?:java|ecma)script/i,
45023         rscriptTypeMasked = /^true\/(.*)/,
45024         rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
45025
45026         // We have to close these tags to support XHTML (#13200)
45027         wrapMap = {
45028
45029           // Support: IE9
45030           option: [1, "<select multiple='multiple'>", "</select>"],
45031
45032           thead: [1, "<table>", "</table>"],
45033           col: [2, "<table><colgroup>", "</colgroup></table>"],
45034           tr: [2, "<table><tbody>", "</tbody></table>"],
45035           td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
45036
45037           _default: [0, "", ""]
45038         };
45039
45040       // Support: IE9
45041       wrapMap.optgroup = wrapMap.option;
45042
45043       wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
45044       wrapMap.th = wrapMap.td;
45045
45046       // Support: 1.x compatibility
45047       // Manipulating tables requires a tbody
45048       function manipulationTarget(elem, content) {
45049         return jQuery.nodeName(elem, "table") &&
45050           jQuery.nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr") ?
45051
45052           elem.getElementsByTagName("tbody")[0] ||
45053           elem.appendChild(elem.ownerDocument.createElement("tbody")) :
45054           elem;
45055       }
45056
45057       // Replace/restore the type attribute of script elements for safe DOM
45058       // manipulation
45059       function disableScript(elem) {
45060         elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
45061         return elem;
45062       }
45063
45064       function restoreScript(elem) {
45065         var match = rscriptTypeMasked.exec(elem.type);
45066
45067         if (match) {
45068           elem.type = match[1];
45069         } else {
45070           elem.removeAttribute("type");
45071         }
45072
45073         return elem;
45074       }
45075
45076       // Mark scripts as having already been evaluated
45077       function setGlobalEval(elems, refElements) {
45078         var i = 0,
45079           l = elems.length;
45080
45081         for (; i < l; i++) {
45082           data_priv.set(
45083             elems[i], "globalEval", !refElements || data_priv.get(refElements[i], "globalEval")
45084           );
45085         }
45086       }
45087
45088       function cloneCopyEvent(src, dest) {
45089         var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
45090
45091         if (dest.nodeType !== 1) {
45092           return;
45093         }
45094
45095         // 1. Copy private data: events, handlers, etc.
45096         if (data_priv.hasData(src)) {
45097           pdataOld = data_priv.access(src);
45098           pdataCur = data_priv.set(dest, pdataOld);
45099           events = pdataOld.events;
45100
45101           if (events) {
45102             delete pdataCur.handle;
45103             pdataCur.events = {};
45104
45105             for (type in events) {
45106               for (i = 0, l = events[type].length; i < l; i++) {
45107                 jQuery.event.add(dest, type, events[type][i]);
45108               }
45109             }
45110           }
45111         }
45112
45113         // 2. Copy user data
45114         if (data_user.hasData(src)) {
45115           udataOld = data_user.access(src);
45116           udataCur = jQuery.extend({}, udataOld);
45117
45118           data_user.set(dest, udataCur);
45119         }
45120       }
45121
45122       function getAll(context, tag) {
45123         var ret = context.getElementsByTagName ? context.getElementsByTagName(tag || "*") :
45124           context.querySelectorAll ? context.querySelectorAll(tag || "*") : [];
45125
45126         return tag === undefined || tag && jQuery.nodeName(context, tag) ?
45127           jQuery.merge([context], ret) :
45128           ret;
45129       }
45130
45131       // Fix IE bugs, see support tests
45132       function fixInput(src, dest) {
45133         var nodeName = dest.nodeName.toLowerCase();
45134
45135         // Fails to persist the checked state of a cloned checkbox or radio button.
45136         if (nodeName === "input" && rcheckableType.test(src.type)) {
45137           dest.checked = src.checked;
45138
45139           // Fails to return the selected option to the default selected state when
45140           // cloning options
45141         } else if (nodeName === "input" || nodeName === "textarea") {
45142           dest.defaultValue = src.defaultValue;
45143         }
45144       }
45145
45146       jQuery.extend({
45147         clone: function(elem, dataAndEvents, deepDataAndEvents) {
45148           var i, l, srcElements, destElements,
45149             clone = elem.cloneNode(true),
45150             inPage = jQuery.contains(elem.ownerDocument, elem);
45151
45152           // Fix IE cloning issues
45153           if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) &&
45154             !jQuery.isXMLDoc(elem)) {
45155
45156             // We eschew Sizzle here for performance reasons:
45157             // http://jsperf.com/getall-vs-sizzle/2
45158             destElements = getAll(clone);
45159             srcElements = getAll(elem);
45160
45161             for (i = 0, l = srcElements.length; i < l; i++) {
45162               fixInput(srcElements[i], destElements[i]);
45163             }
45164           }
45165
45166           // Copy the events from the original to the clone
45167           if (dataAndEvents) {
45168             if (deepDataAndEvents) {
45169               srcElements = srcElements || getAll(elem);
45170               destElements = destElements || getAll(clone);
45171
45172               for (i = 0, l = srcElements.length; i < l; i++) {
45173                 cloneCopyEvent(srcElements[i], destElements[i]);
45174               }
45175             } else {
45176               cloneCopyEvent(elem, clone);
45177             }
45178           }
45179
45180           // Preserve script evaluation history
45181           destElements = getAll(clone, "script");
45182           if (destElements.length > 0) {
45183             setGlobalEval(destElements, !inPage && getAll(elem, "script"));
45184           }
45185
45186           // Return the cloned set
45187           return clone;
45188         },
45189
45190         buildFragment: function(elems, context, scripts, selection) {
45191           var elem, tmp, tag, wrap, contains, j,
45192             fragment = context.createDocumentFragment(),
45193             nodes = [],
45194             i = 0,
45195             l = elems.length;
45196
45197           for (; i < l; i++) {
45198             elem = elems[i];
45199
45200             if (elem || elem === 0) {
45201
45202               // Add nodes directly
45203               if (jQuery.type(elem) === "object") {
45204                 // Support: QtWebKit, PhantomJS
45205                 // push.apply(_, arraylike) throws on ancient WebKit
45206                 jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
45207
45208                 // Convert non-html into a text node
45209               } else if (!rhtml.test(elem)) {
45210                 nodes.push(context.createTextNode(elem));
45211
45212                 // Convert html into DOM nodes
45213               } else {
45214                 tmp = tmp || fragment.appendChild(context.createElement("div"));
45215
45216                 // Deserialize a standard representation
45217                 tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
45218                 wrap = wrapMap[tag] || wrapMap._default;
45219                 tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2];
45220
45221                 // Descend through wrappers to the right content
45222                 j = wrap[0];
45223                 while (j--) {
45224                   tmp = tmp.lastChild;
45225                 }
45226
45227                 // Support: QtWebKit, PhantomJS
45228                 // push.apply(_, arraylike) throws on ancient WebKit
45229                 jQuery.merge(nodes, tmp.childNodes);
45230
45231                 // Remember the top-level container
45232                 tmp = fragment.firstChild;
45233
45234                 // Ensure the created nodes are orphaned (#12392)
45235                 tmp.textContent = "";
45236               }
45237             }
45238           }
45239
45240           // Remove wrapper from fragment
45241           fragment.textContent = "";
45242
45243           i = 0;
45244           while ((elem = nodes[i++])) {
45245
45246             // #4087 - If origin and destination elements are the same, and this
45247             // is
45248             // that element, do not do anything
45249             if (selection && jQuery.inArray(elem, selection) !== -1) {
45250               continue;
45251             }
45252
45253             contains = jQuery.contains(elem.ownerDocument, elem);
45254
45255             // Append to fragment
45256             tmp = getAll(fragment.appendChild(elem), "script");
45257
45258             // Preserve script evaluation history
45259             if (contains) {
45260               setGlobalEval(tmp);
45261             }
45262
45263             // Capture executables
45264             if (scripts) {
45265               j = 0;
45266               while ((elem = tmp[j++])) {
45267                 if (rscriptType.test(elem.type || "")) {
45268                   scripts.push(elem);
45269                 }
45270               }
45271             }
45272           }
45273
45274           return fragment;
45275         },
45276
45277         cleanData: function(elems) {
45278           var data, elem, type, key,
45279             special = jQuery.event.special,
45280             i = 0;
45281
45282           for (;
45283             (elem = elems[i]) !== undefined; i++) {
45284             if (jQuery.acceptData(elem)) {
45285               key = elem[data_priv.expando];
45286
45287               if (key && (data = data_priv.cache[key])) {
45288                 if (data.events) {
45289                   for (type in data.events) {
45290                     if (special[type]) {
45291                       jQuery.event.remove(elem, type);
45292
45293                       // This is a shortcut to avoid jQuery.event.remove's
45294                       // overhead
45295                     } else {
45296                       jQuery.removeEvent(elem, type, data.handle);
45297                     }
45298                   }
45299                 }
45300                 if (data_priv.cache[key]) {
45301                   // Discard any remaining `private` data
45302                   delete data_priv.cache[key];
45303                 }
45304               }
45305             }
45306             // Discard any remaining `user` data
45307             delete data_user.cache[elem[data_user.expando]];
45308           }
45309         }
45310       });
45311
45312       jQuery.fn.extend({
45313         text: function(value) {
45314           return access(this, function(value) {
45315             return value === undefined ?
45316               jQuery.text(this) :
45317               this.empty().each(function() {
45318                 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45319                   this.textContent = value;
45320                 }
45321               });
45322           }, null, value, arguments.length);
45323         },
45324
45325         append: function() {
45326           return this.domManip(arguments, function(elem) {
45327             if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45328               var target = manipulationTarget(this, elem);
45329               target.appendChild(elem);
45330             }
45331           });
45332         },
45333
45334         prepend: function() {
45335           return this.domManip(arguments, function(elem) {
45336             if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45337               var target = manipulationTarget(this, elem);
45338               target.insertBefore(elem, target.firstChild);
45339             }
45340           });
45341         },
45342
45343         before: function() {
45344           return this.domManip(arguments, function(elem) {
45345             if (this.parentNode) {
45346               this.parentNode.insertBefore(elem, this);
45347             }
45348           });
45349         },
45350
45351         after: function() {
45352           return this.domManip(arguments, function(elem) {
45353             if (this.parentNode) {
45354               this.parentNode.insertBefore(elem, this.nextSibling);
45355             }
45356           });
45357         },
45358
45359         remove: function(selector, keepData /* Internal Use Only */ ) {
45360           var elem,
45361             elems = selector ? jQuery.filter(selector, this) : this,
45362             i = 0;
45363
45364           for (;
45365             (elem = elems[i]) != null; i++) {
45366             if (!keepData && elem.nodeType === 1) {
45367               jQuery.cleanData(getAll(elem));
45368             }
45369
45370             if (elem.parentNode) {
45371               if (keepData && jQuery.contains(elem.ownerDocument, elem)) {
45372                 setGlobalEval(getAll(elem, "script"));
45373               }
45374               elem.parentNode.removeChild(elem);
45375             }
45376           }
45377
45378           return this;
45379         },
45380
45381         empty: function() {
45382           var elem,
45383             i = 0;
45384
45385           for (;
45386             (elem = this[i]) != null; i++) {
45387             if (elem.nodeType === 1) {
45388
45389               // Prevent memory leaks
45390               jQuery.cleanData(getAll(elem, false));
45391
45392               // Remove any remaining nodes
45393               elem.textContent = "";
45394             }
45395           }
45396
45397           return this;
45398         },
45399
45400         clone: function(dataAndEvents, deepDataAndEvents) {
45401           dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
45402           deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
45403
45404           return this.map(function() {
45405             return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
45406           });
45407         },
45408
45409         html: function(value) {
45410           return access(this, function(value) {
45411             var elem = this[0] || {},
45412               i = 0,
45413               l = this.length;
45414
45415             if (value === undefined && elem.nodeType === 1) {
45416               return elem.innerHTML;
45417             }
45418
45419             // See if we can take a shortcut and just use innerHTML
45420             if (typeof value === "string" && !rnoInnerhtml.test(value) &&
45421               !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
45422
45423               value = value.replace(rxhtmlTag, "<$1></$2>");
45424
45425               try {
45426                 for (; i < l; i++) {
45427                   elem = this[i] || {};
45428
45429                   // Remove element nodes and prevent memory leaks
45430                   if (elem.nodeType === 1) {
45431                     jQuery.cleanData(getAll(elem, false));
45432                     elem.innerHTML = value;
45433                   }
45434                 }
45435
45436                 elem = 0;
45437
45438                 // If using innerHTML throws an exception, use the fallback
45439                 // method
45440               } catch (e) {}
45441             }
45442
45443             if (elem) {
45444               this.empty().append(value);
45445             }
45446           }, null, value, arguments.length);
45447         },
45448
45449         replaceWith: function() {
45450           var arg = arguments[0];
45451
45452           // Make the changes, replacing each context element with the new content
45453           this.domManip(arguments, function(elem) {
45454             arg = this.parentNode;
45455
45456             jQuery.cleanData(getAll(this));
45457
45458             if (arg) {
45459               arg.replaceChild(elem, this);
45460             }
45461           });
45462
45463           // Force removal if there was no new content (e.g., from empty
45464           // arguments)
45465           return arg && (arg.length || arg.nodeType) ? this : this.remove();
45466         },
45467
45468         detach: function(selector) {
45469           return this.remove(selector, true);
45470         },
45471
45472         domManip: function(args, callback) {
45473
45474           // Flatten any nested arrays
45475           args = concat.apply([], args);
45476
45477           var fragment, first, scripts, hasScripts, node, doc,
45478             i = 0,
45479             l = this.length,
45480             set = this,
45481             iNoClone = l - 1,
45482             value = args[0],
45483             isFunction = jQuery.isFunction(value);
45484
45485           // We can't cloneNode fragments that contain checked, in WebKit
45486           if (isFunction ||
45487             (l > 1 && typeof value === "string" &&
45488               !support.checkClone && rchecked.test(value))) {
45489             return this.each(function(index) {
45490               var self = set.eq(index);
45491               if (isFunction) {
45492                 args[0] = value.call(this, index, self.html());
45493               }
45494               self.domManip(args, callback);
45495             });
45496           }
45497
45498           if (l) {
45499             fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, this);
45500             first = fragment.firstChild;
45501
45502             if (fragment.childNodes.length === 1) {
45503               fragment = first;
45504             }
45505
45506             if (first) {
45507               scripts = jQuery.map(getAll(fragment, "script"), disableScript);
45508               hasScripts = scripts.length;
45509
45510               // Use the original fragment for the last item instead of the
45511               // first because it can end up
45512               // being emptied incorrectly in certain situations (#8070).
45513               for (; i < l; i++) {
45514                 node = fragment;
45515
45516                 if (i !== iNoClone) {
45517                   node = jQuery.clone(node, true, true);
45518
45519                   // Keep references to cloned scripts for later
45520                   // restoration
45521                   if (hasScripts) {
45522                     // Support: QtWebKit
45523                     // jQuery.merge because push.apply(_, arraylike)
45524                     // throws
45525                     jQuery.merge(scripts, getAll(node, "script"));
45526                   }
45527                 }
45528
45529                 callback.call(this[i], node, i);
45530               }
45531
45532               if (hasScripts) {
45533                 doc = scripts[scripts.length - 1].ownerDocument;
45534
45535                 // Reenable scripts
45536                 jQuery.map(scripts, restoreScript);
45537
45538                 // Evaluate executable scripts on first document insertion
45539                 for (i = 0; i < hasScripts; i++) {
45540                   node = scripts[i];
45541                   if (rscriptType.test(node.type || "") &&
45542                     !data_priv.access(node, "globalEval") && jQuery.contains(doc, node)) {
45543
45544                     if (node.src) {
45545                       // Optional AJAX dependency, but won't run
45546                       // scripts if not present
45547                       if (jQuery._evalUrl) {
45548                         jQuery._evalUrl(node.src);
45549                       }
45550                     } else {
45551                       jQuery.globalEval(node.textContent.replace(rcleanScript, ""));
45552                     }
45553                   }
45554                 }
45555               }
45556             }
45557           }
45558
45559           return this;
45560         }
45561       });
45562
45563       jQuery.each({
45564         appendTo: "append",
45565         prependTo: "prepend",
45566         insertBefore: "before",
45567         insertAfter: "after",
45568         replaceAll: "replaceWith"
45569       }, function(name, original) {
45570         jQuery.fn[name] = function(selector) {
45571           var elems,
45572             ret = [],
45573             insert = jQuery(selector),
45574             last = insert.length - 1,
45575             i = 0;
45576
45577           for (; i <= last; i++) {
45578             elems = i === last ? this : this.clone(true);
45579             jQuery(insert[i])[original](elems);
45580
45581             // Support: QtWebKit
45582             // .get() because push.apply(_, arraylike) throws
45583             push.apply(ret, elems.get());
45584           }
45585
45586           return this.pushStack(ret);
45587         };
45588       });
45589
45590
45591       var iframe,
45592         elemdisplay = {};
45593
45594       /**
45595        * Retrieve the actual display of a element
45596        *
45597        * @param {String}
45598        *            name nodeName of the element
45599        * @param {Object}
45600        *            doc Document object
45601        */
45602       // Called only from within defaultDisplay
45603       function actualDisplay(name, doc) {
45604         var style,
45605           elem = jQuery(doc.createElement(name)).appendTo(doc.body),
45606
45607           // getDefaultComputedStyle might be reliably used only on attached
45608           // element
45609           display = window.getDefaultComputedStyle && (style = window.getDefaultComputedStyle(elem[0])) ?
45610
45611           // Use of this method is a temporary fix (more like optimization)
45612           // until something better comes along,
45613           // since it was removed from specification and supported only in FF
45614           style.display : jQuery.css(elem[0], "display");
45615
45616         // We don't have any data stored on the element,
45617         // so use "detach" method as fast way to get rid of the element
45618         elem.detach();
45619
45620         return display;
45621       }
45622
45623       /**
45624        * Try to determine the default display value of an element
45625        *
45626        * @param {String}
45627        *            nodeName
45628        */
45629       function defaultDisplay(nodeName) {
45630         var doc = document,
45631           display = elemdisplay[nodeName];
45632
45633         if (!display) {
45634           display = actualDisplay(nodeName, doc);
45635
45636           // If the simple way fails, read from inside an iframe
45637           if (display === "none" || !display) {
45638
45639             // Use the already-created iframe if possible
45640             iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement);
45641
45642             // Always write a new HTML skeleton so Webkit and Firefox don't
45643             // choke on reuse
45644             doc = iframe[0].contentDocument;
45645
45646             // Support: IE
45647             doc.write();
45648             doc.close();
45649
45650             display = actualDisplay(nodeName, doc);
45651             iframe.detach();
45652           }
45653
45654           // Store the correct default display
45655           elemdisplay[nodeName] = display;
45656         }
45657
45658         return display;
45659       }
45660       var rmargin = (/^margin/);
45661
45662       var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
45663
45664       var getStyles = function(elem) {
45665         // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
45666         // IE throws on elements created in popups
45667         // FF meanwhile throws on frame elements through
45668         // "defaultView.getComputedStyle"
45669         if (elem.ownerDocument.defaultView.opener) {
45670           return elem.ownerDocument.defaultView.getComputedStyle(elem, null);
45671         }
45672
45673         return window.getComputedStyle(elem, null);
45674       };
45675
45676
45677
45678       function curCSS(elem, name, computed) {
45679         var width, minWidth, maxWidth, ret,
45680           style = elem.style;
45681
45682         computed = computed || getStyles(elem);
45683
45684         // Support: IE9
45685         // getPropertyValue is only needed for .css('filter') (#12537)
45686         if (computed) {
45687           ret = computed.getPropertyValue(name) || computed[name];
45688         }
45689
45690         if (computed) {
45691
45692           if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) {
45693             ret = jQuery.style(elem, name);
45694           }
45695
45696           // Support: iOS < 6
45697           // A tribute to the "awesome hack by Dean Edwards"
45698           // iOS < 6 (at least) returns percentage for a larger set of values, but
45699           // width seems to be reliably pixels
45700           // this is against the CSSOM draft spec:
45701           // http://dev.w3.org/csswg/cssom/#resolved-values
45702           if (rnumnonpx.test(ret) && rmargin.test(name)) {
45703
45704             // Remember the original values
45705             width = style.width;
45706             minWidth = style.minWidth;
45707             maxWidth = style.maxWidth;
45708
45709             // Put in the new values to get a computed value out
45710             style.minWidth = style.maxWidth = style.width = ret;
45711             ret = computed.width;
45712
45713             // Revert the changed values
45714             style.width = width;
45715             style.minWidth = minWidth;
45716             style.maxWidth = maxWidth;
45717           }
45718         }
45719
45720         return ret !== undefined ?
45721           // Support: IE
45722           // IE returns zIndex value as an integer.
45723           ret + "" :
45724           ret;
45725       }
45726
45727
45728       function addGetHookIf(conditionFn, hookFn) {
45729         // Define the hook, we'll check on the first run if it's really needed.
45730         return {
45731           get: function() {
45732             if (conditionFn()) {
45733               // Hook not needed (or it's not possible to use it due
45734               // to missing dependency), remove it.
45735               delete this.get;
45736               return;
45737             }
45738
45739             // Hook needed; redefine it so that the support test is not executed
45740             // again.
45741             return (this.get = hookFn).apply(this, arguments);
45742           }
45743         };
45744       }
45745
45746
45747       (function() {
45748         var pixelPositionVal, boxSizingReliableVal,
45749           docElem = document.documentElement,
45750           container = document.createElement("div"),
45751           div = document.createElement("div");
45752
45753         if (!div.style) {
45754           return;
45755         }
45756
45757         // Support: IE9-11+
45758         // Style of cloned element affects source element cloned (#8908)
45759         div.style.backgroundClip = "content-box";
45760         div.cloneNode(true).style.backgroundClip = "";
45761         support.clearCloneStyle = div.style.backgroundClip === "content-box";
45762
45763         container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
45764           "position:absolute";
45765         container.appendChild(div);
45766
45767         // Executing both pixelPosition & boxSizingReliable tests require only one
45768         // layout
45769         // so they're executed at the same time to save the second computation.
45770         function computePixelPositionAndBoxSizingReliable() {
45771           div.style.cssText =
45772             // Support: Firefox<29, Android 2.3
45773             // Vendor-prefix box-sizing
45774             "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
45775             "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
45776             "border:1px;padding:1px;width:4px;position:absolute";
45777           div.innerHTML = "";
45778           docElem.appendChild(container);
45779
45780           var divStyle = window.getComputedStyle(div, null);
45781           pixelPositionVal = divStyle.top !== "1%";
45782           boxSizingReliableVal = divStyle.width === "4px";
45783
45784           docElem.removeChild(container);
45785         }
45786
45787         // Support: node.js jsdom
45788         // Don't assume that getComputedStyle is a property of the global object
45789         if (window.getComputedStyle) {
45790           jQuery.extend(support, {
45791             pixelPosition: function() {
45792
45793               // This test is executed only once but we still do memoizing
45794               // since we can use the boxSizingReliable pre-computing.
45795               // No need to check if the test was already performed, though.
45796               computePixelPositionAndBoxSizingReliable();
45797               return pixelPositionVal;
45798             },
45799             boxSizingReliable: function() {
45800               if (boxSizingReliableVal == null) {
45801                 computePixelPositionAndBoxSizingReliable();
45802               }
45803               return boxSizingReliableVal;
45804             },
45805             reliableMarginRight: function() {
45806
45807               // Support: Android 2.3
45808               // Check if div with explicit width and no margin-right
45809               // incorrectly
45810               // gets computed margin-right based on width of container.
45811               // (#3333)
45812               // WebKit Bug 13343 - getComputedStyle returns wrong value for
45813               // margin-right
45814               // This support function is only executed once so no memoizing
45815               // is needed.
45816               var ret,
45817                 marginDiv = div.appendChild(document.createElement("div"));
45818
45819               // Reset CSS: box-sizing; display; margin; border; padding
45820               marginDiv.style.cssText = div.style.cssText =
45821                 // Support: Firefox<29, Android 2.3
45822                 // Vendor-prefix box-sizing
45823                 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
45824                 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
45825               marginDiv.style.marginRight = marginDiv.style.width = "0";
45826               div.style.width = "1px";
45827               docElem.appendChild(container);
45828
45829               ret = !parseFloat(window.getComputedStyle(marginDiv, null).marginRight);
45830
45831               docElem.removeChild(container);
45832               div.removeChild(marginDiv);
45833
45834               return ret;
45835             }
45836           });
45837         }
45838       })();
45839
45840
45841       // A method for quickly swapping in/out CSS properties to get correct
45842       // calculations.
45843       jQuery.swap = function(elem, options, callback, args) {
45844         var ret, name,
45845           old = {};
45846
45847         // Remember the old values, and insert the new ones
45848         for (name in options) {
45849           old[name] = elem.style[name];
45850           elem.style[name] = options[name];
45851         }
45852
45853         ret = callback.apply(elem, args || []);
45854
45855         // Revert the old values
45856         for (name in options) {
45857           elem.style[name] = old[name];
45858         }
45859
45860         return ret;
45861       };
45862
45863
45864       var
45865         // Swappable if display is none or starts with table except "table",
45866         // "table-cell", or "table-caption"
45867         // See here for display values:
45868         // https://developer.mozilla.org/en-US/docs/CSS/display
45869         rdisplayswap = /^(none|table(?!-c[ea]).+)/,
45870         rnumsplit = new RegExp("^(" + pnum + ")(.*)$", "i"),
45871         rrelNum = new RegExp("^([+-])=(" + pnum + ")", "i"),
45872
45873         cssShow = {
45874           position: "absolute",
45875           visibility: "hidden",
45876           display: "block"
45877         },
45878         cssNormalTransform = {
45879           letterSpacing: "0",
45880           fontWeight: "400"
45881         },
45882
45883         cssPrefixes = ["Webkit", "O", "Moz", "ms"];
45884
45885       // Return a css property mapped to a potentially vendor prefixed property
45886       function vendorPropName(style, name) {
45887
45888         // Shortcut for names that are not vendor prefixed
45889         if (name in style) {
45890           return name;
45891         }
45892
45893         // Check for vendor prefixed names
45894         var capName = name[0].toUpperCase() + name.slice(1),
45895           origName = name,
45896           i = cssPrefixes.length;
45897
45898         while (i--) {
45899           name = cssPrefixes[i] + capName;
45900           if (name in style) {
45901             return name;
45902           }
45903         }
45904
45905         return origName;
45906       }
45907
45908       function setPositiveNumber(elem, value, subtract) {
45909         var matches = rnumsplit.exec(value);
45910         return matches ?
45911           // Guard against undefined "subtract", e.g., when used as in cssHooks
45912           Math.max(0, matches[1] - (subtract || 0)) + (matches[2] || "px") :
45913           value;
45914       }
45915
45916       function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) {
45917         var i = extra === (isBorderBox ? "border" : "content") ?
45918           // If we already have the right measurement, avoid augmentation
45919           4 :
45920           // Otherwise initialize for horizontal or vertical properties
45921           name === "width" ? 1 : 0,
45922
45923           val = 0;
45924
45925         for (; i < 4; i += 2) {
45926           // Both box models exclude margin, so add it if we want it
45927           if (extra === "margin") {
45928             val += jQuery.css(elem, extra + cssExpand[i], true, styles);
45929           }
45930
45931           if (isBorderBox) {
45932             // border-box includes padding, so remove it if we want content
45933             if (extra === "content") {
45934               val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
45935             }
45936
45937             // At this point, extra isn't border nor margin, so remove border
45938             if (extra !== "margin") {
45939               val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
45940             }
45941           } else {
45942             // At this point, extra isn't content, so add padding
45943             val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
45944
45945             // At this point, extra isn't content nor padding, so add border
45946             if (extra !== "padding") {
45947               val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
45948             }
45949           }
45950         }
45951
45952         return val;
45953       }
45954
45955       function getWidthOrHeight(elem, name, extra) {
45956
45957         // Start with offset property, which is equivalent to the border-box value
45958         var valueIsBorderBox = true,
45959           val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
45960           styles = getStyles(elem),
45961           isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
45962
45963         // Some non-html elements return undefined for offsetWidth, so check for
45964         // null/undefined
45965         // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
45966         // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
45967         if (val <= 0 || val == null) {
45968           // Fall back to computed then uncomputed css if necessary
45969           val = curCSS(elem, name, styles);
45970           if (val < 0 || val == null) {
45971             val = elem.style[name];
45972           }
45973
45974           // Computed unit is not pixels. Stop here and return.
45975           if (rnumnonpx.test(val)) {
45976             return val;
45977           }
45978
45979           // Check for style in case a browser which returns unreliable values
45980           // for getComputedStyle silently falls back to the reliable elem.style
45981           valueIsBorderBox = isBorderBox &&
45982             (support.boxSizingReliable() || val === elem.style[name]);
45983
45984           // Normalize "", auto, and prepare for extra
45985           val = parseFloat(val) || 0;
45986         }
45987
45988         // Use the active box-sizing model to add/subtract irrelevant styles
45989         return (val +
45990           augmentWidthOrHeight(
45991             elem,
45992             name,
45993             extra || (isBorderBox ? "border" : "content"),
45994             valueIsBorderBox,
45995             styles
45996           )
45997         ) + "px";
45998       }
45999
46000       function showHide(elements, show) {
46001         var display, elem, hidden,
46002           values = [],
46003           index = 0,
46004           length = elements.length;
46005
46006         for (; index < length; index++) {
46007           elem = elements[index];
46008           if (!elem.style) {
46009             continue;
46010           }
46011
46012           values[index] = data_priv.get(elem, "olddisplay");
46013           display = elem.style.display;
46014           if (show) {
46015             // Reset the inline display of this element to learn if it is
46016             // being hidden by cascaded rules or not
46017             if (!values[index] && display === "none") {
46018               elem.style.display = "";
46019             }
46020
46021             // Set elements which have been overridden with display: none
46022             // in a stylesheet to whatever the default browser style is
46023             // for such an element
46024             if (elem.style.display === "" && isHidden(elem)) {
46025               values[index] = data_priv.access(elem, "olddisplay", defaultDisplay(elem.nodeName));
46026             }
46027           } else {
46028             hidden = isHidden(elem);
46029
46030             if (display !== "none" || !hidden) {
46031               data_priv.set(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"));
46032             }
46033           }
46034         }
46035
46036         // Set the display of most of the elements in a second loop
46037         // to avoid the constant reflow
46038         for (index = 0; index < length; index++) {
46039           elem = elements[index];
46040           if (!elem.style) {
46041             continue;
46042           }
46043           if (!show || elem.style.display === "none" || elem.style.display === "") {
46044             elem.style.display = show ? values[index] || "" : "none";
46045           }
46046         }
46047
46048         return elements;
46049       }
46050
46051       jQuery.extend({
46052
46053         // Add in style property hooks for overriding the default
46054         // behavior of getting and setting a style property
46055         cssHooks: {
46056           opacity: {
46057             get: function(elem, computed) {
46058               if (computed) {
46059
46060                 // We should always get a number back from opacity
46061                 var ret = curCSS(elem, "opacity");
46062                 return ret === "" ? "1" : ret;
46063               }
46064             }
46065           }
46066         },
46067
46068         // Don't automatically add "px" to these possibly-unitless properties
46069         cssNumber: {
46070           "columnCount": true,
46071           "fillOpacity": true,
46072           "flexGrow": true,
46073           "flexShrink": true,
46074           "fontWeight": true,
46075           "lineHeight": true,
46076           "opacity": true,
46077           "order": true,
46078           "orphans": true,
46079           "widows": true,
46080           "zIndex": true,
46081           "zoom": true
46082         },
46083
46084         // Add in properties whose names you wish to fix before
46085         // setting or getting the value
46086         cssProps: {
46087           "float": "cssFloat"
46088         },
46089
46090         // Get and set the style property on a DOM Node
46091         style: function(elem, name, value, extra) {
46092
46093           // Don't set styles on text and comment nodes
46094           if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
46095             return;
46096           }
46097
46098           // Make sure that we're working with the right name
46099           var ret, type, hooks,
46100             origName = jQuery.camelCase(name),
46101             style = elem.style;
46102
46103           name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName));
46104
46105           // Gets hook for the prefixed version, then unprefixed version
46106           hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
46107
46108           // Check if we're setting a value
46109           if (value !== undefined) {
46110             type = typeof value;
46111
46112             // Convert "+=" or "-=" to relative numbers (#7345)
46113             if (type === "string" && (ret = rrelNum.exec(value))) {
46114               value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name));
46115               // Fixes bug #9237
46116               type = "number";
46117             }
46118
46119             // Make sure that null and NaN values aren't set (#7116)
46120             if (value == null || value !== value) {
46121               return;
46122             }
46123
46124             // If a number, add 'px' to the (except for certain CSS properties)
46125             if (type === "number" && !jQuery.cssNumber[origName]) {
46126               value += "px";
46127             }
46128
46129             // Support: IE9-11+
46130             // background-* props affect original clone's values
46131             if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
46132               style[name] = "inherit";
46133             }
46134
46135             // If a hook was provided, use that value, otherwise just set the
46136             // specified value
46137             if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {
46138               style[name] = value;
46139             }
46140
46141           } else {
46142             // If a hook was provided get the non-computed value from there
46143             if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {
46144               return ret;
46145             }
46146
46147             // Otherwise just get the value from the style object
46148             return style[name];
46149           }
46150         },
46151
46152         css: function(elem, name, extra, styles) {
46153           var val, num, hooks,
46154             origName = jQuery.camelCase(name);
46155
46156           // Make sure that we're working with the right name
46157           name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName));
46158
46159           // Try prefixed name followed by the unprefixed name
46160           hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
46161
46162           // If a hook was provided get the computed value from there
46163           if (hooks && "get" in hooks) {
46164             val = hooks.get(elem, true, extra);
46165           }
46166
46167           // Otherwise, if a way to get the computed value exists, use that
46168           if (val === undefined) {
46169             val = curCSS(elem, name, styles);
46170           }
46171
46172           // Convert "normal" to computed value
46173           if (val === "normal" && name in cssNormalTransform) {
46174             val = cssNormalTransform[name];
46175           }
46176
46177           // Make numeric if forced or a qualifier was provided and val looks
46178           // numeric
46179           if (extra === "" || extra) {
46180             num = parseFloat(val);
46181             return extra === true || jQuery.isNumeric(num) ? num || 0 : val;
46182           }
46183           return val;
46184         }
46185       });
46186
46187       jQuery.each(["height", "width"], function(i, name) {
46188         jQuery.cssHooks[name] = {
46189           get: function(elem, computed, extra) {
46190             if (computed) {
46191
46192               // Certain elements can have dimension info if we invisibly show
46193               // them
46194               // but it must have a current display style that would benefit
46195               return rdisplayswap.test(jQuery.css(elem, "display")) && elem.offsetWidth === 0 ?
46196                 jQuery.swap(elem, cssShow, function() {
46197                   return getWidthOrHeight(elem, name, extra);
46198                 }) :
46199                 getWidthOrHeight(elem, name, extra);
46200             }
46201           },
46202
46203           set: function(elem, value, extra) {
46204             var styles = extra && getStyles(elem);
46205             return setPositiveNumber(elem, value, extra ?
46206               augmentWidthOrHeight(
46207                 elem,
46208                 name,
46209                 extra,
46210                 jQuery.css(elem, "boxSizing", false, styles) === "border-box",
46211                 styles
46212               ) : 0
46213             );
46214           }
46215         };
46216       });
46217
46218       // Support: Android 2.3
46219       jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight,
46220         function(elem, computed) {
46221           if (computed) {
46222             return jQuery.swap(elem, {
46223                 "display": "inline-block"
46224               },
46225               curCSS, [elem, "marginRight"]);
46226           }
46227         }
46228       );
46229
46230       // These hooks are used by animate to expand properties
46231       jQuery.each({
46232         margin: "",
46233         padding: "",
46234         border: "Width"
46235       }, function(prefix, suffix) {
46236         jQuery.cssHooks[prefix + suffix] = {
46237           expand: function(value) {
46238             var i = 0,
46239               expanded = {},
46240
46241               // Assumes a single number if not a string
46242               parts = typeof value === "string" ? value.split(" ") : [value];
46243
46244             for (; i < 4; i++) {
46245               expanded[prefix + cssExpand[i] + suffix] =
46246                 parts[i] || parts[i - 2] || parts[0];
46247             }
46248
46249             return expanded;
46250           }
46251         };
46252
46253         if (!rmargin.test(prefix)) {
46254           jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
46255         }
46256       });
46257
46258       jQuery.fn.extend({
46259         css: function(name, value) {
46260           return access(this, function(elem, name, value) {
46261             var styles, len,
46262               map = {},
46263               i = 0;
46264
46265             if (jQuery.isArray(name)) {
46266               styles = getStyles(elem);
46267               len = name.length;
46268
46269               for (; i < len; i++) {
46270                 map[name[i]] = jQuery.css(elem, name[i], false, styles);
46271               }
46272
46273               return map;
46274             }
46275
46276             return value !== undefined ?
46277               jQuery.style(elem, name, value) :
46278               jQuery.css(elem, name);
46279           }, name, value, arguments.length > 1);
46280         },
46281         show: function() {
46282           return showHide(this, true);
46283         },
46284         hide: function() {
46285           return showHide(this);
46286         },
46287         toggle: function(state) {
46288           if (typeof state === "boolean") {
46289             return state ? this.show() : this.hide();
46290           }
46291
46292           return this.each(function() {
46293             if (isHidden(this)) {
46294               jQuery(this).show();
46295             } else {
46296               jQuery(this).hide();
46297             }
46298           });
46299         }
46300       });
46301
46302
46303       function Tween(elem, options, prop, end, easing) {
46304         return new Tween.prototype.init(elem, options, prop, end, easing);
46305       }
46306       jQuery.Tween = Tween;
46307
46308       Tween.prototype = {
46309         constructor: Tween,
46310         init: function(elem, options, prop, end, easing, unit) {
46311           this.elem = elem;
46312           this.prop = prop;
46313           this.easing = easing || "swing";
46314           this.options = options;
46315           this.start = this.now = this.cur();
46316           this.end = end;
46317           this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
46318         },
46319         cur: function() {
46320           var hooks = Tween.propHooks[this.prop];
46321
46322           return hooks && hooks.get ?
46323             hooks.get(this) :
46324             Tween.propHooks._default.get(this);
46325         },
46326         run: function(percent) {
46327           var eased,
46328             hooks = Tween.propHooks[this.prop];
46329
46330           if (this.options.duration) {
46331             this.pos = eased = jQuery.easing[this.easing](
46332               percent, this.options.duration * percent, 0, 1, this.options.duration
46333             );
46334           } else {
46335             this.pos = eased = percent;
46336           }
46337           this.now = (this.end - this.start) * eased + this.start;
46338
46339           if (this.options.step) {
46340             this.options.step.call(this.elem, this.now, this);
46341           }
46342
46343           if (hooks && hooks.set) {
46344             hooks.set(this);
46345           } else {
46346             Tween.propHooks._default.set(this);
46347           }
46348           return this;
46349         }
46350       };
46351
46352       Tween.prototype.init.prototype = Tween.prototype;
46353
46354       Tween.propHooks = {
46355         _default: {
46356           get: function(tween) {
46357             var result;
46358
46359             if (tween.elem[tween.prop] != null &&
46360               (!tween.elem.style || tween.elem.style[tween.prop] == null)) {
46361               return tween.elem[tween.prop];
46362             }
46363
46364             // Passing an empty string as a 3rd parameter to .css will
46365             // automatically
46366             // attempt a parseFloat and fallback to a string if the parse fails.
46367             // Simple values such as "10px" are parsed to Float;
46368             // complex values such as "rotate(1rad)" are returned as-is.
46369             result = jQuery.css(tween.elem, tween.prop, "");
46370             // Empty strings, null, undefined and "auto" are converted to 0.
46371             return !result || result === "auto" ? 0 : result;
46372           },
46373           set: function(tween) {
46374             // Use step hook for back compat.
46375             // Use cssHook if its there.
46376             // Use .style if available and use plain properties where available.
46377             if (jQuery.fx.step[tween.prop]) {
46378               jQuery.fx.step[tween.prop](tween);
46379             } else if (tween.elem.style && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) {
46380               jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
46381             } else {
46382               tween.elem[tween.prop] = tween.now;
46383             }
46384           }
46385         }
46386       };
46387
46388       // Support: IE9
46389       // Panic based approach to setting things on disconnected nodes
46390       Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
46391         set: function(tween) {
46392           if (tween.elem.nodeType && tween.elem.parentNode) {
46393             tween.elem[tween.prop] = tween.now;
46394           }
46395         }
46396       };
46397
46398       jQuery.easing = {
46399         linear: function(p) {
46400           return p;
46401         },
46402         swing: function(p) {
46403           return 0.5 - Math.cos(p * Math.PI) / 2;
46404         }
46405       };
46406
46407       jQuery.fx = Tween.prototype.init;
46408
46409       // Back Compat <1.8 extension point
46410       jQuery.fx.step = {};
46411
46412
46413
46414
46415       var
46416         fxNow, timerId,
46417         rfxtypes = /^(?:toggle|show|hide)$/,
46418         rfxnum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"),
46419         rrun = /queueHooks$/,
46420         animationPrefilters = [defaultPrefilter],
46421         tweeners = {
46422           "*": [function(prop, value) {
46423             var tween = this.createTween(prop, value),
46424               target = tween.cur(),
46425               parts = rfxnum.exec(value),
46426               unit = parts && parts[3] || (jQuery.cssNumber[prop] ? "" : "px"),
46427
46428               // Starting value computation is required for potential unit
46429               // mismatches
46430               start = (jQuery.cssNumber[prop] || unit !== "px" && +target) &&
46431               rfxnum.exec(jQuery.css(tween.elem, prop)),
46432               scale = 1,
46433               maxIterations = 20;
46434
46435             if (start && start[3] !== unit) {
46436               // Trust units reported by jQuery.css
46437               unit = unit || start[3];
46438
46439               // Make sure we update the tween properties later on
46440               parts = parts || [];
46441
46442               // Iteratively approximate from a nonzero starting point
46443               start = +target || 1;
46444
46445               do {
46446                 // If previous iteration zeroed out, double until we get
46447                 // *something*.
46448                 // Use string for doubling so we don't accidentally see
46449                 // scale as unchanged below
46450                 scale = scale || ".5";
46451
46452                 // Adjust and apply
46453                 start = start / scale;
46454                 jQuery.style(tween.elem, prop, start + unit);
46455
46456                 // Update scale, tolerating zero or NaN from tween.cur(),
46457                 // break the loop if scale is unchanged or perfect, or if we've
46458                 // just had enough
46459               } while (scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations);
46460             }
46461
46462             // Update tween properties
46463             if (parts) {
46464               start = tween.start = +start || +target || 0;
46465               tween.unit = unit;
46466               // If a +=/-= token was provided, we're doing a relative
46467               // animation
46468               tween.end = parts[1] ?
46469                 start + (parts[1] + 1) * parts[2] :
46470                 +parts[2];
46471             }
46472
46473             return tween;
46474           }]
46475         };
46476
46477       // Animations created synchronously will run synchronously
46478       function createFxNow() {
46479         setTimeout(function() {
46480           fxNow = undefined;
46481         });
46482         return (fxNow = jQuery.now());
46483       }
46484
46485       // Generate parameters to create a standard animation
46486       function genFx(type, includeWidth) {
46487         var which,
46488           i = 0,
46489           attrs = {
46490             height: type
46491           };
46492
46493         // If we include width, step value is 1 to do all cssExpand values,
46494         // otherwise step value is 2 to skip over Left and Right
46495         includeWidth = includeWidth ? 1 : 0;
46496         for (; i < 4; i += 2 - includeWidth) {
46497           which = cssExpand[i];
46498           attrs["margin" + which] = attrs["padding" + which] = type;
46499         }
46500
46501         if (includeWidth) {
46502           attrs.opacity = attrs.width = type;
46503         }
46504
46505         return attrs;
46506       }
46507
46508       function createTween(value, prop, animation) {
46509         var tween,
46510           collection = (tweeners[prop] || []).concat(tweeners["*"]),
46511           index = 0,
46512           length = collection.length;
46513         for (; index < length; index++) {
46514           if ((tween = collection[index].call(animation, prop, value))) {
46515
46516             // We're done with this property
46517             return tween;
46518           }
46519         }
46520       }
46521
46522       function defaultPrefilter(elem, props, opts) {
46523         /* jshint validthis: true */
46524         var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
46525           anim = this,
46526           orig = {},
46527           style = elem.style,
46528           hidden = elem.nodeType && isHidden(elem),
46529           dataShow = data_priv.get(elem, "fxshow");
46530
46531         // Handle queue: false promises
46532         if (!opts.queue) {
46533           hooks = jQuery._queueHooks(elem, "fx");
46534           if (hooks.unqueued == null) {
46535             hooks.unqueued = 0;
46536             oldfire = hooks.empty.fire;
46537             hooks.empty.fire = function() {
46538               if (!hooks.unqueued) {
46539                 oldfire();
46540               }
46541             };
46542           }
46543           hooks.unqueued++;
46544
46545           anim.always(function() {
46546             // Ensure the complete handler is called before this completes
46547             anim.always(function() {
46548               hooks.unqueued--;
46549               if (!jQuery.queue(elem, "fx").length) {
46550                 hooks.empty.fire();
46551               }
46552             });
46553           });
46554         }
46555
46556         // Height/width overflow pass
46557         if (elem.nodeType === 1 && ("height" in props || "width" in props)) {
46558           // Make sure that nothing sneaks out
46559           // Record all 3 overflow attributes because IE9-10 do not
46560           // change the overflow attribute when overflowX and
46561           // overflowY are set to the same value
46562           opts.overflow = [style.overflow, style.overflowX, style.overflowY];
46563
46564           // Set display property to inline-block for height/width
46565           // animations on inline elements that are having width/height animated
46566           display = jQuery.css(elem, "display");
46567
46568           // Test default display if display is currently "none"
46569           checkDisplay = display === "none" ?
46570             data_priv.get(elem, "olddisplay") || defaultDisplay(elem.nodeName) : display;
46571
46572           if (checkDisplay === "inline" && jQuery.css(elem, "float") === "none") {
46573             style.display = "inline-block";
46574           }
46575         }
46576
46577         if (opts.overflow) {
46578           style.overflow = "hidden";
46579           anim.always(function() {
46580             style.overflow = opts.overflow[0];
46581             style.overflowX = opts.overflow[1];
46582             style.overflowY = opts.overflow[2];
46583           });
46584         }
46585
46586         // show/hide pass
46587         for (prop in props) {
46588           value = props[prop];
46589           if (rfxtypes.exec(value)) {
46590             delete props[prop];
46591             toggle = toggle || value === "toggle";
46592             if (value === (hidden ? "hide" : "show")) {
46593
46594               // If there is dataShow left over from a stopped hide or show
46595               // and we are going to proceed with show, we should pretend to
46596               // be hidden
46597               if (value === "show" && dataShow && dataShow[prop] !== undefined) {
46598                 hidden = true;
46599               } else {
46600                 continue;
46601               }
46602             }
46603             orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
46604
46605             // Any non-fx value stops us from restoring the original display value
46606           } else {
46607             display = undefined;
46608           }
46609         }
46610
46611         if (!jQuery.isEmptyObject(orig)) {
46612           if (dataShow) {
46613             if ("hidden" in dataShow) {
46614               hidden = dataShow.hidden;
46615             }
46616           } else {
46617             dataShow = data_priv.access(elem, "fxshow", {});
46618           }
46619
46620           // Store state if its toggle - enables .stop().toggle() to "reverse"
46621           if (toggle) {
46622             dataShow.hidden = !hidden;
46623           }
46624           if (hidden) {
46625             jQuery(elem).show();
46626           } else {
46627             anim.done(function() {
46628               jQuery(elem).hide();
46629             });
46630           }
46631           anim.done(function() {
46632             var prop;
46633
46634             data_priv.remove(elem, "fxshow");
46635             for (prop in orig) {
46636               jQuery.style(elem, prop, orig[prop]);
46637             }
46638           });
46639           for (prop in orig) {
46640             tween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
46641
46642             if (!(prop in dataShow)) {
46643               dataShow[prop] = tween.start;
46644               if (hidden) {
46645                 tween.end = tween.start;
46646                 tween.start = prop === "width" || prop === "height" ? 1 : 0;
46647               }
46648             }
46649           }
46650
46651           // If this is a noop like .hide().hide(), restore an overwritten display
46652           // value
46653         } else if ((display === "none" ? defaultDisplay(elem.nodeName) : display) === "inline") {
46654           style.display = display;
46655         }
46656       }
46657
46658       function propFilter(props, specialEasing) {
46659         var index, name, easing, value, hooks;
46660
46661         // camelCase, specialEasing and expand cssHook pass
46662         for (index in props) {
46663           name = jQuery.camelCase(index);
46664           easing = specialEasing[name];
46665           value = props[index];
46666           if (jQuery.isArray(value)) {
46667             easing = value[1];
46668             value = props[index] = value[0];
46669           }
46670
46671           if (index !== name) {
46672             props[name] = value;
46673             delete props[index];
46674           }
46675
46676           hooks = jQuery.cssHooks[name];
46677           if (hooks && "expand" in hooks) {
46678             value = hooks.expand(value);
46679             delete props[name];
46680
46681             // Not quite $.extend, this won't overwrite existing keys.
46682             // Reusing 'index' because we have the correct "name"
46683             for (index in value) {
46684               if (!(index in props)) {
46685                 props[index] = value[index];
46686                 specialEasing[index] = easing;
46687               }
46688             }
46689           } else {
46690             specialEasing[name] = easing;
46691           }
46692         }
46693       }
46694
46695       function Animation(elem, properties, options) {
46696         var result,
46697           stopped,
46698           index = 0,
46699           length = animationPrefilters.length,
46700           deferred = jQuery.Deferred().always(function() {
46701             // Don't match elem in the :animated selector
46702             delete tick.elem;
46703           }),
46704           tick = function() {
46705             if (stopped) {
46706               return false;
46707             }
46708             var currentTime = fxNow || createFxNow(),
46709               remaining = Math.max(0, animation.startTime + animation.duration - currentTime),
46710               // Support: Android 2.3
46711               // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )`
46712               // (#12497)
46713               temp = remaining / animation.duration || 0,
46714               percent = 1 - temp,
46715               index = 0,
46716               length = animation.tweens.length;
46717
46718             for (; index < length; index++) {
46719               animation.tweens[index].run(percent);
46720             }
46721
46722             deferred.notifyWith(elem, [animation, percent, remaining]);
46723
46724             if (percent < 1 && length) {
46725               return remaining;
46726             } else {
46727               deferred.resolveWith(elem, [animation]);
46728               return false;
46729             }
46730           },
46731           animation = deferred.promise({
46732             elem: elem,
46733             props: jQuery.extend({}, properties),
46734             opts: jQuery.extend(true, {
46735               specialEasing: {}
46736             }, options),
46737             originalProperties: properties,
46738             originalOptions: options,
46739             startTime: fxNow || createFxNow(),
46740             duration: options.duration,
46741             tweens: [],
46742             createTween: function(prop, end) {
46743               var tween = jQuery.Tween(elem, animation.opts, prop, end,
46744                 animation.opts.specialEasing[prop] || animation.opts.easing);
46745               animation.tweens.push(tween);
46746               return tween;
46747             },
46748             stop: function(gotoEnd) {
46749               var index = 0,
46750                 // If we are going to the end, we want to run all the tweens
46751                 // otherwise we skip this part
46752                 length = gotoEnd ? animation.tweens.length : 0;
46753               if (stopped) {
46754                 return this;
46755               }
46756               stopped = true;
46757               for (; index < length; index++) {
46758                 animation.tweens[index].run(1);
46759               }
46760
46761               // Resolve when we played the last frame; otherwise, reject
46762               if (gotoEnd) {
46763                 deferred.resolveWith(elem, [animation, gotoEnd]);
46764               } else {
46765                 deferred.rejectWith(elem, [animation, gotoEnd]);
46766               }
46767               return this;
46768             }
46769           }),
46770           props = animation.props;
46771
46772         propFilter(props, animation.opts.specialEasing);
46773
46774         for (; index < length; index++) {
46775           result = animationPrefilters[index].call(animation, elem, props, animation.opts);
46776           if (result) {
46777             return result;
46778           }
46779         }
46780
46781         jQuery.map(props, createTween, animation);
46782
46783         if (jQuery.isFunction(animation.opts.start)) {
46784           animation.opts.start.call(elem, animation);
46785         }
46786
46787         jQuery.fx.timer(
46788           jQuery.extend(tick, {
46789             elem: elem,
46790             anim: animation,
46791             queue: animation.opts.queue
46792           })
46793         );
46794
46795         // attach callbacks from options
46796         return animation.progress(animation.opts.progress)
46797           .done(animation.opts.done, animation.opts.complete)
46798           .fail(animation.opts.fail)
46799           .always(animation.opts.always);
46800       }
46801
46802       jQuery.Animation = jQuery.extend(Animation, {
46803
46804         tweener: function(props, callback) {
46805           if (jQuery.isFunction(props)) {
46806             callback = props;
46807             props = ["*"];
46808           } else {
46809             props = props.split(" ");
46810           }
46811
46812           var prop,
46813             index = 0,
46814             length = props.length;
46815
46816           for (; index < length; index++) {
46817             prop = props[index];
46818             tweeners[prop] = tweeners[prop] || [];
46819             tweeners[prop].unshift(callback);
46820           }
46821         },
46822
46823         prefilter: function(callback, prepend) {
46824           if (prepend) {
46825             animationPrefilters.unshift(callback);
46826           } else {
46827             animationPrefilters.push(callback);
46828           }
46829         }
46830       });
46831
46832       jQuery.speed = function(speed, easing, fn) {
46833         var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
46834           complete: fn || !fn && easing ||
46835             jQuery.isFunction(speed) && speed,
46836           duration: speed,
46837           easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
46838         };
46839
46840         opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
46841           opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
46842
46843         // Normalize opt.queue - true/undefined/null -> "fx"
46844         if (opt.queue == null || opt.queue === true) {
46845           opt.queue = "fx";
46846         }
46847
46848         // Queueing
46849         opt.old = opt.complete;
46850
46851         opt.complete = function() {
46852           if (jQuery.isFunction(opt.old)) {
46853             opt.old.call(this);
46854           }
46855
46856           if (opt.queue) {
46857             jQuery.dequeue(this, opt.queue);
46858           }
46859         };
46860
46861         return opt;
46862       };
46863
46864       jQuery.fn.extend({
46865         fadeTo: function(speed, to, easing, callback) {
46866
46867           // Show any hidden elements after setting opacity to 0
46868           return this.filter(isHidden).css("opacity", 0).show()
46869
46870             // Animate to the value specified
46871             .end().animate({
46872               opacity: to
46873             }, speed, easing, callback);
46874         },
46875         animate: function(prop, speed, easing, callback) {
46876           var empty = jQuery.isEmptyObject(prop),
46877             optall = jQuery.speed(speed, easing, callback),
46878             doAnimation = function() {
46879               // Operate on a copy of prop so per-property easing won't be
46880               // lost
46881               var anim = Animation(this, jQuery.extend({}, prop), optall);
46882
46883               // Empty animations, or finishing resolves immediately
46884               if (empty || data_priv.get(this, "finish")) {
46885                 anim.stop(true);
46886               }
46887             };
46888           doAnimation.finish = doAnimation;
46889
46890           return empty || optall.queue === false ?
46891             this.each(doAnimation) :
46892             this.queue(optall.queue, doAnimation);
46893         },
46894         stop: function(type, clearQueue, gotoEnd) {
46895           var stopQueue = function(hooks) {
46896             var stop = hooks.stop;
46897             delete hooks.stop;
46898             stop(gotoEnd);
46899           };
46900
46901           if (typeof type !== "string") {
46902             gotoEnd = clearQueue;
46903             clearQueue = type;
46904             type = undefined;
46905           }
46906           if (clearQueue && type !== false) {
46907             this.queue(type || "fx", []);
46908           }
46909
46910           return this.each(function() {
46911             var dequeue = true,
46912               index = type != null && type + "queueHooks",
46913               timers = jQuery.timers,
46914               data = data_priv.get(this);
46915
46916             if (index) {
46917               if (data[index] && data[index].stop) {
46918                 stopQueue(data[index]);
46919               }
46920             } else {
46921               for (index in data) {
46922                 if (data[index] && data[index].stop && rrun.test(index)) {
46923                   stopQueue(data[index]);
46924                 }
46925               }
46926             }
46927
46928             for (index = timers.length; index--;) {
46929               if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
46930                 timers[index].anim.stop(gotoEnd);
46931                 dequeue = false;
46932                 timers.splice(index, 1);
46933               }
46934             }
46935
46936             // Start the next in the queue if the last step wasn't forced.
46937             // Timers currently will call their complete callbacks, which
46938             // will dequeue but only if they were gotoEnd.
46939             if (dequeue || !gotoEnd) {
46940               jQuery.dequeue(this, type);
46941             }
46942           });
46943         },
46944         finish: function(type) {
46945           if (type !== false) {
46946             type = type || "fx";
46947           }
46948           return this.each(function() {
46949             var index,
46950               data = data_priv.get(this),
46951               queue = data[type + "queue"],
46952               hooks = data[type + "queueHooks"],
46953               timers = jQuery.timers,
46954               length = queue ? queue.length : 0;
46955
46956             // Enable finishing flag on private data
46957             data.finish = true;
46958
46959             // Empty the queue first
46960             jQuery.queue(this, type, []);
46961
46962             if (hooks && hooks.stop) {
46963               hooks.stop.call(this, true);
46964             }
46965
46966             // Look for any active animations, and finish them
46967             for (index = timers.length; index--;) {
46968               if (timers[index].elem === this && timers[index].queue === type) {
46969                 timers[index].anim.stop(true);
46970                 timers.splice(index, 1);
46971               }
46972             }
46973
46974             // Look for any animations in the old queue and finish them
46975             for (index = 0; index < length; index++) {
46976               if (queue[index] && queue[index].finish) {
46977                 queue[index].finish.call(this);
46978               }
46979             }
46980
46981             // Turn off finishing flag
46982             delete data.finish;
46983           });
46984         }
46985       });
46986
46987       jQuery.each(["toggle", "show", "hide"], function(i, name) {
46988         var cssFn = jQuery.fn[name];
46989         jQuery.fn[name] = function(speed, easing, callback) {
46990           return speed == null || typeof speed === "boolean" ?
46991             cssFn.apply(this, arguments) :
46992             this.animate(genFx(name, true), speed, easing, callback);
46993         };
46994       });
46995
46996       // Generate shortcuts for custom animations
46997       jQuery.each({
46998         slideDown: genFx("show"),
46999         slideUp: genFx("hide"),
47000         slideToggle: genFx("toggle"),
47001         fadeIn: {
47002           opacity: "show"
47003         },
47004         fadeOut: {
47005           opacity: "hide"
47006         },
47007         fadeToggle: {
47008           opacity: "toggle"
47009         }
47010       }, function(name, props) {
47011         jQuery.fn[name] = function(speed, easing, callback) {
47012           return this.animate(props, speed, easing, callback);
47013         };
47014       });
47015
47016       jQuery.timers = [];
47017       jQuery.fx.tick = function() {
47018         var timer,
47019           i = 0,
47020           timers = jQuery.timers;
47021
47022         fxNow = jQuery.now();
47023
47024         for (; i < timers.length; i++) {
47025           timer = timers[i];
47026           // Checks the timer has not already been removed
47027           if (!timer() && timers[i] === timer) {
47028             timers.splice(i--, 1);
47029           }
47030         }
47031
47032         if (!timers.length) {
47033           jQuery.fx.stop();
47034         }
47035         fxNow = undefined;
47036       };
47037
47038       jQuery.fx.timer = function(timer) {
47039         jQuery.timers.push(timer);
47040         if (timer()) {
47041           jQuery.fx.start();
47042         } else {
47043           jQuery.timers.pop();
47044         }
47045       };
47046
47047       jQuery.fx.interval = 13;
47048
47049       jQuery.fx.start = function() {
47050         if (!timerId) {
47051           timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval);
47052         }
47053       };
47054
47055       jQuery.fx.stop = function() {
47056         clearInterval(timerId);
47057         timerId = null;
47058       };
47059
47060       jQuery.fx.speeds = {
47061         slow: 600,
47062         fast: 200,
47063         // Default speed
47064         _default: 400
47065       };
47066
47067
47068       // Based off of the plugin by Clint Helfers, with permission.
47069       // http://blindsignals.com/index.php/2009/07/jquery-delay/
47070       jQuery.fn.delay = function(time, type) {
47071         time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
47072         type = type || "fx";
47073
47074         return this.queue(type, function(next, hooks) {
47075           var timeout = setTimeout(next, time);
47076           hooks.stop = function() {
47077             clearTimeout(timeout);
47078           };
47079         });
47080       };
47081
47082
47083       (function() {
47084         var input = document.createElement("input"),
47085           select = document.createElement("select"),
47086           opt = select.appendChild(document.createElement("option"));
47087
47088         input.type = "checkbox";
47089
47090         // Support: iOS<=5.1, Android<=4.2+
47091         // Default value for a checkbox should be "on"
47092         support.checkOn = input.value !== "";
47093
47094         // Support: IE<=11+
47095         // Must access selectedIndex to make default options select
47096         support.optSelected = opt.selected;
47097
47098         // Support: Android<=2.3
47099         // Options inside disabled selects are incorrectly marked as disabled
47100         select.disabled = true;
47101         support.optDisabled = !opt.disabled;
47102
47103         // Support: IE<=11+
47104         // An input loses its value after becoming a radio
47105         input = document.createElement("input");
47106         input.value = "t";
47107         input.type = "radio";
47108         support.radioValue = input.value === "t";
47109       })();
47110
47111
47112       var nodeHook, boolHook,
47113         attrHandle = jQuery.expr.attrHandle;
47114
47115       jQuery.fn.extend({
47116         attr: function(name, value) {
47117           return access(this, jQuery.attr, name, value, arguments.length > 1);
47118         },
47119
47120         removeAttr: function(name) {
47121           return this.each(function() {
47122             jQuery.removeAttr(this, name);
47123           });
47124         }
47125       });
47126
47127       jQuery.extend({
47128         attr: function(elem, name, value) {
47129           var hooks, ret,
47130             nType = elem.nodeType;
47131
47132           // don't get/set attributes on text, comment and attribute nodes
47133           if (!elem || nType === 3 || nType === 8 || nType === 2) {
47134             return;
47135           }
47136
47137           // Fallback to prop when attributes are not supported
47138           if (typeof elem.getAttribute === strundefined) {
47139             return jQuery.prop(elem, name, value);
47140           }
47141
47142           // All attributes are lowercase
47143           // Grab necessary hook if one is defined
47144           if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
47145             name = name.toLowerCase();
47146             hooks = jQuery.attrHooks[name] ||
47147               (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook);
47148           }
47149
47150           if (value !== undefined) {
47151
47152             if (value === null) {
47153               jQuery.removeAttr(elem, name);
47154
47155             } else if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
47156               return ret;
47157
47158             } else {
47159               elem.setAttribute(name, value + "");
47160               return value;
47161             }
47162
47163           } else if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
47164             return ret;
47165
47166           } else {
47167             ret = jQuery.find.attr(elem, name);
47168
47169             // Non-existent attributes return null, we normalize to undefined
47170             return ret == null ?
47171               undefined :
47172               ret;
47173           }
47174         },
47175
47176         removeAttr: function(elem, value) {
47177           var name, propName,
47178             i = 0,
47179             attrNames = value && value.match(rnotwhite);
47180
47181           if (attrNames && elem.nodeType === 1) {
47182             while ((name = attrNames[i++])) {
47183               propName = jQuery.propFix[name] || name;
47184
47185               // Boolean attributes get special treatment (#10870)
47186               if (jQuery.expr.match.bool.test(name)) {
47187                 // Set corresponding property to false
47188                 elem[propName] = false;
47189               }
47190
47191               elem.removeAttribute(name);
47192             }
47193           }
47194         },
47195
47196         attrHooks: {
47197           type: {
47198             set: function(elem, value) {
47199               if (!support.radioValue && value === "radio" &&
47200                 jQuery.nodeName(elem, "input")) {
47201                 var val = elem.value;
47202                 elem.setAttribute("type", value);
47203                 if (val) {
47204                   elem.value = val;
47205                 }
47206                 return value;
47207               }
47208             }
47209           }
47210         }
47211       });
47212
47213       // Hooks for boolean attributes
47214       boolHook = {
47215         set: function(elem, value, name) {
47216           if (value === false) {
47217             // Remove boolean attributes when set to false
47218             jQuery.removeAttr(elem, name);
47219           } else {
47220             elem.setAttribute(name, name);
47221           }
47222           return name;
47223         }
47224       };
47225       jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(i, name) {
47226         var getter = attrHandle[name] || jQuery.find.attr;
47227
47228         attrHandle[name] = function(elem, name, isXML) {
47229           var ret, handle;
47230           if (!isXML) {
47231             // Avoid an infinite loop by temporarily removing this function from
47232             // the getter
47233             handle = attrHandle[name];
47234             attrHandle[name] = ret;
47235             ret = getter(elem, name, isXML) != null ?
47236               name.toLowerCase() :
47237               null;
47238             attrHandle[name] = handle;
47239           }
47240           return ret;
47241         };
47242       });
47243
47244
47245
47246
47247       var rfocusable = /^(?:input|select|textarea|button)$/i;
47248
47249       jQuery.fn.extend({
47250         prop: function(name, value) {
47251           return access(this, jQuery.prop, name, value, arguments.length > 1);
47252         },
47253
47254         removeProp: function(name) {
47255           return this.each(function() {
47256             delete this[jQuery.propFix[name] || name];
47257           });
47258         }
47259       });
47260
47261       jQuery.extend({
47262         propFix: {
47263           "for": "htmlFor",
47264           "class": "className"
47265         },
47266
47267         prop: function(elem, name, value) {
47268           var ret, hooks, notxml,
47269             nType = elem.nodeType;
47270
47271           // Don't get/set properties on text, comment and attribute nodes
47272           if (!elem || nType === 3 || nType === 8 || nType === 2) {
47273             return;
47274           }
47275
47276           notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
47277
47278           if (notxml) {
47279             // Fix name and attach hooks
47280             name = jQuery.propFix[name] || name;
47281             hooks = jQuery.propHooks[name];
47282           }
47283
47284           if (value !== undefined) {
47285             return hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined ?
47286               ret :
47287               (elem[name] = value);
47288
47289           } else {
47290             return hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null ?
47291               ret :
47292               elem[name];
47293           }
47294         },
47295
47296         propHooks: {
47297           tabIndex: {
47298             get: function(elem) {
47299               return elem.hasAttribute("tabindex") || rfocusable.test(elem.nodeName) || elem.href ?
47300                 elem.tabIndex :
47301                 -1;
47302             }
47303           }
47304         }
47305       });
47306
47307       if (!support.optSelected) {
47308         jQuery.propHooks.selected = {
47309           get: function(elem) {
47310             var parent = elem.parentNode;
47311             if (parent && parent.parentNode) {
47312               parent.parentNode.selectedIndex;
47313             }
47314             return null;
47315           }
47316         };
47317       }
47318
47319       jQuery.each([
47320         "tabIndex",
47321         "readOnly",
47322         "maxLength",
47323         "cellSpacing",
47324         "cellPadding",
47325         "rowSpan",
47326         "colSpan",
47327         "useMap",
47328         "frameBorder",
47329         "contentEditable"
47330       ], function() {
47331         jQuery.propFix[this.toLowerCase()] = this;
47332       });
47333
47334
47335
47336
47337       var rclass = /[\t\r\n\f]/g;
47338
47339       jQuery.fn.extend({
47340         addClass: function(value) {
47341           var classes, elem, cur, clazz, j, finalValue,
47342             proceed = typeof value === "string" && value,
47343             i = 0,
47344             len = this.length;
47345
47346           if (jQuery.isFunction(value)) {
47347             return this.each(function(j) {
47348               jQuery(this).addClass(value.call(this, j, this.className));
47349             });
47350           }
47351
47352           if (proceed) {
47353             // The disjunction here is for better compressibility (see
47354             // removeClass)
47355             classes = (value || "").match(rnotwhite) || [];
47356
47357             for (; i < len; i++) {
47358               elem = this[i];
47359               cur = elem.nodeType === 1 && (elem.className ?
47360                 (" " + elem.className + " ").replace(rclass, " ") :
47361                 " "
47362               );
47363
47364               if (cur) {
47365                 j = 0;
47366                 while ((clazz = classes[j++])) {
47367                   if (cur.indexOf(" " + clazz + " ") < 0) {
47368                     cur += clazz + " ";
47369                   }
47370                 }
47371
47372                 // only assign if different to avoid unneeded rendering.
47373                 finalValue = jQuery.trim(cur);
47374                 if (elem.className !== finalValue) {
47375                   elem.className = finalValue;
47376                 }
47377               }
47378             }
47379           }
47380
47381           return this;
47382         },
47383
47384         removeClass: function(value) {
47385           var classes, elem, cur, clazz, j, finalValue,
47386             proceed = arguments.length === 0 || typeof value === "string" && value,
47387             i = 0,
47388             len = this.length;
47389
47390           if (jQuery.isFunction(value)) {
47391             return this.each(function(j) {
47392               jQuery(this).removeClass(value.call(this, j, this.className));
47393             });
47394           }
47395           if (proceed) {
47396             classes = (value || "").match(rnotwhite) || [];
47397
47398             for (; i < len; i++) {
47399               elem = this[i];
47400               // This expression is here for better compressibility (see
47401               // addClass)
47402               cur = elem.nodeType === 1 && (elem.className ?
47403                 (" " + elem.className + " ").replace(rclass, " ") :
47404                 ""
47405               );
47406
47407               if (cur) {
47408                 j = 0;
47409                 while ((clazz = classes[j++])) {
47410                   // Remove *all* instances
47411                   while (cur.indexOf(" " + clazz + " ") >= 0) {
47412                     cur = cur.replace(" " + clazz + " ", " ");
47413                   }
47414                 }
47415
47416                 // Only assign if different to avoid unneeded rendering.
47417                 finalValue = value ? jQuery.trim(cur) : "";
47418                 if (elem.className !== finalValue) {
47419                   elem.className = finalValue;
47420                 }
47421               }
47422             }
47423           }
47424
47425           return this;
47426         },
47427
47428         toggleClass: function(value, stateVal) {
47429           var type = typeof value;
47430
47431           if (typeof stateVal === "boolean" && type === "string") {
47432             return stateVal ? this.addClass(value) : this.removeClass(value);
47433           }
47434
47435           if (jQuery.isFunction(value)) {
47436             return this.each(function(i) {
47437               jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal);
47438             });
47439           }
47440
47441           return this.each(function() {
47442             if (type === "string") {
47443               // Toggle individual class names
47444               var className,
47445                 i = 0,
47446                 self = jQuery(this),
47447                 classNames = value.match(rnotwhite) || [];
47448
47449               while ((className = classNames[i++])) {
47450                 // Check each className given, space separated list
47451                 if (self.hasClass(className)) {
47452                   self.removeClass(className);
47453                 } else {
47454                   self.addClass(className);
47455                 }
47456               }
47457
47458               // Toggle whole class name
47459             } else if (type === strundefined || type === "boolean") {
47460               if (this.className) {
47461                 // store className if set
47462                 data_priv.set(this, "__className__", this.className);
47463               }
47464
47465               // If the element has a class name or if we're passed `false`,
47466               // then remove the whole classname (if there was one, the above
47467               // saved it).
47468               // Otherwise bring back whatever was previously saved (if
47469               // anything),
47470               // falling back to the empty string if nothing was stored.
47471               this.className = this.className || value === false ? "" : data_priv.get(this, "__className__") || "";
47472             }
47473           });
47474         },
47475
47476         hasClass: function(selector) {
47477           var className = " " + selector + " ",
47478             i = 0,
47479             l = this.length;
47480           for (; i < l; i++) {
47481             if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) {
47482               return true;
47483             }
47484           }
47485
47486           return false;
47487         }
47488       });
47489
47490
47491
47492
47493       var rreturn = /\r/g;
47494
47495       jQuery.fn.extend({
47496         val: function(value) {
47497           var hooks, ret, isFunction,
47498             elem = this[0];
47499
47500           if (!arguments.length) {
47501             if (elem) {
47502               hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
47503
47504               if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
47505                 return ret;
47506               }
47507
47508               ret = elem.value;
47509
47510               return typeof ret === "string" ?
47511                 // Handle most common string cases
47512                 ret.replace(rreturn, "") :
47513                 // Handle cases where value is null/undef or number
47514                 ret == null ? "" : ret;
47515             }
47516
47517             return;
47518           }
47519
47520           isFunction = jQuery.isFunction(value);
47521
47522           return this.each(function(i) {
47523             var val;
47524
47525             if (this.nodeType !== 1) {
47526               return;
47527             }
47528
47529             if (isFunction) {
47530               val = value.call(this, i, jQuery(this).val());
47531             } else {
47532               val = value;
47533             }
47534
47535             // Treat null/undefined as ""; convert numbers to string
47536             if (val == null) {
47537               val = "";
47538
47539             } else if (typeof val === "number") {
47540               val += "";
47541
47542             } else if (jQuery.isArray(val)) {
47543               val = jQuery.map(val, function(value) {
47544                 return value == null ? "" : value + "";
47545               });
47546             }
47547
47548             hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
47549
47550             // If set returns undefined, fall back to normal setting
47551             if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) {
47552               this.value = val;
47553             }
47554           });
47555         }
47556       });
47557
47558       jQuery.extend({
47559         valHooks: {
47560           option: {
47561             get: function(elem) {
47562               var val = jQuery.find.attr(elem, "value");
47563               return val != null ?
47564                 val :
47565                 // Support: IE10-11+
47566                 // option.text throws exceptions (#14686, #14858)
47567                 jQuery.trim(jQuery.text(elem));
47568             }
47569           },
47570           select: {
47571             get: function(elem) {
47572               var value, option,
47573                 options = elem.options,
47574                 index = elem.selectedIndex,
47575                 one = elem.type === "select-one" || index < 0,
47576                 values = one ? null : [],
47577                 max = one ? index + 1 : options.length,
47578                 i = index < 0 ?
47579                 max :
47580                 one ? index : 0;
47581
47582               // Loop through all the selected options
47583               for (; i < max; i++) {
47584                 option = options[i];
47585
47586                 // IE6-9 doesn't update selected after form reset (#2551)
47587                 if ((option.selected || i === index) &&
47588                   // Don't return options that are disabled or in a
47589                   // disabled optgroup
47590                   (support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
47591                   (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) {
47592
47593                   // Get the specific value for the option
47594                   value = jQuery(option).val();
47595
47596                   // We don't need an array for one selects
47597                   if (one) {
47598                     return value;
47599                   }
47600
47601                   // Multi-Selects return an array
47602                   values.push(value);
47603                 }
47604               }
47605
47606               return values;
47607             },
47608
47609             set: function(elem, value) {
47610               var optionSet, option,
47611                 options = elem.options,
47612                 values = jQuery.makeArray(value),
47613                 i = options.length;
47614
47615               while (i--) {
47616                 option = options[i];
47617                 if ((option.selected = jQuery.inArray(option.value, values) >= 0)) {
47618                   optionSet = true;
47619                 }
47620               }
47621
47622               // Force browsers to behave consistently when non-matching value
47623               // is set
47624               if (!optionSet) {
47625                 elem.selectedIndex = -1;
47626               }
47627               return values;
47628             }
47629           }
47630         }
47631       });
47632
47633       // Radios and checkboxes getter/setter
47634       jQuery.each(["radio", "checkbox"], function() {
47635         jQuery.valHooks[this] = {
47636           set: function(elem, value) {
47637             if (jQuery.isArray(value)) {
47638               return (elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0);
47639             }
47640           }
47641         };
47642         if (!support.checkOn) {
47643           jQuery.valHooks[this].get = function(elem) {
47644             return elem.getAttribute("value") === null ? "on" : elem.value;
47645           };
47646         }
47647       });
47648
47649
47650
47651
47652       // Return jQuery for attributes-only inclusion
47653
47654
47655       jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " +
47656         "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
47657         "change select submit keydown keypress keyup error contextmenu").split(" "), function(i, name) {
47658
47659         // Handle event binding
47660         jQuery.fn[name] = function(data, fn) {
47661           return arguments.length > 0 ?
47662             this.on(name, null, data, fn) :
47663             this.trigger(name);
47664         };
47665       });
47666
47667       jQuery.fn.extend({
47668         hover: function(fnOver, fnOut) {
47669           return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
47670         },
47671
47672         bind: function(types, data, fn) {
47673           return this.on(types, null, data, fn);
47674         },
47675         unbind: function(types, fn) {
47676           return this.off(types, null, fn);
47677         },
47678
47679         delegate: function(selector, types, data, fn) {
47680           return this.on(types, selector, data, fn);
47681         },
47682         undelegate: function(selector, types, fn) {
47683           // ( namespace ) or ( selector, types [, fn] )
47684           return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
47685         }
47686       });
47687
47688
47689       var nonce = jQuery.now();
47690
47691       var rquery = (/\?/);
47692
47693
47694
47695       // Support: Android 2.3
47696       // Workaround failure to string-cast null input
47697       jQuery.parseJSON = function(data) {
47698         return JSON.parse(data + "");
47699       };
47700
47701
47702       // Cross-browser xml parsing
47703       jQuery.parseXML = function(data) {
47704         var xml, tmp;
47705         if (!data || typeof data !== "string") {
47706           return null;
47707         }
47708
47709         // Support: IE9
47710         try {
47711           tmp = new DOMParser();
47712           xml = tmp.parseFromString(data, "text/xml");
47713         } catch (e) {
47714           xml = undefined;
47715         }
47716
47717         if (!xml || xml.getElementsByTagName("parsererror").length) {
47718           jQuery.error("Invalid XML: " + data);
47719         }
47720         return xml;
47721       };
47722
47723
47724       var
47725         rhash = /#.*$/,
47726         rts = /([?&])_=[^&]*/,
47727         rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
47728         // #7653, #8125, #8152: local protocol detection
47729         rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
47730         rnoContent = /^(?:GET|HEAD)$/,
47731         rprotocol = /^\/\//,
47732         rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
47733
47734         /*
47735          * Prefilters 1) They are useful to introduce custom dataTypes (see
47736          * ajax/jsonp.js for an example) 2) These are called: - BEFORE asking for a
47737          * transport - AFTER param serialization (s.data is a string if
47738          * s.processData is true) 3) key is the dataType 4) the catchall symbol "*"
47739          * can be used 5) execution will start with transport dataType and THEN
47740          * continue down to "*" if needed
47741          */
47742         prefilters = {},
47743
47744         /*
47745          * Transports bindings 1) key is the dataType 2) the catchall symbol "*" can
47746          * be used 3) selection will start with transport dataType and THEN go to
47747          * "*" if needed
47748          */
47749         transports = {},
47750
47751         // Avoid comment-prolog char sequence (#10098); must appease lint and evade
47752         // compression
47753         allTypes = "*/".concat("*"),
47754
47755         // Document location
47756         ajaxLocation = window.location.href,
47757
47758         // Segment location into parts
47759         ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [];
47760
47761       // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
47762       function addToPrefiltersOrTransports(structure) {
47763
47764         // dataTypeExpression is optional and defaults to "*"
47765         return function(dataTypeExpression, func) {
47766
47767           if (typeof dataTypeExpression !== "string") {
47768             func = dataTypeExpression;
47769             dataTypeExpression = "*";
47770           }
47771
47772           var dataType,
47773             i = 0,
47774             dataTypes = dataTypeExpression.toLowerCase().match(rnotwhite) || [];
47775
47776           if (jQuery.isFunction(func)) {
47777             // For each dataType in the dataTypeExpression
47778             while ((dataType = dataTypes[i++])) {
47779               // Prepend if requested
47780               if (dataType[0] === "+") {
47781                 dataType = dataType.slice(1) || "*";
47782                 (structure[dataType] = structure[dataType] || []).unshift(func);
47783
47784                 // Otherwise append
47785               } else {
47786                 (structure[dataType] = structure[dataType] || []).push(func);
47787               }
47788             }
47789           }
47790         };
47791       }
47792
47793       // Base inspection function for prefilters and transports
47794       function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
47795
47796         var inspected = {},
47797           seekingTransport = (structure === transports);
47798
47799         function inspect(dataType) {
47800           var selected;
47801           inspected[dataType] = true;
47802           jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
47803             var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
47804             if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
47805               options.dataTypes.unshift(dataTypeOrTransport);
47806               inspect(dataTypeOrTransport);
47807               return false;
47808             } else if (seekingTransport) {
47809               return !(selected = dataTypeOrTransport);
47810             }
47811           });
47812           return selected;
47813         }
47814
47815         return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
47816       }
47817
47818       // A special extend for ajax options
47819       // that takes "flat" options (not to be deep extended)
47820       // Fixes #9887
47821       function ajaxExtend(target, src) {
47822         var key, deep,
47823           flatOptions = jQuery.ajaxSettings.flatOptions || {};
47824
47825         for (key in src) {
47826           if (src[key] !== undefined) {
47827             (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];
47828           }
47829         }
47830         if (deep) {
47831           jQuery.extend(true, target, deep);
47832         }
47833
47834         return target;
47835       }
47836
47837       /*
47838        * Handles responses to an ajax request: - finds the right dataType (mediates
47839        * between content-type and expected dataType) - returns the corresponding
47840        * response
47841        */
47842       function ajaxHandleResponses(s, jqXHR, responses) {
47843
47844         var ct, type, finalDataType, firstDataType,
47845           contents = s.contents,
47846           dataTypes = s.dataTypes;
47847
47848         // Remove auto dataType and get content-type in the process
47849         while (dataTypes[0] === "*") {
47850           dataTypes.shift();
47851           if (ct === undefined) {
47852             ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
47853           }
47854         }
47855
47856         // Check if we're dealing with a known content-type
47857         if (ct) {
47858           for (type in contents) {
47859             if (contents[type] && contents[type].test(ct)) {
47860               dataTypes.unshift(type);
47861               break;
47862             }
47863           }
47864         }
47865
47866         // Check to see if we have a response for the expected dataType
47867         if (dataTypes[0] in responses) {
47868           finalDataType = dataTypes[0];
47869         } else {
47870           // Try convertible dataTypes
47871           for (type in responses) {
47872             if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
47873               finalDataType = type;
47874               break;
47875             }
47876             if (!firstDataType) {
47877               firstDataType = type;
47878             }
47879           }
47880           // Or just use first one
47881           finalDataType = finalDataType || firstDataType;
47882         }
47883
47884         // If we found a dataType
47885         // We add the dataType to the list if needed
47886         // and return the corresponding response
47887         if (finalDataType) {
47888           if (finalDataType !== dataTypes[0]) {
47889             dataTypes.unshift(finalDataType);
47890           }
47891           return responses[finalDataType];
47892         }
47893       }
47894
47895       /*
47896        * Chain conversions given the request and the original response Also sets the
47897        * responseXXX fields on the jqXHR instance
47898        */
47899       function ajaxConvert(s, response, jqXHR, isSuccess) {
47900         var conv2, current, conv, tmp, prev,
47901           converters = {},
47902           // Work with a copy of dataTypes in case we need to modify it for
47903           // conversion
47904           dataTypes = s.dataTypes.slice();
47905
47906         // Create converters map with lowercased keys
47907         if (dataTypes[1]) {
47908           for (conv in s.converters) {
47909             converters[conv.toLowerCase()] = s.converters[conv];
47910           }
47911         }
47912
47913         current = dataTypes.shift();
47914
47915         // Convert to each sequential dataType
47916         while (current) {
47917
47918           if (s.responseFields[current]) {
47919             jqXHR[s.responseFields[current]] = response;
47920           }
47921
47922           // Apply the dataFilter if provided
47923           if (!prev && isSuccess && s.dataFilter) {
47924             response = s.dataFilter(response, s.dataType);
47925           }
47926
47927           prev = current;
47928           current = dataTypes.shift();
47929
47930           if (current) {
47931
47932             // There's only work to do if current dataType is non-auto
47933             if (current === "*") {
47934
47935               current = prev;
47936
47937               // Convert response if prev dataType is non-auto and differs from
47938               // current
47939             } else if (prev !== "*" && prev !== current) {
47940
47941               // Seek a direct converter
47942               conv = converters[prev + " " + current] || converters["* " + current];
47943
47944               // If none found, seek a pair
47945               if (!conv) {
47946                 for (conv2 in converters) {
47947
47948                   // If conv2 outputs current
47949                   tmp = conv2.split(" ");
47950                   if (tmp[1] === current) {
47951
47952                     // If prev can be converted to accepted input
47953                     conv = converters[prev + " " + tmp[0]] ||
47954                       converters["* " + tmp[0]];
47955                     if (conv) {
47956                       // Condense equivalence converters
47957                       if (conv === true) {
47958                         conv = converters[conv2];
47959
47960                         // Otherwise, insert the intermediate dataType
47961                       } else if (converters[conv2] !== true) {
47962                         current = tmp[0];
47963                         dataTypes.unshift(tmp[1]);
47964                       }
47965                       break;
47966                     }
47967                   }
47968                 }
47969               }
47970
47971               // Apply converter (if not an equivalence)
47972               if (conv !== true) {
47973
47974                 // Unless errors are allowed to bubble, catch and return
47975                 // them
47976                 if (conv && s["throws"]) {
47977                   response = conv(response);
47978                 } else {
47979                   try {
47980                     response = conv(response);
47981                   } catch (e) {
47982                     return {
47983                       state: "parsererror",
47984                       error: conv ? e : "No conversion from " + prev + " to " + current
47985                     };
47986                   }
47987                 }
47988               }
47989             }
47990           }
47991         }
47992
47993         return {
47994           state: "success",
47995           data: response
47996         };
47997       }
47998
47999       jQuery.extend({
48000
48001         // Counter for holding the number of active queries
48002         active: 0,
48003
48004         // Last-Modified header cache for next request
48005         lastModified: {},
48006         etag: {},
48007
48008         ajaxSettings: {
48009           url: ajaxLocation,
48010           type: "GET",
48011           isLocal: rlocalProtocol.test(ajaxLocParts[1]),
48012           global: true,
48013           processData: true,
48014           async: true,
48015           contentType: "application/x-www-form-urlencoded; charset=UTF-8",
48016           /*
48017            * timeout: 0, data: null, dataType: null, username: null, password:
48018            * null, cache: null, throws: false, traditional: false, headers: {},
48019            */
48020
48021           accepts: {
48022             "*": allTypes,
48023             text: "text/plain",
48024             html: "text/html",
48025             xml: "application/xml, text/xml",
48026             json: "application/json, text/javascript"
48027           },
48028
48029           contents: {
48030             xml: /xml/,
48031             html: /html/,
48032             json: /json/
48033           },
48034
48035           responseFields: {
48036             xml: "responseXML",
48037             text: "responseText",
48038             json: "responseJSON"
48039           },
48040
48041           // Data converters
48042           // Keys separate source (or catchall "*") and destination types with a
48043           // single space
48044           converters: {
48045
48046             // Convert anything to text
48047             "* text": String,
48048
48049             // Text to html (true = no transformation)
48050             "text html": true,
48051
48052             // Evaluate text as a json expression
48053             "text json": jQuery.parseJSON,
48054
48055             // Parse text as xml
48056             "text xml": jQuery.parseXML
48057           },
48058
48059           // For options that shouldn't be deep extended:
48060           // you can add your own custom options here if
48061           // and when you create one that shouldn't be
48062           // deep extended (see ajaxExtend)
48063           flatOptions: {
48064             url: true,
48065             context: true
48066           }
48067         },
48068
48069         // Creates a full fledged settings object into target
48070         // with both ajaxSettings and settings fields.
48071         // If target is omitted, writes into ajaxSettings.
48072         ajaxSetup: function(target, settings) {
48073           return settings ?
48074
48075             // Building a settings object
48076             ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :
48077
48078             // Extending ajaxSettings
48079             ajaxExtend(jQuery.ajaxSettings, target);
48080         },
48081
48082         ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
48083         ajaxTransport: addToPrefiltersOrTransports(transports),
48084
48085         // Main method
48086         ajax: function(url, options) {
48087
48088           // If url is an object, simulate pre-1.5 signature
48089           if (typeof url === "object") {
48090             options = url;
48091             url = undefined;
48092           }
48093
48094           // Force options to be an object
48095           options = options || {};
48096
48097           var transport,
48098             // URL without anti-cache param
48099             cacheURL,
48100             // Response headers
48101             responseHeadersString,
48102             responseHeaders,
48103             // timeout handle
48104             timeoutTimer,
48105             // Cross-domain detection vars
48106             parts,
48107             // To know if global events are to be dispatched
48108             fireGlobals,
48109             // Loop variable
48110             i,
48111             // Create the final options object
48112             s = jQuery.ajaxSetup({}, options),
48113             // Callbacks context
48114             callbackContext = s.context || s,
48115             // Context for global events is callbackContext if it is a DOM node
48116             // or jQuery collection
48117             globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ?
48118             jQuery(callbackContext) :
48119             jQuery.event,
48120             // Deferreds
48121             deferred = jQuery.Deferred(),
48122             completeDeferred = jQuery.Callbacks("once memory"),
48123             // Status-dependent callbacks
48124             statusCode = s.statusCode || {},
48125             // Headers (they are sent all at once)
48126             requestHeaders = {},
48127             requestHeadersNames = {},
48128             // The jqXHR state
48129             state = 0,
48130             // Default abort message
48131             strAbort = "canceled",
48132             // Fake xhr
48133             jqXHR = {
48134               readyState: 0,
48135
48136               // Builds headers hashtable if needed
48137               getResponseHeader: function(key) {
48138                 var match;
48139                 if (state === 2) {
48140                   if (!responseHeaders) {
48141                     responseHeaders = {};
48142                     while ((match = rheaders.exec(responseHeadersString))) {
48143                       responseHeaders[match[1].toLowerCase()] = match[2];
48144                     }
48145                   }
48146                   match = responseHeaders[key.toLowerCase()];
48147                 }
48148                 return match == null ? null : match;
48149               },
48150
48151               // Raw string
48152               getAllResponseHeaders: function() {
48153                 return state === 2 ? responseHeadersString : null;
48154               },
48155
48156               // Caches the header
48157               setRequestHeader: function(name, value) {
48158                 var lname = name.toLowerCase();
48159                 if (!state) {
48160                   name = requestHeadersNames[lname] = requestHeadersNames[lname] || name;
48161                   requestHeaders[name] = value;
48162                 }
48163                 return this;
48164               },
48165
48166               // Overrides response content-type header
48167               overrideMimeType: function(type) {
48168                 if (!state) {
48169                   s.mimeType = type;
48170                 }
48171                 return this;
48172               },
48173
48174               // Status-dependent callbacks
48175               statusCode: function(map) {
48176                 var code;
48177                 if (map) {
48178                   if (state < 2) {
48179                     for (code in map) {
48180                       // Lazy-add the new callback in a way that
48181                       // preserves old ones
48182                       statusCode[code] = [statusCode[code], map[code]];
48183                     }
48184                   } else {
48185                     // Execute the appropriate callbacks
48186                     jqXHR.always(map[jqXHR.status]);
48187                   }
48188                 }
48189                 return this;
48190               },
48191
48192               // Cancel the request
48193               abort: function(statusText) {
48194                 var finalText = statusText || strAbort;
48195                 if (transport) {
48196                   transport.abort(finalText);
48197                 }
48198                 done(0, finalText);
48199                 return this;
48200               }
48201             };
48202
48203           // Attach deferreds
48204           deferred.promise(jqXHR).complete = completeDeferred.add;
48205           jqXHR.success = jqXHR.done;
48206           jqXHR.error = jqXHR.fail;
48207
48208           // Remove hash character (#7531: and string promotion)
48209           // Add protocol if not provided (prefilters might expect it)
48210           // Handle falsy url in the settings object (#10093: consistency with old
48211           // signature)
48212           // We also use the url parameter if available
48213           s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "")
48214             .replace(rprotocol, ajaxLocParts[1] + "//");
48215
48216           // Alias method option to type as per ticket #12004
48217           s.type = options.method || options.type || s.method || s.type;
48218
48219           // Extract dataTypes list
48220           s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(rnotwhite) || [""];
48221
48222           // A cross-domain request is in order when we have a protocol:host:port
48223           // mismatch
48224           if (s.crossDomain == null) {
48225             parts = rurl.exec(s.url.toLowerCase());
48226             s.crossDomain = !!(parts &&
48227               (parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] ||
48228                 (parts[3] || (parts[1] === "http:" ? "80" : "443")) !==
48229                 (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? "80" : "443")))
48230             );
48231           }
48232
48233           // Convert data if not already a string
48234           if (s.data && s.processData && typeof s.data !== "string") {
48235             s.data = jQuery.param(s.data, s.traditional);
48236           }
48237
48238           // Apply prefilters
48239           inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
48240
48241           // If request was aborted inside a prefilter, stop there
48242           if (state === 2) {
48243             return jqXHR;
48244           }
48245
48246           // We can fire global events as of now if asked to
48247           // Don't fire events if jQuery.event is undefined in an AMD-usage
48248           // scenario (#15118)
48249           fireGlobals = jQuery.event && s.global;
48250
48251           // Watch for a new set of requests
48252           if (fireGlobals && jQuery.active++ === 0) {
48253             jQuery.event.trigger("ajaxStart");
48254           }
48255
48256           // Uppercase the type
48257           s.type = s.type.toUpperCase();
48258
48259           // Determine if request has content
48260           s.hasContent = !rnoContent.test(s.type);
48261
48262           // Save the URL in case we're toying with the If-Modified-Since
48263           // and/or If-None-Match header later on
48264           cacheURL = s.url;
48265
48266           // More options handling for requests with no content
48267           if (!s.hasContent) {
48268
48269             // If data is available, append data to url
48270             if (s.data) {
48271               cacheURL = (s.url += (rquery.test(cacheURL) ? "&" : "?") + s.data);
48272               // #9682: remove data so that it's not used in an eventual retry
48273               delete s.data;
48274             }
48275
48276             // Add anti-cache in url if needed
48277             if (s.cache === false) {
48278               s.url = rts.test(cacheURL) ?
48279
48280                 // If there is already a '_' parameter, set its value
48281                 cacheURL.replace(rts, "$1_=" + nonce++) :
48282
48283                 // Otherwise add one to the end
48284                 cacheURL + (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce++;
48285             }
48286           }
48287
48288           // Set the If-Modified-Since and/or If-None-Match header, if in
48289           // ifModified mode.
48290           if (s.ifModified) {
48291             if (jQuery.lastModified[cacheURL]) {
48292               jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
48293             }
48294             if (jQuery.etag[cacheURL]) {
48295               jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
48296             }
48297           }
48298
48299           // Set the correct header, if data is being sent
48300           if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
48301             jqXHR.setRequestHeader("Content-Type", s.contentType);
48302           }
48303
48304           // Set the Accepts header for the server, depending on the dataType
48305           jqXHR.setRequestHeader(
48306             "Accept",
48307             s.dataTypes[0] && s.accepts[s.dataTypes[0]] ?
48308             s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") :
48309             s.accepts["*"]
48310           );
48311
48312           // Check for headers option
48313           for (i in s.headers) {
48314             jqXHR.setRequestHeader(i, s.headers[i]);
48315           }
48316
48317           // Allow custom headers/mimetypes and early abort
48318           if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) {
48319             // Abort if not done already and return
48320             return jqXHR.abort();
48321           }
48322
48323           // Aborting is no longer a cancellation
48324           strAbort = "abort";
48325
48326           // Install callbacks on deferreds
48327           for (i in {
48328               success: 1,
48329               error: 1,
48330               complete: 1
48331             }) {
48332             jqXHR[i](s[i]);
48333           }
48334
48335           // Get transport
48336           transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
48337
48338           // If no transport, we auto-abort
48339           if (!transport) {
48340             done(-1, "No Transport");
48341           } else {
48342             jqXHR.readyState = 1;
48343
48344             // Send global event
48345             if (fireGlobals) {
48346               globalEventContext.trigger("ajaxSend", [jqXHR, s]);
48347             }
48348             // Timeout
48349             if (s.async && s.timeout > 0) {
48350               timeoutTimer = setTimeout(function() {
48351                 jqXHR.abort("timeout");
48352               }, s.timeout);
48353             }
48354
48355             try {
48356               state = 1;
48357               transport.send(requestHeaders, done);
48358             } catch (e) {
48359               // Propagate exception as error if not done
48360               if (state < 2) {
48361                 done(-1, e);
48362                 // Simply rethrow otherwise
48363               } else {
48364                 throw e;
48365               }
48366             }
48367           }
48368
48369           // Callback for when everything is done
48370           function done(status, nativeStatusText, responses, headers) {
48371             var isSuccess, success, error, response, modified,
48372               statusText = nativeStatusText;
48373
48374             // Called once
48375             if (state === 2) {
48376               return;
48377             }
48378
48379             // State is "done" now
48380             state = 2;
48381
48382             // Clear timeout if it exists
48383             if (timeoutTimer) {
48384               clearTimeout(timeoutTimer);
48385             }
48386
48387             // Dereference transport for early garbage collection
48388             // (no matter how long the jqXHR object will be used)
48389             transport = undefined;
48390
48391             // Cache response headers
48392             responseHeadersString = headers || "";
48393
48394             // Set readyState
48395             jqXHR.readyState = status > 0 ? 4 : 0;
48396
48397             // Determine if successful
48398             isSuccess = status >= 200 && status < 300 || status === 304;
48399
48400             // Get response data
48401             if (responses) {
48402               response = ajaxHandleResponses(s, jqXHR, responses);
48403             }
48404
48405             // Convert no matter what (that way responseXXX fields are always
48406             // set)
48407             response = ajaxConvert(s, response, jqXHR, isSuccess);
48408
48409             // If successful, handle type chaining
48410             if (isSuccess) {
48411
48412               // Set the If-Modified-Since and/or If-None-Match header, if in
48413               // ifModified mode.
48414               if (s.ifModified) {
48415                 modified = jqXHR.getResponseHeader("Last-Modified");
48416                 if (modified) {
48417                   jQuery.lastModified[cacheURL] = modified;
48418                 }
48419                 modified = jqXHR.getResponseHeader("etag");
48420                 if (modified) {
48421                   jQuery.etag[cacheURL] = modified;
48422                 }
48423               }
48424
48425               // if no content
48426               if (status === 204 || s.type === "HEAD") {
48427                 statusText = "nocontent";
48428
48429                 // if not modified
48430               } else if (status === 304) {
48431                 statusText = "notmodified";
48432
48433                 // If we have data, let's convert it
48434               } else {
48435                 statusText = response.state;
48436                 success = response.data;
48437                 error = response.error;
48438                 isSuccess = !error;
48439               }
48440             } else {
48441               // Extract error from statusText and normalize for non-aborts
48442               error = statusText;
48443               if (status || !statusText) {
48444                 statusText = "error";
48445                 if (status < 0) {
48446                   status = 0;
48447                 }
48448               }
48449             }
48450
48451             // Set data for the fake xhr object
48452             jqXHR.status = status;
48453             jqXHR.statusText = (nativeStatusText || statusText) + "";
48454
48455             // Success/Error
48456             if (isSuccess) {
48457               deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
48458             } else {
48459               deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
48460             }
48461
48462             // Status-dependent callbacks
48463             jqXHR.statusCode(statusCode);
48464             statusCode = undefined;
48465
48466             if (fireGlobals) {
48467               globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]);
48468             }
48469
48470             // Complete
48471             completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
48472
48473             if (fireGlobals) {
48474               globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
48475               // Handle the global AJAX counter
48476               if (!(--jQuery.active)) {
48477                 jQuery.event.trigger("ajaxStop");
48478               }
48479             }
48480           }
48481
48482           return jqXHR;
48483         },
48484
48485         getJSON: function(url, data, callback) {
48486           return jQuery.get(url, data, callback, "json");
48487         },
48488
48489         getScript: function(url, callback) {
48490           return jQuery.get(url, undefined, callback, "script");
48491         }
48492       });
48493
48494       jQuery.each(["get", "post"], function(i, method) {
48495         jQuery[method] = function(url, data, callback, type) {
48496           // Shift arguments if data argument was omitted
48497           if (jQuery.isFunction(data)) {
48498             type = type || callback;
48499             callback = data;
48500             data = undefined;
48501           }
48502
48503           return jQuery.ajax({
48504             url: url,
48505             type: method,
48506             dataType: type,
48507             data: data,
48508             success: callback
48509           });
48510         };
48511       });
48512
48513
48514       jQuery._evalUrl = function(url) {
48515         return jQuery.ajax({
48516           url: url,
48517           type: "GET",
48518           dataType: "script",
48519           async: false,
48520           global: false,
48521           "throws": true
48522         });
48523       };
48524
48525
48526       jQuery.fn.extend({
48527         wrapAll: function(html) {
48528           var wrap;
48529
48530           if (jQuery.isFunction(html)) {
48531             return this.each(function(i) {
48532               jQuery(this).wrapAll(html.call(this, i));
48533             });
48534           }
48535
48536           if (this[0]) {
48537
48538             // The elements to wrap the target around
48539             wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
48540
48541             if (this[0].parentNode) {
48542               wrap.insertBefore(this[0]);
48543             }
48544
48545             wrap.map(function() {
48546               var elem = this;
48547
48548               while (elem.firstElementChild) {
48549                 elem = elem.firstElementChild;
48550               }
48551
48552               return elem;
48553             }).append(this);
48554           }
48555
48556           return this;
48557         },
48558
48559         wrapInner: function(html) {
48560           if (jQuery.isFunction(html)) {
48561             return this.each(function(i) {
48562               jQuery(this).wrapInner(html.call(this, i));
48563             });
48564           }
48565
48566           return this.each(function() {
48567             var self = jQuery(this),
48568               contents = self.contents();
48569
48570             if (contents.length) {
48571               contents.wrapAll(html);
48572
48573             } else {
48574               self.append(html);
48575             }
48576           });
48577         },
48578
48579         wrap: function(html) {
48580           var isFunction = jQuery.isFunction(html);
48581
48582           return this.each(function(i) {
48583             jQuery(this).wrapAll(isFunction ? html.call(this, i) : html);
48584           });
48585         },
48586
48587         unwrap: function() {
48588           return this.parent().each(function() {
48589             if (!jQuery.nodeName(this, "body")) {
48590               jQuery(this).replaceWith(this.childNodes);
48591             }
48592           }).end();
48593         }
48594       });
48595
48596
48597       jQuery.expr.filters.hidden = function(elem) {
48598         // Support: Opera <= 12.12
48599         // Opera reports offsetWidths and offsetHeights less than zero on some
48600         // elements
48601         return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
48602       };
48603       jQuery.expr.filters.visible = function(elem) {
48604         return !jQuery.expr.filters.hidden(elem);
48605       };
48606
48607
48608
48609
48610       var r20 = /%20/g,
48611         rbracket = /\[\]$/,
48612         rCRLF = /\r?\n/g,
48613         rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
48614         rsubmittable = /^(?:input|select|textarea|keygen)/i;
48615
48616       function buildParams(prefix, obj, traditional, add) {
48617         var name;
48618
48619         if (jQuery.isArray(obj)) {
48620           // Serialize array item.
48621           jQuery.each(obj, function(i, v) {
48622             if (traditional || rbracket.test(prefix)) {
48623               // Treat each array item as a scalar.
48624               add(prefix, v);
48625
48626             } else {
48627               // Item is non-scalar (array or object), encode its numeric
48628               // index.
48629               buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add);
48630             }
48631           });
48632
48633         } else if (!traditional && jQuery.type(obj) === "object") {
48634           // Serialize object item.
48635           for (name in obj) {
48636             buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
48637           }
48638
48639         } else {
48640           // Serialize scalar item.
48641           add(prefix, obj);
48642         }
48643       }
48644
48645       // Serialize an array of form elements or a set of
48646       // key/values into a query string
48647       jQuery.param = function(a, traditional) {
48648         var prefix,
48649           s = [],
48650           add = function(key, value) {
48651             // If value is a function, invoke it and return its value
48652             value = jQuery.isFunction(value) ? value() : (value == null ? "" : value);
48653             s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
48654           };
48655
48656         // Set traditional to true for jQuery <= 1.3.2 behavior.
48657         if (traditional === undefined) {
48658           traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
48659         }
48660
48661         // If an array was passed in, assume that it is an array of form elements.
48662         if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) {
48663           // Serialize the form elements
48664           jQuery.each(a, function() {
48665             add(this.name, this.value);
48666           });
48667
48668         } else {
48669           // If traditional, encode the "old" way (the way 1.3.2 or older
48670           // did it), otherwise encode params recursively.
48671           for (prefix in a) {
48672             buildParams(prefix, a[prefix], traditional, add);
48673           }
48674         }
48675
48676         // Return the resulting serialization
48677         return s.join("&").replace(r20, "+");
48678       };
48679
48680       jQuery.fn.extend({
48681         serialize: function() {
48682           return jQuery.param(this.serializeArray());
48683         },
48684         serializeArray: function() {
48685           return this.map(function() {
48686               // Can add propHook for "elements" to filter or add form elements
48687               var elements = jQuery.prop(this, "elements");
48688               return elements ? jQuery.makeArray(elements) : this;
48689             })
48690             .filter(function() {
48691               var type = this.type;
48692
48693               // Use .is( ":disabled" ) so that fieldset[disabled] works
48694               return this.name && !jQuery(this).is(":disabled") &&
48695                 rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&
48696                 (this.checked || !rcheckableType.test(type));
48697             })
48698             .map(function(i, elem) {
48699               var val = jQuery(this).val();
48700
48701               return val == null ?
48702                 null :
48703                 jQuery.isArray(val) ?
48704                 jQuery.map(val, function(val) {
48705                   return {
48706                     name: elem.name,
48707                     value: val.replace(rCRLF, "\r\n")
48708                   };
48709                 }) : {
48710                   name: elem.name,
48711                   value: val.replace(rCRLF, "\r\n")
48712                 };
48713             }).get();
48714         }
48715       });
48716
48717
48718       jQuery.ajaxSettings.xhr = function() {
48719         try {
48720           return new XMLHttpRequest();
48721         } catch (e) {}
48722       };
48723
48724       var xhrId = 0,
48725         xhrCallbacks = {},
48726         xhrSuccessStatus = {
48727           // file protocol always yields status code 0, assume 200
48728           0: 200,
48729           // Support: IE9
48730           // #1450: sometimes IE returns 1223 when it should be 204
48731           1223: 204
48732         },
48733         xhrSupported = jQuery.ajaxSettings.xhr();
48734
48735       // Support: IE9
48736       // Open requests must be manually aborted on unload (#5280)
48737       // See https://support.microsoft.com/kb/2856746 for more info
48738       if (window.attachEvent) {
48739         window.attachEvent("onunload", function() {
48740           for (var key in xhrCallbacks) {
48741             xhrCallbacks[key]();
48742           }
48743         });
48744       }
48745
48746       support.cors = !!xhrSupported && ("withCredentials" in xhrSupported);
48747       support.ajax = xhrSupported = !!xhrSupported;
48748
48749       jQuery.ajaxTransport(function(options) {
48750         var callback;
48751
48752         // Cross domain only allowed if supported through XMLHttpRequest
48753         if (support.cors || xhrSupported && !options.crossDomain) {
48754           return {
48755             send: function(headers, complete) {
48756               var i,
48757                 xhr = options.xhr(),
48758                 id = ++xhrId;
48759
48760               xhr.open(options.type, options.url, options.async, options.username, options.password);
48761
48762               // Apply custom fields if provided
48763               if (options.xhrFields) {
48764                 for (i in options.xhrFields) {
48765                   xhr[i] = options.xhrFields[i];
48766                 }
48767               }
48768
48769               // Override mime type if needed
48770               if (options.mimeType && xhr.overrideMimeType) {
48771                 xhr.overrideMimeType(options.mimeType);
48772               }
48773
48774               // X-Requested-With header
48775               // For cross-domain requests, seeing as conditions for a
48776               // preflight are
48777               // akin to a jigsaw puzzle, we simply never set it to be sure.
48778               // (it can always be set on a per-request basis or even using
48779               // ajaxSetup)
48780               // For same-domain requests, won't change header if already
48781               // provided.
48782               if (!options.crossDomain && !headers["X-Requested-With"]) {
48783                 headers["X-Requested-With"] = "XMLHttpRequest";
48784               }
48785
48786               // Set headers
48787               for (i in headers) {
48788                 xhr.setRequestHeader(i, headers[i]);
48789               }
48790
48791               // Callback
48792               callback = function(type) {
48793                 return function() {
48794                   if (callback) {
48795                     delete xhrCallbacks[id];
48796                     callback = xhr.onload = xhr.onerror = null;
48797
48798                     if (type === "abort") {
48799                       xhr.abort();
48800                     } else if (type === "error") {
48801                       complete(
48802                         // file: protocol always yields status 0;
48803                         // see #8605, #14207
48804                         xhr.status,
48805                         xhr.statusText
48806                       );
48807                     } else {
48808                       complete(
48809                         xhrSuccessStatus[xhr.status] || xhr.status,
48810                         xhr.statusText,
48811                         // Support: IE9
48812                         // Accessing binary-data responseText throws
48813                         // an exception
48814                         // (#11426)
48815                         typeof xhr.responseText === "string" ? {
48816                           text: xhr.responseText
48817                         } : undefined,
48818                         xhr.getAllResponseHeaders()
48819                       );
48820                     }
48821                   }
48822                 };
48823               };
48824
48825               // Listen to events
48826               xhr.onload = callback();
48827               xhr.onerror = callback("error");
48828
48829               // Create the abort callback
48830               callback = xhrCallbacks[id] = callback("abort");
48831
48832               try {
48833                 // Do send the request (this may raise an exception)
48834                 xhr.send(options.hasContent && options.data || null);
48835               } catch (e) {
48836                 // #14683: Only rethrow if this hasn't been notified as an
48837                 // error yet
48838                 if (callback) {
48839                   throw e;
48840                 }
48841               }
48842             },
48843
48844             abort: function() {
48845               if (callback) {
48846                 callback();
48847               }
48848             }
48849           };
48850         }
48851       });
48852
48853
48854
48855
48856       // Install script dataType
48857       jQuery.ajaxSetup({
48858         accepts: {
48859           script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
48860         },
48861         contents: {
48862           script: /(?:java|ecma)script/
48863         },
48864         converters: {
48865           "text script": function(text) {
48866             jQuery.globalEval(text);
48867             return text;
48868           }
48869         }
48870       });
48871
48872       // Handle cache's special case and crossDomain
48873       jQuery.ajaxPrefilter("script", function(s) {
48874         if (s.cache === undefined) {
48875           s.cache = false;
48876         }
48877         if (s.crossDomain) {
48878           s.type = "GET";
48879         }
48880       });
48881
48882       // Bind script tag hack transport
48883       jQuery.ajaxTransport("script", function(s) {
48884         // This transport only deals with cross domain requests
48885         if (s.crossDomain) {
48886           var script, callback;
48887           return {
48888             send: function(_, complete) {
48889               script = jQuery("<script>").prop({
48890                 async: true,
48891                 charset: s.scriptCharset,
48892                 src: s.url
48893               }).on(
48894                 "load error",
48895                 callback = function(evt) {
48896                   script.remove();
48897                   callback = null;
48898                   if (evt) {
48899                     complete(evt.type === "error" ? 404 : 200, evt.type);
48900                   }
48901                 }
48902               );
48903               document.head.appendChild(script[0]);
48904             },
48905             abort: function() {
48906               if (callback) {
48907                 callback();
48908               }
48909             }
48910           };
48911         }
48912       });
48913
48914
48915
48916
48917       var oldCallbacks = [],
48918         rjsonp = /(=)\?(?=&|$)|\?\?/;
48919
48920       // Default jsonp settings
48921       jQuery.ajaxSetup({
48922         jsonp: "callback",
48923         jsonpCallback: function() {
48924           var callback = oldCallbacks.pop() || (jQuery.expando + "_" + (nonce++));
48925           this[callback] = true;
48926           return callback;
48927         }
48928       });
48929
48930       // Detect, normalize options and install callbacks for jsonp requests
48931       jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
48932
48933         var callbackName, overwritten, responseContainer,
48934           jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ?
48935             "url" :
48936             typeof s.data === "string" && !(s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(s.data) && "data"
48937           );
48938
48939         // Handle iff the expected data type is "jsonp" or we have a parameter to
48940         // set
48941         if (jsonProp || s.dataTypes[0] === "jsonp") {
48942
48943           // Get callback name, remembering preexisting value associated with it
48944           callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ?
48945             s.jsonpCallback() :
48946             s.jsonpCallback;
48947
48948           // Insert callback into url or form data
48949           if (jsonProp) {
48950             s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
48951           } else if (s.jsonp !== false) {
48952             s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
48953           }
48954
48955           // Use data converter to retrieve json after script execution
48956           s.converters["script json"] = function() {
48957             if (!responseContainer) {
48958               jQuery.error(callbackName + " was not called");
48959             }
48960             return responseContainer[0];
48961           };
48962
48963           // force json dataType
48964           s.dataTypes[0] = "json";
48965
48966           // Install callback
48967           overwritten = window[callbackName];
48968           window[callbackName] = function() {
48969             responseContainer = arguments;
48970           };
48971
48972           // Clean-up function (fires after converters)
48973           jqXHR.always(function() {
48974             // Restore preexisting value
48975             window[callbackName] = overwritten;
48976
48977             // Save back as free
48978             if (s[callbackName]) {
48979               // make sure that re-using the options doesn't screw things
48980               // around
48981               s.jsonpCallback = originalSettings.jsonpCallback;
48982
48983               // save the callback name for future use
48984               oldCallbacks.push(callbackName);
48985             }
48986
48987             // Call if it was a function and we have a response
48988             if (responseContainer && jQuery.isFunction(overwritten)) {
48989               overwritten(responseContainer[0]);
48990             }
48991
48992             responseContainer = overwritten = undefined;
48993           });
48994
48995           // Delegate to script
48996           return "script";
48997         }
48998       });
48999
49000
49001
49002
49003       // data: string of html
49004       // context (optional): If specified, the fragment will be created in this
49005       // context, defaults to document
49006       // keepScripts (optional): If true, will include scripts passed in the html
49007       // string
49008       jQuery.parseHTML = function(data, context, keepScripts) {
49009         if (!data || typeof data !== "string") {
49010           return null;
49011         }
49012         if (typeof context === "boolean") {
49013           keepScripts = context;
49014           context = false;
49015         }
49016         context = context || document;
49017
49018         var parsed = rsingleTag.exec(data),
49019           scripts = !keepScripts && [];
49020
49021         // Single tag
49022         if (parsed) {
49023           return [context.createElement(parsed[1])];
49024         }
49025
49026         parsed = jQuery.buildFragment([data], context, scripts);
49027
49028         if (scripts && scripts.length) {
49029           jQuery(scripts).remove();
49030         }
49031
49032         return jQuery.merge([], parsed.childNodes);
49033       };
49034
49035
49036       // Keep a copy of the old load method
49037       var _load = jQuery.fn.load;
49038
49039       /**
49040        * Load a url into a page
49041        */
49042       jQuery.fn.load = function(url, params, callback) {
49043         if (typeof url !== "string" && _load) {
49044           return _load.apply(this, arguments);
49045         }
49046
49047         var selector, type, response,
49048           self = this,
49049           off = url.indexOf(" ");
49050
49051         if (off >= 0) {
49052           selector = jQuery.trim(url.slice(off));
49053           url = url.slice(0, off);
49054         }
49055
49056         // If it's a function
49057         if (jQuery.isFunction(params)) {
49058
49059           // We assume that it's the callback
49060           callback = params;
49061           params = undefined;
49062
49063           // Otherwise, build a param string
49064         } else if (params && typeof params === "object") {
49065           type = "POST";
49066         }
49067
49068         // If we have elements to modify, make the request
49069         if (self.length > 0) {
49070           jQuery.ajax({
49071             url: url,
49072
49073             // if "type" variable is undefined, then "GET" method will be used
49074             type: type,
49075             dataType: "html",
49076             data: params
49077           }).done(function(responseText) {
49078
49079             // Save response for use in complete callback
49080             response = arguments;
49081
49082             self.html(selector ?
49083
49084               // If a selector was specified, locate the right elements in a
49085               // dummy div
49086               // Exclude scripts to avoid IE 'Permission Denied' errors
49087               jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) :
49088
49089               // Otherwise use the full result
49090               responseText);
49091
49092           }).complete(callback && function(jqXHR, status) {
49093             self.each(callback, response || [jqXHR.responseText, status, jqXHR]);
49094           });
49095         }
49096
49097         return this;
49098       };
49099
49100
49101
49102
49103       // Attach a bunch of functions for handling common AJAX events
49104       jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(i, type) {
49105         jQuery.fn[type] = function(fn) {
49106           return this.on(type, fn);
49107         };
49108       });
49109
49110
49111
49112
49113       jQuery.expr.filters.animated = function(elem) {
49114         return jQuery.grep(jQuery.timers, function(fn) {
49115           return elem === fn.elem;
49116         }).length;
49117       };
49118
49119
49120
49121
49122       var docElem = window.document.documentElement;
49123
49124       /**
49125        * Gets a window from an element
49126        */
49127       function getWindow(elem) {
49128         return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
49129       }
49130
49131       jQuery.offset = {
49132         setOffset: function(elem, options, i) {
49133           var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
49134             position = jQuery.css(elem, "position"),
49135             curElem = jQuery(elem),
49136             props = {};
49137
49138           // Set position first, in-case top/left are set even on static elem
49139           if (position === "static") {
49140             elem.style.position = "relative";
49141           }
49142
49143           curOffset = curElem.offset();
49144           curCSSTop = jQuery.css(elem, "top");
49145           curCSSLeft = jQuery.css(elem, "left");
49146           calculatePosition = (position === "absolute" || position === "fixed") &&
49147             (curCSSTop + curCSSLeft).indexOf("auto") > -1;
49148
49149           // Need to be able to calculate position if either
49150           // top or left is auto and position is either absolute or fixed
49151           if (calculatePosition) {
49152             curPosition = curElem.position();
49153             curTop = curPosition.top;
49154             curLeft = curPosition.left;
49155
49156           } else {
49157             curTop = parseFloat(curCSSTop) || 0;
49158             curLeft = parseFloat(curCSSLeft) || 0;
49159           }
49160
49161           if (jQuery.isFunction(options)) {
49162             options = options.call(elem, i, curOffset);
49163           }
49164
49165           if (options.top != null) {
49166             props.top = (options.top - curOffset.top) + curTop;
49167           }
49168           if (options.left != null) {
49169             props.left = (options.left - curOffset.left) + curLeft;
49170           }
49171
49172           if ("using" in options) {
49173             options.using.call(elem, props);
49174
49175           } else {
49176             curElem.css(props);
49177           }
49178         }
49179       };
49180
49181       jQuery.fn.extend({
49182         offset: function(options) {
49183           if (arguments.length) {
49184             return options === undefined ?
49185               this :
49186               this.each(function(i) {
49187                 jQuery.offset.setOffset(this, options, i);
49188               });
49189           }
49190
49191           var docElem, win,
49192             elem = this[0],
49193             box = {
49194               top: 0,
49195               left: 0
49196             },
49197             doc = elem && elem.ownerDocument;
49198
49199           if (!doc) {
49200             return;
49201           }
49202
49203           docElem = doc.documentElement;
49204
49205           // Make sure it's not a disconnected DOM node
49206           if (!jQuery.contains(docElem, elem)) {
49207             return box;
49208           }
49209
49210           // Support: BlackBerry 5, iOS 3 (original iPhone)
49211           // If we don't have gBCR, just use 0,0 rather than error
49212           if (typeof elem.getBoundingClientRect !== strundefined) {
49213             box = elem.getBoundingClientRect();
49214           }
49215           win = getWindow(doc);
49216           return {
49217             top: box.top + win.pageYOffset - docElem.clientTop,
49218             left: box.left + win.pageXOffset - docElem.clientLeft
49219           };
49220         },
49221
49222         position: function() {
49223           if (!this[0]) {
49224             return;
49225           }
49226
49227           var offsetParent, offset,
49228             elem = this[0],
49229             parentOffset = {
49230               top: 0,
49231               left: 0
49232             };
49233
49234           // Fixed elements are offset from window (parentOffset = {top:0, left:
49235           // 0}, because it is its only offset parent
49236           if (jQuery.css(elem, "position") === "fixed") {
49237             // Assume getBoundingClientRect is there when computed position is
49238             // fixed
49239             offset = elem.getBoundingClientRect();
49240
49241           } else {
49242             // Get *real* offsetParent
49243             offsetParent = this.offsetParent();
49244
49245             // Get correct offsets
49246             offset = this.offset();
49247             if (!jQuery.nodeName(offsetParent[0], "html")) {
49248               parentOffset = offsetParent.offset();
49249             }
49250
49251             // Add offsetParent borders
49252             parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true);
49253             parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true);
49254           }
49255
49256           // Subtract parent offsets and element margins
49257           return {
49258             top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
49259             left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
49260           };
49261         },
49262
49263         offsetParent: function() {
49264           return this.map(function() {
49265             var offsetParent = this.offsetParent || docElem;
49266
49267             while (offsetParent && (!jQuery.nodeName(offsetParent, "html") && jQuery.css(offsetParent, "position") === "static")) {
49268               offsetParent = offsetParent.offsetParent;
49269             }
49270
49271             return offsetParent || docElem;
49272           });
49273         }
49274       });
49275
49276       // Create scrollLeft and scrollTop methods
49277       jQuery.each({
49278         scrollLeft: "pageXOffset",
49279         scrollTop: "pageYOffset"
49280       }, function(method, prop) {
49281         var top = "pageYOffset" === prop;
49282
49283         jQuery.fn[method] = function(val) {
49284           return access(this, function(elem, method, val) {
49285             var win = getWindow(elem);
49286
49287             if (val === undefined) {
49288               return win ? win[prop] : elem[method];
49289             }
49290
49291             if (win) {
49292               win.scrollTo(!top ? val : window.pageXOffset,
49293                 top ? val : window.pageYOffset
49294               );
49295
49296             } else {
49297               elem[method] = val;
49298             }
49299           }, method, val, arguments.length, null);
49300         };
49301       });
49302
49303       // Support: Safari<7+, Chrome<37+
49304       // Add the top/left cssHooks using jQuery.fn.position
49305       // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
49306       // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
49307       // getComputedStyle returns percent when specified for top/left/bottom/right;
49308       // rather than make the css module depend on the offset module, just check for
49309       // it here
49310       jQuery.each(["top", "left"], function(i, prop) {
49311         jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition,
49312           function(elem, computed) {
49313             if (computed) {
49314               computed = curCSS(elem, prop);
49315               // If curCSS returns percentage, fallback to offset
49316               return rnumnonpx.test(computed) ?
49317                 jQuery(elem).position()[prop] + "px" :
49318                 computed;
49319             }
49320           }
49321         );
49322       });
49323
49324
49325       // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth
49326       // methods
49327       jQuery.each({
49328         Height: "height",
49329         Width: "width"
49330       }, function(name, type) {
49331         jQuery.each({
49332           padding: "inner" + name,
49333           content: type,
49334           "": "outer" + name
49335         }, function(defaultExtra, funcName) {
49336           // Margin is only for outerHeight, outerWidth
49337           jQuery.fn[funcName] = function(margin, value) {
49338             var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
49339               extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
49340
49341             return access(this, function(elem, type, value) {
49342               var doc;
49343
49344               if (jQuery.isWindow(elem)) {
49345                 // As of 5/8/2012 this will yield incorrect results for
49346                 // Mobile Safari, but there
49347                 // isn't a whole lot we can do. See pull request at this URL
49348                 // for discussion:
49349                 // https://github.com/jquery/jquery/pull/764
49350                 return elem.document.documentElement["client" + name];
49351               }
49352
49353               // Get document width or height
49354               if (elem.nodeType === 9) {
49355                 doc = elem.documentElement;
49356
49357                 // Either scroll[Width/Height] or offset[Width/Height] or
49358                 // client[Width/Height],
49359                 // whichever is greatest
49360                 return Math.max(
49361                   elem.body["scroll" + name], doc["scroll" + name],
49362                   elem.body["offset" + name], doc["offset" + name],
49363                   doc["client" + name]
49364                 );
49365               }
49366
49367               return value === undefined ?
49368                 // Get width or height on the element, requesting but not
49369                 // forcing parseFloat
49370                 jQuery.css(elem, type, extra) :
49371
49372                 // Set width or height on the element
49373                 jQuery.style(elem, type, value, extra);
49374             }, type, chainable ? margin : undefined, chainable, null);
49375           };
49376         });
49377       });
49378
49379
49380       // The number of elements contained in the matched element set
49381       jQuery.fn.size = function() {
49382         return this.length;
49383       };
49384
49385       jQuery.fn.andSelf = jQuery.fn.addBack;
49386
49387
49388
49389
49390       // Register as a named AMD module, since jQuery can be concatenated with other
49391       // files that may use define, but not via a proper concatenation script that
49392       // understands anonymous AMD modules. A named AMD is safest and most robust
49393       // way to register. Lowercase jquery is used because AMD module names are
49394       // derived from file names, and jQuery is normally delivered in a lowercase
49395       // file name. Do this after creating the global so that if an AMD module wants
49396       // to call noConflict to hide this version of jQuery, it will work.
49397
49398       // Note that for maximum portability, libraries that are not jQuery should
49399       // declare themselves as anonymous modules, and avoid setting a global if an
49400       // AMD loader is present. jQuery is a special case. For more information, see
49401       // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
49402
49403       if (typeof define === "function" && define.amd) {
49404         define("jquery", [], function() {
49405           return jQuery;
49406         });
49407       }
49408
49409
49410
49411
49412       var
49413         // Map over jQuery in case of overwrite
49414         _jQuery = window.jQuery,
49415
49416         // Map over the $ in case of overwrite
49417         _$ = window.$;
49418
49419       jQuery.noConflict = function(deep) {
49420         if (window.$ === jQuery) {
49421           window.$ = _$;
49422         }
49423
49424         if (deep && window.jQuery === jQuery) {
49425           window.jQuery = _jQuery;
49426         }
49427
49428         return jQuery;
49429       };
49430
49431       // Expose jQuery and $ identifiers, even in AMD
49432       // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
49433       // and CommonJS for browser emulators (#13566)
49434       if (typeof noGlobal === strundefined) {
49435         window.jQuery = window.$ = jQuery;
49436       }
49437
49438
49439
49440
49441       return jQuery;
49442
49443     }));
49444
49445   }, {}],
49446   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\flatten.js": [function(require, module, exports) {
49447     var baseFlatten = require('../internal/baseFlatten'),
49448       isIterateeCall = require('../internal/isIterateeCall');
49449
49450     /**
49451      * Flattens a nested array. If `isDeep` is `true` the array is recursively
49452      * flattened, otherwise it's only flattened a single level.
49453      *
49454      * @static
49455      * @memberOf _
49456      * @category Array
49457      * @param {Array}
49458      *            array The array to flatten.
49459      * @param {boolean}
49460      *            [isDeep] Specify a deep flatten.
49461      * @param- {Object} [guard] Enables use as a callback for functions like
49462      *         `_.map`.
49463      * @returns {Array} Returns the new flattened array.
49464      * @example
49465      *
49466      * _.flatten([1, [2, 3, [4]]]); // => [1, 2, 3, [4]]
49467      *  // using `isDeep` _.flatten([1, [2, 3, [4]]], true); // => [1, 2, 3, 4]
49468      */
49469     function flatten(array, isDeep, guard) {
49470       var length = array ? array.length : 0;
49471       if (guard && isIterateeCall(array, isDeep, guard)) {
49472         isDeep = false;
49473       }
49474       return length ? baseFlatten(array, isDeep) : [];
49475     }
49476
49477     module.exports = flatten;
49478
49479   }, {
49480     "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
49481     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
49482   }],
49483   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\last.js": [function(require, module, exports) {
49484     /**
49485      * Gets the last element of `array`.
49486      *
49487      * @static
49488      * @memberOf _
49489      * @category Array
49490      * @param {Array}
49491      *            array The array to query.
49492      * @returns {*} Returns the last element of `array`.
49493      * @example
49494      *
49495      * _.last([1, 2, 3]); // => 3
49496      */
49497     function last(array) {
49498       var length = array ? array.length : 0;
49499       return length ? array[length - 1] : undefined;
49500     }
49501
49502     module.exports = last;
49503
49504   }, {}],
49505   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\uniq.js": [function(require, module, exports) {
49506     var baseCallback = require('../internal/baseCallback'),
49507       baseUniq = require('../internal/baseUniq'),
49508       isIterateeCall = require('../internal/isIterateeCall'),
49509       sortedUniq = require('../internal/sortedUniq');
49510
49511     /**
49512      * Creates a duplicate-free version of an array, using
49513      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
49514      * for equality comparisons, in which only the first occurence of each element
49515      * is kept. Providing `true` for `isSorted` performs a faster search algorithm
49516      * for sorted arrays. If an iteratee function is provided it's invoked for each
49517      * element in the array to generate the criterion by which uniqueness is
49518      * computed. The `iteratee` is bound to `thisArg` and invoked with three
49519      * arguments: (value, index, array).
49520      *
49521      * If a property name is provided for `iteratee` the created `_.property` style
49522      * callback returns the property value of the given element.
49523      *
49524      * If a value is also provided for `thisArg` the created `_.matchesProperty`
49525      * style callback returns `true` for elements that have a matching property
49526      * value, else `false`.
49527      *
49528      * If an object is provided for `iteratee` the created `_.matches` style
49529      * callback returns `true` for elements that have the properties of the given
49530      * object, else `false`.
49531      *
49532      * @static
49533      * @memberOf _
49534      * @alias unique
49535      * @category Array
49536      * @param {Array}
49537      *            array The array to inspect.
49538      * @param {boolean}
49539      *            [isSorted] Specify the array is sorted.
49540      * @param {Function|Object|string}
49541      *            [iteratee] The function invoked per iteration.
49542      * @param {*}
49543      *            [thisArg] The `this` binding of `iteratee`.
49544      * @returns {Array} Returns the new duplicate-value-free array.
49545      * @example
49546      *
49547      * _.uniq([2, 1, 2]); // => [2, 1]
49548      *  // using `isSorted` _.uniq([1, 1, 2], true); // => [1, 2]
49549      *  // using an iteratee function _.uniq([1, 2.5, 1.5, 2], function(n) { return
49550      * this.floor(n); }, Math); // => [1, 2.5]
49551      *  // using the `_.property` callback shorthand _.uniq([{ 'x': 1 }, { 'x': 2 }, {
49552      * 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }]
49553      */
49554     function uniq(array, isSorted, iteratee, thisArg) {
49555       var length = array ? array.length : 0;
49556       if (!length) {
49557         return [];
49558       }
49559       if (isSorted != null && typeof isSorted != 'boolean') {
49560         thisArg = iteratee;
49561         iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
49562         isSorted = false;
49563       }
49564       iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);
49565       return (isSorted) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
49566     }
49567
49568     module.exports = uniq;
49569
49570   }, {
49571     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49572     "../internal/baseUniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseUniq.js",
49573     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
49574     "../internal/sortedUniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\sortedUniq.js"
49575   }],
49576   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\unique.js": [function(require, module, exports) {
49577     module.exports = require('./uniq');
49578
49579   }, {
49580     "./uniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\uniq.js"
49581   }],
49582   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\chain\\lodash.js": [function(require, module, exports) {
49583     var LazyWrapper = require('../internal/LazyWrapper'),
49584       LodashWrapper = require('../internal/LodashWrapper'),
49585       baseLodash = require('../internal/baseLodash'),
49586       isArray = require('../lang/isArray'),
49587       isObjectLike = require('../internal/isObjectLike'),
49588       wrapperClone = require('../internal/wrapperClone');
49589
49590     /** Used for native method references. */
49591     var objectProto = Object.prototype;
49592
49593     /** Used to check objects for own properties. */
49594     var hasOwnProperty = objectProto.hasOwnProperty;
49595
49596     /**
49597      * Creates a `lodash` object which wraps `value` to enable implicit chaining.
49598      * Methods that operate on and return arrays, collections, and functions can be
49599      * chained together. Methods that retrieve a single value or may return a
49600      * primitive value will automatically end the chain returning the unwrapped
49601      * value. Explicit chaining may be enabled using `_.chain`. The execution of
49602      * chained methods is lazy, that is, execution is deferred until `_#value` is
49603      * implicitly or explicitly called.
49604      *
49605      * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
49606      * fusion is an optimization strategy which merge iteratee calls; this can help
49607      * to avoid the creation of intermediate data structures and greatly reduce the
49608      * number of iteratee executions.
49609      *
49610      * Chaining is supported in custom builds as long as the `_#value` method is
49611      * directly or indirectly included in the build.
49612      *
49613      * In addition to lodash methods, wrappers have `Array` and `String` methods.
49614      *
49615      * The wrapper `Array` methods are: `concat`, `join`, `pop`, `push`, `reverse`,
49616      * `shift`, `slice`, `sort`, `splice`, and `unshift`
49617      *
49618      * The wrapper `String` methods are: `replace` and `split`
49619      *
49620      * The wrapper methods that support shortcut fusion are: `compact`, `drop`,
49621      * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, `initial`,
49622      * `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, `take`,
49623      * `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, and `where`
49624      *
49625      * The chainable wrapper methods are: `after`, `ary`, `assign`, `at`, `before`,
49626      * `bind`, `bindAll`, `bindKey`, `callback`, `chain`, `chunk`, `commit`,
49627      * `compact`, `concat`, `constant`, `countBy`, `create`, `curry`, `debounce`,
49628      * `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, `drop`,
49629      * `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`, `flatten`,
49630      * `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`,
49631      * `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`,
49632      * `initial`, `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`,
49633      * `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`,
49634      * `method`, `methodOf`, `mixin`, `modArgs`, `negate`, `omit`, `once`, `pairs`,
49635      * `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`, `property`,
49636      * `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`,
49637      * `rest`, `restParam`, `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`,
49638      * `sortByAll`, `sortByOrder`, `splice`, `spread`, `take`, `takeRight`,
49639      * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`,
49640      * `toPlainObject`, `transform`, `union`, `uniq`, `unshift`, `unzip`,
49641      * `unzipWith`, `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`,
49642      * `zipObject`, `zipWith`
49643      *
49644      * The wrapper methods that are **not** chainable by default are: `add`,
49645      * `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, `deburr`,
49646      * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
49647      * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
49648      * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
49649      * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
49650      * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
49651      * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
49652      * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
49653      * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
49654      * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
49655      * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
49656      * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
49657      * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
49658      * `unescape`, `uniqueId`, `value`, and `words`
49659      *
49660      * The wrapper method `sample` will return a wrapped value when `n` is provided,
49661      * otherwise an unwrapped value is returned.
49662      *
49663      * @name _
49664      * @constructor
49665      * @category Chain
49666      * @param {*}
49667      *            value The value to wrap in a `lodash` instance.
49668      * @returns {Object} Returns the new `lodash` wrapper instance.
49669      * @example
49670      *
49671      * var wrapped = _([1, 2, 3]);
49672      *  // returns an unwrapped value wrapped.reduce(function(total, n) { return
49673      * total + n; }); // => 6
49674      *  // returns a wrapped value var squares = wrapped.map(function(n) { return n *
49675      * n; });
49676      *
49677      * _.isArray(squares); // => false
49678      *
49679      * _.isArray(squares.value()); // => true
49680      */
49681     function lodash(value) {
49682       if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
49683         if (value instanceof LodashWrapper) {
49684           return value;
49685         }
49686         if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
49687           return wrapperClone(value);
49688         }
49689       }
49690       return new LodashWrapper(value);
49691     }
49692
49693     // Ensure wrappers are instances of `baseLodash`.
49694     lodash.prototype = baseLodash.prototype;
49695
49696     module.exports = lodash;
49697
49698   }, {
49699     "../internal/LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
49700     "../internal/LodashWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js",
49701     "../internal/baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js",
49702     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
49703     "../internal/wrapperClone": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\wrapperClone.js",
49704     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49705   }],
49706   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\every.js": [function(require, module, exports) {
49707     var arrayEvery = require('../internal/arrayEvery'),
49708       baseCallback = require('../internal/baseCallback'),
49709       baseEvery = require('../internal/baseEvery'),
49710       isArray = require('../lang/isArray'),
49711       isIterateeCall = require('../internal/isIterateeCall');
49712
49713     /**
49714      * Checks if `predicate` returns truthy for **all** elements of `collection`.
49715      * The predicate is bound to `thisArg` and invoked with three arguments: (value,
49716      * index|key, collection).
49717      *
49718      * If a property name is provided for `predicate` the created `_.property` style
49719      * callback returns the property value of the given element.
49720      *
49721      * If a value is also provided for `thisArg` the created `_.matchesProperty`
49722      * style callback returns `true` for elements that have a matching property
49723      * value, else `false`.
49724      *
49725      * If an object is provided for `predicate` the created `_.matches` style
49726      * callback returns `true` for elements that have the properties of the given
49727      * object, else `false`.
49728      *
49729      * @static
49730      * @memberOf _
49731      * @alias all
49732      * @category Collection
49733      * @param {Array|Object|string}
49734      *            collection The collection to iterate over.
49735      * @param {Function|Object|string}
49736      *            [predicate=_.identity] The function invoked per iteration.
49737      * @param {*}
49738      *            [thisArg] The `this` binding of `predicate`.
49739      * @returns {boolean} Returns `true` if all elements pass the predicate check,
49740      *          else `false`.
49741      * @example
49742      *
49743      * _.every([true, 1, null, 'yes'], Boolean); // => false
49744      *
49745      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
49746      * 'active': false } ];
49747      *  // using the `_.matches` callback shorthand _.every(users, { 'user':
49748      * 'barney', 'active': false }); // => false
49749      *  // using the `_.matchesProperty` callback shorthand _.every(users, 'active',
49750      * false); // => true
49751      *  // using the `_.property` callback shorthand _.every(users, 'active'); // =>
49752      * false
49753      */
49754     function every(collection, predicate, thisArg) {
49755       var func = isArray(collection) ? arrayEvery : baseEvery;
49756       if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
49757         predicate = undefined;
49758       }
49759       if (typeof predicate != 'function' || thisArg !== undefined) {
49760         predicate = baseCallback(predicate, thisArg, 3);
49761       }
49762       return func(collection, predicate);
49763     }
49764
49765     module.exports = every;
49766
49767   }, {
49768     "../internal/arrayEvery": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEvery.js",
49769     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49770     "../internal/baseEvery": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEvery.js",
49771     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
49772     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49773   }],
49774   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js": [function(require, module, exports) {
49775     var arrayFilter = require('../internal/arrayFilter'),
49776       baseCallback = require('../internal/baseCallback'),
49777       baseFilter = require('../internal/baseFilter'),
49778       isArray = require('../lang/isArray');
49779
49780     /**
49781      * Iterates over elements of `collection`, returning an array of all elements
49782      * `predicate` returns truthy for. The predicate is bound to `thisArg` and
49783      * invoked with three arguments: (value, index|key, collection).
49784      *
49785      * If a property name is provided for `predicate` the created `_.property` style
49786      * callback returns the property value of the given element.
49787      *
49788      * If a value is also provided for `thisArg` the created `_.matchesProperty`
49789      * style callback returns `true` for elements that have a matching property
49790      * value, else `false`.
49791      *
49792      * If an object is provided for `predicate` the created `_.matches` style
49793      * callback returns `true` for elements that have the properties of the given
49794      * object, else `false`.
49795      *
49796      * @static
49797      * @memberOf _
49798      * @alias select
49799      * @category Collection
49800      * @param {Array|Object|string}
49801      *            collection The collection to iterate over.
49802      * @param {Function|Object|string}
49803      *            [predicate=_.identity] The function invoked per iteration.
49804      * @param {*}
49805      *            [thisArg] The `this` binding of `predicate`.
49806      * @returns {Array} Returns the new filtered array.
49807      * @example
49808      *
49809      * _.filter([4, 5, 6], function(n) { return n % 2 == 0; }); // => [4, 6]
49810      *
49811      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
49812      * 'fred', 'age': 40, 'active': false } ];
49813      *  // using the `_.matches` callback shorthand _.pluck(_.filter(users, { 'age':
49814      * 36, 'active': true }), 'user'); // => ['barney']
49815      *  // using the `_.matchesProperty` callback shorthand _.pluck(_.filter(users,
49816      * 'active', false), 'user'); // => ['fred']
49817      *  // using the `_.property` callback shorthand _.pluck(_.filter(users,
49818      * 'active'), 'user'); // => ['barney']
49819      */
49820     function filter(collection, predicate, thisArg) {
49821       var func = isArray(collection) ? arrayFilter : baseFilter;
49822       predicate = baseCallback(predicate, thisArg, 3);
49823       return func(collection, predicate);
49824     }
49825
49826     module.exports = filter;
49827
49828   }, {
49829     "../internal/arrayFilter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayFilter.js",
49830     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49831     "../internal/baseFilter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFilter.js",
49832     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49833   }],
49834   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js": [function(require, module, exports) {
49835     var baseEach = require('../internal/baseEach'),
49836       createFind = require('../internal/createFind');
49837
49838     /**
49839      * Iterates over elements of `collection`, returning the first element
49840      * `predicate` returns truthy for. The predicate is bound to `thisArg` and
49841      * invoked with three arguments: (value, index|key, collection).
49842      *
49843      * If a property name is provided for `predicate` the created `_.property` style
49844      * callback returns the property value of the given element.
49845      *
49846      * If a value is also provided for `thisArg` the created `_.matchesProperty`
49847      * style callback returns `true` for elements that have a matching property
49848      * value, else `false`.
49849      *
49850      * If an object is provided for `predicate` the created `_.matches` style
49851      * callback returns `true` for elements that have the properties of the given
49852      * object, else `false`.
49853      *
49854      * @static
49855      * @memberOf _
49856      * @alias detect
49857      * @category Collection
49858      * @param {Array|Object|string}
49859      *            collection The collection to search.
49860      * @param {Function|Object|string}
49861      *            [predicate=_.identity] The function invoked per iteration.
49862      * @param {*}
49863      *            [thisArg] The `this` binding of `predicate`.
49864      * @returns {*} Returns the matched element, else `undefined`.
49865      * @example
49866      *
49867      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
49868      * 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1,
49869      * 'active': true } ];
49870      *
49871      * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); // =>
49872      * 'barney'
49873      *  // using the `_.matches` callback shorthand _.result(_.find(users, { 'age':
49874      * 1, 'active': true }), 'user'); // => 'pebbles'
49875      *  // using the `_.matchesProperty` callback shorthand _.result(_.find(users,
49876      * 'active', false), 'user'); // => 'fred'
49877      *  // using the `_.property` callback shorthand _.result(_.find(users,
49878      * 'active'), 'user'); // => 'barney'
49879      */
49880     var find = createFind(baseEach);
49881
49882     module.exports = find;
49883
49884   }, {
49885     "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
49886     "../internal/createFind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createFind.js"
49887   }],
49888   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js": [function(require, module, exports) {
49889     var arrayEach = require('../internal/arrayEach'),
49890       baseEach = require('../internal/baseEach'),
49891       createForEach = require('../internal/createForEach');
49892
49893     /**
49894      * Iterates over elements of `collection` invoking `iteratee` for each element.
49895      * The `iteratee` is bound to `thisArg` and invoked with three arguments:
49896      * (value, index|key, collection). Iteratee functions may exit iteration early
49897      * by explicitly returning `false`.
49898      *
49899      * **Note:** As with other "Collections" methods, objects with a "length"
49900      * property are iterated like arrays. To avoid this behavior `_.forIn` or
49901      * `_.forOwn` may be used for object iteration.
49902      *
49903      * @static
49904      * @memberOf _
49905      * @alias each
49906      * @category Collection
49907      * @param {Array|Object|string}
49908      *            collection The collection to iterate over.
49909      * @param {Function}
49910      *            [iteratee=_.identity] The function invoked per iteration.
49911      * @param {*}
49912      *            [thisArg] The `this` binding of `iteratee`.
49913      * @returns {Array|Object|string} Returns `collection`.
49914      * @example
49915      *
49916      * _([1, 2]).forEach(function(n) { console.log(n); }).value(); // => logs each
49917      * value from left to right and returns the array
49918      *
49919      * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { console.log(n, key); }); // =>
49920      * logs each value-key pair and returns the object (iteration order is not
49921      * guaranteed)
49922      */
49923     var forEach = createForEach(arrayEach, baseEach);
49924
49925     module.exports = forEach;
49926
49927   }, {
49928     "../internal/arrayEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js",
49929     "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
49930     "../internal/createForEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createForEach.js"
49931   }],
49932   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js": [function(require, module, exports) {
49933     var createAggregator = require('../internal/createAggregator');
49934
49935     /** Used for native method references. */
49936     var objectProto = Object.prototype;
49937
49938     /** Used to check objects for own properties. */
49939     var hasOwnProperty = objectProto.hasOwnProperty;
49940
49941     /**
49942      * Creates an object composed of keys generated from the results of running each
49943      * element of `collection` through `iteratee`. The corresponding value of each
49944      * key is an array of the elements responsible for generating the key. The
49945      * `iteratee` is bound to `thisArg` and invoked with three arguments: (value,
49946      * index|key, collection).
49947      *
49948      * If a property name is provided for `iteratee` the created `_.property` style
49949      * callback returns the property value of the given element.
49950      *
49951      * If a value is also provided for `thisArg` the created `_.matchesProperty`
49952      * style callback returns `true` for elements that have a matching property
49953      * value, else `false`.
49954      *
49955      * If an object is provided for `iteratee` the created `_.matches` style
49956      * callback returns `true` for elements that have the properties of the given
49957      * object, else `false`.
49958      *
49959      * @static
49960      * @memberOf _
49961      * @category Collection
49962      * @param {Array|Object|string}
49963      *            collection The collection to iterate over.
49964      * @param {Function|Object|string}
49965      *            [iteratee=_.identity] The function invoked per iteration.
49966      * @param {*}
49967      *            [thisArg] The `this` binding of `iteratee`.
49968      * @returns {Object} Returns the composed aggregate object.
49969      * @example
49970      *
49971      * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
49972      * '4': [4.2], '6': [6.1, 6.4] }
49973      *
49974      * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
49975      * '4': [4.2], '6': [6.1, 6.4] }
49976      *  // using the `_.property` callback shorthand _.groupBy(['one', 'two',
49977      * 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] }
49978      */
49979     var groupBy = createAggregator(function(result, value, key) {
49980       if (hasOwnProperty.call(result, key)) {
49981         result[key].push(value);
49982       } else {
49983         result[key] = [value];
49984       }
49985     });
49986
49987     module.exports = groupBy;
49988
49989   }, {
49990     "../internal/createAggregator": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAggregator.js"
49991   }],
49992   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\includes.js": [function(require, module, exports) {
49993     var baseIndexOf = require('../internal/baseIndexOf'),
49994       getLength = require('../internal/getLength'),
49995       isArray = require('../lang/isArray'),
49996       isIterateeCall = require('../internal/isIterateeCall'),
49997       isLength = require('../internal/isLength'),
49998       isString = require('../lang/isString'),
49999       values = require('../object/values');
50000
50001     /*
50002      * Native method references for those with the same name as other `lodash`
50003      * methods.
50004      */
50005     var nativeMax = Math.max;
50006
50007     /**
50008      * Checks if `target` is in `collection` using
50009      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
50010      * for equality comparisons. If `fromIndex` is negative, it's used as the offset
50011      * from the end of `collection`.
50012      *
50013      * @static
50014      * @memberOf _
50015      * @alias contains, include
50016      * @category Collection
50017      * @param {Array|Object|string}
50018      *            collection The collection to search.
50019      * @param {*}
50020      *            target The value to search for.
50021      * @param {number}
50022      *            [fromIndex=0] The index to search from.
50023      * @param- {Object} [guard] Enables use as a callback for functions like
50024      *         `_.reduce`.
50025      * @returns {boolean} Returns `true` if a matching element is found, else
50026      *          `false`.
50027      * @example
50028      *
50029      * _.includes([1, 2, 3], 1); // => true
50030      *
50031      * _.includes([1, 2, 3], 1, 2); // => false
50032      *
50033      * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); // => true
50034      *
50035      * _.includes('pebbles', 'eb'); // => true
50036      */
50037     function includes(collection, target, fromIndex, guard) {
50038       var length = collection ? getLength(collection) : 0;
50039       if (!isLength(length)) {
50040         collection = values(collection);
50041         length = collection.length;
50042       }
50043       if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
50044         fromIndex = 0;
50045       } else {
50046         fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
50047       }
50048       return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) : (!!length && baseIndexOf(collection, target, fromIndex) > -1);
50049     }
50050
50051     module.exports = includes;
50052
50053   }, {
50054     "../internal/baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
50055     "../internal/getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
50056     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
50057     "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
50058     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
50059     "../lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
50060     "../object/values": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js"
50061   }],
50062   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js": [function(require, module, exports) {
50063     var arrayMap = require('../internal/arrayMap'),
50064       baseCallback = require('../internal/baseCallback'),
50065       baseMap = require('../internal/baseMap'),
50066       isArray = require('../lang/isArray');
50067
50068     /**
50069      * Creates an array of values by running each element in `collection` through
50070      * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
50071      * arguments: (value, index|key, collection).
50072      *
50073      * If a property name is provided for `iteratee` the created `_.property` style
50074      * callback returns the property value of the given element.
50075      *
50076      * If a value is also provided for `thisArg` the created `_.matchesProperty`
50077      * style callback returns `true` for elements that have a matching property
50078      * value, else `false`.
50079      *
50080      * If an object is provided for `iteratee` the created `_.matches` style
50081      * callback returns `true` for elements that have the properties of the given
50082      * object, else `false`.
50083      *
50084      * Many lodash methods are guarded to work as iteratees for methods like
50085      * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
50086      *
50087      * The guarded methods are: `ary`, `callback`, `chunk`, `clone`, `create`,
50088      * `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `flatten`,
50089      * `invert`, `max`, `min`, `parseInt`, `slice`, `sortBy`, `take`, `takeRight`,
50090      * `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `random`, `range`,
50091      * `sample`, `some`, `sum`, `uniq`, and `words`
50092      *
50093      * @static
50094      * @memberOf _
50095      * @alias collect
50096      * @category Collection
50097      * @param {Array|Object|string}
50098      *            collection The collection to iterate over.
50099      * @param {Function|Object|string}
50100      *            [iteratee=_.identity] The function invoked per iteration.
50101      * @param {*}
50102      *            [thisArg] The `this` binding of `iteratee`.
50103      * @returns {Array} Returns the new mapped array.
50104      * @example
50105      *
50106      * function timesThree(n) { return n * 3; }
50107      *
50108      * _.map([1, 2], timesThree); // => [3, 6]
50109      *
50110      * _.map({ 'a': 1, 'b': 2 }, timesThree); // => [3, 6] (iteration order is not
50111      * guaranteed)
50112      *
50113      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
50114      *  // using the `_.property` callback shorthand _.map(users, 'user'); // =>
50115      * ['barney', 'fred']
50116      */
50117     function map(collection, iteratee, thisArg) {
50118       var func = isArray(collection) ? arrayMap : baseMap;
50119       iteratee = baseCallback(iteratee, thisArg, 3);
50120       return func(collection, iteratee);
50121     }
50122
50123     module.exports = map;
50124
50125   }, {
50126     "../internal/arrayMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js",
50127     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50128     "../internal/baseMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js",
50129     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
50130   }],
50131   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js": [function(require, module, exports) {
50132     var arrayReduce = require('../internal/arrayReduce'),
50133       baseEach = require('../internal/baseEach'),
50134       createReduce = require('../internal/createReduce');
50135
50136     /**
50137      * Reduces `collection` to a value which is the accumulated result of running
50138      * each element in `collection` through `iteratee`, where each successive
50139      * invocation is supplied the return value of the previous. If `accumulator` is
50140      * not provided the first element of `collection` is used as the initial value.
50141      * The `iteratee` is bound to `thisArg` and invoked with four arguments:
50142      * (accumulator, value, index|key, collection).
50143      *
50144      * Many lodash methods are guarded to work as iteratees for methods like
50145      * `_.reduce`, `_.reduceRight`, and `_.transform`.
50146      *
50147      * The guarded methods are: `assign`, `defaults`, `defaultsDeep`, `includes`,
50148      * `merge`, `sortByAll`, and `sortByOrder`
50149      *
50150      * @static
50151      * @memberOf _
50152      * @alias foldl, inject
50153      * @category Collection
50154      * @param {Array|Object|string}
50155      *            collection The collection to iterate over.
50156      * @param {Function}
50157      *            [iteratee=_.identity] The function invoked per iteration.
50158      * @param {*}
50159      *            [accumulator] The initial value.
50160      * @param {*}
50161      *            [thisArg] The `this` binding of `iteratee`.
50162      * @returns {*} Returns the accumulated value.
50163      * @example
50164      *
50165      * _.reduce([1, 2], function(total, n) { return total + n; }); // => 3
50166      *
50167      * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] = n * 3;
50168      * return result; }, {}); // => { 'a': 3, 'b': 6 } (iteration order is not
50169      * guaranteed)
50170      */
50171     var reduce = createReduce(arrayReduce, baseEach);
50172
50173     module.exports = reduce;
50174
50175   }, {
50176     "../internal/arrayReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayReduce.js",
50177     "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
50178     "../internal/createReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createReduce.js"
50179   }],
50180   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\size.js": [function(require, module, exports) {
50181     var getLength = require('../internal/getLength'),
50182       isLength = require('../internal/isLength'),
50183       keys = require('../object/keys');
50184
50185     /**
50186      * Gets the size of `collection` by returning its length for array-like values
50187      * or the number of own enumerable properties for objects.
50188      *
50189      * @static
50190      * @memberOf _
50191      * @category Collection
50192      * @param {Array|Object|string}
50193      *            collection The collection to inspect.
50194      * @returns {number} Returns the size of `collection`.
50195      * @example
50196      *
50197      * _.size([1, 2, 3]); // => 3
50198      *
50199      * _.size({ 'a': 1, 'b': 2 }); // => 2
50200      *
50201      * _.size('pebbles'); // => 7
50202      */
50203     function size(collection) {
50204       var length = collection ? getLength(collection) : 0;
50205       return isLength(length) ? length : keys(collection).length;
50206     }
50207
50208     module.exports = size;
50209
50210   }, {
50211     "../internal/getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
50212     "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
50213     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
50214   }],
50215   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\some.js": [function(require, module, exports) {
50216     var arraySome = require('../internal/arraySome'),
50217       baseCallback = require('../internal/baseCallback'),
50218       baseSome = require('../internal/baseSome'),
50219       isArray = require('../lang/isArray'),
50220       isIterateeCall = require('../internal/isIterateeCall');
50221
50222     /**
50223      * Checks if `predicate` returns truthy for **any** element of `collection`. The
50224      * function returns as soon as it finds a passing value and does not iterate
50225      * over the entire collection. The predicate is bound to `thisArg` and invoked
50226      * with three arguments: (value, index|key, collection).
50227      *
50228      * If a property name is provided for `predicate` the created `_.property` style
50229      * callback returns the property value of the given element.
50230      *
50231      * If a value is also provided for `thisArg` the created `_.matchesProperty`
50232      * style callback returns `true` for elements that have a matching property
50233      * value, else `false`.
50234      *
50235      * If an object is provided for `predicate` the created `_.matches` style
50236      * callback returns `true` for elements that have the properties of the given
50237      * object, else `false`.
50238      *
50239      * @static
50240      * @memberOf _
50241      * @alias any
50242      * @category Collection
50243      * @param {Array|Object|string}
50244      *            collection The collection to iterate over.
50245      * @param {Function|Object|string}
50246      *            [predicate=_.identity] The function invoked per iteration.
50247      * @param {*}
50248      *            [thisArg] The `this` binding of `predicate`.
50249      * @returns {boolean} Returns `true` if any element passes the predicate check,
50250      *          else `false`.
50251      * @example
50252      *
50253      * _.some([null, 0, 'yes', false], Boolean); // => true
50254      *
50255      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
50256      * 'active': false } ];
50257      *  // using the `_.matches` callback shorthand _.some(users, { 'user':
50258      * 'barney', 'active': false }); // => false
50259      *  // using the `_.matchesProperty` callback shorthand _.some(users, 'active',
50260      * false); // => true
50261      *  // using the `_.property` callback shorthand _.some(users, 'active'); // =>
50262      * true
50263      */
50264     function some(collection, predicate, thisArg) {
50265       var func = isArray(collection) ? arraySome : baseSome;
50266       if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
50267         predicate = undefined;
50268       }
50269       if (typeof predicate != 'function' || thisArg !== undefined) {
50270         predicate = baseCallback(predicate, thisArg, 3);
50271       }
50272       return func(collection, predicate);
50273     }
50274
50275     module.exports = some;
50276
50277   }, {
50278     "../internal/arraySome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js",
50279     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50280     "../internal/baseSome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSome.js",
50281     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
50282     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
50283   }],
50284   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\sortBy.js": [function(require, module, exports) {
50285     var baseCallback = require('../internal/baseCallback'),
50286       baseMap = require('../internal/baseMap'),
50287       baseSortBy = require('../internal/baseSortBy'),
50288       compareAscending = require('../internal/compareAscending'),
50289       isIterateeCall = require('../internal/isIterateeCall');
50290
50291     /**
50292      * Creates an array of elements, sorted in ascending order by the results of
50293      * running each element in a collection through `iteratee`. This method performs
50294      * a stable sort, that is, it preserves the original sort order of equal
50295      * elements. The `iteratee` is bound to `thisArg` and invoked with three
50296      * arguments: (value, index|key, collection).
50297      *
50298      * If a property name is provided for `iteratee` the created `_.property` style
50299      * callback returns the property value of the given element.
50300      *
50301      * If a value is also provided for `thisArg` the created `_.matchesProperty`
50302      * style callback returns `true` for elements that have a matching property
50303      * value, else `false`.
50304      *
50305      * If an object is provided for `iteratee` the created `_.matches` style
50306      * callback returns `true` for elements that have the properties of the given
50307      * object, else `false`.
50308      *
50309      * @static
50310      * @memberOf _
50311      * @category Collection
50312      * @param {Array|Object|string}
50313      *            collection The collection to iterate over.
50314      * @param {Function|Object|string}
50315      *            [iteratee=_.identity] The function invoked per iteration.
50316      * @param {*}
50317      *            [thisArg] The `this` binding of `iteratee`.
50318      * @returns {Array} Returns the new sorted array.
50319      * @example
50320      *
50321      * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); // => [3, 1, 2]
50322      *
50323      * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); // => [3, 1,
50324      * 2]
50325      *
50326      * var users = [ { 'user': 'fred' }, { 'user': 'pebbles' }, { 'user': 'barney' } ];
50327      *  // using the `_.property` callback shorthand _.pluck(_.sortBy(users,
50328      * 'user'), 'user'); // => ['barney', 'fred', 'pebbles']
50329      */
50330     function sortBy(collection, iteratee, thisArg) {
50331       if (collection == null) {
50332         return [];
50333       }
50334       if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
50335         iteratee = undefined;
50336       }
50337       var index = -1;
50338       iteratee = baseCallback(iteratee, thisArg, 3);
50339
50340       var result = baseMap(collection, function(value, key, collection) {
50341         return {
50342           'criteria': iteratee(value, key, collection),
50343           'index': ++index,
50344           'value': value
50345         };
50346       });
50347       return baseSortBy(result, compareAscending);
50348     }
50349
50350     module.exports = sortBy;
50351
50352   }, {
50353     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50354     "../internal/baseMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js",
50355     "../internal/baseSortBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSortBy.js",
50356     "../internal/compareAscending": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\compareAscending.js",
50357     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
50358   }],
50359   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js": [function(require, module, exports) {
50360     var getNative = require('../internal/getNative');
50361
50362     /*
50363      * Native method references for those with the same name as other `lodash`
50364      * methods.
50365      */
50366     var nativeNow = getNative(Date, 'now');
50367
50368     /**
50369      * Gets the number of milliseconds that have elapsed since the Unix epoch (1
50370      * January 1970 00:00:00 UTC).
50371      *
50372      * @static
50373      * @memberOf _
50374      * @category Date
50375      * @example
50376      *
50377      * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // =>
50378      * logs the number of milliseconds it took for the deferred function to be
50379      * invoked
50380      */
50381     var now = nativeNow || function() {
50382       return new Date().getTime();
50383     };
50384
50385     module.exports = now;
50386
50387   }, {
50388     "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
50389   }],
50390   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\bind.js": [function(require, module, exports) {
50391     var createWrapper = require('../internal/createWrapper'),
50392       replaceHolders = require('../internal/replaceHolders'),
50393       restParam = require('./restParam');
50394
50395     /** Used to compose bitmasks for wrapper metadata. */
50396     var BIND_FLAG = 1,
50397       PARTIAL_FLAG = 32;
50398
50399     /**
50400      * Creates a function that invokes `func` with the `this` binding of `thisArg`
50401      * and prepends any additional `_.bind` arguments to those provided to the bound
50402      * function.
50403      *
50404      * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
50405      * may be used as a placeholder for partially applied arguments.
50406      *
50407      * **Note:** Unlike native `Function#bind` this method does not set the "length"
50408      * property of bound functions.
50409      *
50410      * @static
50411      * @memberOf _
50412      * @category Function
50413      * @param {Function}
50414      *            func The function to bind.
50415      * @param {*}
50416      *            thisArg The `this` binding of `func`.
50417      * @param {...*}
50418      *            [partials] The arguments to be partially applied.
50419      * @returns {Function} Returns the new bound function.
50420      * @example
50421      *
50422      * var greet = function(greeting, punctuation) { return greeting + ' ' +
50423      * this.user + punctuation; };
50424      *
50425      * var object = { 'user': 'fred' };
50426      *
50427      * var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!'
50428      *  // using placeholders var bound = _.bind(greet, object, _, '!');
50429      * bound('hi'); // => 'hi fred!'
50430      */
50431     var bind = restParam(function(func, thisArg, partials) {
50432       var bitmask = BIND_FLAG;
50433       if (partials.length) {
50434         var holders = replaceHolders(partials, bind.placeholder);
50435         bitmask |= PARTIAL_FLAG;
50436       }
50437       return createWrapper(func, bitmask, thisArg, partials, holders);
50438     });
50439
50440     // Assign default placeholders.
50441     bind.placeholder = {};
50442
50443     module.exports = bind;
50444
50445   }, {
50446     "../internal/createWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createWrapper.js",
50447     "../internal/replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js",
50448     "./restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js"
50449   }],
50450   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js": [function(require, module, exports) {
50451     var isObject = require('../lang/isObject'),
50452       now = require('../date/now');
50453
50454     /** Used as the `TypeError` message for "Functions" methods. */
50455     var FUNC_ERROR_TEXT = 'Expected a function';
50456
50457     /*
50458      * Native method references for those with the same name as other `lodash`
50459      * methods.
50460      */
50461     var nativeMax = Math.max;
50462
50463     /**
50464      * Creates a debounced function that delays invoking `func` until after `wait`
50465      * milliseconds have elapsed since the last time the debounced function was
50466      * invoked. The debounced function comes with a `cancel` method to cancel
50467      * delayed invocations. Provide an options object to indicate that `func` should
50468      * be invoked on the leading and/or trailing edge of the `wait` timeout.
50469      * Subsequent calls to the debounced function return the result of the last
50470      * `func` invocation.
50471      *
50472      * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
50473      * on the trailing edge of the timeout only if the the debounced function is
50474      * invoked more than once during the `wait` timeout.
50475      *
50476      * See [David Corbacho's
50477      * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
50478      * for details over the differences between `_.debounce` and `_.throttle`.
50479      *
50480      * @static
50481      * @memberOf _
50482      * @category Function
50483      * @param {Function}
50484      *            func The function to debounce.
50485      * @param {number}
50486      *            [wait=0] The number of milliseconds to delay.
50487      * @param {Object}
50488      *            [options] The options object.
50489      * @param {boolean}
50490      *            [options.leading=false] Specify invoking on the leading edge of
50491      *            the timeout.
50492      * @param {number}
50493      *            [options.maxWait] The maximum time `func` is allowed to be delayed
50494      *            before it's invoked.
50495      * @param {boolean}
50496      *            [options.trailing=true] Specify invoking on the trailing edge of
50497      *            the timeout.
50498      * @returns {Function} Returns the new debounced function.
50499      * @example
50500      *  // avoid costly calculations while the window size is in flux
50501      * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
50502      *  // invoke `sendMail` when the click event is fired, debouncing subsequent
50503      * calls jQuery('#postbox').on('click', _.debounce(sendMail, 300, { 'leading':
50504      * true, 'trailing': false }));
50505      *  // ensure `batchLog` is invoked once after 1 second of debounced calls var
50506      * source = new EventSource('/stream'); jQuery(source).on('message',
50507      * _.debounce(batchLog, 250, { 'maxWait': 1000 }));
50508      *  // cancel a debounced call var todoChanges = _.debounce(batchLog, 1000);
50509      * Object.observe(models.todo, todoChanges);
50510      *
50511      * Object.observe(models, function(changes) { if (_.find(changes, { 'user':
50512      * 'todo', 'type': 'delete'})) { todoChanges.cancel(); } }, ['delete']);
50513      *  // ...at some point `models.todo` is changed models.todo.completed = true;
50514      *  // ...before 1 second has passed `models.todo` is deleted // which cancels
50515      * the debounced `todoChanges` call delete models.todo;
50516      */
50517     function debounce(func, wait, options) {
50518       var args,
50519         maxTimeoutId,
50520         result,
50521         stamp,
50522         thisArg,
50523         timeoutId,
50524         trailingCall,
50525         lastCalled = 0,
50526         maxWait = false,
50527         trailing = true;
50528
50529       if (typeof func != 'function') {
50530         throw new TypeError(FUNC_ERROR_TEXT);
50531       }
50532       wait = wait < 0 ? 0 : (+wait || 0);
50533       if (options === true) {
50534         var leading = true;
50535         trailing = false;
50536       } else if (isObject(options)) {
50537         leading = !!options.leading;
50538         maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
50539         trailing = 'trailing' in options ? !!options.trailing : trailing;
50540       }
50541
50542       function cancel() {
50543         if (timeoutId) {
50544           clearTimeout(timeoutId);
50545         }
50546         if (maxTimeoutId) {
50547           clearTimeout(maxTimeoutId);
50548         }
50549         lastCalled = 0;
50550         maxTimeoutId = timeoutId = trailingCall = undefined;
50551       }
50552
50553       function complete(isCalled, id) {
50554         if (id) {
50555           clearTimeout(id);
50556         }
50557         maxTimeoutId = timeoutId = trailingCall = undefined;
50558         if (isCalled) {
50559           lastCalled = now();
50560           result = func.apply(thisArg, args);
50561           if (!timeoutId && !maxTimeoutId) {
50562             args = thisArg = undefined;
50563           }
50564         }
50565       }
50566
50567       function delayed() {
50568         var remaining = wait - (now() - stamp);
50569         if (remaining <= 0 || remaining > wait) {
50570           complete(trailingCall, maxTimeoutId);
50571         } else {
50572           timeoutId = setTimeout(delayed, remaining);
50573         }
50574       }
50575
50576       function maxDelayed() {
50577         complete(trailing, timeoutId);
50578       }
50579
50580       function debounced() {
50581         args = arguments;
50582         stamp = now();
50583         thisArg = this;
50584         trailingCall = trailing && (timeoutId || !leading);
50585
50586         if (maxWait === false) {
50587           var leadingCall = leading && !timeoutId;
50588         } else {
50589           if (!maxTimeoutId && !leading) {
50590             lastCalled = stamp;
50591           }
50592           var remaining = maxWait - (stamp - lastCalled),
50593             isCalled = remaining <= 0 || remaining > maxWait;
50594
50595           if (isCalled) {
50596             if (maxTimeoutId) {
50597               maxTimeoutId = clearTimeout(maxTimeoutId);
50598             }
50599             lastCalled = stamp;
50600             result = func.apply(thisArg, args);
50601           } else if (!maxTimeoutId) {
50602             maxTimeoutId = setTimeout(maxDelayed, remaining);
50603           }
50604         }
50605         if (isCalled && timeoutId) {
50606           timeoutId = clearTimeout(timeoutId);
50607         } else if (!timeoutId && wait !== maxWait) {
50608           timeoutId = setTimeout(delayed, wait);
50609         }
50610         if (leadingCall) {
50611           isCalled = true;
50612           result = func.apply(thisArg, args);
50613         }
50614         if (isCalled && !timeoutId && !maxTimeoutId) {
50615           args = thisArg = undefined;
50616         }
50617         return result;
50618       }
50619       debounced.cancel = cancel;
50620       return debounced;
50621     }
50622
50623     module.exports = debounce;
50624
50625   }, {
50626     "../date/now": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js",
50627     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
50628   }],
50629   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\defer.js": [function(require, module, exports) {
50630     var baseDelay = require('../internal/baseDelay'),
50631       restParam = require('./restParam');
50632
50633     /**
50634      * Defers invoking the `func` until the current call stack has cleared. Any
50635      * additional arguments are provided to `func` when it's invoked.
50636      *
50637      * @static
50638      * @memberOf _
50639      * @category Function
50640      * @param {Function}
50641      *            func The function to defer.
50642      * @param {...*}
50643      *            [args] The arguments to invoke the function with.
50644      * @returns {number} Returns the timer id.
50645      * @example
50646      *
50647      * _.defer(function(text) { console.log(text); }, 'deferred'); // logs
50648      * 'deferred' after one or more milliseconds
50649      */
50650     var defer = restParam(function(func, args) {
50651       return baseDelay(func, 1, args);
50652     });
50653
50654     module.exports = defer;
50655
50656   }, {
50657     "../internal/baseDelay": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDelay.js",
50658     "./restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js"
50659   }],
50660   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js": [function(require, module, exports) {
50661     /** Used as the `TypeError` message for "Functions" methods. */
50662     var FUNC_ERROR_TEXT = 'Expected a function';
50663
50664     /*
50665      * Native method references for those with the same name as other `lodash`
50666      * methods.
50667      */
50668     var nativeMax = Math.max;
50669
50670     /**
50671      * Creates a function that invokes `func` with the `this` binding of the created
50672      * function and arguments from `start` and beyond provided as an array.
50673      *
50674      * **Note:** This method is based on the [rest
50675      * parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
50676      *
50677      * @static
50678      * @memberOf _
50679      * @category Function
50680      * @param {Function}
50681      *            func The function to apply a rest parameter to.
50682      * @param {number}
50683      *            [start=func.length-1] The start position of the rest parameter.
50684      * @returns {Function} Returns the new function.
50685      * @example
50686      *
50687      * var say = _.restParam(function(what, names) { return what + ' ' +
50688      * _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') +
50689      * _.last(names); });
50690      *
50691      * say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, &
50692      * pebbles'
50693      */
50694     function restParam(func, start) {
50695       if (typeof func != 'function') {
50696         throw new TypeError(FUNC_ERROR_TEXT);
50697       }
50698       start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
50699       return function() {
50700         var args = arguments,
50701           index = -1,
50702           length = nativeMax(args.length - start, 0),
50703           rest = Array(length);
50704
50705         while (++index < length) {
50706           rest[index] = args[start + index];
50707         }
50708         switch (start) {
50709           case 0:
50710             return func.call(this, rest);
50711           case 1:
50712             return func.call(this, args[0], rest);
50713           case 2:
50714             return func.call(this, args[0], args[1], rest);
50715         }
50716         var otherArgs = Array(start + 1);
50717         index = -1;
50718         while (++index < start) {
50719           otherArgs[index] = args[index];
50720         }
50721         otherArgs[start] = rest;
50722         return func.apply(this, otherArgs);
50723       };
50724     }
50725
50726     module.exports = restParam;
50727
50728   }, {}],
50729   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\index.js": [function(require, module, exports) {
50730     (function(global) {
50731       /**
50732        * @license lodash 3.10.1 (Custom Build) <https://lodash.com/> Build: `lodash
50733        *          modern -d -o ./index.js` Copyright 2012-2015 The Dojo Foundation
50734        *          <http://dojofoundation.org/> Based on Underscore.js 1.8.3
50735        *          <http://underscorejs.org/LICENSE> Copyright 2009-2015 Jeremy
50736        *          Ashkenas, DocumentCloud and Investigative Reporters & Editors
50737        *          Available under MIT license <https://lodash.com/license>
50738        */
50739       ;
50740       (function() {
50741
50742         /** Used as a safe reference for `undefined` in pre-ES5 environments. */
50743         var undefined;
50744
50745         /** Used as the semantic version number. */
50746         var VERSION = '3.10.1';
50747
50748         /** Used to compose bitmasks for wrapper metadata. */
50749         var BIND_FLAG = 1,
50750           BIND_KEY_FLAG = 2,
50751           CURRY_BOUND_FLAG = 4,
50752           CURRY_FLAG = 8,
50753           CURRY_RIGHT_FLAG = 16,
50754           PARTIAL_FLAG = 32,
50755           PARTIAL_RIGHT_FLAG = 64,
50756           ARY_FLAG = 128,
50757           REARG_FLAG = 256;
50758
50759         /** Used as default options for `_.trunc`. */
50760         var DEFAULT_TRUNC_LENGTH = 30,
50761           DEFAULT_TRUNC_OMISSION = '...';
50762
50763         /** Used to detect when a function becomes hot. */
50764         var HOT_COUNT = 150,
50765           HOT_SPAN = 16;
50766
50767         /** Used as the size to enable large array optimizations. */
50768         var LARGE_ARRAY_SIZE = 200;
50769
50770         /** Used to indicate the type of lazy iteratees. */
50771         var LAZY_FILTER_FLAG = 1,
50772           LAZY_MAP_FLAG = 2;
50773
50774         /** Used as the `TypeError` message for "Functions" methods. */
50775         var FUNC_ERROR_TEXT = 'Expected a function';
50776
50777         /** Used as the internal argument placeholder. */
50778         var PLACEHOLDER = '__lodash_placeholder__';
50779
50780         /** `Object#toString` result references. */
50781         var argsTag = '[object Arguments]',
50782           arrayTag = '[object Array]',
50783           boolTag = '[object Boolean]',
50784           dateTag = '[object Date]',
50785           errorTag = '[object Error]',
50786           funcTag = '[object Function]',
50787           mapTag = '[object Map]',
50788           numberTag = '[object Number]',
50789           objectTag = '[object Object]',
50790           regexpTag = '[object RegExp]',
50791           setTag = '[object Set]',
50792           stringTag = '[object String]',
50793           weakMapTag = '[object WeakMap]';
50794
50795         var arrayBufferTag = '[object ArrayBuffer]',
50796           float32Tag = '[object Float32Array]',
50797           float64Tag = '[object Float64Array]',
50798           int8Tag = '[object Int8Array]',
50799           int16Tag = '[object Int16Array]',
50800           int32Tag = '[object Int32Array]',
50801           uint8Tag = '[object Uint8Array]',
50802           uint8ClampedTag = '[object Uint8ClampedArray]',
50803           uint16Tag = '[object Uint16Array]',
50804           uint32Tag = '[object Uint32Array]';
50805
50806         /** Used to match empty string literals in compiled template source. */
50807         var reEmptyStringLeading = /\b__p \+= '';/g,
50808           reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
50809           reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
50810
50811         /** Used to match HTML entities and HTML characters. */
50812         var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
50813           reUnescapedHtml = /[&<>"'`]/g,
50814           reHasEscapedHtml = RegExp(reEscapedHtml.source),
50815           reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
50816
50817         /** Used to match template delimiters. */
50818         var reEscape = /<%-([\s\S]+?)%>/g,
50819           reEvaluate = /<%([\s\S]+?)%>/g,
50820           reInterpolate = /<%=([\s\S]+?)%>/g;
50821
50822         /** Used to match property names within property paths. */
50823         var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
50824           reIsPlainProp = /^\w*$/,
50825           rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
50826
50827         /**
50828          * Used to match `RegExp` [syntax
50829          * characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns) and
50830          * those outlined by
50831          * [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).
50832          */
50833         var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,
50834           reHasRegExpChars = RegExp(reRegExpChars.source);
50835
50836         /**
50837          * Used to match [combining diacritical
50838          * marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
50839          */
50840         var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
50841
50842         /** Used to match backslashes in property paths. */
50843         var reEscapeChar = /\\(\\)?/g;
50844
50845         /**
50846          * Used to match [ES template
50847          * delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components).
50848          */
50849         var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
50850
50851         /** Used to match `RegExp` flags from their coerced string values. */
50852         var reFlags = /\w*$/;
50853
50854         /** Used to detect hexadecimal string values. */
50855         var reHasHexPrefix = /^0[xX]/;
50856
50857         /** Used to detect host constructors (Safari > 5). */
50858         var reIsHostCtor = /^\[object .+?Constructor\]$/;
50859
50860         /** Used to detect unsigned integer values. */
50861         var reIsUint = /^\d+$/;
50862
50863         /**
50864          * Used to match latin-1 supplementary letters (excluding mathematical
50865          * operators).
50866          */
50867         var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
50868
50869         /** Used to ensure capturing order of template delimiters. */
50870         var reNoMatch = /($^)/;
50871
50872         /** Used to match unescaped characters in compiled string literals. */
50873         var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
50874
50875         /** Used to match words to create compound words. */
50876         var reWords = (function() {
50877           var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
50878             lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
50879
50880           return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
50881         }());
50882
50883         /** Used to assign default `context` object properties. */
50884         var contextProps = [
50885           'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
50886           'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
50887           'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',
50888           'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
50889           'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'
50890         ];
50891
50892         /** Used to make template sourceURLs easier to identify. */
50893         var templateCounter = -1;
50894
50895         /** Used to identify `toStringTag` values of typed arrays. */
50896         var typedArrayTags = {};
50897         typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
50898           typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
50899           typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
50900           typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
50901           typedArrayTags[uint32Tag] = true;
50902         typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
50903           typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
50904           typedArrayTags[dateTag] = typedArrayTags[errorTag] =
50905           typedArrayTags[funcTag] = typedArrayTags[mapTag] =
50906           typedArrayTags[numberTag] = typedArrayTags[objectTag] =
50907           typedArrayTags[regexpTag] = typedArrayTags[setTag] =
50908           typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
50909
50910         /** Used to identify `toStringTag` values supported by `_.clone`. */
50911         var cloneableTags = {};
50912         cloneableTags[argsTag] = cloneableTags[arrayTag] =
50913           cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
50914           cloneableTags[dateTag] = cloneableTags[float32Tag] =
50915           cloneableTags[float64Tag] = cloneableTags[int8Tag] =
50916           cloneableTags[int16Tag] = cloneableTags[int32Tag] =
50917           cloneableTags[numberTag] = cloneableTags[objectTag] =
50918           cloneableTags[regexpTag] = cloneableTags[stringTag] =
50919           cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
50920           cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
50921         cloneableTags[errorTag] = cloneableTags[funcTag] =
50922           cloneableTags[mapTag] = cloneableTags[setTag] =
50923           cloneableTags[weakMapTag] = false;
50924
50925         /** Used to map latin-1 supplementary letters to basic latin letters. */
50926         var deburredLetters = {
50927           '\xc0': 'A',
50928           '\xc1': 'A',
50929           '\xc2': 'A',
50930           '\xc3': 'A',
50931           '\xc4': 'A',
50932           '\xc5': 'A',
50933           '\xe0': 'a',
50934           '\xe1': 'a',
50935           '\xe2': 'a',
50936           '\xe3': 'a',
50937           '\xe4': 'a',
50938           '\xe5': 'a',
50939           '\xc7': 'C',
50940           '\xe7': 'c',
50941           '\xd0': 'D',
50942           '\xf0': 'd',
50943           '\xc8': 'E',
50944           '\xc9': 'E',
50945           '\xca': 'E',
50946           '\xcb': 'E',
50947           '\xe8': 'e',
50948           '\xe9': 'e',
50949           '\xea': 'e',
50950           '\xeb': 'e',
50951           '\xcC': 'I',
50952           '\xcd': 'I',
50953           '\xce': 'I',
50954           '\xcf': 'I',
50955           '\xeC': 'i',
50956           '\xed': 'i',
50957           '\xee': 'i',
50958           '\xef': 'i',
50959           '\xd1': 'N',
50960           '\xf1': 'n',
50961           '\xd2': 'O',
50962           '\xd3': 'O',
50963           '\xd4': 'O',
50964           '\xd5': 'O',
50965           '\xd6': 'O',
50966           '\xd8': 'O',
50967           '\xf2': 'o',
50968           '\xf3': 'o',
50969           '\xf4': 'o',
50970           '\xf5': 'o',
50971           '\xf6': 'o',
50972           '\xf8': 'o',
50973           '\xd9': 'U',
50974           '\xda': 'U',
50975           '\xdb': 'U',
50976           '\xdc': 'U',
50977           '\xf9': 'u',
50978           '\xfa': 'u',
50979           '\xfb': 'u',
50980           '\xfc': 'u',
50981           '\xdd': 'Y',
50982           '\xfd': 'y',
50983           '\xff': 'y',
50984           '\xc6': 'Ae',
50985           '\xe6': 'ae',
50986           '\xde': 'Th',
50987           '\xfe': 'th',
50988           '\xdf': 'ss'
50989         };
50990
50991         /** Used to map characters to HTML entities. */
50992         var htmlEscapes = {
50993           '&': '&amp;',
50994           '<': '&lt;',
50995           '>': '&gt;',
50996           '"': '&quot;',
50997           "'": '&#39;',
50998           '`': '&#96;'
50999         };
51000
51001         /** Used to map HTML entities to characters. */
51002         var htmlUnescapes = {
51003           '&amp;': '&',
51004           '&lt;': '<',
51005           '&gt;': '>',
51006           '&quot;': '"',
51007           '&#39;': "'",
51008           '&#96;': '`'
51009         };
51010
51011         /** Used to determine if values are of the language type `Object`. */
51012         var objectTypes = {
51013           'function': true,
51014           'object': true
51015         };
51016
51017         /** Used to escape characters for inclusion in compiled regexes. */
51018         var regexpEscapes = {
51019           '0': 'x30',
51020           '1': 'x31',
51021           '2': 'x32',
51022           '3': 'x33',
51023           '4': 'x34',
51024           '5': 'x35',
51025           '6': 'x36',
51026           '7': 'x37',
51027           '8': 'x38',
51028           '9': 'x39',
51029           'A': 'x41',
51030           'B': 'x42',
51031           'C': 'x43',
51032           'D': 'x44',
51033           'E': 'x45',
51034           'F': 'x46',
51035           'a': 'x61',
51036           'b': 'x62',
51037           'c': 'x63',
51038           'd': 'x64',
51039           'e': 'x65',
51040           'f': 'x66',
51041           'n': 'x6e',
51042           'r': 'x72',
51043           't': 'x74',
51044           'u': 'x75',
51045           'v': 'x76',
51046           'x': 'x78'
51047         };
51048
51049         /** Used to escape characters for inclusion in compiled string literals. */
51050         var stringEscapes = {
51051           '\\': '\\',
51052           "'": "'",
51053           '\n': 'n',
51054           '\r': 'r',
51055           '\u2028': 'u2028',
51056           '\u2029': 'u2029'
51057         };
51058
51059         /** Detect free variable `exports`. */
51060         var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
51061
51062         /** Detect free variable `module`. */
51063         var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
51064
51065         /** Detect free variable `global` from Node.js. */
51066         var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
51067
51068         /** Detect free variable `self`. */
51069         var freeSelf = objectTypes[typeof self] && self && self.Object && self;
51070
51071         /** Detect free variable `window`. */
51072         var freeWindow = objectTypes[typeof window] && window && window.Object && window;
51073
51074         /** Detect the popular CommonJS extension `module.exports`. */
51075         var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
51076
51077         /**
51078          * Used as a reference to the global object.
51079          *
51080          * The `this` value is used if it's the global object to avoid
51081          * Greasemonkey's restricted `window` object, otherwise the `window` object
51082          * is used.
51083          */
51084         var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
51085
51086         /*--------------------------------------------------------------------------*/
51087
51088         /**
51089          * The base implementation of `compareAscending` which compares values and
51090          * sorts them in ascending order without guaranteeing a stable sort.
51091          *
51092          * @private
51093          * @param {*}
51094          *            value The value to compare.
51095          * @param {*}
51096          *            other The other value to compare.
51097          * @returns {number} Returns the sort order indicator for `value`.
51098          */
51099         function baseCompareAscending(value, other) {
51100           if (value !== other) {
51101             var valIsNull = value === null,
51102               valIsUndef = value === undefined,
51103               valIsReflexive = value === value;
51104
51105             var othIsNull = other === null,
51106               othIsUndef = other === undefined,
51107               othIsReflexive = other === other;
51108
51109             if ((value > other && !othIsNull) || !valIsReflexive ||
51110               (valIsNull && !othIsUndef && othIsReflexive) ||
51111               (valIsUndef && othIsReflexive)) {
51112               return 1;
51113             }
51114             if ((value < other && !valIsNull) || !othIsReflexive ||
51115               (othIsNull && !valIsUndef && valIsReflexive) ||
51116               (othIsUndef && valIsReflexive)) {
51117               return -1;
51118             }
51119           }
51120           return 0;
51121         }
51122
51123         /**
51124          * The base implementation of `_.findIndex` and `_.findLastIndex` without
51125          * support for callback shorthands and `this` binding.
51126          *
51127          * @private
51128          * @param {Array}
51129          *            array The array to search.
51130          * @param {Function}
51131          *            predicate The function invoked per iteration.
51132          * @param {boolean}
51133          *            [fromRight] Specify iterating from right to left.
51134          * @returns {number} Returns the index of the matched value, else `-1`.
51135          */
51136         function baseFindIndex(array, predicate, fromRight) {
51137           var length = array.length,
51138             index = fromRight ? length : -1;
51139
51140           while ((fromRight ? index-- : ++index < length)) {
51141             if (predicate(array[index], index, array)) {
51142               return index;
51143             }
51144           }
51145           return -1;
51146         }
51147
51148         /**
51149          * The base implementation of `_.indexOf` without support for binary
51150          * searches.
51151          *
51152          * @private
51153          * @param {Array}
51154          *            array The array to search.
51155          * @param {*}
51156          *            value The value to search for.
51157          * @param {number}
51158          *            fromIndex The index to search from.
51159          * @returns {number} Returns the index of the matched value, else `-1`.
51160          */
51161         function baseIndexOf(array, value, fromIndex) {
51162           if (value !== value) {
51163             return indexOfNaN(array, fromIndex);
51164           }
51165           var index = fromIndex - 1,
51166             length = array.length;
51167
51168           while (++index < length) {
51169             if (array[index] === value) {
51170               return index;
51171             }
51172           }
51173           return -1;
51174         }
51175
51176         /**
51177          * The base implementation of `_.isFunction` without support for
51178          * environments with incorrect `typeof` results.
51179          *
51180          * @private
51181          * @param {*}
51182          *            value The value to check.
51183          * @returns {boolean} Returns `true` if `value` is correctly classified,
51184          *          else `false`.
51185          */
51186         function baseIsFunction(value) {
51187           // Avoid a Chakra JIT bug in compatibility modes of IE 11.
51188           // See https://github.com/jashkenas/underscore/issues/1621 for more details.
51189           return typeof value == 'function' || false;
51190         }
51191
51192         /**
51193          * Converts `value` to a string if it's not one. An empty string is returned
51194          * for `null` or `undefined` values.
51195          *
51196          * @private
51197          * @param {*}
51198          *            value The value to process.
51199          * @returns {string} Returns the string.
51200          */
51201         function baseToString(value) {
51202           return value == null ? '' : (value + '');
51203         }
51204
51205         /**
51206          * Used by `_.trim` and `_.trimLeft` to get the index of the first character
51207          * of `string` that is not found in `chars`.
51208          *
51209          * @private
51210          * @param {string}
51211          *            string The string to inspect.
51212          * @param {string}
51213          *            chars The characters to find.
51214          * @returns {number} Returns the index of the first character not found in
51215          *          `chars`.
51216          */
51217         function charsLeftIndex(string, chars) {
51218           var index = -1,
51219             length = string.length;
51220
51221           while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
51222           return index;
51223         }
51224
51225         /**
51226          * Used by `_.trim` and `_.trimRight` to get the index of the last character
51227          * of `string` that is not found in `chars`.
51228          *
51229          * @private
51230          * @param {string}
51231          *            string The string to inspect.
51232          * @param {string}
51233          *            chars The characters to find.
51234          * @returns {number} Returns the index of the last character not found in
51235          *          `chars`.
51236          */
51237         function charsRightIndex(string, chars) {
51238           var index = string.length;
51239
51240           while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
51241           return index;
51242         }
51243
51244         /**
51245          * Used by `_.sortBy` to compare transformed elements of a collection and
51246          * stable sort them in ascending order.
51247          *
51248          * @private
51249          * @param {Object}
51250          *            object The object to compare.
51251          * @param {Object}
51252          *            other The other object to compare.
51253          * @returns {number} Returns the sort order indicator for `object`.
51254          */
51255         function compareAscending(object, other) {
51256           return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
51257         }
51258
51259         /**
51260          * Used by `_.sortByOrder` to compare multiple properties of a value to
51261          * another and stable sort them.
51262          *
51263          * If `orders` is unspecified, all valuess are sorted in ascending order.
51264          * Otherwise, a value is sorted in ascending order if its corresponding
51265          * order is "asc", and descending if "desc".
51266          *
51267          * @private
51268          * @param {Object}
51269          *            object The object to compare.
51270          * @param {Object}
51271          *            other The other object to compare.
51272          * @param {boolean[]}
51273          *            orders The order to sort by for each property.
51274          * @returns {number} Returns the sort order indicator for `object`.
51275          */
51276         function compareMultiple(object, other, orders) {
51277           var index = -1,
51278             objCriteria = object.criteria,
51279             othCriteria = other.criteria,
51280             length = objCriteria.length,
51281             ordersLength = orders.length;
51282
51283           while (++index < length) {
51284             var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
51285             if (result) {
51286               if (index >= ordersLength) {
51287                 return result;
51288               }
51289               var order = orders[index];
51290               return result * ((order === 'asc' || order === true) ? 1 : -1);
51291             }
51292           }
51293           // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
51294           // that causes it, under certain circumstances, to provide the same value
51295           // for
51296           // `object` and `other`. See
51297           // https://github.com/jashkenas/underscore/pull/1247
51298           // for more details.
51299           //
51300           // This also ensures a stable sort in V8 and other engines.
51301           // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
51302           return object.index - other.index;
51303         }
51304
51305         /**
51306          * Used by `_.deburr` to convert latin-1 supplementary letters to basic
51307          * latin letters.
51308          *
51309          * @private
51310          * @param {string}
51311          *            letter The matched letter to deburr.
51312          * @returns {string} Returns the deburred letter.
51313          */
51314         function deburrLetter(letter) {
51315           return deburredLetters[letter];
51316         }
51317
51318         /**
51319          * Used by `_.escape` to convert characters to HTML entities.
51320          *
51321          * @private
51322          * @param {string}
51323          *            chr The matched character to escape.
51324          * @returns {string} Returns the escaped character.
51325          */
51326         function escapeHtmlChar(chr) {
51327           return htmlEscapes[chr];
51328         }
51329
51330         /**
51331          * Used by `_.escapeRegExp` to escape characters for inclusion in compiled
51332          * regexes.
51333          *
51334          * @private
51335          * @param {string}
51336          *            chr The matched character to escape.
51337          * @param {string}
51338          *            leadingChar The capture group for a leading character.
51339          * @param {string}
51340          *            whitespaceChar The capture group for a whitespace character.
51341          * @returns {string} Returns the escaped character.
51342          */
51343         function escapeRegExpChar(chr, leadingChar, whitespaceChar) {
51344           if (leadingChar) {
51345             chr = regexpEscapes[chr];
51346           } else if (whitespaceChar) {
51347             chr = stringEscapes[chr];
51348           }
51349           return '\\' + chr;
51350         }
51351
51352         /**
51353          * Used by `_.template` to escape characters for inclusion in compiled
51354          * string literals.
51355          *
51356          * @private
51357          * @param {string}
51358          *            chr The matched character to escape.
51359          * @returns {string} Returns the escaped character.
51360          */
51361         function escapeStringChar(chr) {
51362           return '\\' + stringEscapes[chr];
51363         }
51364
51365         /**
51366          * Gets the index at which the first occurrence of `NaN` is found in
51367          * `array`.
51368          *
51369          * @private
51370          * @param {Array}
51371          *            array The array to search.
51372          * @param {number}
51373          *            fromIndex The index to search from.
51374          * @param {boolean}
51375          *            [fromRight] Specify iterating from right to left.
51376          * @returns {number} Returns the index of the matched `NaN`, else `-1`.
51377          */
51378         function indexOfNaN(array, fromIndex, fromRight) {
51379           var length = array.length,
51380             index = fromIndex + (fromRight ? 0 : -1);
51381
51382           while ((fromRight ? index-- : ++index < length)) {
51383             var other = array[index];
51384             if (other !== other) {
51385               return index;
51386             }
51387           }
51388           return -1;
51389         }
51390
51391         /**
51392          * Checks if `value` is object-like.
51393          *
51394          * @private
51395          * @param {*}
51396          *            value The value to check.
51397          * @returns {boolean} Returns `true` if `value` is object-like, else
51398          *          `false`.
51399          */
51400         function isObjectLike(value) {
51401           return !!value && typeof value == 'object';
51402         }
51403
51404         /**
51405          * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
51406          * character code is whitespace.
51407          *
51408          * @private
51409          * @param {number}
51410          *            charCode The character code to inspect.
51411          * @returns {boolean} Returns `true` if `charCode` is whitespace, else
51412          *          `false`.
51413          */
51414         function isSpace(charCode) {
51415           return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
51416             (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
51417         }
51418
51419         /**
51420          * Replaces all `placeholder` elements in `array` with an internal
51421          * placeholder and returns an array of their indexes.
51422          *
51423          * @private
51424          * @param {Array}
51425          *            array The array to modify.
51426          * @param {*}
51427          *            placeholder The placeholder to replace.
51428          * @returns {Array} Returns the new array of placeholder indexes.
51429          */
51430         function replaceHolders(array, placeholder) {
51431           var index = -1,
51432             length = array.length,
51433             resIndex = -1,
51434             result = [];
51435
51436           while (++index < length) {
51437             if (array[index] === placeholder) {
51438               array[index] = PLACEHOLDER;
51439               result[++resIndex] = index;
51440             }
51441           }
51442           return result;
51443         }
51444
51445         /**
51446          * An implementation of `_.uniq` optimized for sorted arrays without support
51447          * for callback shorthands and `this` binding.
51448          *
51449          * @private
51450          * @param {Array}
51451          *            array The array to inspect.
51452          * @param {Function}
51453          *            [iteratee] The function invoked per iteration.
51454          * @returns {Array} Returns the new duplicate-value-free array.
51455          */
51456         function sortedUniq(array, iteratee) {
51457           var seen,
51458             index = -1,
51459             length = array.length,
51460             resIndex = -1,
51461             result = [];
51462
51463           while (++index < length) {
51464             var value = array[index],
51465               computed = iteratee ? iteratee(value, index, array) : value;
51466
51467             if (!index || seen !== computed) {
51468               seen = computed;
51469               result[++resIndex] = value;
51470             }
51471           }
51472           return result;
51473         }
51474
51475         /**
51476          * Used by `_.trim` and `_.trimLeft` to get the index of the first
51477          * non-whitespace character of `string`.
51478          *
51479          * @private
51480          * @param {string}
51481          *            string The string to inspect.
51482          * @returns {number} Returns the index of the first non-whitespace
51483          *          character.
51484          */
51485         function trimmedLeftIndex(string) {
51486           var index = -1,
51487             length = string.length;
51488
51489           while (++index < length && isSpace(string.charCodeAt(index))) {}
51490           return index;
51491         }
51492
51493         /**
51494          * Used by `_.trim` and `_.trimRight` to get the index of the last
51495          * non-whitespace character of `string`.
51496          *
51497          * @private
51498          * @param {string}
51499          *            string The string to inspect.
51500          * @returns {number} Returns the index of the last non-whitespace character.
51501          */
51502         function trimmedRightIndex(string) {
51503           var index = string.length;
51504
51505           while (index-- && isSpace(string.charCodeAt(index))) {}
51506           return index;
51507         }
51508
51509         /**
51510          * Used by `_.unescape` to convert HTML entities to characters.
51511          *
51512          * @private
51513          * @param {string}
51514          *            chr The matched character to unescape.
51515          * @returns {string} Returns the unescaped character.
51516          */
51517         function unescapeHtmlChar(chr) {
51518           return htmlUnescapes[chr];
51519         }
51520
51521         /*--------------------------------------------------------------------------*/
51522
51523         /**
51524          * Create a new pristine `lodash` function using the given `context` object.
51525          *
51526          * @static
51527          * @memberOf _
51528          * @category Utility
51529          * @param {Object}
51530          *            [context=root] The context object.
51531          * @returns {Function} Returns a new `lodash` function.
51532          * @example
51533          *
51534          * _.mixin({ 'foo': _.constant('foo') });
51535          *
51536          * var lodash = _.runInContext(); lodash.mixin({ 'bar':
51537          * lodash.constant('bar') });
51538          *
51539          * _.isFunction(_.foo); // => true _.isFunction(_.bar); // => false
51540          *
51541          * lodash.isFunction(lodash.foo); // => false lodash.isFunction(lodash.bar); // =>
51542          * true
51543          *  // using `context` to mock `Date#getTime` use in `_.now` var mock =
51544          * _.runInContext({ 'Date': function() { return { 'getTime': getTimeMock }; }
51545          * });
51546          *  // or creating a suped-up `defer` in Node.js var defer =
51547          * _.runInContext({ 'setTimeout': setImmediate }).defer;
51548          */
51549         function runInContext(context) {
51550           // Avoid issues with some ES3 environments that attempt to use values, named
51551           // after built-in constructors like `Object`, for the creation of literals.
51552           // ES5 clears this up by stating that literals must use built-in
51553           // constructors.
51554           // See https://es5.github.io/#x11.1.5 for more details.
51555           context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
51556
51557           /** Native constructor references. */
51558           var Array = context.Array,
51559             Date = context.Date,
51560             Error = context.Error,
51561             Function = context.Function,
51562             Math = context.Math,
51563             Number = context.Number,
51564             Object = context.Object,
51565             RegExp = context.RegExp,
51566             String = context.String,
51567             TypeError = context.TypeError;
51568
51569           /** Used for native method references. */
51570           var arrayProto = Array.prototype,
51571             objectProto = Object.prototype,
51572             stringProto = String.prototype;
51573
51574           /** Used to resolve the decompiled source of functions. */
51575           var fnToString = Function.prototype.toString;
51576
51577           /** Used to check objects for own properties. */
51578           var hasOwnProperty = objectProto.hasOwnProperty;
51579
51580           /** Used to generate unique IDs. */
51581           var idCounter = 0;
51582
51583           /**
51584            * Used to resolve the
51585            * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
51586            * of values.
51587            */
51588           var objToString = objectProto.toString;
51589
51590           /** Used to restore the original `_` reference in `_.noConflict`. */
51591           var oldDash = root._;
51592
51593           /** Used to detect if a method is native. */
51594           var reIsNative = RegExp('^' +
51595             fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
51596             .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
51597           );
51598
51599           /** Native method references. */
51600           var ArrayBuffer = context.ArrayBuffer,
51601             clearTimeout = context.clearTimeout,
51602             parseFloat = context.parseFloat,
51603             pow = Math.pow,
51604             propertyIsEnumerable = objectProto.propertyIsEnumerable,
51605             Set = getNative(context, 'Set'),
51606             setTimeout = context.setTimeout,
51607             splice = arrayProto.splice,
51608             Uint8Array = context.Uint8Array,
51609             WeakMap = getNative(context, 'WeakMap');
51610
51611           /*
51612            * Native method references for those with the same name as other `lodash`
51613            * methods.
51614            */
51615           var nativeCeil = Math.ceil,
51616             nativeCreate = getNative(Object, 'create'),
51617             nativeFloor = Math.floor,
51618             nativeIsArray = getNative(Array, 'isArray'),
51619             nativeIsFinite = context.isFinite,
51620             nativeKeys = getNative(Object, 'keys'),
51621             nativeMax = Math.max,
51622             nativeMin = Math.min,
51623             nativeNow = getNative(Date, 'now'),
51624             nativeParseInt = context.parseInt,
51625             nativeRandom = Math.random;
51626
51627           /** Used as references for `-Infinity` and `Infinity`. */
51628           var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
51629             POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
51630
51631           /** Used as references for the maximum length and index of an array. */
51632           var MAX_ARRAY_LENGTH = 4294967295,
51633             MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
51634             HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
51635
51636           /**
51637            * Used as the [maximum
51638            * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
51639            * of an array-like value.
51640            */
51641           var MAX_SAFE_INTEGER = 9007199254740991;
51642
51643           /** Used to store function metadata. */
51644           var metaMap = WeakMap && new WeakMap;
51645
51646           /** Used to lookup unminified function names. */
51647           var realNames = {};
51648
51649           /*------------------------------------------------------------------------*/
51650
51651           /**
51652            * Creates a `lodash` object which wraps `value` to enable implicit
51653            * chaining. Methods that operate on and return arrays, collections, and
51654            * functions can be chained together. Methods that retrieve a single value
51655            * or may return a primitive value will automatically end the chain
51656            * returning the unwrapped value. Explicit chaining may be enabled using
51657            * `_.chain`. The execution of chained methods is lazy, that is, execution
51658            * is deferred until `_#value` is implicitly or explicitly called.
51659            *
51660            * Lazy evaluation allows several methods to support shortcut fusion.
51661            * Shortcut fusion is an optimization strategy which merge iteratee calls;
51662            * this can help to avoid the creation of intermediate data structures and
51663            * greatly reduce the number of iteratee executions.
51664            *
51665            * Chaining is supported in custom builds as long as the `_#value` method is
51666            * directly or indirectly included in the build.
51667            *
51668            * In addition to lodash methods, wrappers have `Array` and `String`
51669            * methods.
51670            *
51671            * The wrapper `Array` methods are: `concat`, `join`, `pop`, `push`,
51672            * `reverse`, `shift`, `slice`, `sort`, `splice`, and `unshift`
51673            *
51674            * The wrapper `String` methods are: `replace` and `split`
51675            *
51676            * The wrapper methods that support shortcut fusion are: `compact`, `drop`,
51677            * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, `initial`,
51678            * `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, `take`,
51679            * `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, and `where`
51680            *
51681            * The chainable wrapper methods are: `after`, `ary`, `assign`, `at`,
51682            * `before`, `bind`, `bindAll`, `bindKey`, `callback`, `chain`, `chunk`,
51683            * `commit`, `compact`, `concat`, `constant`, `countBy`, `create`, `curry`,
51684            * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
51685            * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`,
51686            * `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`,
51687            * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`,
51688            * `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
51689            * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
51690            * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `modArgs`, `negate`,
51691            * `omit`, `once`, `pairs`, `partial`, `partialRight`, `partition`, `pick`,
51692            * `plant`, `pluck`, `property`, `propertyOf`, `pull`, `pullAt`, `push`,
51693            * `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, `reverse`,
51694            * `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`,
51695            * `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`,
51696            * `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
51697            * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
51698            * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`,
51699            * `zipWith`
51700            *
51701            * The wrapper methods that are **not** chainable by default are: `add`,
51702            * `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
51703            * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`,
51704            * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`,
51705            * `findWhere`, `first`, `floor`, `get`, `gt`, `gte`, `has`, `identity`,
51706            * `includes`, `indexOf`, `inRange`, `isArguments`, `isArray`, `isBoolean`,
51707            * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`
51708            * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`,
51709            * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`,
51710            * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`,
51711            * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`,
51712            * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`,
51713            * `round`, `runInContext`, `shift`, `size`, `snakeCase`, `some`,
51714            * `sortedIndex`, `sortedLastIndex`, `startCase`, `startsWith`, `sum`,
51715            * `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`,
51716            * `uniqueId`, `value`, and `words`
51717            *
51718            * The wrapper method `sample` will return a wrapped value when `n` is
51719            * provided, otherwise an unwrapped value is returned.
51720            *
51721            * @name _
51722            * @constructor
51723            * @category Chain
51724            * @param {*}
51725            *            value The value to wrap in a `lodash` instance.
51726            * @returns {Object} Returns the new `lodash` wrapper instance.
51727            * @example
51728            *
51729            * var wrapped = _([1, 2, 3]);
51730            *  // returns an unwrapped value wrapped.reduce(function(total, n) { return
51731            * total + n; }); // => 6
51732            *  // returns a wrapped value var squares = wrapped.map(function(n) {
51733            * return n * n; });
51734            *
51735            * _.isArray(squares); // => false
51736            *
51737            * _.isArray(squares.value()); // => true
51738            */
51739           function lodash(value) {
51740             if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
51741               if (value instanceof LodashWrapper) {
51742                 return value;
51743               }
51744               if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
51745                 return wrapperClone(value);
51746               }
51747             }
51748             return new LodashWrapper(value);
51749           }
51750
51751           /**
51752            * The function whose prototype all chaining wrappers inherit from.
51753            *
51754            * @private
51755            */
51756           function baseLodash() {
51757             // No operation performed.
51758           }
51759
51760           /**
51761            * The base constructor for creating `lodash` wrapper objects.
51762            *
51763            * @private
51764            * @param {*}
51765            *            value The value to wrap.
51766            * @param {boolean}
51767            *            [chainAll] Enable chaining for all wrapper methods.
51768            * @param {Array}
51769            *            [actions=[]] Actions to peform to resolve the unwrapped value.
51770            */
51771           function LodashWrapper(value, chainAll, actions) {
51772             this.__wrapped__ = value;
51773             this.__actions__ = actions || [];
51774             this.__chain__ = !!chainAll;
51775           }
51776
51777           /**
51778            * An object environment feature flags.
51779            *
51780            * @static
51781            * @memberOf _
51782            * @type Object
51783            */
51784           var support = lodash.support = {};
51785
51786           /**
51787            * By default, the template delimiters used by lodash are like those in
51788            * embedded Ruby (ERB). Change the following template settings to use
51789            * alternative delimiters.
51790            *
51791            * @static
51792            * @memberOf _
51793            * @type Object
51794            */
51795           lodash.templateSettings = {
51796
51797             /**
51798              * Used to detect `data` property values to be HTML-escaped.
51799              *
51800              * @memberOf _.templateSettings
51801              * @type RegExp
51802              */
51803             'escape': reEscape,
51804
51805             /**
51806              * Used to detect code to be evaluated.
51807              *
51808              * @memberOf _.templateSettings
51809              * @type RegExp
51810              */
51811             'evaluate': reEvaluate,
51812
51813             /**
51814              * Used to detect `data` property values to inject.
51815              *
51816              * @memberOf _.templateSettings
51817              * @type RegExp
51818              */
51819             'interpolate': reInterpolate,
51820
51821             /**
51822              * Used to reference the data object in the template text.
51823              *
51824              * @memberOf _.templateSettings
51825              * @type string
51826              */
51827             'variable': '',
51828
51829             /**
51830              * Used to import variables into the compiled template.
51831              *
51832              * @memberOf _.templateSettings
51833              * @type Object
51834              */
51835             'imports': {
51836
51837               /**
51838                * A reference to the `lodash` function.
51839                *
51840                * @memberOf _.templateSettings.imports
51841                * @type Function
51842                */
51843               '_': lodash
51844             }
51845           };
51846
51847           /*------------------------------------------------------------------------*/
51848
51849           /**
51850            * Creates a lazy wrapper object which wraps `value` to enable lazy
51851            * evaluation.
51852            *
51853            * @private
51854            * @param {*}
51855            *            value The value to wrap.
51856            */
51857           function LazyWrapper(value) {
51858             this.__wrapped__ = value;
51859             this.__actions__ = [];
51860             this.__dir__ = 1;
51861             this.__filtered__ = false;
51862             this.__iteratees__ = [];
51863             this.__takeCount__ = POSITIVE_INFINITY;
51864             this.__views__ = [];
51865           }
51866
51867           /**
51868            * Creates a clone of the lazy wrapper object.
51869            *
51870            * @private
51871            * @name clone
51872            * @memberOf LazyWrapper
51873            * @returns {Object} Returns the cloned `LazyWrapper` object.
51874            */
51875           function lazyClone() {
51876             var result = new LazyWrapper(this.__wrapped__);
51877             result.__actions__ = arrayCopy(this.__actions__);
51878             result.__dir__ = this.__dir__;
51879             result.__filtered__ = this.__filtered__;
51880             result.__iteratees__ = arrayCopy(this.__iteratees__);
51881             result.__takeCount__ = this.__takeCount__;
51882             result.__views__ = arrayCopy(this.__views__);
51883             return result;
51884           }
51885
51886           /**
51887            * Reverses the direction of lazy iteration.
51888            *
51889            * @private
51890            * @name reverse
51891            * @memberOf LazyWrapper
51892            * @returns {Object} Returns the new reversed `LazyWrapper` object.
51893            */
51894           function lazyReverse() {
51895             if (this.__filtered__) {
51896               var result = new LazyWrapper(this);
51897               result.__dir__ = -1;
51898               result.__filtered__ = true;
51899             } else {
51900               result = this.clone();
51901               result.__dir__ *= -1;
51902             }
51903             return result;
51904           }
51905
51906           /**
51907            * Extracts the unwrapped value from its lazy wrapper.
51908            *
51909            * @private
51910            * @name value
51911            * @memberOf LazyWrapper
51912            * @returns {*} Returns the unwrapped value.
51913            */
51914           function lazyValue() {
51915             var array = this.__wrapped__.value(),
51916               dir = this.__dir__,
51917               isArr = isArray(array),
51918               isRight = dir < 0,
51919               arrLength = isArr ? array.length : 0,
51920               view = getView(0, arrLength, this.__views__),
51921               start = view.start,
51922               end = view.end,
51923               length = end - start,
51924               index = isRight ? end : (start - 1),
51925               iteratees = this.__iteratees__,
51926               iterLength = iteratees.length,
51927               resIndex = 0,
51928               takeCount = nativeMin(length, this.__takeCount__);
51929
51930             if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
51931               return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__);
51932             }
51933             var result = [];
51934
51935             outer:
51936               while (length-- && resIndex < takeCount) {
51937                 index += dir;
51938
51939                 var iterIndex = -1,
51940                   value = array[index];
51941
51942                 while (++iterIndex < iterLength) {
51943                   var data = iteratees[iterIndex],
51944                     iteratee = data.iteratee,
51945                     type = data.type,
51946                     computed = iteratee(value);
51947
51948                   if (type == LAZY_MAP_FLAG) {
51949                     value = computed;
51950                   } else if (!computed) {
51951                     if (type == LAZY_FILTER_FLAG) {
51952                       continue outer;
51953                     } else {
51954                       break outer;
51955                     }
51956                   }
51957                 }
51958                 result[resIndex++] = value;
51959               }
51960             return result;
51961           }
51962
51963           /*------------------------------------------------------------------------*/
51964
51965           /**
51966            * Creates a cache object to store key/value pairs.
51967            *
51968            * @private
51969            * @static
51970            * @name Cache
51971            * @memberOf _.memoize
51972            */
51973           function MapCache() {
51974             this.__data__ = {};
51975           }
51976
51977           /**
51978            * Removes `key` and its value from the cache.
51979            *
51980            * @private
51981            * @name delete
51982            * @memberOf _.memoize.Cache
51983            * @param {string}
51984            *            key The key of the value to remove.
51985            * @returns {boolean} Returns `true` if the entry was removed successfully,
51986            *          else `false`.
51987            */
51988           function mapDelete(key) {
51989             return this.has(key) && delete this.__data__[key];
51990           }
51991
51992           /**
51993            * Gets the cached value for `key`.
51994            *
51995            * @private
51996            * @name get
51997            * @memberOf _.memoize.Cache
51998            * @param {string}
51999            *            key The key of the value to get.
52000            * @returns {*} Returns the cached value.
52001            */
52002           function mapGet(key) {
52003             return key == '__proto__' ? undefined : this.__data__[key];
52004           }
52005
52006           /**
52007            * Checks if a cached value for `key` exists.
52008            *
52009            * @private
52010            * @name has
52011            * @memberOf _.memoize.Cache
52012            * @param {string}
52013            *            key The key of the entry to check.
52014            * @returns {boolean} Returns `true` if an entry for `key` exists, else
52015            *          `false`.
52016            */
52017           function mapHas(key) {
52018             return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
52019           }
52020
52021           /**
52022            * Sets `value` to `key` of the cache.
52023            *
52024            * @private
52025            * @name set
52026            * @memberOf _.memoize.Cache
52027            * @param {string}
52028            *            key The key of the value to cache.
52029            * @param {*}
52030            *            value The value to cache.
52031            * @returns {Object} Returns the cache object.
52032            */
52033           function mapSet(key, value) {
52034             if (key != '__proto__') {
52035               this.__data__[key] = value;
52036             }
52037             return this;
52038           }
52039
52040           /*------------------------------------------------------------------------*/
52041
52042           /**
52043            *
52044            * Creates a cache object to store unique values.
52045            *
52046            * @private
52047            * @param {Array}
52048            *            [values] The values to cache.
52049            */
52050           function SetCache(values) {
52051             var length = values ? values.length : 0;
52052
52053             this.data = {
52054               'hash': nativeCreate(null),
52055               'set': new Set
52056             };
52057             while (length--) {
52058               this.push(values[length]);
52059             }
52060           }
52061
52062           /**
52063            * Checks if `value` is in `cache` mimicking the return signature of
52064            * `_.indexOf` by returning `0` if the value is found, else `-1`.
52065            *
52066            * @private
52067            * @param {Object}
52068            *            cache The cache to search.
52069            * @param {*}
52070            *            value The value to search for.
52071            * @returns {number} Returns `0` if `value` is found, else `-1`.
52072            */
52073           function cacheIndexOf(cache, value) {
52074             var data = cache.data,
52075               result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
52076
52077             return result ? 0 : -1;
52078           }
52079
52080           /**
52081            * Adds `value` to the cache.
52082            *
52083            * @private
52084            * @name push
52085            * @memberOf SetCache
52086            * @param {*}
52087            *            value The value to cache.
52088            */
52089           function cachePush(value) {
52090             var data = this.data;
52091             if (typeof value == 'string' || isObject(value)) {
52092               data.set.add(value);
52093             } else {
52094               data.hash[value] = true;
52095             }
52096           }
52097
52098           /*------------------------------------------------------------------------*/
52099
52100           /**
52101            * Creates a new array joining `array` with `other`.
52102            *
52103            * @private
52104            * @param {Array}
52105            *            array The array to join.
52106            * @param {Array}
52107            *            other The other array to join.
52108            * @returns {Array} Returns the new concatenated array.
52109            */
52110           function arrayConcat(array, other) {
52111             var index = -1,
52112               length = array.length,
52113               othIndex = -1,
52114               othLength = other.length,
52115               result = Array(length + othLength);
52116
52117             while (++index < length) {
52118               result[index] = array[index];
52119             }
52120             while (++othIndex < othLength) {
52121               result[index++] = other[othIndex];
52122             }
52123             return result;
52124           }
52125
52126           /**
52127            * Copies the values of `source` to `array`.
52128            *
52129            * @private
52130            * @param {Array}
52131            *            source The array to copy values from.
52132            * @param {Array}
52133            *            [array=[]] The array to copy values to.
52134            * @returns {Array} Returns `array`.
52135            */
52136           function arrayCopy(source, array) {
52137             var index = -1,
52138               length = source.length;
52139
52140             array || (array = Array(length));
52141             while (++index < length) {
52142               array[index] = source[index];
52143             }
52144             return array;
52145           }
52146
52147           /**
52148            * A specialized version of `_.forEach` for arrays without support for
52149            * callback shorthands and `this` binding.
52150            *
52151            * @private
52152            * @param {Array}
52153            *            array The array to iterate over.
52154            * @param {Function}
52155            *            iteratee The function invoked per iteration.
52156            * @returns {Array} Returns `array`.
52157            */
52158           function arrayEach(array, iteratee) {
52159             var index = -1,
52160               length = array.length;
52161
52162             while (++index < length) {
52163               if (iteratee(array[index], index, array) === false) {
52164                 break;
52165               }
52166             }
52167             return array;
52168           }
52169
52170           /**
52171            * A specialized version of `_.forEachRight` for arrays without support for
52172            * callback shorthands and `this` binding.
52173            *
52174            * @private
52175            * @param {Array}
52176            *            array The array to iterate over.
52177            * @param {Function}
52178            *            iteratee The function invoked per iteration.
52179            * @returns {Array} Returns `array`.
52180            */
52181           function arrayEachRight(array, iteratee) {
52182             var length = array.length;
52183
52184             while (length--) {
52185               if (iteratee(array[length], length, array) === false) {
52186                 break;
52187               }
52188             }
52189             return array;
52190           }
52191
52192           /**
52193            * A specialized version of `_.every` for arrays without support for
52194            * callback shorthands and `this` binding.
52195            *
52196            * @private
52197            * @param {Array}
52198            *            array The array to iterate over.
52199            * @param {Function}
52200            *            predicate The function invoked per iteration.
52201            * @returns {boolean} Returns `true` if all elements pass the predicate
52202            *          check, else `false`.
52203            */
52204           function arrayEvery(array, predicate) {
52205             var index = -1,
52206               length = array.length;
52207
52208             while (++index < length) {
52209               if (!predicate(array[index], index, array)) {
52210                 return false;
52211               }
52212             }
52213             return true;
52214           }
52215
52216           /**
52217            * A specialized version of `baseExtremum` for arrays which invokes
52218            * `iteratee` with one argument: (value).
52219            *
52220            * @private
52221            * @param {Array}
52222            *            array The array to iterate over.
52223            * @param {Function}
52224            *            iteratee The function invoked per iteration.
52225            * @param {Function}
52226            *            comparator The function used to compare values.
52227            * @param {*}
52228            *            exValue The initial extremum value.
52229            * @returns {*} Returns the extremum value.
52230            */
52231           function arrayExtremum(array, iteratee, comparator, exValue) {
52232             var index = -1,
52233               length = array.length,
52234               computed = exValue,
52235               result = computed;
52236
52237             while (++index < length) {
52238               var value = array[index],
52239                 current = +iteratee(value);
52240
52241               if (comparator(current, computed)) {
52242                 computed = current;
52243                 result = value;
52244               }
52245             }
52246             return result;
52247           }
52248
52249           /**
52250            * A specialized version of `_.filter` for arrays without support for
52251            * callback shorthands and `this` binding.
52252            *
52253            * @private
52254            * @param {Array}
52255            *            array The array to iterate over.
52256            * @param {Function}
52257            *            predicate The function invoked per iteration.
52258            * @returns {Array} Returns the new filtered array.
52259            */
52260           function arrayFilter(array, predicate) {
52261             var index = -1,
52262               length = array.length,
52263               resIndex = -1,
52264               result = [];
52265
52266             while (++index < length) {
52267               var value = array[index];
52268               if (predicate(value, index, array)) {
52269                 result[++resIndex] = value;
52270               }
52271             }
52272             return result;
52273           }
52274
52275           /**
52276            * A specialized version of `_.map` for arrays without support for callback
52277            * shorthands and `this` binding.
52278            *
52279            * @private
52280            * @param {Array}
52281            *            array The array to iterate over.
52282            * @param {Function}
52283            *            iteratee The function invoked per iteration.
52284            * @returns {Array} Returns the new mapped array.
52285            */
52286           function arrayMap(array, iteratee) {
52287             var index = -1,
52288               length = array.length,
52289               result = Array(length);
52290
52291             while (++index < length) {
52292               result[index] = iteratee(array[index], index, array);
52293             }
52294             return result;
52295           }
52296
52297           /**
52298            * Appends the elements of `values` to `array`.
52299            *
52300            * @private
52301            * @param {Array}
52302            *            array The array to modify.
52303            * @param {Array}
52304            *            values The values to append.
52305            * @returns {Array} Returns `array`.
52306            */
52307           function arrayPush(array, values) {
52308             var index = -1,
52309               length = values.length,
52310               offset = array.length;
52311
52312             while (++index < length) {
52313               array[offset + index] = values[index];
52314             }
52315             return array;
52316           }
52317
52318           /**
52319            * A specialized version of `_.reduce` for arrays without support for
52320            * callback shorthands and `this` binding.
52321            *
52322            * @private
52323            * @param {Array}
52324            *            array The array to iterate over.
52325            * @param {Function}
52326            *            iteratee The function invoked per iteration.
52327            * @param {*}
52328            *            [accumulator] The initial value.
52329            * @param {boolean}
52330            *            [initFromArray] Specify using the first element of `array` as
52331            *            the initial value.
52332            * @returns {*} Returns the accumulated value.
52333            */
52334           function arrayReduce(array, iteratee, accumulator, initFromArray) {
52335             var index = -1,
52336               length = array.length;
52337
52338             if (initFromArray && length) {
52339               accumulator = array[++index];
52340             }
52341             while (++index < length) {
52342               accumulator = iteratee(accumulator, array[index], index, array);
52343             }
52344             return accumulator;
52345           }
52346
52347           /**
52348            * A specialized version of `_.reduceRight` for arrays without support for
52349            * callback shorthands and `this` binding.
52350            *
52351            * @private
52352            * @param {Array}
52353            *            array The array to iterate over.
52354            * @param {Function}
52355            *            iteratee The function invoked per iteration.
52356            * @param {*}
52357            *            [accumulator] The initial value.
52358            * @param {boolean}
52359            *            [initFromArray] Specify using the last element of `array` as
52360            *            the initial value.
52361            * @returns {*} Returns the accumulated value.
52362            */
52363           function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
52364             var length = array.length;
52365             if (initFromArray && length) {
52366               accumulator = array[--length];
52367             }
52368             while (length--) {
52369               accumulator = iteratee(accumulator, array[length], length, array);
52370             }
52371             return accumulator;
52372           }
52373
52374           /**
52375            * A specialized version of `_.some` for arrays without support for callback
52376            * shorthands and `this` binding.
52377            *
52378            * @private
52379            * @param {Array}
52380            *            array The array to iterate over.
52381            * @param {Function}
52382            *            predicate The function invoked per iteration.
52383            * @returns {boolean} Returns `true` if any element passes the predicate
52384            *          check, else `false`.
52385            */
52386           function arraySome(array, predicate) {
52387             var index = -1,
52388               length = array.length;
52389
52390             while (++index < length) {
52391               if (predicate(array[index], index, array)) {
52392                 return true;
52393               }
52394             }
52395             return false;
52396           }
52397
52398           /**
52399            * A specialized version of `_.sum` for arrays without support for callback
52400            * shorthands and `this` binding..
52401            *
52402            * @private
52403            * @param {Array}
52404            *            array The array to iterate over.
52405            * @param {Function}
52406            *            iteratee The function invoked per iteration.
52407            * @returns {number} Returns the sum.
52408            */
52409           function arraySum(array, iteratee) {
52410             var length = array.length,
52411               result = 0;
52412
52413             while (length--) {
52414               result += +iteratee(array[length]) || 0;
52415             }
52416             return result;
52417           }
52418
52419           /**
52420            * Used by `_.defaults` to customize its `_.assign` use.
52421            *
52422            * @private
52423            * @param {*}
52424            *            objectValue The destination object property value.
52425            * @param {*}
52426            *            sourceValue The source object property value.
52427            * @returns {*} Returns the value to assign to the destination object.
52428            */
52429           function assignDefaults(objectValue, sourceValue) {
52430             return objectValue === undefined ? sourceValue : objectValue;
52431           }
52432
52433           /**
52434            * Used by `_.template` to customize its `_.assign` use.
52435            *
52436            * **Note:** This function is like `assignDefaults` except that it ignores
52437            * inherited property values when checking if a property is `undefined`.
52438            *
52439            * @private
52440            * @param {*}
52441            *            objectValue The destination object property value.
52442            * @param {*}
52443            *            sourceValue The source object property value.
52444            * @param {string}
52445            *            key The key associated with the object and source values.
52446            * @param {Object}
52447            *            object The destination object.
52448            * @returns {*} Returns the value to assign to the destination object.
52449            */
52450           function assignOwnDefaults(objectValue, sourceValue, key, object) {
52451             return (objectValue === undefined || !hasOwnProperty.call(object, key)) ? sourceValue : objectValue;
52452           }
52453
52454           /**
52455            * A specialized version of `_.assign` for customizing assigned values
52456            * without support for argument juggling, multiple sources, and `this`
52457            * binding `customizer` functions.
52458            *
52459            * @private
52460            * @param {Object}
52461            *            object The destination object.
52462            * @param {Object}
52463            *            source The source object.
52464            * @param {Function}
52465            *            customizer The function to customize assigned values.
52466            * @returns {Object} Returns `object`.
52467            */
52468           function assignWith(object, source, customizer) {
52469             var index = -1,
52470               props = keys(source),
52471               length = props.length;
52472
52473             while (++index < length) {
52474               var key = props[index],
52475                 value = object[key],
52476                 result = customizer(value, source[key], key, object, source);
52477
52478               if ((result === result ? (result !== value) : (value === value)) ||
52479                 (value === undefined && !(key in object))) {
52480                 object[key] = result;
52481               }
52482             }
52483             return object;
52484           }
52485
52486           /**
52487            * The base implementation of `_.assign` without support for argument
52488            * juggling, multiple sources, and `customizer` functions.
52489            *
52490            * @private
52491            * @param {Object}
52492            *            object The destination object.
52493            * @param {Object}
52494            *            source The source object.
52495            * @returns {Object} Returns `object`.
52496            */
52497           function baseAssign(object, source) {
52498             return source == null ? object : baseCopy(source, keys(source), object);
52499           }
52500
52501           /**
52502            * The base implementation of `_.at` without support for string collections
52503            * and individual key arguments.
52504            *
52505            * @private
52506            * @param {Array|Object}
52507            *            collection The collection to iterate over.
52508            * @param {number[]|string[]}
52509            *            props The property names or indexes of elements to pick.
52510            * @returns {Array} Returns the new array of picked elements.
52511            */
52512           function baseAt(collection, props) {
52513             var index = -1,
52514               isNil = collection == null,
52515               isArr = !isNil && isArrayLike(collection),
52516               length = isArr ? collection.length : 0,
52517               propsLength = props.length,
52518               result = Array(propsLength);
52519
52520             while (++index < propsLength) {
52521               var key = props[index];
52522               if (isArr) {
52523                 result[index] = isIndex(key, length) ? collection[key] : undefined;
52524               } else {
52525                 result[index] = isNil ? undefined : collection[key];
52526               }
52527             }
52528             return result;
52529           }
52530
52531           /**
52532            * Copies properties of `source` to `object`.
52533            *
52534            * @private
52535            * @param {Object}
52536            *            source The object to copy properties from.
52537            * @param {Array}
52538            *            props The property names to copy.
52539            * @param {Object}
52540            *            [object={}] The object to copy properties to.
52541            * @returns {Object} Returns `object`.
52542            */
52543           function baseCopy(source, props, object) {
52544             object || (object = {});
52545
52546             var index = -1,
52547               length = props.length;
52548
52549             while (++index < length) {
52550               var key = props[index];
52551               object[key] = source[key];
52552             }
52553             return object;
52554           }
52555
52556           /**
52557            * The base implementation of `_.callback` which supports specifying the
52558            * number of arguments to provide to `func`.
52559            *
52560            * @private
52561            * @param {*}
52562            *            [func=_.identity] The value to convert to a callback.
52563            * @param {*}
52564            *            [thisArg] The `this` binding of `func`.
52565            * @param {number}
52566            *            [argCount] The number of arguments to provide to `func`.
52567            * @returns {Function} Returns the callback.
52568            */
52569           function baseCallback(func, thisArg, argCount) {
52570             var type = typeof func;
52571             if (type == 'function') {
52572               return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
52573             }
52574             if (func == null) {
52575               return identity;
52576             }
52577             if (type == 'object') {
52578               return baseMatches(func);
52579             }
52580             return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
52581           }
52582
52583           /**
52584            * The base implementation of `_.clone` without support for argument
52585            * juggling and `this` binding `customizer` functions.
52586            *
52587            * @private
52588            * @param {*}
52589            *            value The value to clone.
52590            * @param {boolean}
52591            *            [isDeep] Specify a deep clone.
52592            * @param {Function}
52593            *            [customizer] The function to customize cloning values.
52594            * @param {string}
52595            *            [key] The key of `value`.
52596            * @param {Object}
52597            *            [object] The object `value` belongs to.
52598            * @param {Array}
52599            *            [stackA=[]] Tracks traversed source objects.
52600            * @param {Array}
52601            *            [stackB=[]] Associates clones with source counterparts.
52602            * @returns {*} Returns the cloned value.
52603            */
52604           function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
52605             var result;
52606             if (customizer) {
52607               result = object ? customizer(value, key, object) : customizer(value);
52608             }
52609             if (result !== undefined) {
52610               return result;
52611             }
52612             if (!isObject(value)) {
52613               return value;
52614             }
52615             var isArr = isArray(value);
52616             if (isArr) {
52617               result = initCloneArray(value);
52618               if (!isDeep) {
52619                 return arrayCopy(value, result);
52620               }
52621             } else {
52622               var tag = objToString.call(value),
52623                 isFunc = tag == funcTag;
52624
52625               if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
52626                 result = initCloneObject(isFunc ? {} : value);
52627                 if (!isDeep) {
52628                   return baseAssign(result, value);
52629                 }
52630               } else {
52631                 return cloneableTags[tag] ? initCloneByTag(value, tag, isDeep) : (object ? value : {});
52632               }
52633             }
52634             // Check for circular references and return its corresponding clone.
52635             stackA || (stackA = []);
52636             stackB || (stackB = []);
52637
52638             var length = stackA.length;
52639             while (length--) {
52640               if (stackA[length] == value) {
52641                 return stackB[length];
52642               }
52643             }
52644             // Add the source value to the stack of traversed objects and associate
52645             // it with its clone.
52646             stackA.push(value);
52647             stackB.push(result);
52648
52649             // Recursively populate clone (susceptible to call stack limits).
52650             (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
52651               result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
52652             });
52653             return result;
52654           }
52655
52656           /**
52657            * The base implementation of `_.create` without support for assigning
52658            * properties to the created object.
52659            *
52660            * @private
52661            * @param {Object}
52662            *            prototype The object to inherit from.
52663            * @returns {Object} Returns the new object.
52664            */
52665           var baseCreate = (function() {
52666             function object() {}
52667             return function(prototype) {
52668               if (isObject(prototype)) {
52669                 object.prototype = prototype;
52670                 var result = new object;
52671                 object.prototype = undefined;
52672               }
52673               return result || {};
52674             };
52675           }());
52676
52677           /**
52678            * The base implementation of `_.delay` and `_.defer` which accepts an index
52679            * of where to slice the arguments to provide to `func`.
52680            *
52681            * @private
52682            * @param {Function}
52683            *            func The function to delay.
52684            * @param {number}
52685            *            wait The number of milliseconds to delay invocation.
52686            * @param {Object}
52687            *            args The arguments provide to `func`.
52688            * @returns {number} Returns the timer id.
52689            */
52690           function baseDelay(func, wait, args) {
52691             if (typeof func != 'function') {
52692               throw new TypeError(FUNC_ERROR_TEXT);
52693             }
52694             return setTimeout(function() {
52695               func.apply(undefined, args);
52696             }, wait);
52697           }
52698
52699           /**
52700            * The base implementation of `_.difference` which accepts a single array of
52701            * values to exclude.
52702            *
52703            * @private
52704            * @param {Array}
52705            *            array The array to inspect.
52706            * @param {Array}
52707            *            values The values to exclude.
52708            * @returns {Array} Returns the new array of filtered values.
52709            */
52710           function baseDifference(array, values) {
52711             var length = array ? array.length : 0,
52712               result = [];
52713
52714             if (!length) {
52715               return result;
52716             }
52717             var index = -1,
52718               indexOf = getIndexOf(),
52719               isCommon = indexOf == baseIndexOf,
52720               cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
52721               valuesLength = values.length;
52722
52723             if (cache) {
52724               indexOf = cacheIndexOf;
52725               isCommon = false;
52726               values = cache;
52727             }
52728             outer:
52729               while (++index < length) {
52730                 var value = array[index];
52731
52732                 if (isCommon && value === value) {
52733                   var valuesIndex = valuesLength;
52734                   while (valuesIndex--) {
52735                     if (values[valuesIndex] === value) {
52736                       continue outer;
52737                     }
52738                   }
52739                   result.push(value);
52740                 } else if (indexOf(values, value, 0) < 0) {
52741                   result.push(value);
52742                 }
52743               }
52744             return result;
52745           }
52746
52747           /**
52748            * The base implementation of `_.forEach` without support for callback
52749            * shorthands and `this` binding.
52750            *
52751            * @private
52752            * @param {Array|Object|string}
52753            *            collection The collection to iterate over.
52754            * @param {Function}
52755            *            iteratee The function invoked per iteration.
52756            * @returns {Array|Object|string} Returns `collection`.
52757            */
52758           var baseEach = createBaseEach(baseForOwn);
52759
52760           /**
52761            * The base implementation of `_.forEachRight` without support for callback
52762            * shorthands and `this` binding.
52763            *
52764            * @private
52765            * @param {Array|Object|string}
52766            *            collection The collection to iterate over.
52767            * @param {Function}
52768            *            iteratee The function invoked per iteration.
52769            * @returns {Array|Object|string} Returns `collection`.
52770            */
52771           var baseEachRight = createBaseEach(baseForOwnRight, true);
52772
52773           /**
52774            * The base implementation of `_.every` without support for callback
52775            * shorthands and `this` binding.
52776            *
52777            * @private
52778            * @param {Array|Object|string}
52779            *            collection The collection to iterate over.
52780            * @param {Function}
52781            *            predicate The function invoked per iteration.
52782            * @returns {boolean} Returns `true` if all elements pass the predicate
52783            *          check, else `false`
52784            */
52785           function baseEvery(collection, predicate) {
52786             var result = true;
52787             baseEach(collection, function(value, index, collection) {
52788               result = !!predicate(value, index, collection);
52789               return result;
52790             });
52791             return result;
52792           }
52793
52794           /**
52795            * Gets the extremum value of `collection` invoking `iteratee` for each
52796            * value in `collection` to generate the criterion by which the value is
52797            * ranked. The `iteratee` is invoked with three arguments: (value,
52798            * index|key, collection).
52799            *
52800            * @private
52801            * @param {Array|Object|string}
52802            *            collection The collection to iterate over.
52803            * @param {Function}
52804            *            iteratee The function invoked per iteration.
52805            * @param {Function}
52806            *            comparator The function used to compare values.
52807            * @param {*}
52808            *            exValue The initial extremum value.
52809            * @returns {*} Returns the extremum value.
52810            */
52811           function baseExtremum(collection, iteratee, comparator, exValue) {
52812             var computed = exValue,
52813               result = computed;
52814
52815             baseEach(collection, function(value, index, collection) {
52816               var current = +iteratee(value, index, collection);
52817               if (comparator(current, computed) || (current === exValue && current === result)) {
52818                 computed = current;
52819                 result = value;
52820               }
52821             });
52822             return result;
52823           }
52824
52825           /**
52826            * The base implementation of `_.fill` without an iteratee call guard.
52827            *
52828            * @private
52829            * @param {Array}
52830            *            array The array to fill.
52831            * @param {*}
52832            *            value The value to fill `array` with.
52833            * @param {number}
52834            *            [start=0] The start position.
52835            * @param {number}
52836            *            [end=array.length] The end position.
52837            * @returns {Array} Returns `array`.
52838            */
52839           function baseFill(array, value, start, end) {
52840             var length = array.length;
52841
52842             start = start == null ? 0 : (+start || 0);
52843             if (start < 0) {
52844               start = -start > length ? 0 : (length + start);
52845             }
52846             end = (end === undefined || end > length) ? length : (+end || 0);
52847             if (end < 0) {
52848               end += length;
52849             }
52850             length = start > end ? 0 : (end >>> 0);
52851             start >>>= 0;
52852
52853             while (start < length) {
52854               array[start++] = value;
52855             }
52856             return array;
52857           }
52858
52859           /**
52860            * The base implementation of `_.filter` without support for callback
52861            * shorthands and `this` binding.
52862            *
52863            * @private
52864            * @param {Array|Object|string}
52865            *            collection The collection to iterate over.
52866            * @param {Function}
52867            *            predicate The function invoked per iteration.
52868            * @returns {Array} Returns the new filtered array.
52869            */
52870           function baseFilter(collection, predicate) {
52871             var result = [];
52872             baseEach(collection, function(value, index, collection) {
52873               if (predicate(value, index, collection)) {
52874                 result.push(value);
52875               }
52876             });
52877             return result;
52878           }
52879
52880           /**
52881            * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and
52882            * `_.findLastKey`, without support for callback shorthands and `this`
52883            * binding, which iterates over `collection` using the provided `eachFunc`.
52884            *
52885            * @private
52886            * @param {Array|Object|string}
52887            *            collection The collection to search.
52888            * @param {Function}
52889            *            predicate The function invoked per iteration.
52890            * @param {Function}
52891            *            eachFunc The function to iterate over `collection`.
52892            * @param {boolean}
52893            *            [retKey] Specify returning the key of the found element
52894            *            instead of the element itself.
52895            * @returns {*} Returns the found element or its key, else `undefined`.
52896            */
52897           function baseFind(collection, predicate, eachFunc, retKey) {
52898             var result;
52899             eachFunc(collection, function(value, key, collection) {
52900               if (predicate(value, key, collection)) {
52901                 result = retKey ? key : value;
52902                 return false;
52903               }
52904             });
52905             return result;
52906           }
52907
52908           /**
52909            * The base implementation of `_.flatten` with added support for restricting
52910            * flattening and specifying the start index.
52911            *
52912            * @private
52913            * @param {Array}
52914            *            array The array to flatten.
52915            * @param {boolean}
52916            *            [isDeep] Specify a deep flatten.
52917            * @param {boolean}
52918            *            [isStrict] Restrict flattening to arrays-like objects.
52919            * @param {Array}
52920            *            [result=[]] The initial result value.
52921            * @returns {Array} Returns the new flattened array.
52922            */
52923           function baseFlatten(array, isDeep, isStrict, result) {
52924             result || (result = []);
52925
52926             var index = -1,
52927               length = array.length;
52928
52929             while (++index < length) {
52930               var value = array[index];
52931               if (isObjectLike(value) && isArrayLike(value) &&
52932                 (isStrict || isArray(value) || isArguments(value))) {
52933                 if (isDeep) {
52934                   // Recursively flatten arrays (susceptible to call stack limits).
52935                   baseFlatten(value, isDeep, isStrict, result);
52936                 } else {
52937                   arrayPush(result, value);
52938                 }
52939               } else if (!isStrict) {
52940                 result[result.length] = value;
52941               }
52942             }
52943             return result;
52944           }
52945
52946           /**
52947            * The base implementation of `baseForIn` and `baseForOwn` which iterates
52948            * over `object` properties returned by `keysFunc` invoking `iteratee` for
52949            * each property. Iteratee functions may exit iteration early by explicitly
52950            * returning `false`.
52951            *
52952            * @private
52953            * @param {Object}
52954            *            object The object to iterate over.
52955            * @param {Function}
52956            *            iteratee The function invoked per iteration.
52957            * @param {Function}
52958            *            keysFunc The function to get the keys of `object`.
52959            * @returns {Object} Returns `object`.
52960            */
52961           var baseFor = createBaseFor();
52962
52963           /**
52964            * This function is like `baseFor` except that it iterates over properties
52965            * in the opposite order.
52966            *
52967            * @private
52968            * @param {Object}
52969            *            object The object to iterate over.
52970            * @param {Function}
52971            *            iteratee The function invoked per iteration.
52972            * @param {Function}
52973            *            keysFunc The function to get the keys of `object`.
52974            * @returns {Object} Returns `object`.
52975            */
52976           var baseForRight = createBaseFor(true);
52977
52978           /**
52979            * The base implementation of `_.forIn` without support for callback
52980            * shorthands and `this` binding.
52981            *
52982            * @private
52983            * @param {Object}
52984            *            object The object to iterate over.
52985            * @param {Function}
52986            *            iteratee The function invoked per iteration.
52987            * @returns {Object} Returns `object`.
52988            */
52989           function baseForIn(object, iteratee) {
52990             return baseFor(object, iteratee, keysIn);
52991           }
52992
52993           /**
52994            * The base implementation of `_.forOwn` without support for callback
52995            * shorthands and `this` binding.
52996            *
52997            * @private
52998            * @param {Object}
52999            *            object The object to iterate over.
53000            * @param {Function}
53001            *            iteratee The function invoked per iteration.
53002            * @returns {Object} Returns `object`.
53003            */
53004           function baseForOwn(object, iteratee) {
53005             return baseFor(object, iteratee, keys);
53006           }
53007
53008           /**
53009            * The base implementation of `_.forOwnRight` without support for callback
53010            * shorthands and `this` binding.
53011            *
53012            * @private
53013            * @param {Object}
53014            *            object The object to iterate over.
53015            * @param {Function}
53016            *            iteratee The function invoked per iteration.
53017            * @returns {Object} Returns `object`.
53018            */
53019           function baseForOwnRight(object, iteratee) {
53020             return baseForRight(object, iteratee, keys);
53021           }
53022
53023           /**
53024            * The base implementation of `_.functions` which creates an array of
53025            * `object` function property names filtered from those provided.
53026            *
53027            * @private
53028            * @param {Object}
53029            *            object The object to inspect.
53030            * @param {Array}
53031            *            props The property names to filter.
53032            * @returns {Array} Returns the new array of filtered property names.
53033            */
53034           function baseFunctions(object, props) {
53035             var index = -1,
53036               length = props.length,
53037               resIndex = -1,
53038               result = [];
53039
53040             while (++index < length) {
53041               var key = props[index];
53042               if (isFunction(object[key])) {
53043                 result[++resIndex] = key;
53044               }
53045             }
53046             return result;
53047           }
53048
53049           /**
53050            * The base implementation of `get` without support for string paths and
53051            * default values.
53052            *
53053            * @private
53054            * @param {Object}
53055            *            object The object to query.
53056            * @param {Array}
53057            *            path The path of the property to get.
53058            * @param {string}
53059            *            [pathKey] The key representation of path.
53060            * @returns {*} Returns the resolved value.
53061            */
53062           function baseGet(object, path, pathKey) {
53063             if (object == null) {
53064               return;
53065             }
53066             if (pathKey !== undefined && pathKey in toObject(object)) {
53067               path = [pathKey];
53068             }
53069             var index = 0,
53070               length = path.length;
53071
53072             while (object != null && index < length) {
53073               object = object[path[index++]];
53074             }
53075             return (index && index == length) ? object : undefined;
53076           }
53077
53078           /**
53079            * The base implementation of `_.isEqual` without support for `this` binding
53080            * `customizer` functions.
53081            *
53082            * @private
53083            * @param {*}
53084            *            value The value to compare.
53085            * @param {*}
53086            *            other The other value to compare.
53087            * @param {Function}
53088            *            [customizer] The function to customize comparing values.
53089            * @param {boolean}
53090            *            [isLoose] Specify performing partial comparisons.
53091            * @param {Array}
53092            *            [stackA] Tracks traversed `value` objects.
53093            * @param {Array}
53094            *            [stackB] Tracks traversed `other` objects.
53095            * @returns {boolean} Returns `true` if the values are equivalent, else
53096            *          `false`.
53097            */
53098           function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
53099             if (value === other) {
53100               return true;
53101             }
53102             if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
53103               return value !== value && other !== other;
53104             }
53105             return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
53106           }
53107
53108           /**
53109            * A specialized version of `baseIsEqual` for arrays and objects which
53110            * performs deep comparisons and tracks traversed objects enabling objects
53111            * with circular references to be compared.
53112            *
53113            * @private
53114            * @param {Object}
53115            *            object The object to compare.
53116            * @param {Object}
53117            *            other The other object to compare.
53118            * @param {Function}
53119            *            equalFunc The function to determine equivalents of values.
53120            * @param {Function}
53121            *            [customizer] The function to customize comparing objects.
53122            * @param {boolean}
53123            *            [isLoose] Specify performing partial comparisons.
53124            * @param {Array}
53125            *            [stackA=[]] Tracks traversed `value` objects.
53126            * @param {Array}
53127            *            [stackB=[]] Tracks traversed `other` objects.
53128            * @returns {boolean} Returns `true` if the objects are equivalent, else
53129            *          `false`.
53130            */
53131           function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
53132             var objIsArr = isArray(object),
53133               othIsArr = isArray(other),
53134               objTag = arrayTag,
53135               othTag = arrayTag;
53136
53137             if (!objIsArr) {
53138               objTag = objToString.call(object);
53139               if (objTag == argsTag) {
53140                 objTag = objectTag;
53141               } else if (objTag != objectTag) {
53142                 objIsArr = isTypedArray(object);
53143               }
53144             }
53145             if (!othIsArr) {
53146               othTag = objToString.call(other);
53147               if (othTag == argsTag) {
53148                 othTag = objectTag;
53149               } else if (othTag != objectTag) {
53150                 othIsArr = isTypedArray(other);
53151               }
53152             }
53153             var objIsObj = objTag == objectTag,
53154               othIsObj = othTag == objectTag,
53155               isSameTag = objTag == othTag;
53156
53157             if (isSameTag && !(objIsArr || objIsObj)) {
53158               return equalByTag(object, other, objTag);
53159             }
53160             if (!isLoose) {
53161               var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
53162                 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
53163
53164               if (objIsWrapped || othIsWrapped) {
53165                 return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
53166               }
53167             }
53168             if (!isSameTag) {
53169               return false;
53170             }
53171             // Assume cyclic values are equal.
53172             // For more information on detecting circular references see
53173             // https://es5.github.io/#JO.
53174             stackA || (stackA = []);
53175             stackB || (stackB = []);
53176
53177             var length = stackA.length;
53178             while (length--) {
53179               if (stackA[length] == object) {
53180                 return stackB[length] == other;
53181               }
53182             }
53183             // Add `object` and `other` to the stack of traversed objects.
53184             stackA.push(object);
53185             stackB.push(other);
53186
53187             var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
53188
53189             stackA.pop();
53190             stackB.pop();
53191
53192             return result;
53193           }
53194
53195           /**
53196            * The base implementation of `_.isMatch` without support for callback
53197            * shorthands and `this` binding.
53198            *
53199            * @private
53200            * @param {Object}
53201            *            object The object to inspect.
53202            * @param {Array}
53203            *            matchData The propery names, values, and compare flags to
53204            *            match.
53205            * @param {Function}
53206            *            [customizer] The function to customize comparing objects.
53207            * @returns {boolean} Returns `true` if `object` is a match, else `false`.
53208            */
53209           function baseIsMatch(object, matchData, customizer) {
53210             var index = matchData.length,
53211               length = index,
53212               noCustomizer = !customizer;
53213
53214             if (object == null) {
53215               return !length;
53216             }
53217             object = toObject(object);
53218             while (index--) {
53219               var data = matchData[index];
53220               if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) {
53221                 return false;
53222               }
53223             }
53224             while (++index < length) {
53225               data = matchData[index];
53226               var key = data[0],
53227                 objValue = object[key],
53228                 srcValue = data[1];
53229
53230               if (noCustomizer && data[2]) {
53231                 if (objValue === undefined && !(key in object)) {
53232                   return false;
53233                 }
53234               } else {
53235                 var result = customizer ? customizer(objValue, srcValue, key) : undefined;
53236                 if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
53237                   return false;
53238                 }
53239               }
53240             }
53241             return true;
53242           }
53243
53244           /**
53245            * The base implementation of `_.map` without support for callback
53246            * shorthands and `this` binding.
53247            *
53248            * @private
53249            * @param {Array|Object|string}
53250            *            collection The collection to iterate over.
53251            * @param {Function}
53252            *            iteratee The function invoked per iteration.
53253            * @returns {Array} Returns the new mapped array.
53254            */
53255           function baseMap(collection, iteratee) {
53256             var index = -1,
53257               result = isArrayLike(collection) ? Array(collection.length) : [];
53258
53259             baseEach(collection, function(value, key, collection) {
53260               result[++index] = iteratee(value, key, collection);
53261             });
53262             return result;
53263           }
53264
53265           /**
53266            * The base implementation of `_.matches` which does not clone `source`.
53267            *
53268            * @private
53269            * @param {Object}
53270            *            source The object of property values to match.
53271            * @returns {Function} Returns the new function.
53272            */
53273           function baseMatches(source) {
53274             var matchData = getMatchData(source);
53275             if (matchData.length == 1 && matchData[0][2]) {
53276               var key = matchData[0][0],
53277                 value = matchData[0][1];
53278
53279               return function(object) {
53280                 if (object == null) {
53281                   return false;
53282                 }
53283                 return object[key] === value && (value !== undefined || (key in toObject(object)));
53284               };
53285             }
53286             return function(object) {
53287               return baseIsMatch(object, matchData);
53288             };
53289           }
53290
53291           /**
53292            * The base implementation of `_.matchesProperty` which does not clone
53293            * `srcValue`.
53294            *
53295            * @private
53296            * @param {string}
53297            *            path The path of the property to get.
53298            * @param {*}
53299            *            srcValue The value to compare.
53300            * @returns {Function} Returns the new function.
53301            */
53302           function baseMatchesProperty(path, srcValue) {
53303             var isArr = isArray(path),
53304               isCommon = isKey(path) && isStrictComparable(srcValue),
53305               pathKey = (path + '');
53306
53307             path = toPath(path);
53308             return function(object) {
53309               if (object == null) {
53310                 return false;
53311               }
53312               var key = pathKey;
53313               object = toObject(object);
53314               if ((isArr || !isCommon) && !(key in object)) {
53315                 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
53316                 if (object == null) {
53317                   return false;
53318                 }
53319                 key = last(path);
53320                 object = toObject(object);
53321               }
53322               return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true);
53323             };
53324           }
53325
53326           /**
53327            * The base implementation of `_.merge` without support for argument
53328            * juggling, multiple sources, and `this` binding `customizer` functions.
53329            *
53330            * @private
53331            * @param {Object}
53332            *            object The destination object.
53333            * @param {Object}
53334            *            source The source object.
53335            * @param {Function}
53336            *            [customizer] The function to customize merged values.
53337            * @param {Array}
53338            *            [stackA=[]] Tracks traversed source objects.
53339            * @param {Array}
53340            *            [stackB=[]] Associates values with source counterparts.
53341            * @returns {Object} Returns `object`.
53342            */
53343           function baseMerge(object, source, customizer, stackA, stackB) {
53344             if (!isObject(object)) {
53345               return object;
53346             }
53347             var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
53348               props = isSrcArr ? undefined : keys(source);
53349
53350             arrayEach(props || source, function(srcValue, key) {
53351               if (props) {
53352                 key = srcValue;
53353                 srcValue = source[key];
53354               }
53355               if (isObjectLike(srcValue)) {
53356                 stackA || (stackA = []);
53357                 stackB || (stackB = []);
53358                 baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
53359               } else {
53360                 var value = object[key],
53361                   result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
53362                   isCommon = result === undefined;
53363
53364                 if (isCommon) {
53365                   result = srcValue;
53366                 }
53367                 if ((result !== undefined || (isSrcArr && !(key in object))) &&
53368                   (isCommon || (result === result ? (result !== value) : (value === value)))) {
53369                   object[key] = result;
53370                 }
53371               }
53372             });
53373             return object;
53374           }
53375
53376           /**
53377            * A specialized version of `baseMerge` for arrays and objects which
53378            * performs deep merges and tracks traversed objects enabling objects with
53379            * circular references to be merged.
53380            *
53381            * @private
53382            * @param {Object}
53383            *            object The destination object.
53384            * @param {Object}
53385            *            source The source object.
53386            * @param {string}
53387            *            key The key of the value to merge.
53388            * @param {Function}
53389            *            mergeFunc The function to merge values.
53390            * @param {Function}
53391            *            [customizer] The function to customize merged values.
53392            * @param {Array}
53393            *            [stackA=[]] Tracks traversed source objects.
53394            * @param {Array}
53395            *            [stackB=[]] Associates values with source counterparts.
53396            * @returns {boolean} Returns `true` if the objects are equivalent, else
53397            *          `false`.
53398            */
53399           function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
53400             var length = stackA.length,
53401               srcValue = source[key];
53402
53403             while (length--) {
53404               if (stackA[length] == srcValue) {
53405                 object[key] = stackB[length];
53406                 return;
53407               }
53408             }
53409             var value = object[key],
53410               result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
53411               isCommon = result === undefined;
53412
53413             if (isCommon) {
53414               result = srcValue;
53415               if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
53416                 result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []);
53417               } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
53418                 result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {});
53419               } else {
53420                 isCommon = false;
53421               }
53422             }
53423             // Add the source value to the stack of traversed objects and associate
53424             // it with its merged value.
53425             stackA.push(srcValue);
53426             stackB.push(result);
53427
53428             if (isCommon) {
53429               // Recursively merge objects and arrays (susceptible to call stack
53430               // limits).
53431               object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
53432             } else if (result === result ? (result !== value) : (value === value)) {
53433               object[key] = result;
53434             }
53435           }
53436
53437           /**
53438            * The base implementation of `_.property` without support for deep paths.
53439            *
53440            * @private
53441            * @param {string}
53442            *            key The key of the property to get.
53443            * @returns {Function} Returns the new function.
53444            */
53445           function baseProperty(key) {
53446             return function(object) {
53447               return object == null ? undefined : object[key];
53448             };
53449           }
53450
53451           /**
53452            * A specialized version of `baseProperty` which supports deep paths.
53453            *
53454            * @private
53455            * @param {Array|string}
53456            *            path The path of the property to get.
53457            * @returns {Function} Returns the new function.
53458            */
53459           function basePropertyDeep(path) {
53460             var pathKey = (path + '');
53461             path = toPath(path);
53462             return function(object) {
53463               return baseGet(object, path, pathKey);
53464             };
53465           }
53466
53467           /**
53468            * The base implementation of `_.pullAt` without support for individual
53469            * index arguments and capturing the removed elements.
53470            *
53471            * @private
53472            * @param {Array}
53473            *            array The array to modify.
53474            * @param {number[]}
53475            *            indexes The indexes of elements to remove.
53476            * @returns {Array} Returns `array`.
53477            */
53478           function basePullAt(array, indexes) {
53479             var length = array ? indexes.length : 0;
53480             while (length--) {
53481               var index = indexes[length];
53482               if (index != previous && isIndex(index)) {
53483                 var previous = index;
53484                 splice.call(array, index, 1);
53485               }
53486             }
53487             return array;
53488           }
53489
53490           /**
53491            * The base implementation of `_.random` without support for argument
53492            * juggling and returning floating-point numbers.
53493            *
53494            * @private
53495            * @param {number}
53496            *            min The minimum possible value.
53497            * @param {number}
53498            *            max The maximum possible value.
53499            * @returns {number} Returns the random number.
53500            */
53501           function baseRandom(min, max) {
53502             return min + nativeFloor(nativeRandom() * (max - min + 1));
53503           }
53504
53505           /**
53506            * The base implementation of `_.reduce` and `_.reduceRight` without support
53507            * for callback shorthands and `this` binding, which iterates over
53508            * `collection` using the provided `eachFunc`.
53509            *
53510            * @private
53511            * @param {Array|Object|string}
53512            *            collection The collection to iterate over.
53513            * @param {Function}
53514            *            iteratee The function invoked per iteration.
53515            * @param {*}
53516            *            accumulator The initial value.
53517            * @param {boolean}
53518            *            initFromCollection Specify using the first or last element of
53519            *            `collection` as the initial value.
53520            * @param {Function}
53521            *            eachFunc The function to iterate over `collection`.
53522            * @returns {*} Returns the accumulated value.
53523            */
53524           function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
53525             eachFunc(collection, function(value, index, collection) {
53526               accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
53527             });
53528             return accumulator;
53529           }
53530
53531           /**
53532            * The base implementation of `setData` without support for hot loop
53533            * detection.
53534            *
53535            * @private
53536            * @param {Function}
53537            *            func The function to associate metadata with.
53538            * @param {*}
53539            *            data The metadata.
53540            * @returns {Function} Returns `func`.
53541            */
53542           var baseSetData = !metaMap ? identity : function(func, data) {
53543             metaMap.set(func, data);
53544             return func;
53545           };
53546
53547           /**
53548            * The base implementation of `_.slice` without an iteratee call guard.
53549            *
53550            * @private
53551            * @param {Array}
53552            *            array The array to slice.
53553            * @param {number}
53554            *            [start=0] The start position.
53555            * @param {number}
53556            *            [end=array.length] The end position.
53557            * @returns {Array} Returns the slice of `array`.
53558            */
53559           function baseSlice(array, start, end) {
53560             var index = -1,
53561               length = array.length;
53562
53563             start = start == null ? 0 : (+start || 0);
53564             if (start < 0) {
53565               start = -start > length ? 0 : (length + start);
53566             }
53567             end = (end === undefined || end > length) ? length : (+end || 0);
53568             if (end < 0) {
53569               end += length;
53570             }
53571             length = start > end ? 0 : ((end - start) >>> 0);
53572             start >>>= 0;
53573
53574             var result = Array(length);
53575             while (++index < length) {
53576               result[index] = array[index + start];
53577             }
53578             return result;
53579           }
53580
53581           /**
53582            * The base implementation of `_.some` without support for callback
53583            * shorthands and `this` binding.
53584            *
53585            * @private
53586            * @param {Array|Object|string}
53587            *            collection The collection to iterate over.
53588            * @param {Function}
53589            *            predicate The function invoked per iteration.
53590            * @returns {boolean} Returns `true` if any element passes the predicate
53591            *          check, else `false`.
53592            */
53593           function baseSome(collection, predicate) {
53594             var result;
53595
53596             baseEach(collection, function(value, index, collection) {
53597               result = predicate(value, index, collection);
53598               return !result;
53599             });
53600             return !!result;
53601           }
53602
53603           /**
53604            * The base implementation of `_.sortBy` which uses `comparer` to define the
53605            * sort order of `array` and replaces criteria objects with their
53606            * corresponding values.
53607            *
53608            * @private
53609            * @param {Array}
53610            *            array The array to sort.
53611            * @param {Function}
53612            *            comparer The function to define sort order.
53613            * @returns {Array} Returns `array`.
53614            */
53615           function baseSortBy(array, comparer) {
53616             var length = array.length;
53617
53618             array.sort(comparer);
53619             while (length--) {
53620               array[length] = array[length].value;
53621             }
53622             return array;
53623           }
53624
53625           /**
53626            * The base implementation of `_.sortByOrder` without param guards.
53627            *
53628            * @private
53629            * @param {Array|Object|string}
53630            *            collection The collection to iterate over.
53631            * @param {Function[]|Object[]|string[]}
53632            *            iteratees The iteratees to sort by.
53633            * @param {boolean[]}
53634            *            orders The sort orders of `iteratees`.
53635            * @returns {Array} Returns the new sorted array.
53636            */
53637           function baseSortByOrder(collection, iteratees, orders) {
53638             var callback = getCallback(),
53639               index = -1;
53640
53641             iteratees = arrayMap(iteratees, function(iteratee) {
53642               return callback(iteratee);
53643             });
53644
53645             var result = baseMap(collection, function(value) {
53646               var criteria = arrayMap(iteratees, function(iteratee) {
53647                 return iteratee(value);
53648               });
53649               return {
53650                 'criteria': criteria,
53651                 'index': ++index,
53652                 'value': value
53653               };
53654             });
53655
53656             return baseSortBy(result, function(object, other) {
53657               return compareMultiple(object, other, orders);
53658             });
53659           }
53660
53661           /**
53662            * The base implementation of `_.sum` without support for callback
53663            * shorthands and `this` binding.
53664            *
53665            * @private
53666            * @param {Array|Object|string}
53667            *            collection The collection to iterate over.
53668            * @param {Function}
53669            *            iteratee The function invoked per iteration.
53670            * @returns {number} Returns the sum.
53671            */
53672           function baseSum(collection, iteratee) {
53673             var result = 0;
53674             baseEach(collection, function(value, index, collection) {
53675               result += +iteratee(value, index, collection) || 0;
53676             });
53677             return result;
53678           }
53679
53680           /**
53681            * The base implementation of `_.uniq` without support for callback
53682            * shorthands and `this` binding.
53683            *
53684            * @private
53685            * @param {Array}
53686            *            array The array to inspect.
53687            * @param {Function}
53688            *            [iteratee] The function invoked per iteration.
53689            * @returns {Array} Returns the new duplicate-value-free array.
53690            */
53691           function baseUniq(array, iteratee) {
53692             var index = -1,
53693               indexOf = getIndexOf(),
53694               length = array.length,
53695               isCommon = indexOf == baseIndexOf,
53696               isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
53697               seen = isLarge ? createCache() : null,
53698               result = [];
53699
53700             if (seen) {
53701               indexOf = cacheIndexOf;
53702               isCommon = false;
53703             } else {
53704               isLarge = false;
53705               seen = iteratee ? [] : result;
53706             }
53707             outer:
53708               while (++index < length) {
53709                 var value = array[index],
53710                   computed = iteratee ? iteratee(value, index, array) : value;
53711
53712                 if (isCommon && value === value) {
53713                   var seenIndex = seen.length;
53714                   while (seenIndex--) {
53715                     if (seen[seenIndex] === computed) {
53716                       continue outer;
53717                     }
53718                   }
53719                   if (iteratee) {
53720                     seen.push(computed);
53721                   }
53722                   result.push(value);
53723                 } else if (indexOf(seen, computed, 0) < 0) {
53724                   if (iteratee || isLarge) {
53725                     seen.push(computed);
53726                   }
53727                   result.push(value);
53728                 }
53729               }
53730             return result;
53731           }
53732
53733           /**
53734            * The base implementation of `_.values` and `_.valuesIn` which creates an
53735            * array of `object` property values corresponding to the property names of
53736            * `props`.
53737            *
53738            * @private
53739            * @param {Object}
53740            *            object The object to query.
53741            * @param {Array}
53742            *            props The property names to get values for.
53743            * @returns {Object} Returns the array of property values.
53744            */
53745           function baseValues(object, props) {
53746             var index = -1,
53747               length = props.length,
53748               result = Array(length);
53749
53750             while (++index < length) {
53751               result[index] = object[props[index]];
53752             }
53753             return result;
53754           }
53755
53756           /**
53757            * The base implementation of `_.dropRightWhile`, `_.dropWhile`,
53758            * `_.takeRightWhile`, and `_.takeWhile` without support for callback
53759            * shorthands and `this` binding.
53760            *
53761            * @private
53762            * @param {Array}
53763            *            array The array to query.
53764            * @param {Function}
53765            *            predicate The function invoked per iteration.
53766            * @param {boolean}
53767            *            [isDrop] Specify dropping elements instead of taking them.
53768            * @param {boolean}
53769            *            [fromRight] Specify iterating from right to left.
53770            * @returns {Array} Returns the slice of `array`.
53771            */
53772           function baseWhile(array, predicate, isDrop, fromRight) {
53773             var length = array.length,
53774               index = fromRight ? length : -1;
53775
53776             while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
53777             return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
53778           }
53779
53780           /**
53781            * The base implementation of `wrapperValue` which returns the result of
53782            * performing a sequence of actions on the unwrapped `value`, where each
53783            * successive action is supplied the return value of the previous.
53784            *
53785            * @private
53786            * @param {*}
53787            *            value The unwrapped value.
53788            * @param {Array}
53789            *            actions Actions to peform to resolve the unwrapped value.
53790            * @returns {*} Returns the resolved value.
53791            */
53792           function baseWrapperValue(value, actions) {
53793             var result = value;
53794             if (result instanceof LazyWrapper) {
53795               result = result.value();
53796             }
53797             var index = -1,
53798               length = actions.length;
53799
53800             while (++index < length) {
53801               var action = actions[index];
53802               result = action.func.apply(action.thisArg, arrayPush([result], action.args));
53803             }
53804             return result;
53805           }
53806
53807           /**
53808            * Performs a binary search of `array` to determine the index at which
53809            * `value` should be inserted into `array` in order to maintain its sort
53810            * order.
53811            *
53812            * @private
53813            * @param {Array}
53814            *            array The sorted array to inspect.
53815            * @param {*}
53816            *            value The value to evaluate.
53817            * @param {boolean}
53818            *            [retHighest] Specify returning the highest qualified index.
53819            * @returns {number} Returns the index at which `value` should be inserted
53820            *          into `array`.
53821            */
53822           function binaryIndex(array, value, retHighest) {
53823             var low = 0,
53824               high = array ? array.length : low;
53825
53826             if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
53827               while (low < high) {
53828                 var mid = (low + high) >>> 1,
53829                   computed = array[mid];
53830
53831                 if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
53832                   low = mid + 1;
53833                 } else {
53834                   high = mid;
53835                 }
53836               }
53837               return high;
53838             }
53839             return binaryIndexBy(array, value, identity, retHighest);
53840           }
53841
53842           /**
53843            * This function is like `binaryIndex` except that it invokes `iteratee` for
53844            * `value` and each element of `array` to compute their sort ranking. The
53845            * iteratee is invoked with one argument; (value).
53846            *
53847            * @private
53848            * @param {Array}
53849            *            array The sorted array to inspect.
53850            * @param {*}
53851            *            value The value to evaluate.
53852            * @param {Function}
53853            *            iteratee The function invoked per iteration.
53854            * @param {boolean}
53855            *            [retHighest] Specify returning the highest qualified index.
53856            * @returns {number} Returns the index at which `value` should be inserted
53857            *          into `array`.
53858            */
53859           function binaryIndexBy(array, value, iteratee, retHighest) {
53860             value = iteratee(value);
53861
53862             var low = 0,
53863               high = array ? array.length : 0,
53864               valIsNaN = value !== value,
53865               valIsNull = value === null,
53866               valIsUndef = value === undefined;
53867
53868             while (low < high) {
53869               var mid = nativeFloor((low + high) / 2),
53870                 computed = iteratee(array[mid]),
53871                 isDef = computed !== undefined,
53872                 isReflexive = computed === computed;
53873
53874               if (valIsNaN) {
53875                 var setLow = isReflexive || retHighest;
53876               } else if (valIsNull) {
53877                 setLow = isReflexive && isDef && (retHighest || computed != null);
53878               } else if (valIsUndef) {
53879                 setLow = isReflexive && (retHighest || isDef);
53880               } else if (computed == null) {
53881                 setLow = false;
53882               } else {
53883                 setLow = retHighest ? (computed <= value) : (computed < value);
53884               }
53885               if (setLow) {
53886                 low = mid + 1;
53887               } else {
53888                 high = mid;
53889               }
53890             }
53891             return nativeMin(high, MAX_ARRAY_INDEX);
53892           }
53893
53894           /**
53895            * A specialized version of `baseCallback` which only supports `this`
53896            * binding and specifying the number of arguments to provide to `func`.
53897            *
53898            * @private
53899            * @param {Function}
53900            *            func The function to bind.
53901            * @param {*}
53902            *            thisArg The `this` binding of `func`.
53903            * @param {number}
53904            *            [argCount] The number of arguments to provide to `func`.
53905            * @returns {Function} Returns the callback.
53906            */
53907           function bindCallback(func, thisArg, argCount) {
53908             if (typeof func != 'function') {
53909               return identity;
53910             }
53911             if (thisArg === undefined) {
53912               return func;
53913             }
53914             switch (argCount) {
53915               case 1:
53916                 return function(value) {
53917                   return func.call(thisArg, value);
53918                 };
53919               case 3:
53920                 return function(value, index, collection) {
53921                   return func.call(thisArg, value, index, collection);
53922                 };
53923               case 4:
53924                 return function(accumulator, value, index, collection) {
53925                   return func.call(thisArg, accumulator, value, index, collection);
53926                 };
53927               case 5:
53928                 return function(value, other, key, object, source) {
53929                   return func.call(thisArg, value, other, key, object, source);
53930                 };
53931             }
53932             return function() {
53933               return func.apply(thisArg, arguments);
53934             };
53935           }
53936
53937           /**
53938            * Creates a clone of the given array buffer.
53939            *
53940            * @private
53941            * @param {ArrayBuffer}
53942            *            buffer The array buffer to clone.
53943            * @returns {ArrayBuffer} Returns the cloned array buffer.
53944            */
53945           function bufferClone(buffer) {
53946             var result = new ArrayBuffer(buffer.byteLength),
53947               view = new Uint8Array(result);
53948
53949             view.set(new Uint8Array(buffer));
53950             return result;
53951           }
53952
53953           /**
53954            * Creates an array that is the composition of partially applied arguments,
53955            * placeholders, and provided arguments into a single array of arguments.
53956            *
53957            * @private
53958            * @param {Array|Object}
53959            *            args The provided arguments.
53960            * @param {Array}
53961            *            partials The arguments to prepend to those provided.
53962            * @param {Array}
53963            *            holders The `partials` placeholder indexes.
53964            * @returns {Array} Returns the new array of composed arguments.
53965            */
53966           function composeArgs(args, partials, holders) {
53967             var holdersLength = holders.length,
53968               argsIndex = -1,
53969               argsLength = nativeMax(args.length - holdersLength, 0),
53970               leftIndex = -1,
53971               leftLength = partials.length,
53972               result = Array(leftLength + argsLength);
53973
53974             while (++leftIndex < leftLength) {
53975               result[leftIndex] = partials[leftIndex];
53976             }
53977             while (++argsIndex < holdersLength) {
53978               result[holders[argsIndex]] = args[argsIndex];
53979             }
53980             while (argsLength--) {
53981               result[leftIndex++] = args[argsIndex++];
53982             }
53983             return result;
53984           }
53985
53986           /**
53987            * This function is like `composeArgs` except that the arguments composition
53988            * is tailored for `_.partialRight`.
53989            *
53990            * @private
53991            * @param {Array|Object}
53992            *            args The provided arguments.
53993            * @param {Array}
53994            *            partials The arguments to append to those provided.
53995            * @param {Array}
53996            *            holders The `partials` placeholder indexes.
53997            * @returns {Array} Returns the new array of composed arguments.
53998            */
53999           function composeArgsRight(args, partials, holders) {
54000             var holdersIndex = -1,
54001               holdersLength = holders.length,
54002               argsIndex = -1,
54003               argsLength = nativeMax(args.length - holdersLength, 0),
54004               rightIndex = -1,
54005               rightLength = partials.length,
54006               result = Array(argsLength + rightLength);
54007
54008             while (++argsIndex < argsLength) {
54009               result[argsIndex] = args[argsIndex];
54010             }
54011             var offset = argsIndex;
54012             while (++rightIndex < rightLength) {
54013               result[offset + rightIndex] = partials[rightIndex];
54014             }
54015             while (++holdersIndex < holdersLength) {
54016               result[offset + holders[holdersIndex]] = args[argsIndex++];
54017             }
54018             return result;
54019           }
54020
54021           /**
54022            * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition`
54023            * function.
54024            *
54025            * @private
54026            * @param {Function}
54027            *            setter The function to set keys and values of the accumulator
54028            *            object.
54029            * @param {Function}
54030            *            [initializer] The function to initialize the accumulator
54031            *            object.
54032            * @returns {Function} Returns the new aggregator function.
54033            */
54034           function createAggregator(setter, initializer) {
54035             return function(collection, iteratee, thisArg) {
54036               var result = initializer ? initializer() : {};
54037               iteratee = getCallback(iteratee, thisArg, 3);
54038
54039               if (isArray(collection)) {
54040                 var index = -1,
54041                   length = collection.length;
54042
54043                 while (++index < length) {
54044                   var value = collection[index];
54045                   setter(result, value, iteratee(value, index, collection), collection);
54046                 }
54047               } else {
54048                 baseEach(collection, function(value, key, collection) {
54049                   setter(result, value, iteratee(value, key, collection), collection);
54050                 });
54051               }
54052               return result;
54053             };
54054           }
54055
54056           /**
54057            * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
54058            *
54059            * @private
54060            * @param {Function}
54061            *            assigner The function to assign values.
54062            * @returns {Function} Returns the new assigner function.
54063            */
54064           function createAssigner(assigner) {
54065             return restParam(function(object, sources) {
54066               var index = -1,
54067                 length = object == null ? 0 : sources.length,
54068                 customizer = length > 2 ? sources[length - 2] : undefined,
54069                 guard = length > 2 ? sources[2] : undefined,
54070                 thisArg = length > 1 ? sources[length - 1] : undefined;
54071
54072               if (typeof customizer == 'function') {
54073                 customizer = bindCallback(customizer, thisArg, 5);
54074                 length -= 2;
54075               } else {
54076                 customizer = typeof thisArg == 'function' ? thisArg : undefined;
54077                 length -= (customizer ? 1 : 0);
54078               }
54079               if (guard && isIterateeCall(sources[0], sources[1], guard)) {
54080                 customizer = length < 3 ? undefined : customizer;
54081                 length = 1;
54082               }
54083               while (++index < length) {
54084                 var source = sources[index];
54085                 if (source) {
54086                   assigner(object, source, customizer);
54087                 }
54088               }
54089               return object;
54090             });
54091           }
54092
54093           /**
54094            * Creates a `baseEach` or `baseEachRight` function.
54095            *
54096            * @private
54097            * @param {Function}
54098            *            eachFunc The function to iterate over a collection.
54099            * @param {boolean}
54100            *            [fromRight] Specify iterating from right to left.
54101            * @returns {Function} Returns the new base function.
54102            */
54103           function createBaseEach(eachFunc, fromRight) {
54104             return function(collection, iteratee) {
54105               var length = collection ? getLength(collection) : 0;
54106               if (!isLength(length)) {
54107                 return eachFunc(collection, iteratee);
54108               }
54109               var index = fromRight ? length : -1,
54110                 iterable = toObject(collection);
54111
54112               while ((fromRight ? index-- : ++index < length)) {
54113                 if (iteratee(iterable[index], index, iterable) === false) {
54114                   break;
54115                 }
54116               }
54117               return collection;
54118             };
54119           }
54120
54121           /**
54122            * Creates a base function for `_.forIn` or `_.forInRight`.
54123            *
54124            * @private
54125            * @param {boolean}
54126            *            [fromRight] Specify iterating from right to left.
54127            * @returns {Function} Returns the new base function.
54128            */
54129           function createBaseFor(fromRight) {
54130             return function(object, iteratee, keysFunc) {
54131               var iterable = toObject(object),
54132                 props = keysFunc(object),
54133                 length = props.length,
54134                 index = fromRight ? length : -1;
54135
54136               while ((fromRight ? index-- : ++index < length)) {
54137                 var key = props[index];
54138                 if (iteratee(iterable[key], key, iterable) === false) {
54139                   break;
54140                 }
54141               }
54142               return object;
54143             };
54144           }
54145
54146           /**
54147            * Creates a function that wraps `func` and invokes it with the `this`
54148            * binding of `thisArg`.
54149            *
54150            * @private
54151            * @param {Function}
54152            *            func The function to bind.
54153            * @param {*}
54154            *            [thisArg] The `this` binding of `func`.
54155            * @returns {Function} Returns the new bound function.
54156            */
54157           function createBindWrapper(func, thisArg) {
54158             var Ctor = createCtorWrapper(func);
54159
54160             function wrapper() {
54161               var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
54162               return fn.apply(thisArg, arguments);
54163             }
54164             return wrapper;
54165           }
54166
54167           /**
54168            * Creates a `Set` cache object to optimize linear searches of large arrays.
54169            *
54170            * @private
54171            * @param {Array}
54172            *            [values] The values to cache.
54173            * @returns {null|Object} Returns the new cache object if `Set` is
54174            *          supported, else `null`.
54175            */
54176           function createCache(values) {
54177             return (nativeCreate && Set) ? new SetCache(values) : null;
54178           }
54179
54180           /**
54181            * Creates a function that produces compound words out of the words in a
54182            * given string.
54183            *
54184            * @private
54185            * @param {Function}
54186            *            callback The function to combine each word.
54187            * @returns {Function} Returns the new compounder function.
54188            */
54189           function createCompounder(callback) {
54190             return function(string) {
54191               var index = -1,
54192                 array = words(deburr(string)),
54193                 length = array.length,
54194                 result = '';
54195
54196               while (++index < length) {
54197                 result = callback(result, array[index], index);
54198               }
54199               return result;
54200             };
54201           }
54202
54203           /**
54204            * Creates a function that produces an instance of `Ctor` regardless of
54205            * whether it was invoked as part of a `new` expression or by `call` or
54206            * `apply`.
54207            *
54208            * @private
54209            * @param {Function}
54210            *            Ctor The constructor to wrap.
54211            * @returns {Function} Returns the new wrapped function.
54212            */
54213           function createCtorWrapper(Ctor) {
54214             return function() {
54215               // Use a `switch` statement to work with class constructors.
54216               // See
54217               // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
54218               // for more details.
54219               var args = arguments;
54220               switch (args.length) {
54221                 case 0:
54222                   return new Ctor;
54223                 case 1:
54224                   return new Ctor(args[0]);
54225                 case 2:
54226                   return new Ctor(args[0], args[1]);
54227                 case 3:
54228                   return new Ctor(args[0], args[1], args[2]);
54229                 case 4:
54230                   return new Ctor(args[0], args[1], args[2], args[3]);
54231                 case 5:
54232                   return new Ctor(args[0], args[1], args[2], args[3], args[4]);
54233                 case 6:
54234                   return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
54235                 case 7:
54236                   return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
54237               }
54238               var thisBinding = baseCreate(Ctor.prototype),
54239                 result = Ctor.apply(thisBinding, args);
54240
54241               // Mimic the constructor's `return` behavior.
54242               // See https://es5.github.io/#x13.2.2 for more details.
54243               return isObject(result) ? result : thisBinding;
54244             };
54245           }
54246
54247           /**
54248            * Creates a `_.curry` or `_.curryRight` function.
54249            *
54250            * @private
54251            * @param {boolean}
54252            *            flag The curry bit flag.
54253            * @returns {Function} Returns the new curry function.
54254            */
54255           function createCurry(flag) {
54256             function curryFunc(func, arity, guard) {
54257               if (guard && isIterateeCall(func, arity, guard)) {
54258                 arity = undefined;
54259               }
54260               var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
54261               result.placeholder = curryFunc.placeholder;
54262               return result;
54263             }
54264             return curryFunc;
54265           }
54266
54267           /**
54268            * Creates a `_.defaults` or `_.defaultsDeep` function.
54269            *
54270            * @private
54271            * @param {Function}
54272            *            assigner The function to assign values.
54273            * @param {Function}
54274            *            customizer The function to customize assigned values.
54275            * @returns {Function} Returns the new defaults function.
54276            */
54277           function createDefaults(assigner, customizer) {
54278             return restParam(function(args) {
54279               var object = args[0];
54280               if (object == null) {
54281                 return object;
54282               }
54283               args.push(customizer);
54284               return assigner.apply(undefined, args);
54285             });
54286           }
54287
54288           /**
54289            * Creates a `_.max` or `_.min` function.
54290            *
54291            * @private
54292            * @param {Function}
54293            *            comparator The function used to compare values.
54294            * @param {*}
54295            *            exValue The initial extremum value.
54296            * @returns {Function} Returns the new extremum function.
54297            */
54298           function createExtremum(comparator, exValue) {
54299             return function(collection, iteratee, thisArg) {
54300               if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
54301                 iteratee = undefined;
54302               }
54303               iteratee = getCallback(iteratee, thisArg, 3);
54304               if (iteratee.length == 1) {
54305                 collection = isArray(collection) ? collection : toIterable(collection);
54306                 var result = arrayExtremum(collection, iteratee, comparator, exValue);
54307                 if (!(collection.length && result === exValue)) {
54308                   return result;
54309                 }
54310               }
54311               return baseExtremum(collection, iteratee, comparator, exValue);
54312             };
54313           }
54314
54315           /**
54316            * Creates a `_.find` or `_.findLast` function.
54317            *
54318            * @private
54319            * @param {Function}
54320            *            eachFunc The function to iterate over a collection.
54321            * @param {boolean}
54322            *            [fromRight] Specify iterating from right to left.
54323            * @returns {Function} Returns the new find function.
54324            */
54325           function createFind(eachFunc, fromRight) {
54326             return function(collection, predicate, thisArg) {
54327               predicate = getCallback(predicate, thisArg, 3);
54328               if (isArray(collection)) {
54329                 var index = baseFindIndex(collection, predicate, fromRight);
54330                 return index > -1 ? collection[index] : undefined;
54331               }
54332               return baseFind(collection, predicate, eachFunc);
54333             };
54334           }
54335
54336           /**
54337            * Creates a `_.findIndex` or `_.findLastIndex` function.
54338            *
54339            * @private
54340            * @param {boolean}
54341            *            [fromRight] Specify iterating from right to left.
54342            * @returns {Function} Returns the new find function.
54343            */
54344           function createFindIndex(fromRight) {
54345             return function(array, predicate, thisArg) {
54346               if (!(array && array.length)) {
54347                 return -1;
54348               }
54349               predicate = getCallback(predicate, thisArg, 3);
54350               return baseFindIndex(array, predicate, fromRight);
54351             };
54352           }
54353
54354           /**
54355            * Creates a `_.findKey` or `_.findLastKey` function.
54356            *
54357            * @private
54358            * @param {Function}
54359            *            objectFunc The function to iterate over an object.
54360            * @returns {Function} Returns the new find function.
54361            */
54362           function createFindKey(objectFunc) {
54363             return function(object, predicate, thisArg) {
54364               predicate = getCallback(predicate, thisArg, 3);
54365               return baseFind(object, predicate, objectFunc, true);
54366             };
54367           }
54368
54369           /**
54370            * Creates a `_.flow` or `_.flowRight` function.
54371            *
54372            * @private
54373            * @param {boolean}
54374            *            [fromRight] Specify iterating from right to left.
54375            * @returns {Function} Returns the new flow function.
54376            */
54377           function createFlow(fromRight) {
54378             return function() {
54379               var wrapper,
54380                 length = arguments.length,
54381                 index = fromRight ? length : -1,
54382                 leftIndex = 0,
54383                 funcs = Array(length);
54384
54385               while ((fromRight ? index-- : ++index < length)) {
54386                 var func = funcs[leftIndex++] = arguments[index];
54387                 if (typeof func != 'function') {
54388                   throw new TypeError(FUNC_ERROR_TEXT);
54389                 }
54390                 if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
54391                   wrapper = new LodashWrapper([], true);
54392                 }
54393               }
54394               index = wrapper ? -1 : length;
54395               while (++index < length) {
54396                 func = funcs[index];
54397
54398                 var funcName = getFuncName(func),
54399                   data = funcName == 'wrapper' ? getData(func) : undefined;
54400
54401                 if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
54402                   wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
54403                 } else {
54404                   wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
54405                 }
54406               }
54407               return function() {
54408                 var args = arguments,
54409                   value = args[0];
54410
54411                 if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
54412                   return wrapper.plant(value).value();
54413                 }
54414                 var index = 0,
54415                   result = length ? funcs[index].apply(this, args) : value;
54416
54417                 while (++index < length) {
54418                   result = funcs[index].call(this, result);
54419                 }
54420                 return result;
54421               };
54422             };
54423           }
54424
54425           /**
54426            * Creates a function for `_.forEach` or `_.forEachRight`.
54427            *
54428            * @private
54429            * @param {Function}
54430            *            arrayFunc The function to iterate over an array.
54431            * @param {Function}
54432            *            eachFunc The function to iterate over a collection.
54433            * @returns {Function} Returns the new each function.
54434            */
54435           function createForEach(arrayFunc, eachFunc) {
54436             return function(collection, iteratee, thisArg) {
54437               return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
54438             };
54439           }
54440
54441           /**
54442            * Creates a function for `_.forIn` or `_.forInRight`.
54443            *
54444            * @private
54445            * @param {Function}
54446            *            objectFunc The function to iterate over an object.
54447            * @returns {Function} Returns the new each function.
54448            */
54449           function createForIn(objectFunc) {
54450             return function(object, iteratee, thisArg) {
54451               if (typeof iteratee != 'function' || thisArg !== undefined) {
54452                 iteratee = bindCallback(iteratee, thisArg, 3);
54453               }
54454               return objectFunc(object, iteratee, keysIn);
54455             };
54456           }
54457
54458           /**
54459            * Creates a function for `_.forOwn` or `_.forOwnRight`.
54460            *
54461            * @private
54462            * @param {Function}
54463            *            objectFunc The function to iterate over an object.
54464            * @returns {Function} Returns the new each function.
54465            */
54466           function createForOwn(objectFunc) {
54467             return function(object, iteratee, thisArg) {
54468               if (typeof iteratee != 'function' || thisArg !== undefined) {
54469                 iteratee = bindCallback(iteratee, thisArg, 3);
54470               }
54471               return objectFunc(object, iteratee);
54472             };
54473           }
54474
54475           /**
54476            * Creates a function for `_.mapKeys` or `_.mapValues`.
54477            *
54478            * @private
54479            * @param {boolean}
54480            *            [isMapKeys] Specify mapping keys instead of values.
54481            * @returns {Function} Returns the new map function.
54482            */
54483           function createObjectMapper(isMapKeys) {
54484             return function(object, iteratee, thisArg) {
54485               var result = {};
54486               iteratee = getCallback(iteratee, thisArg, 3);
54487
54488               baseForOwn(object, function(value, key, object) {
54489                 var mapped = iteratee(value, key, object);
54490                 key = isMapKeys ? mapped : key;
54491                 value = isMapKeys ? value : mapped;
54492                 result[key] = value;
54493               });
54494               return result;
54495             };
54496           }
54497
54498           /**
54499            * Creates a function for `_.padLeft` or `_.padRight`.
54500            *
54501            * @private
54502            * @param {boolean}
54503            *            [fromRight] Specify padding from the right.
54504            * @returns {Function} Returns the new pad function.
54505            */
54506           function createPadDir(fromRight) {
54507             return function(string, length, chars) {
54508               string = baseToString(string);
54509               return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
54510             };
54511           }
54512
54513           /**
54514            * Creates a `_.partial` or `_.partialRight` function.
54515            *
54516            * @private
54517            * @param {boolean}
54518            *            flag The partial bit flag.
54519            * @returns {Function} Returns the new partial function.
54520            */
54521           function createPartial(flag) {
54522             var partialFunc = restParam(function(func, partials) {
54523               var holders = replaceHolders(partials, partialFunc.placeholder);
54524               return createWrapper(func, flag, undefined, partials, holders);
54525             });
54526             return partialFunc;
54527           }
54528
54529           /**
54530            * Creates a function for `_.reduce` or `_.reduceRight`.
54531            *
54532            * @private
54533            * @param {Function}
54534            *            arrayFunc The function to iterate over an array.
54535            * @param {Function}
54536            *            eachFunc The function to iterate over a collection.
54537            * @returns {Function} Returns the new each function.
54538            */
54539           function createReduce(arrayFunc, eachFunc) {
54540             return function(collection, iteratee, accumulator, thisArg) {
54541               var initFromArray = arguments.length < 3;
54542               return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
54543             };
54544           }
54545
54546           /**
54547            * Creates a function that wraps `func` and invokes it with optional `this`
54548            * binding of, partial application, and currying.
54549            *
54550            * @private
54551            * @param {Function|string}
54552            *            func The function or method name to reference.
54553            * @param {number}
54554            *            bitmask The bitmask of flags. See `createWrapper` for more
54555            *            details.
54556            * @param {*}
54557            *            [thisArg] The `this` binding of `func`.
54558            * @param {Array}
54559            *            [partials] The arguments to prepend to those provided to the
54560            *            new function.
54561            * @param {Array}
54562            *            [holders] The `partials` placeholder indexes.
54563            * @param {Array}
54564            *            [partialsRight] The arguments to append to those provided to
54565            *            the new function.
54566            * @param {Array}
54567            *            [holdersRight] The `partialsRight` placeholder indexes.
54568            * @param {Array}
54569            *            [argPos] The argument positions of the new function.
54570            * @param {number}
54571            *            [ary] The arity cap of `func`.
54572            * @param {number}
54573            *            [arity] The arity of `func`.
54574            * @returns {Function} Returns the new wrapped function.
54575            */
54576           function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
54577             var isAry = bitmask & ARY_FLAG,
54578               isBind = bitmask & BIND_FLAG,
54579               isBindKey = bitmask & BIND_KEY_FLAG,
54580               isCurry = bitmask & CURRY_FLAG,
54581               isCurryBound = bitmask & CURRY_BOUND_FLAG,
54582               isCurryRight = bitmask & CURRY_RIGHT_FLAG,
54583               Ctor = isBindKey ? undefined : createCtorWrapper(func);
54584
54585             function wrapper() {
54586               // Avoid `arguments` object use disqualifying optimizations by
54587               // converting it to an array before providing it to other functions.
54588               var length = arguments.length,
54589                 index = length,
54590                 args = Array(length);
54591
54592               while (index--) {
54593                 args[index] = arguments[index];
54594               }
54595               if (partials) {
54596                 args = composeArgs(args, partials, holders);
54597               }
54598               if (partialsRight) {
54599                 args = composeArgsRight(args, partialsRight, holdersRight);
54600               }
54601               if (isCurry || isCurryRight) {
54602                 var placeholder = wrapper.placeholder,
54603                   argsHolders = replaceHolders(args, placeholder);
54604
54605                 length -= argsHolders.length;
54606                 if (length < arity) {
54607                   var newArgPos = argPos ? arrayCopy(argPos) : undefined,
54608                     newArity = nativeMax(arity - length, 0),
54609                     newsHolders = isCurry ? argsHolders : undefined,
54610                     newHoldersRight = isCurry ? undefined : argsHolders,
54611                     newPartials = isCurry ? args : undefined,
54612                     newPartialsRight = isCurry ? undefined : args;
54613
54614                   bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
54615                   bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
54616
54617                   if (!isCurryBound) {
54618                     bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
54619                   }
54620                   var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
54621                     result = createHybridWrapper.apply(undefined, newData);
54622
54623                   if (isLaziable(func)) {
54624                     setData(result, newData);
54625                   }
54626                   result.placeholder = placeholder;
54627                   return result;
54628                 }
54629               }
54630               var thisBinding = isBind ? thisArg : this,
54631                 fn = isBindKey ? thisBinding[func] : func;
54632
54633               if (argPos) {
54634                 args = reorder(args, argPos);
54635               }
54636               if (isAry && ary < args.length) {
54637                 args.length = ary;
54638               }
54639               if (this && this !== root && this instanceof wrapper) {
54640                 fn = Ctor || createCtorWrapper(func);
54641               }
54642               return fn.apply(thisBinding, args);
54643             }
54644             return wrapper;
54645           }
54646
54647           /**
54648            * Creates the padding required for `string` based on the given `length`.
54649            * The `chars` string is truncated if the number of characters exceeds
54650            * `length`.
54651            *
54652            * @private
54653            * @param {string}
54654            *            string The string to create padding for.
54655            * @param {number}
54656            *            [length=0] The padding length.
54657            * @param {string}
54658            *            [chars=' '] The string used as padding.
54659            * @returns {string} Returns the pad for `string`.
54660            */
54661           function createPadding(string, length, chars) {
54662             var strLength = string.length;
54663             length = +length;
54664
54665             if (strLength >= length || !nativeIsFinite(length)) {
54666               return '';
54667             }
54668             var padLength = length - strLength;
54669             chars = chars == null ? ' ' : (chars + '');
54670             return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
54671           }
54672
54673           /**
54674            * Creates a function that wraps `func` and invokes it with the optional
54675            * `this` binding of `thisArg` and the `partials` prepended to those
54676            * provided to the wrapper.
54677            *
54678            * @private
54679            * @param {Function}
54680            *            func The function to partially apply arguments to.
54681            * @param {number}
54682            *            bitmask The bitmask of flags. See `createWrapper` for more
54683            *            details.
54684            * @param {*}
54685            *            thisArg The `this` binding of `func`.
54686            * @param {Array}
54687            *            partials The arguments to prepend to those provided to the new
54688            *            function.
54689            * @returns {Function} Returns the new bound function.
54690            */
54691           function createPartialWrapper(func, bitmask, thisArg, partials) {
54692             var isBind = bitmask & BIND_FLAG,
54693               Ctor = createCtorWrapper(func);
54694
54695             function wrapper() {
54696               // Avoid `arguments` object use disqualifying optimizations by
54697               // converting it to an array before providing it `func`.
54698               var argsIndex = -1,
54699                 argsLength = arguments.length,
54700                 leftIndex = -1,
54701                 leftLength = partials.length,
54702                 args = Array(leftLength + argsLength);
54703
54704               while (++leftIndex < leftLength) {
54705                 args[leftIndex] = partials[leftIndex];
54706               }
54707               while (argsLength--) {
54708                 args[leftIndex++] = arguments[++argsIndex];
54709               }
54710               var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
54711               return fn.apply(isBind ? thisArg : this, args);
54712             }
54713             return wrapper;
54714           }
54715
54716           /**
54717            * Creates a `_.ceil`, `_.floor`, or `_.round` function.
54718            *
54719            * @private
54720            * @param {string}
54721            *            methodName The name of the `Math` method to use when rounding.
54722            * @returns {Function} Returns the new round function.
54723            */
54724           function createRound(methodName) {
54725             var func = Math[methodName];
54726             return function(number, precision) {
54727               precision = precision === undefined ? 0 : (+precision || 0);
54728               if (precision) {
54729                 precision = pow(10, precision);
54730                 return func(number * precision) / precision;
54731               }
54732               return func(number);
54733             };
54734           }
54735
54736           /**
54737            * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
54738            *
54739            * @private
54740            * @param {boolean}
54741            *            [retHighest] Specify returning the highest qualified index.
54742            * @returns {Function} Returns the new index function.
54743            */
54744           function createSortedIndex(retHighest) {
54745             return function(array, value, iteratee, thisArg) {
54746               var callback = getCallback(iteratee);
54747               return (iteratee == null && callback === baseCallback) ? binaryIndex(array, value, retHighest) : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
54748             };
54749           }
54750
54751           /**
54752            * Creates a function that either curries or invokes `func` with optional
54753            * `this` binding and partially applied arguments.
54754            *
54755            * @private
54756            * @param {Function|string}
54757            *            func The function or method name to reference.
54758            * @param {number}
54759            *            bitmask The bitmask of flags. The bitmask may be composed of
54760            *            the following flags: 1 - `_.bind` 2 - `_.bindKey` 4 -
54761            *            `_.curry` or `_.curryRight` of a bound function 8 - `_.curry`
54762            *            16 - `_.curryRight` 32 - `_.partial` 64 - `_.partialRight` 128 -
54763            *            `_.rearg` 256 - `_.ary`
54764            * @param {*}
54765            *            [thisArg] The `this` binding of `func`.
54766            * @param {Array}
54767            *            [partials] The arguments to be partially applied.
54768            * @param {Array}
54769            *            [holders] The `partials` placeholder indexes.
54770            * @param {Array}
54771            *            [argPos] The argument positions of the new function.
54772            * @param {number}
54773            *            [ary] The arity cap of `func`.
54774            * @param {number}
54775            *            [arity] The arity of `func`.
54776            * @returns {Function} Returns the new wrapped function.
54777            */
54778           function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
54779             var isBindKey = bitmask & BIND_KEY_FLAG;
54780             if (!isBindKey && typeof func != 'function') {
54781               throw new TypeError(FUNC_ERROR_TEXT);
54782             }
54783             var length = partials ? partials.length : 0;
54784             if (!length) {
54785               bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
54786               partials = holders = undefined;
54787             }
54788             length -= (holders ? holders.length : 0);
54789             if (bitmask & PARTIAL_RIGHT_FLAG) {
54790               var partialsRight = partials,
54791                 holdersRight = holders;
54792
54793               partials = holders = undefined;
54794             }
54795             var data = isBindKey ? undefined : getData(func),
54796               newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
54797
54798             if (data) {
54799               mergeData(newData, data);
54800               bitmask = newData[1];
54801               arity = newData[9];
54802             }
54803             newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0);
54804
54805             if (bitmask == BIND_FLAG) {
54806               var result = createBindWrapper(newData[0], newData[2]);
54807             } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
54808               result = createPartialWrapper.apply(undefined, newData);
54809             } else {
54810               result = createHybridWrapper.apply(undefined, newData);
54811             }
54812             var setter = data ? baseSetData : setData;
54813             return setter(result, newData);
54814           }
54815
54816           /**
54817            * A specialized version of `baseIsEqualDeep` for arrays with support for
54818            * partial deep comparisons.
54819            *
54820            * @private
54821            * @param {Array}
54822            *            array The array to compare.
54823            * @param {Array}
54824            *            other The other array to compare.
54825            * @param {Function}
54826            *            equalFunc The function to determine equivalents of values.
54827            * @param {Function}
54828            *            [customizer] The function to customize comparing arrays.
54829            * @param {boolean}
54830            *            [isLoose] Specify performing partial comparisons.
54831            * @param {Array}
54832            *            [stackA] Tracks traversed `value` objects.
54833            * @param {Array}
54834            *            [stackB] Tracks traversed `other` objects.
54835            * @returns {boolean} Returns `true` if the arrays are equivalent, else
54836            *          `false`.
54837            */
54838           function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
54839             var index = -1,
54840               arrLength = array.length,
54841               othLength = other.length;
54842
54843             if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
54844               return false;
54845             }
54846             // Ignore non-index properties.
54847             while (++index < arrLength) {
54848               var arrValue = array[index],
54849                 othValue = other[index],
54850                 result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
54851
54852               if (result !== undefined) {
54853                 if (result) {
54854                   continue;
54855                 }
54856                 return false;
54857               }
54858               // Recursively compare arrays (susceptible to call stack limits).
54859               if (isLoose) {
54860                 if (!arraySome(other, function(othValue) {
54861                     return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
54862                   })) {
54863                   return false;
54864                 }
54865               } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
54866                 return false;
54867               }
54868             }
54869             return true;
54870           }
54871
54872           /**
54873            * A specialized version of `baseIsEqualDeep` for comparing objects of the
54874            * same `toStringTag`.
54875            *
54876            * **Note:** This function only supports comparing values with tags of
54877            * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
54878            *
54879            * @private
54880            * @param {Object}
54881            *            object The object to compare.
54882            * @param {Object}
54883            *            other The other object to compare.
54884            * @param {string}
54885            *            tag The `toStringTag` of the objects to compare.
54886            * @returns {boolean} Returns `true` if the objects are equivalent, else
54887            *          `false`.
54888            */
54889           function equalByTag(object, other, tag) {
54890             switch (tag) {
54891               case boolTag:
54892               case dateTag:
54893                 // Coerce dates and booleans to numbers, dates to milliseconds and
54894                 // booleans
54895                 // to `1` or `0` treating invalid dates coerced to `NaN` as not
54896                 // equal.
54897                 return +object == +other;
54898
54899               case errorTag:
54900                 return object.name == other.name && object.message == other.message;
54901
54902               case numberTag:
54903                 // Treat `NaN` vs. `NaN` as equal.
54904                 return (object != +object) ? other != +other : object == +other;
54905
54906               case regexpTag:
54907               case stringTag:
54908                 // Coerce regexes to strings and treat strings primitives and string
54909                 // objects as equal. See https://es5.github.io/#x15.10.6.4 for more
54910                 // details.
54911                 return object == (other + '');
54912             }
54913             return false;
54914           }
54915
54916           /**
54917            * A specialized version of `baseIsEqualDeep` for objects with support for
54918            * partial deep comparisons.
54919            *
54920            * @private
54921            * @param {Object}
54922            *            object The object to compare.
54923            * @param {Object}
54924            *            other The other object to compare.
54925            * @param {Function}
54926            *            equalFunc The function to determine equivalents of values.
54927            * @param {Function}
54928            *            [customizer] The function to customize comparing values.
54929            * @param {boolean}
54930            *            [isLoose] Specify performing partial comparisons.
54931            * @param {Array}
54932            *            [stackA] Tracks traversed `value` objects.
54933            * @param {Array}
54934            *            [stackB] Tracks traversed `other` objects.
54935            * @returns {boolean} Returns `true` if the objects are equivalent, else
54936            *          `false`.
54937            */
54938           function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
54939             var objProps = keys(object),
54940               objLength = objProps.length,
54941               othProps = keys(other),
54942               othLength = othProps.length;
54943
54944             if (objLength != othLength && !isLoose) {
54945               return false;
54946             }
54947             var index = objLength;
54948             while (index--) {
54949               var key = objProps[index];
54950               if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
54951                 return false;
54952               }
54953             }
54954             var skipCtor = isLoose;
54955             while (++index < objLength) {
54956               key = objProps[index];
54957               var objValue = object[key],
54958                 othValue = other[key],
54959                 result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
54960
54961               // Recursively compare objects (susceptible to call stack limits).
54962               if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
54963                 return false;
54964               }
54965               skipCtor || (skipCtor = key == 'constructor');
54966             }
54967             if (!skipCtor) {
54968               var objCtor = object.constructor,
54969                 othCtor = other.constructor;
54970
54971               // Non `Object` object instances with different constructors are not
54972               // equal.
54973               if (objCtor != othCtor &&
54974                 ('constructor' in object && 'constructor' in other) &&
54975                 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
54976                   typeof othCtor == 'function' && othCtor instanceof othCtor)) {
54977                 return false;
54978               }
54979             }
54980             return true;
54981           }
54982
54983           /**
54984            * Gets the appropriate "callback" function. If the `_.callback` method is
54985            * customized this function returns the custom method, otherwise it returns
54986            * the `baseCallback` function. If arguments are provided the chosen
54987            * function is invoked with them and its result is returned.
54988            *
54989            * @private
54990            * @returns {Function} Returns the chosen function or its result.
54991            */
54992           function getCallback(func, thisArg, argCount) {
54993             var result = lodash.callback || callback;
54994             result = result === callback ? baseCallback : result;
54995             return argCount ? result(func, thisArg, argCount) : result;
54996           }
54997
54998           /**
54999            * Gets metadata for `func`.
55000            *
55001            * @private
55002            * @param {Function}
55003            *            func The function to query.
55004            * @returns {*} Returns the metadata for `func`.
55005            */
55006           var getData = !metaMap ? noop : function(func) {
55007             return metaMap.get(func);
55008           };
55009
55010           /**
55011            * Gets the name of `func`.
55012            *
55013            * @private
55014            * @param {Function}
55015            *            func The function to query.
55016            * @returns {string} Returns the function name.
55017            */
55018           function getFuncName(func) {
55019             var result = func.name,
55020               array = realNames[result],
55021               length = array ? array.length : 0;
55022
55023             while (length--) {
55024               var data = array[length],
55025                 otherFunc = data.func;
55026               if (otherFunc == null || otherFunc == func) {
55027                 return data.name;
55028               }
55029             }
55030             return result;
55031           }
55032
55033           /**
55034            * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
55035            * customized this function returns the custom method, otherwise it returns
55036            * the `baseIndexOf` function. If arguments are provided the chosen function
55037            * is invoked with them and its result is returned.
55038            *
55039            * @private
55040            * @returns {Function|number} Returns the chosen function or its result.
55041            */
55042           function getIndexOf(collection, target, fromIndex) {
55043             var result = lodash.indexOf || indexOf;
55044             result = result === indexOf ? baseIndexOf : result;
55045             return collection ? result(collection, target, fromIndex) : result;
55046           }
55047
55048           /**
55049            * Gets the "length" property value of `object`.
55050            *
55051            * **Note:** This function is used to avoid a [JIT
55052            * bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects Safari
55053            * on at least iOS 8.1-8.3 ARM64.
55054            *
55055            * @private
55056            * @param {Object}
55057            *            object The object to query.
55058            * @returns {*} Returns the "length" value.
55059            */
55060           var getLength = baseProperty('length');
55061
55062           /**
55063            * Gets the propery names, values, and compare flags of `object`.
55064            *
55065            * @private
55066            * @param {Object}
55067            *            object The object to query.
55068            * @returns {Array} Returns the match data of `object`.
55069            */
55070           function getMatchData(object) {
55071             var result = pairs(object),
55072               length = result.length;
55073
55074             while (length--) {
55075               result[length][2] = isStrictComparable(result[length][1]);
55076             }
55077             return result;
55078           }
55079
55080           /**
55081            * Gets the native function at `key` of `object`.
55082            *
55083            * @private
55084            * @param {Object}
55085            *            object The object to query.
55086            * @param {string}
55087            *            key The key of the method to get.
55088            * @returns {*} Returns the function if it's native, else `undefined`.
55089            */
55090           function getNative(object, key) {
55091             var value = object == null ? undefined : object[key];
55092             return isNative(value) ? value : undefined;
55093           }
55094
55095           /**
55096            * Gets the view, applying any `transforms` to the `start` and `end`
55097            * positions.
55098            *
55099            * @private
55100            * @param {number}
55101            *            start The start of the view.
55102            * @param {number}
55103            *            end The end of the view.
55104            * @param {Array}
55105            *            transforms The transformations to apply to the view.
55106            * @returns {Object} Returns an object containing the `start` and `end`
55107            *          positions of the view.
55108            */
55109           function getView(start, end, transforms) {
55110             var index = -1,
55111               length = transforms.length;
55112
55113             while (++index < length) {
55114               var data = transforms[index],
55115                 size = data.size;
55116
55117               switch (data.type) {
55118                 case 'drop':
55119                   start += size;
55120                   break;
55121                 case 'dropRight':
55122                   end -= size;
55123                   break;
55124                 case 'take':
55125                   end = nativeMin(end, start + size);
55126                   break;
55127                 case 'takeRight':
55128                   start = nativeMax(start, end - size);
55129                   break;
55130               }
55131             }
55132             return {
55133               'start': start,
55134               'end': end
55135             };
55136           }
55137
55138           /**
55139            * Initializes an array clone.
55140            *
55141            * @private
55142            * @param {Array}
55143            *            array The array to clone.
55144            * @returns {Array} Returns the initialized clone.
55145            */
55146           function initCloneArray(array) {
55147             var length = array.length,
55148               result = new array.constructor(length);
55149
55150             // Add array properties assigned by `RegExp#exec`.
55151             if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
55152               result.index = array.index;
55153               result.input = array.input;
55154             }
55155             return result;
55156           }
55157
55158           /**
55159            * Initializes an object clone.
55160            *
55161            * @private
55162            * @param {Object}
55163            *            object The object to clone.
55164            * @returns {Object} Returns the initialized clone.
55165            */
55166           function initCloneObject(object) {
55167             var Ctor = object.constructor;
55168             if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
55169               Ctor = Object;
55170             }
55171             return new Ctor;
55172           }
55173
55174           /**
55175            * Initializes an object clone based on its `toStringTag`.
55176            *
55177            * **Note:** This function only supports cloning values with tags of
55178            * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
55179            *
55180            * @private
55181            * @param {Object}
55182            *            object The object to clone.
55183            * @param {string}
55184            *            tag The `toStringTag` of the object to clone.
55185            * @param {boolean}
55186            *            [isDeep] Specify a deep clone.
55187            * @returns {Object} Returns the initialized clone.
55188            */
55189           function initCloneByTag(object, tag, isDeep) {
55190             var Ctor = object.constructor;
55191             switch (tag) {
55192               case arrayBufferTag:
55193                 return bufferClone(object);
55194
55195               case boolTag:
55196               case dateTag:
55197                 return new Ctor(+object);
55198
55199               case float32Tag:
55200               case float64Tag:
55201               case int8Tag:
55202               case int16Tag:
55203               case int32Tag:
55204               case uint8Tag:
55205               case uint8ClampedTag:
55206               case uint16Tag:
55207               case uint32Tag:
55208                 var buffer = object.buffer;
55209                 return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
55210
55211               case numberTag:
55212               case stringTag:
55213                 return new Ctor(object);
55214
55215               case regexpTag:
55216                 var result = new Ctor(object.source, reFlags.exec(object));
55217                 result.lastIndex = object.lastIndex;
55218             }
55219             return result;
55220           }
55221
55222           /**
55223            * Invokes the method at `path` on `object`.
55224            *
55225            * @private
55226            * @param {Object}
55227            *            object The object to query.
55228            * @param {Array|string}
55229            *            path The path of the method to invoke.
55230            * @param {Array}
55231            *            args The arguments to invoke the method with.
55232            * @returns {*} Returns the result of the invoked method.
55233            */
55234           function invokePath(object, path, args) {
55235             if (object != null && !isKey(path, object)) {
55236               path = toPath(path);
55237               object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
55238               path = last(path);
55239             }
55240             var func = object == null ? object : object[path];
55241             return func == null ? undefined : func.apply(object, args);
55242           }
55243
55244           /**
55245            * Checks if `value` is array-like.
55246            *
55247            * @private
55248            * @param {*}
55249            *            value The value to check.
55250            * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
55251            */
55252           function isArrayLike(value) {
55253             return value != null && isLength(getLength(value));
55254           }
55255
55256           /**
55257            * Checks if `value` is a valid array-like index.
55258            *
55259            * @private
55260            * @param {*}
55261            *            value The value to check.
55262            * @param {number}
55263            *            [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
55264            * @returns {boolean} Returns `true` if `value` is a valid index, else
55265            *          `false`.
55266            */
55267           function isIndex(value, length) {
55268             value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
55269             length = length == null ? MAX_SAFE_INTEGER : length;
55270             return value > -1 && value % 1 == 0 && value < length;
55271           }
55272
55273           /**
55274            * Checks if the provided arguments are from an iteratee call.
55275            *
55276            * @private
55277            * @param {*}
55278            *            value The potential iteratee value argument.
55279            * @param {*}
55280            *            index The potential iteratee index or key argument.
55281            * @param {*}
55282            *            object The potential iteratee object argument.
55283            * @returns {boolean} Returns `true` if the arguments are from an iteratee
55284            *          call, else `false`.
55285            */
55286           function isIterateeCall(value, index, object) {
55287             if (!isObject(object)) {
55288               return false;
55289             }
55290             var type = typeof index;
55291             if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) {
55292               var other = object[index];
55293               return value === value ? (value === other) : (other !== other);
55294             }
55295             return false;
55296           }
55297
55298           /**
55299            * Checks if `value` is a property name and not a property path.
55300            *
55301            * @private
55302            * @param {*}
55303            *            value The value to check.
55304            * @param {Object}
55305            *            [object] The object to query keys on.
55306            * @returns {boolean} Returns `true` if `value` is a property name, else
55307            *          `false`.
55308            */
55309           function isKey(value, object) {
55310             var type = typeof value;
55311             if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
55312               return true;
55313             }
55314             if (isArray(value)) {
55315               return false;
55316             }
55317             var result = !reIsDeepProp.test(value);
55318             return result || (object != null && value in toObject(object));
55319           }
55320
55321           /**
55322            * Checks if `func` has a lazy counterpart.
55323            *
55324            * @private
55325            * @param {Function}
55326            *            func The function to check.
55327            * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else
55328            *          `false`.
55329            */
55330           function isLaziable(func) {
55331             var funcName = getFuncName(func);
55332             if (!(funcName in LazyWrapper.prototype)) {
55333               return false;
55334             }
55335             var other = lodash[funcName];
55336             if (func === other) {
55337               return true;
55338             }
55339             var data = getData(other);
55340             return !!data && func === data[0];
55341           }
55342
55343           /**
55344            * Checks if `value` is a valid array-like length.
55345            *
55346            * **Note:** This function is based on
55347            * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
55348            *
55349            * @private
55350            * @param {*}
55351            *            value The value to check.
55352            * @returns {boolean} Returns `true` if `value` is a valid length, else
55353            *          `false`.
55354            */
55355           function isLength(value) {
55356             return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
55357           }
55358
55359           /**
55360            * Checks if `value` is suitable for strict equality comparisons, i.e.
55361            * `===`.
55362            *
55363            * @private
55364            * @param {*}
55365            *            value The value to check.
55366            * @returns {boolean} Returns `true` if `value` if suitable for strict
55367            *          equality comparisons, else `false`.
55368            */
55369           function isStrictComparable(value) {
55370             return value === value && !isObject(value);
55371           }
55372
55373           /**
55374            * Merges the function metadata of `source` into `data`.
55375            *
55376            * Merging metadata reduces the number of wrappers required to invoke a
55377            * function. This is possible because methods like `_.bind`, `_.curry`, and
55378            * `_.partial` may be applied regardless of execution order. Methods like
55379            * `_.ary` and `_.rearg` augment function arguments, making the order in
55380            * which they are executed important, preventing the merging of metadata.
55381            * However, we make an exception for a safe common case where curried
55382            * functions have `_.ary` and or `_.rearg` applied.
55383            *
55384            * @private
55385            * @param {Array}
55386            *            data The destination metadata.
55387            * @param {Array}
55388            *            source The source metadata.
55389            * @returns {Array} Returns `data`.
55390            */
55391           function mergeData(data, source) {
55392             var bitmask = data[1],
55393               srcBitmask = source[1],
55394               newBitmask = bitmask | srcBitmask,
55395               isCommon = newBitmask < ARY_FLAG;
55396
55397             var isCombo =
55398               (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
55399               (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
55400               (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
55401
55402             // Exit early if metadata can't be merged.
55403             if (!(isCommon || isCombo)) {
55404               return data;
55405             }
55406             // Use source `thisArg` if available.
55407             if (srcBitmask & BIND_FLAG) {
55408               data[2] = source[2];
55409               // Set when currying a bound function.
55410               newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
55411             }
55412             // Compose partial arguments.
55413             var value = source[3];
55414             if (value) {
55415               var partials = data[3];
55416               data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
55417               data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
55418             }
55419             // Compose partial right arguments.
55420             value = source[5];
55421             if (value) {
55422               partials = data[5];
55423               data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
55424               data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
55425             }
55426             // Use source `argPos` if available.
55427             value = source[7];
55428             if (value) {
55429               data[7] = arrayCopy(value);
55430             }
55431             // Use source `ary` if it's smaller.
55432             if (srcBitmask & ARY_FLAG) {
55433               data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
55434             }
55435             // Use source `arity` if one is not provided.
55436             if (data[9] == null) {
55437               data[9] = source[9];
55438             }
55439             // Use source `func` and merge bitmasks.
55440             data[0] = source[0];
55441             data[1] = newBitmask;
55442
55443             return data;
55444           }
55445
55446           /**
55447            * Used by `_.defaultsDeep` to customize its `_.merge` use.
55448            *
55449            * @private
55450            * @param {*}
55451            *            objectValue The destination object property value.
55452            * @param {*}
55453            *            sourceValue The source object property value.
55454            * @returns {*} Returns the value to assign to the destination object.
55455            */
55456           function mergeDefaults(objectValue, sourceValue) {
55457             return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);
55458           }
55459
55460           /**
55461            * A specialized version of `_.pick` which picks `object` properties
55462            * specified by `props`.
55463            *
55464            * @private
55465            * @param {Object}
55466            *            object The source object.
55467            * @param {string[]}
55468            *            props The property names to pick.
55469            * @returns {Object} Returns the new object.
55470            */
55471           function pickByArray(object, props) {
55472             object = toObject(object);
55473
55474             var index = -1,
55475               length = props.length,
55476               result = {};
55477
55478             while (++index < length) {
55479               var key = props[index];
55480               if (key in object) {
55481                 result[key] = object[key];
55482               }
55483             }
55484             return result;
55485           }
55486
55487           /**
55488            * A specialized version of `_.pick` which picks `object` properties
55489            * `predicate` returns truthy for.
55490            *
55491            * @private
55492            * @param {Object}
55493            *            object The source object.
55494            * @param {Function}
55495            *            predicate The function invoked per iteration.
55496            * @returns {Object} Returns the new object.
55497            */
55498           function pickByCallback(object, predicate) {
55499             var result = {};
55500             baseForIn(object, function(value, key, object) {
55501               if (predicate(value, key, object)) {
55502                 result[key] = value;
55503               }
55504             });
55505             return result;
55506           }
55507
55508           /**
55509            * Reorder `array` according to the specified indexes where the element at
55510            * the first index is assigned as the first element, the element at the
55511            * second index is assigned as the second element, and so on.
55512            *
55513            * @private
55514            * @param {Array}
55515            *            array The array to reorder.
55516            * @param {Array}
55517            *            indexes The arranged array indexes.
55518            * @returns {Array} Returns `array`.
55519            */
55520           function reorder(array, indexes) {
55521             var arrLength = array.length,
55522               length = nativeMin(indexes.length, arrLength),
55523               oldArray = arrayCopy(array);
55524
55525             while (length--) {
55526               var index = indexes[length];
55527               array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
55528             }
55529             return array;
55530           }
55531
55532           /**
55533            * Sets metadata for `func`.
55534            *
55535            * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
55536            * period of time, it will trip its breaker and transition to an identity
55537            * function to avoid garbage collection pauses in V8. See [V8 issue
55538            * 2070](https://code.google.com/p/v8/issues/detail?id=2070) for more
55539            * details.
55540            *
55541            * @private
55542            * @param {Function}
55543            *            func The function to associate metadata with.
55544            * @param {*}
55545            *            data The metadata.
55546            * @returns {Function} Returns `func`.
55547            */
55548           var setData = (function() {
55549             var count = 0,
55550               lastCalled = 0;
55551
55552             return function(key, value) {
55553               var stamp = now(),
55554                 remaining = HOT_SPAN - (stamp - lastCalled);
55555
55556               lastCalled = stamp;
55557               if (remaining > 0) {
55558                 if (++count >= HOT_COUNT) {
55559                   return key;
55560                 }
55561               } else {
55562                 count = 0;
55563               }
55564               return baseSetData(key, value);
55565             };
55566           }());
55567
55568           /**
55569            * A fallback implementation of `Object.keys` which creates an array of the
55570            * own enumerable property names of `object`.
55571            *
55572            * @private
55573            * @param {Object}
55574            *            object The object to query.
55575            * @returns {Array} Returns the array of property names.
55576            */
55577           function shimKeys(object) {
55578             var props = keysIn(object),
55579               propsLength = props.length,
55580               length = propsLength && object.length;
55581
55582             var allowIndexes = !!length && isLength(length) &&
55583               (isArray(object) || isArguments(object));
55584
55585             var index = -1,
55586               result = [];
55587
55588             while (++index < propsLength) {
55589               var key = props[index];
55590               if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
55591                 result.push(key);
55592               }
55593             }
55594             return result;
55595           }
55596
55597           /**
55598            * Converts `value` to an array-like object if it's not one.
55599            *
55600            * @private
55601            * @param {*}
55602            *            value The value to process.
55603            * @returns {Array|Object} Returns the array-like object.
55604            */
55605           function toIterable(value) {
55606             if (value == null) {
55607               return [];
55608             }
55609             if (!isArrayLike(value)) {
55610               return values(value);
55611             }
55612             return isObject(value) ? value : Object(value);
55613           }
55614
55615           /**
55616            * Converts `value` to an object if it's not one.
55617            *
55618            * @private
55619            * @param {*}
55620            *            value The value to process.
55621            * @returns {Object} Returns the object.
55622            */
55623           function toObject(value) {
55624             return isObject(value) ? value : Object(value);
55625           }
55626
55627           /**
55628            * Converts `value` to property path array if it's not one.
55629            *
55630            * @private
55631            * @param {*}
55632            *            value The value to process.
55633            * @returns {Array} Returns the property path array.
55634            */
55635           function toPath(value) {
55636             if (isArray(value)) {
55637               return value;
55638             }
55639             var result = [];
55640             baseToString(value).replace(rePropName, function(match, number, quote, string) {
55641               result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
55642             });
55643             return result;
55644           }
55645
55646           /**
55647            * Creates a clone of `wrapper`.
55648            *
55649            * @private
55650            * @param {Object}
55651            *            wrapper The wrapper to clone.
55652            * @returns {Object} Returns the cloned wrapper.
55653            */
55654           function wrapperClone(wrapper) {
55655             return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
55656           }
55657
55658           /*------------------------------------------------------------------------*/
55659
55660           /**
55661            * Creates an array of elements split into groups the length of `size`. If
55662            * `collection` can't be split evenly, the final chunk will be the remaining
55663            * elements.
55664            *
55665            * @static
55666            * @memberOf _
55667            * @category Array
55668            * @param {Array}
55669            *            array The array to process.
55670            * @param {number}
55671            *            [size=1] The length of each chunk.
55672            * @param- {Object} [guard] Enables use as a callback for functions like
55673            *         `_.map`.
55674            * @returns {Array} Returns the new array containing chunks.
55675            * @example
55676            *
55677            * _.chunk(['a', 'b', 'c', 'd'], 2); // => [['a', 'b'], ['c', 'd']]
55678            *
55679            * _.chunk(['a', 'b', 'c', 'd'], 3); // => [['a', 'b', 'c'], ['d']]
55680            */
55681           function chunk(array, size, guard) {
55682             if (guard ? isIterateeCall(array, size, guard) : size == null) {
55683               size = 1;
55684             } else {
55685               size = nativeMax(nativeFloor(size) || 1, 1);
55686             }
55687             var index = 0,
55688               length = array ? array.length : 0,
55689               resIndex = -1,
55690               result = Array(nativeCeil(length / size));
55691
55692             while (index < length) {
55693               result[++resIndex] = baseSlice(array, index, (index += size));
55694             }
55695             return result;
55696           }
55697
55698           /**
55699            * Creates an array with all falsey values removed. The values `false`,
55700            * `null`, `0`, `""`, `undefined`, and `NaN` are falsey.
55701            *
55702            * @static
55703            * @memberOf _
55704            * @category Array
55705            * @param {Array}
55706            *            array The array to compact.
55707            * @returns {Array} Returns the new array of filtered values.
55708            * @example
55709            *
55710            * _.compact([0, 1, false, 2, '', 3]); // => [1, 2, 3]
55711            */
55712           function compact(array) {
55713             var index = -1,
55714               length = array ? array.length : 0,
55715               resIndex = -1,
55716               result = [];
55717
55718             while (++index < length) {
55719               var value = array[index];
55720               if (value) {
55721                 result[++resIndex] = value;
55722               }
55723             }
55724             return result;
55725           }
55726
55727           /**
55728            * Creates an array of unique `array` values not included in the other
55729            * provided arrays using
55730            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
55731            * for equality comparisons.
55732            *
55733            * @static
55734            * @memberOf _
55735            * @category Array
55736            * @param {Array}
55737            *            array The array to inspect.
55738            * @param {...Array}
55739            *            [values] The arrays of values to exclude.
55740            * @returns {Array} Returns the new array of filtered values.
55741            * @example
55742            *
55743            * _.difference([1, 2, 3], [4, 2]); // => [1, 3]
55744            */
55745           var difference = restParam(function(array, values) {
55746             return (isObjectLike(array) && isArrayLike(array)) ? baseDifference(array, baseFlatten(values, false, true)) : [];
55747           });
55748
55749           /**
55750            * Creates a slice of `array` with `n` elements dropped from the beginning.
55751            *
55752            * @static
55753            * @memberOf _
55754            * @category Array
55755            * @param {Array}
55756            *            array The array to query.
55757            * @param {number}
55758            *            [n=1] The number of elements to drop.
55759            * @param- {Object} [guard] Enables use as a callback for functions like
55760            *         `_.map`.
55761            * @returns {Array} Returns the slice of `array`.
55762            * @example
55763            *
55764            * _.drop([1, 2, 3]); // => [2, 3]
55765            *
55766            * _.drop([1, 2, 3], 2); // => [3]
55767            *
55768            * _.drop([1, 2, 3], 5); // => []
55769            *
55770            * _.drop([1, 2, 3], 0); // => [1, 2, 3]
55771            */
55772           function drop(array, n, guard) {
55773             var length = array ? array.length : 0;
55774             if (!length) {
55775               return [];
55776             }
55777             if (guard ? isIterateeCall(array, n, guard) : n == null) {
55778               n = 1;
55779             }
55780             return baseSlice(array, n < 0 ? 0 : n);
55781           }
55782
55783           /**
55784            * Creates a slice of `array` with `n` elements dropped from the end.
55785            *
55786            * @static
55787            * @memberOf _
55788            * @category Array
55789            * @param {Array}
55790            *            array The array to query.
55791            * @param {number}
55792            *            [n=1] The number of elements to drop.
55793            * @param- {Object} [guard] Enables use as a callback for functions like
55794            *         `_.map`.
55795            * @returns {Array} Returns the slice of `array`.
55796            * @example
55797            *
55798            * _.dropRight([1, 2, 3]); // => [1, 2]
55799            *
55800            * _.dropRight([1, 2, 3], 2); // => [1]
55801            *
55802            * _.dropRight([1, 2, 3], 5); // => []
55803            *
55804            * _.dropRight([1, 2, 3], 0); // => [1, 2, 3]
55805            */
55806           function dropRight(array, n, guard) {
55807             var length = array ? array.length : 0;
55808             if (!length) {
55809               return [];
55810             }
55811             if (guard ? isIterateeCall(array, n, guard) : n == null) {
55812               n = 1;
55813             }
55814             n = length - (+n || 0);
55815             return baseSlice(array, 0, n < 0 ? 0 : n);
55816           }
55817
55818           /**
55819            * Creates a slice of `array` excluding elements dropped from the end.
55820            * Elements are dropped until `predicate` returns falsey. The predicate is
55821            * bound to `thisArg` and invoked with three arguments: (value, index,
55822            * array).
55823            *
55824            * If a property name is provided for `predicate` the created `_.property`
55825            * style callback returns the property value of the given element.
55826            *
55827            * If a value is also provided for `thisArg` the created `_.matchesProperty`
55828            * style callback returns `true` for elements that have a matching property
55829            * value, else `false`.
55830            *
55831            * If an object is provided for `predicate` the created `_.matches` style
55832            * callback returns `true` for elements that match the properties of the
55833            * given object, else `false`.
55834            *
55835            * @static
55836            * @memberOf _
55837            * @category Array
55838            * @param {Array}
55839            *            array The array to query.
55840            * @param {Function|Object|string}
55841            *            [predicate=_.identity] The function invoked per iteration.
55842            * @param {*}
55843            *            [thisArg] The `this` binding of `predicate`.
55844            * @returns {Array} Returns the slice of `array`.
55845            * @example
55846            *
55847            * _.dropRightWhile([1, 2, 3], function(n) { return n > 1; }); // => [1]
55848            *
55849            * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
55850            * 'active': false }, { 'user': 'pebbles', 'active': false } ];
55851            *  // using the `_.matches` callback shorthand
55852            * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }),
55853            * 'user'); // => ['barney', 'fred']
55854            *  // using the `_.matchesProperty` callback shorthand
55855            * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); // =>
55856            * ['barney']
55857            *  // using the `_.property` callback shorthand
55858            * _.pluck(_.dropRightWhile(users, 'active'), 'user'); // => ['barney',
55859            * 'fred', 'pebbles']
55860            */
55861           function dropRightWhile(array, predicate, thisArg) {
55862             return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) : [];
55863           }
55864
55865           /**
55866            * Creates a slice of `array` excluding elements dropped from the beginning.
55867            * Elements are dropped until `predicate` returns falsey. The predicate is
55868            * bound to `thisArg` and invoked with three arguments: (value, index,
55869            * array).
55870            *
55871            * If a property name is provided for `predicate` the created `_.property`
55872            * style callback returns the property value of the given element.
55873            *
55874            * If a value is also provided for `thisArg` the created `_.matchesProperty`
55875            * style callback returns `true` for elements that have a matching property
55876            * value, else `false`.
55877            *
55878            * If an object is provided for `predicate` the created `_.matches` style
55879            * callback returns `true` for elements that have the properties of the
55880            * given object, else `false`.
55881            *
55882            * @static
55883            * @memberOf _
55884            * @category Array
55885            * @param {Array}
55886            *            array The array to query.
55887            * @param {Function|Object|string}
55888            *            [predicate=_.identity] The function invoked per iteration.
55889            * @param {*}
55890            *            [thisArg] The `this` binding of `predicate`.
55891            * @returns {Array} Returns the slice of `array`.
55892            * @example
55893            *
55894            * _.dropWhile([1, 2, 3], function(n) { return n < 3; }); // => [3]
55895            *
55896            * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
55897            * 'active': false }, { 'user': 'pebbles', 'active': true } ];
55898            *  // using the `_.matches` callback shorthand _.pluck(_.dropWhile(users, {
55899            * 'user': 'barney', 'active': false }), 'user'); // => ['fred', 'pebbles']
55900            *  // using the `_.matchesProperty` callback shorthand
55901            * _.pluck(_.dropWhile(users, 'active', false), 'user'); // => ['pebbles']
55902            *  // using the `_.property` callback shorthand _.pluck(_.dropWhile(users,
55903            * 'active'), 'user'); // => ['barney', 'fred', 'pebbles']
55904            */
55905           function dropWhile(array, predicate, thisArg) {
55906             return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true) : [];
55907           }
55908
55909           /**
55910            * Fills elements of `array` with `value` from `start` up to, but not
55911            * including, `end`.
55912            *
55913            * **Note:** This method mutates `array`.
55914            *
55915            * @static
55916            * @memberOf _
55917            * @category Array
55918            * @param {Array}
55919            *            array The array to fill.
55920            * @param {*}
55921            *            value The value to fill `array` with.
55922            * @param {number}
55923            *            [start=0] The start position.
55924            * @param {number}
55925            *            [end=array.length] The end position.
55926            * @returns {Array} Returns `array`.
55927            * @example
55928            *
55929            * var array = [1, 2, 3];
55930            *
55931            * _.fill(array, 'a'); console.log(array); // => ['a', 'a', 'a']
55932            *
55933            * _.fill(Array(3), 2); // => [2, 2, 2]
55934            *
55935            * _.fill([4, 6, 8], '*', 1, 2); // => [4, '*', 8]
55936            */
55937           function fill(array, value, start, end) {
55938             var length = array ? array.length : 0;
55939             if (!length) {
55940               return [];
55941             }
55942             if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
55943               start = 0;
55944               end = length;
55945             }
55946             return baseFill(array, value, start, end);
55947           }
55948
55949           /**
55950            * This method is like `_.find` except that it returns the index of the
55951            * first element `predicate` returns truthy for instead of the element
55952            * itself.
55953            *
55954            * If a property name is provided for `predicate` the created `_.property`
55955            * style callback returns the property value of the given element.
55956            *
55957            * If a value is also provided for `thisArg` the created `_.matchesProperty`
55958            * style callback returns `true` for elements that have a matching property
55959            * value, else `false`.
55960            *
55961            * If an object is provided for `predicate` the created `_.matches` style
55962            * callback returns `true` for elements that have the properties of the
55963            * given object, else `false`.
55964            *
55965            * @static
55966            * @memberOf _
55967            * @category Array
55968            * @param {Array}
55969            *            array The array to search.
55970            * @param {Function|Object|string}
55971            *            [predicate=_.identity] The function invoked per iteration.
55972            * @param {*}
55973            *            [thisArg] The `this` binding of `predicate`.
55974            * @returns {number} Returns the index of the found element, else `-1`.
55975            * @example
55976            *
55977            * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
55978            * 'active': false }, { 'user': 'pebbles', 'active': true } ];
55979            *
55980            * _.findIndex(users, function(chr) { return chr.user == 'barney'; }); // =>
55981            * 0
55982            *  // using the `_.matches` callback shorthand _.findIndex(users, { 'user':
55983            * 'fred', 'active': false }); // => 1
55984            *  // using the `_.matchesProperty` callback shorthand _.findIndex(users,
55985            * 'active', false); // => 0
55986            *  // using the `_.property` callback shorthand _.findIndex(users,
55987            * 'active'); // => 2
55988            */
55989           var findIndex = createFindIndex();
55990
55991           /**
55992            * This method is like `_.findIndex` except that it iterates over elements
55993            * of `collection` from right to left.
55994            *
55995            * If a property name is provided for `predicate` the created `_.property`
55996            * style callback returns the property value of the given element.
55997            *
55998            * If a value is also provided for `thisArg` the created `_.matchesProperty`
55999            * style callback returns `true` for elements that have a matching property
56000            * value, else `false`.
56001            *
56002            * If an object is provided for `predicate` the created `_.matches` style
56003            * callback returns `true` for elements that have the properties of the
56004            * given object, else `false`.
56005            *
56006            * @static
56007            * @memberOf _
56008            * @category Array
56009            * @param {Array}
56010            *            array The array to search.
56011            * @param {Function|Object|string}
56012            *            [predicate=_.identity] The function invoked per iteration.
56013            * @param {*}
56014            *            [thisArg] The `this` binding of `predicate`.
56015            * @returns {number} Returns the index of the found element, else `-1`.
56016            * @example
56017            *
56018            * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56019            * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56020            *
56021            * _.findLastIndex(users, function(chr) { return chr.user == 'pebbles'; }); // =>
56022            * 2
56023            *  // using the `_.matches` callback shorthand _.findLastIndex(users, {
56024            * 'user': 'barney', 'active': true }); // => 0
56025            *  // using the `_.matchesProperty` callback shorthand
56026            * _.findLastIndex(users, 'active', false); // => 2
56027            *  // using the `_.property` callback shorthand _.findLastIndex(users,
56028            * 'active'); // => 0
56029            */
56030           var findLastIndex = createFindIndex(true);
56031
56032           /**
56033            * Gets the first element of `array`.
56034            *
56035            * @static
56036            * @memberOf _
56037            * @alias head
56038            * @category Array
56039            * @param {Array}
56040            *            array The array to query.
56041            * @returns {*} Returns the first element of `array`.
56042            * @example
56043            *
56044            * _.first([1, 2, 3]); // => 1
56045            *
56046            * _.first([]); // => undefined
56047            */
56048           function first(array) {
56049             return array ? array[0] : undefined;
56050           }
56051
56052           /**
56053            * Flattens a nested array. If `isDeep` is `true` the array is recursively
56054            * flattened, otherwise it is only flattened a single level.
56055            *
56056            * @static
56057            * @memberOf _
56058            * @category Array
56059            * @param {Array}
56060            *            array The array to flatten.
56061            * @param {boolean}
56062            *            [isDeep] Specify a deep flatten.
56063            * @param- {Object} [guard] Enables use as a callback for functions like
56064            *         `_.map`.
56065            * @returns {Array} Returns the new flattened array.
56066            * @example
56067            *
56068            * _.flatten([1, [2, 3, [4]]]); // => [1, 2, 3, [4]]
56069            *  // using `isDeep` _.flatten([1, [2, 3, [4]]], true); // => [1, 2, 3, 4]
56070            */
56071           function flatten(array, isDeep, guard) {
56072             var length = array ? array.length : 0;
56073             if (guard && isIterateeCall(array, isDeep, guard)) {
56074               isDeep = false;
56075             }
56076             return length ? baseFlatten(array, isDeep) : [];
56077           }
56078
56079           /**
56080            * Recursively flattens a nested array.
56081            *
56082            * @static
56083            * @memberOf _
56084            * @category Array
56085            * @param {Array}
56086            *            array The array to recursively flatten.
56087            * @returns {Array} Returns the new flattened array.
56088            * @example
56089            *
56090            * _.flattenDeep([1, [2, 3, [4]]]); // => [1, 2, 3, 4]
56091            */
56092           function flattenDeep(array) {
56093             var length = array ? array.length : 0;
56094             return length ? baseFlatten(array, true) : [];
56095           }
56096
56097           /**
56098            * Gets the index at which the first occurrence of `value` is found in
56099            * `array` using
56100            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56101            * for equality comparisons. If `fromIndex` is negative, it is used as the
56102            * offset from the end of `array`. If `array` is sorted providing `true` for
56103            * `fromIndex` performs a faster binary search.
56104            *
56105            * @static
56106            * @memberOf _
56107            * @category Array
56108            * @param {Array}
56109            *            array The array to search.
56110            * @param {*}
56111            *            value The value to search for.
56112            * @param {boolean|number}
56113            *            [fromIndex=0] The index to search from or `true` to perform a
56114            *            binary search on a sorted array.
56115            * @returns {number} Returns the index of the matched value, else `-1`.
56116            * @example
56117            *
56118            * _.indexOf([1, 2, 1, 2], 2); // => 1
56119            *  // using `fromIndex` _.indexOf([1, 2, 1, 2], 2, 2); // => 3
56120            *  // performing a binary search _.indexOf([1, 1, 2, 2], 2, true); // => 2
56121            */
56122           function indexOf(array, value, fromIndex) {
56123             var length = array ? array.length : 0;
56124             if (!length) {
56125               return -1;
56126             }
56127             if (typeof fromIndex == 'number') {
56128               fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
56129             } else if (fromIndex) {
56130               var index = binaryIndex(array, value);
56131               if (index < length &&
56132                 (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
56133                 return index;
56134               }
56135               return -1;
56136             }
56137             return baseIndexOf(array, value, fromIndex || 0);
56138           }
56139
56140           /**
56141            * Gets all but the last element of `array`.
56142            *
56143            * @static
56144            * @memberOf _
56145            * @category Array
56146            * @param {Array}
56147            *            array The array to query.
56148            * @returns {Array} Returns the slice of `array`.
56149            * @example
56150            *
56151            * _.initial([1, 2, 3]); // => [1, 2]
56152            */
56153           function initial(array) {
56154             return dropRight(array, 1);
56155           }
56156
56157           /**
56158            * Creates an array of unique values that are included in all of the
56159            * provided arrays using
56160            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56161            * for equality comparisons.
56162            *
56163            * @static
56164            * @memberOf _
56165            * @category Array
56166            * @param {...Array}
56167            *            [arrays] The arrays to inspect.
56168            * @returns {Array} Returns the new array of shared values.
56169            * @example _.intersection([1, 2], [4, 2], [2, 1]); // => [2]
56170            */
56171           var intersection = restParam(function(arrays) {
56172             var othLength = arrays.length,
56173               othIndex = othLength,
56174               caches = Array(length),
56175               indexOf = getIndexOf(),
56176               isCommon = indexOf == baseIndexOf,
56177               result = [];
56178
56179             while (othIndex--) {
56180               var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
56181               caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
56182             }
56183             var array = arrays[0],
56184               index = -1,
56185               length = array ? array.length : 0,
56186               seen = caches[0];
56187
56188             outer:
56189               while (++index < length) {
56190                 value = array[index];
56191                 if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
56192                   var othIndex = othLength;
56193                   while (--othIndex) {
56194                     var cache = caches[othIndex];
56195                     if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
56196                       continue outer;
56197                     }
56198                   }
56199                   if (seen) {
56200                     seen.push(value);
56201                   }
56202                   result.push(value);
56203                 }
56204               }
56205             return result;
56206           });
56207
56208           /**
56209            * Gets the last element of `array`.
56210            *
56211            * @static
56212            * @memberOf _
56213            * @category Array
56214            * @param {Array}
56215            *            array The array to query.
56216            * @returns {*} Returns the last element of `array`.
56217            * @example
56218            *
56219            * _.last([1, 2, 3]); // => 3
56220            */
56221           function last(array) {
56222             var length = array ? array.length : 0;
56223             return length ? array[length - 1] : undefined;
56224           }
56225
56226           /**
56227            * This method is like `_.indexOf` except that it iterates over elements of
56228            * `array` from right to left.
56229            *
56230            * @static
56231            * @memberOf _
56232            * @category Array
56233            * @param {Array}
56234            *            array The array to search.
56235            * @param {*}
56236            *            value The value to search for.
56237            * @param {boolean|number}
56238            *            [fromIndex=array.length-1] The index to search from or `true`
56239            *            to perform a binary search on a sorted array.
56240            * @returns {number} Returns the index of the matched value, else `-1`.
56241            * @example
56242            *
56243            * _.lastIndexOf([1, 2, 1, 2], 2); // => 3
56244            *  // using `fromIndex` _.lastIndexOf([1, 2, 1, 2], 2, 2); // => 1
56245            *  // performing a binary search _.lastIndexOf([1, 1, 2, 2], 2, true); // =>
56246            * 3
56247            */
56248           function lastIndexOf(array, value, fromIndex) {
56249             var length = array ? array.length : 0;
56250             if (!length) {
56251               return -1;
56252             }
56253             var index = length;
56254             if (typeof fromIndex == 'number') {
56255               index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
56256             } else if (fromIndex) {
56257               index = binaryIndex(array, value, true) - 1;
56258               var other = array[index];
56259               if (value === value ? (value === other) : (other !== other)) {
56260                 return index;
56261               }
56262               return -1;
56263             }
56264             if (value !== value) {
56265               return indexOfNaN(array, index, true);
56266             }
56267             while (index--) {
56268               if (array[index] === value) {
56269                 return index;
56270               }
56271             }
56272             return -1;
56273           }
56274
56275           /**
56276            * Removes all provided values from `array` using
56277            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56278            * for equality comparisons.
56279            *
56280            * **Note:** Unlike `_.without`, this method mutates `array`.
56281            *
56282            * @static
56283            * @memberOf _
56284            * @category Array
56285            * @param {Array}
56286            *            array The array to modify.
56287            * @param {...*}
56288            *            [values] The values to remove.
56289            * @returns {Array} Returns `array`.
56290            * @example
56291            *
56292            * var array = [1, 2, 3, 1, 2, 3];
56293            *
56294            * _.pull(array, 2, 3); console.log(array); // => [1, 1]
56295            */
56296           function pull() {
56297             var args = arguments,
56298               array = args[0];
56299
56300             if (!(array && array.length)) {
56301               return array;
56302             }
56303             var index = 0,
56304               indexOf = getIndexOf(),
56305               length = args.length;
56306
56307             while (++index < length) {
56308               var fromIndex = 0,
56309                 value = args[index];
56310
56311               while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
56312                 splice.call(array, fromIndex, 1);
56313               }
56314             }
56315             return array;
56316           }
56317
56318           /**
56319            * Removes elements from `array` corresponding to the given indexes and
56320            * returns an array of the removed elements. Indexes may be specified as an
56321            * array of indexes or as individual arguments.
56322            *
56323            * **Note:** Unlike `_.at`, this method mutates `array`.
56324            *
56325            * @static
56326            * @memberOf _
56327            * @category Array
56328            * @param {Array}
56329            *            array The array to modify.
56330            * @param {...(number|number[])}
56331            *            [indexes] The indexes of elements to remove, specified as
56332            *            individual indexes or arrays of indexes.
56333            * @returns {Array} Returns the new array of removed elements.
56334            * @example
56335            *
56336            * var array = [5, 10, 15, 20]; var evens = _.pullAt(array, 1, 3);
56337            *
56338            * console.log(array); // => [5, 15]
56339            *
56340            * console.log(evens); // => [10, 20]
56341            */
56342           var pullAt = restParam(function(array, indexes) {
56343             indexes = baseFlatten(indexes);
56344
56345             var result = baseAt(array, indexes);
56346             basePullAt(array, indexes.sort(baseCompareAscending));
56347             return result;
56348           });
56349
56350           /**
56351            * Removes all elements from `array` that `predicate` returns truthy for and
56352            * returns an array of the removed elements. The predicate is bound to
56353            * `thisArg` and invoked with three arguments: (value, index, array).
56354            *
56355            * If a property name is provided for `predicate` the created `_.property`
56356            * style callback returns the property value of the given element.
56357            *
56358            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56359            * style callback returns `true` for elements that have a matching property
56360            * value, else `false`.
56361            *
56362            * If an object is provided for `predicate` the created `_.matches` style
56363            * callback returns `true` for elements that have the properties of the
56364            * given object, else `false`.
56365            *
56366            * **Note:** Unlike `_.filter`, this method mutates `array`.
56367            *
56368            * @static
56369            * @memberOf _
56370            * @category Array
56371            * @param {Array}
56372            *            array The array to modify.
56373            * @param {Function|Object|string}
56374            *            [predicate=_.identity] The function invoked per iteration.
56375            * @param {*}
56376            *            [thisArg] The `this` binding of `predicate`.
56377            * @returns {Array} Returns the new array of removed elements.
56378            * @example
56379            *
56380            * var array = [1, 2, 3, 4]; var evens = _.remove(array, function(n) {
56381            * return n % 2 == 0; });
56382            *
56383            * console.log(array); // => [1, 3]
56384            *
56385            * console.log(evens); // => [2, 4]
56386            */
56387           function remove(array, predicate, thisArg) {
56388             var result = [];
56389             if (!(array && array.length)) {
56390               return result;
56391             }
56392             var index = -1,
56393               indexes = [],
56394               length = array.length;
56395
56396             predicate = getCallback(predicate, thisArg, 3);
56397             while (++index < length) {
56398               var value = array[index];
56399               if (predicate(value, index, array)) {
56400                 result.push(value);
56401                 indexes.push(index);
56402               }
56403             }
56404             basePullAt(array, indexes);
56405             return result;
56406           }
56407
56408           /**
56409            * Gets all but the first element of `array`.
56410            *
56411            * @static
56412            * @memberOf _
56413            * @alias tail
56414            * @category Array
56415            * @param {Array}
56416            *            array The array to query.
56417            * @returns {Array} Returns the slice of `array`.
56418            * @example
56419            *
56420            * _.rest([1, 2, 3]); // => [2, 3]
56421            */
56422           function rest(array) {
56423             return drop(array, 1);
56424           }
56425
56426           /**
56427            * Creates a slice of `array` from `start` up to, but not including, `end`.
56428            *
56429            * **Note:** This method is used instead of `Array#slice` to support node
56430            * lists in IE < 9 and to ensure dense arrays are returned.
56431            *
56432            * @static
56433            * @memberOf _
56434            * @category Array
56435            * @param {Array}
56436            *            array The array to slice.
56437            * @param {number}
56438            *            [start=0] The start position.
56439            * @param {number}
56440            *            [end=array.length] The end position.
56441            * @returns {Array} Returns the slice of `array`.
56442            */
56443           function slice(array, start, end) {
56444             var length = array ? array.length : 0;
56445             if (!length) {
56446               return [];
56447             }
56448             if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
56449               start = 0;
56450               end = length;
56451             }
56452             return baseSlice(array, start, end);
56453           }
56454
56455           /**
56456            * Uses a binary search to determine the lowest index at which `value`
56457            * should be inserted into `array` in order to maintain its sort order. If
56458            * an iteratee function is provided it is invoked for `value` and each
56459            * element of `array` to compute their sort ranking. The iteratee is bound
56460            * to `thisArg` and invoked with one argument; (value).
56461            *
56462            * If a property name is provided for `iteratee` the created `_.property`
56463            * style callback returns the property value of the given element.
56464            *
56465            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56466            * style callback returns `true` for elements that have a matching property
56467            * value, else `false`.
56468            *
56469            * If an object is provided for `iteratee` the created `_.matches` style
56470            * callback returns `true` for elements that have the properties of the
56471            * given object, else `false`.
56472            *
56473            * @static
56474            * @memberOf _
56475            * @category Array
56476            * @param {Array}
56477            *            array The sorted array to inspect.
56478            * @param {*}
56479            *            value The value to evaluate.
56480            * @param {Function|Object|string}
56481            *            [iteratee=_.identity] The function invoked per iteration.
56482            * @param {*}
56483            *            [thisArg] The `this` binding of `iteratee`.
56484            * @returns {number} Returns the index at which `value` should be inserted
56485            *          into `array`.
56486            * @example
56487            *
56488            * _.sortedIndex([30, 50], 40); // => 1
56489            *
56490            * _.sortedIndex([4, 4, 5, 5], 5); // => 2
56491            *
56492            * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
56493            *  // using an iteratee function _.sortedIndex(['thirty', 'fifty'],
56494            * 'forty', function(word) { return this.data[word]; }, dict); // => 1
56495            *  // using the `_.property` callback shorthand _.sortedIndex([{ 'x': 30 }, {
56496            * 'x': 50 }], { 'x': 40 }, 'x'); // => 1
56497            */
56498           var sortedIndex = createSortedIndex();
56499
56500           /**
56501            * This method is like `_.sortedIndex` except that it returns the highest
56502            * index at which `value` should be inserted into `array` in order to
56503            * maintain its sort order.
56504            *
56505            * @static
56506            * @memberOf _
56507            * @category Array
56508            * @param {Array}
56509            *            array The sorted array to inspect.
56510            * @param {*}
56511            *            value The value to evaluate.
56512            * @param {Function|Object|string}
56513            *            [iteratee=_.identity] The function invoked per iteration.
56514            * @param {*}
56515            *            [thisArg] The `this` binding of `iteratee`.
56516            * @returns {number} Returns the index at which `value` should be inserted
56517            *          into `array`.
56518            * @example
56519            *
56520            * _.sortedLastIndex([4, 4, 5, 5], 5); // => 4
56521            */
56522           var sortedLastIndex = createSortedIndex(true);
56523
56524           /**
56525            * Creates a slice of `array` with `n` elements taken from the beginning.
56526            *
56527            * @static
56528            * @memberOf _
56529            * @category Array
56530            * @param {Array}
56531            *            array The array to query.
56532            * @param {number}
56533            *            [n=1] The number of elements to take.
56534            * @param- {Object} [guard] Enables use as a callback for functions like
56535            *         `_.map`.
56536            * @returns {Array} Returns the slice of `array`.
56537            * @example
56538            *
56539            * _.take([1, 2, 3]); // => [1]
56540            *
56541            * _.take([1, 2, 3], 2); // => [1, 2]
56542            *
56543            * _.take([1, 2, 3], 5); // => [1, 2, 3]
56544            *
56545            * _.take([1, 2, 3], 0); // => []
56546            */
56547           function take(array, n, guard) {
56548             var length = array ? array.length : 0;
56549             if (!length) {
56550               return [];
56551             }
56552             if (guard ? isIterateeCall(array, n, guard) : n == null) {
56553               n = 1;
56554             }
56555             return baseSlice(array, 0, n < 0 ? 0 : n);
56556           }
56557
56558           /**
56559            * Creates a slice of `array` with `n` elements taken from the end.
56560            *
56561            * @static
56562            * @memberOf _
56563            * @category Array
56564            * @param {Array}
56565            *            array The array to query.
56566            * @param {number}
56567            *            [n=1] The number of elements to take.
56568            * @param- {Object} [guard] Enables use as a callback for functions like
56569            *         `_.map`.
56570            * @returns {Array} Returns the slice of `array`.
56571            * @example
56572            *
56573            * _.takeRight([1, 2, 3]); // => [3]
56574            *
56575            * _.takeRight([1, 2, 3], 2); // => [2, 3]
56576            *
56577            * _.takeRight([1, 2, 3], 5); // => [1, 2, 3]
56578            *
56579            * _.takeRight([1, 2, 3], 0); // => []
56580            */
56581           function takeRight(array, n, guard) {
56582             var length = array ? array.length : 0;
56583             if (!length) {
56584               return [];
56585             }
56586             if (guard ? isIterateeCall(array, n, guard) : n == null) {
56587               n = 1;
56588             }
56589             n = length - (+n || 0);
56590             return baseSlice(array, n < 0 ? 0 : n);
56591           }
56592
56593           /**
56594            * Creates a slice of `array` with elements taken from the end. Elements are
56595            * taken until `predicate` returns falsey. The predicate is bound to
56596            * `thisArg` and invoked with three arguments: (value, index, array).
56597            *
56598            * If a property name is provided for `predicate` the created `_.property`
56599            * style callback returns the property value of the given element.
56600            *
56601            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56602            * style callback returns `true` for elements that have a matching property
56603            * value, else `false`.
56604            *
56605            * If an object is provided for `predicate` the created `_.matches` style
56606            * callback returns `true` for elements that have the properties of the
56607            * given object, else `false`.
56608            *
56609            * @static
56610            * @memberOf _
56611            * @category Array
56612            * @param {Array}
56613            *            array The array to query.
56614            * @param {Function|Object|string}
56615            *            [predicate=_.identity] The function invoked per iteration.
56616            * @param {*}
56617            *            [thisArg] The `this` binding of `predicate`.
56618            * @returns {Array} Returns the slice of `array`.
56619            * @example
56620            *
56621            * _.takeRightWhile([1, 2, 3], function(n) { return n > 1; }); // => [2, 3]
56622            *
56623            * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56624            * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56625            *  // using the `_.matches` callback shorthand
56626            * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }),
56627            * 'user'); // => ['pebbles']
56628            *  // using the `_.matchesProperty` callback shorthand
56629            * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); // => ['fred',
56630            * 'pebbles']
56631            *  // using the `_.property` callback shorthand
56632            * _.pluck(_.takeRightWhile(users, 'active'), 'user'); // => []
56633            */
56634           function takeRightWhile(array, predicate, thisArg) {
56635             return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) : [];
56636           }
56637
56638           /**
56639            * Creates a slice of `array` with elements taken from the beginning.
56640            * Elements are taken until `predicate` returns falsey. The predicate is
56641            * bound to `thisArg` and invoked with three arguments: (value, index,
56642            * array).
56643            *
56644            * If a property name is provided for `predicate` the created `_.property`
56645            * style callback returns the property value of the given element.
56646            *
56647            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56648            * style callback returns `true` for elements that have a matching property
56649            * value, else `false`.
56650            *
56651            * If an object is provided for `predicate` the created `_.matches` style
56652            * callback returns `true` for elements that have the properties of the
56653            * given object, else `false`.
56654            *
56655            * @static
56656            * @memberOf _
56657            * @category Array
56658            * @param {Array}
56659            *            array The array to query.
56660            * @param {Function|Object|string}
56661            *            [predicate=_.identity] The function invoked per iteration.
56662            * @param {*}
56663            *            [thisArg] The `this` binding of `predicate`.
56664            * @returns {Array} Returns the slice of `array`.
56665            * @example
56666            *
56667            * _.takeWhile([1, 2, 3], function(n) { return n < 3; }); // => [1, 2]
56668            *
56669            * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
56670            * 'active': false}, { 'user': 'pebbles', 'active': true } ];
56671            *  // using the `_.matches` callback shorthand _.pluck(_.takeWhile(users, {
56672            * 'user': 'barney', 'active': false }), 'user'); // => ['barney']
56673            *  // using the `_.matchesProperty` callback shorthand
56674            * _.pluck(_.takeWhile(users, 'active', false), 'user'); // => ['barney',
56675            * 'fred']
56676            *  // using the `_.property` callback shorthand _.pluck(_.takeWhile(users,
56677            * 'active'), 'user'); // => []
56678            */
56679           function takeWhile(array, predicate, thisArg) {
56680             return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3)) : [];
56681           }
56682
56683           /**
56684            * Creates an array of unique values, in order, from all of the provided
56685            * arrays using
56686            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56687            * for equality comparisons.
56688            *
56689            * @static
56690            * @memberOf _
56691            * @category Array
56692            * @param {...Array}
56693            *            [arrays] The arrays to inspect.
56694            * @returns {Array} Returns the new array of combined values.
56695            * @example
56696            *
56697            * _.union([1, 2], [4, 2], [2, 1]); // => [1, 2, 4]
56698            */
56699           var union = restParam(function(arrays) {
56700             return baseUniq(baseFlatten(arrays, false, true));
56701           });
56702
56703           /**
56704            * Creates a duplicate-free version of an array, using
56705            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56706            * for equality comparisons, in which only the first occurence of each
56707            * element is kept. Providing `true` for `isSorted` performs a faster search
56708            * algorithm for sorted arrays. If an iteratee function is provided it is
56709            * invoked for each element in the array to generate the criterion by which
56710            * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked
56711            * with three arguments: (value, index, array).
56712            *
56713            * If a property name is provided for `iteratee` the created `_.property`
56714            * style callback returns the property value of the given element.
56715            *
56716            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56717            * style callback returns `true` for elements that have a matching property
56718            * value, else `false`.
56719            *
56720            * If an object is provided for `iteratee` the created `_.matches` style
56721            * callback returns `true` for elements that have the properties of the
56722            * given object, else `false`.
56723            *
56724            * @static
56725            * @memberOf _
56726            * @alias unique
56727            * @category Array
56728            * @param {Array}
56729            *            array The array to inspect.
56730            * @param {boolean}
56731            *            [isSorted] Specify the array is sorted.
56732            * @param {Function|Object|string}
56733            *            [iteratee] The function invoked per iteration.
56734            * @param {*}
56735            *            [thisArg] The `this` binding of `iteratee`.
56736            * @returns {Array} Returns the new duplicate-value-free array.
56737            * @example
56738            *
56739            * _.uniq([2, 1, 2]); // => [2, 1]
56740            *  // using `isSorted` _.uniq([1, 1, 2], true); // => [1, 2]
56741            *  // using an iteratee function _.uniq([1, 2.5, 1.5, 2], function(n) {
56742            * return this.floor(n); }, Math); // => [1, 2.5]
56743            *  // using the `_.property` callback shorthand _.uniq([{ 'x': 1 }, { 'x':
56744            * 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }]
56745            */
56746           function uniq(array, isSorted, iteratee, thisArg) {
56747             var length = array ? array.length : 0;
56748             if (!length) {
56749               return [];
56750             }
56751             if (isSorted != null && typeof isSorted != 'boolean') {
56752               thisArg = iteratee;
56753               iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
56754               isSorted = false;
56755             }
56756             var callback = getCallback();
56757             if (!(iteratee == null && callback === baseCallback)) {
56758               iteratee = callback(iteratee, thisArg, 3);
56759             }
56760             return (isSorted && getIndexOf() == baseIndexOf) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
56761           }
56762
56763           /**
56764            * This method is like `_.zip` except that it accepts an array of grouped
56765            * elements and creates an array regrouping the elements to their pre-zip
56766            * configuration.
56767            *
56768            * @static
56769            * @memberOf _
56770            * @category Array
56771            * @param {Array}
56772            *            array The array of grouped elements to process.
56773            * @returns {Array} Returns the new array of regrouped elements.
56774            * @example
56775            *
56776            * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); // =>
56777            * [['fred', 30, true], ['barney', 40, false]]
56778            *
56779            * _.unzip(zipped); // => [['fred', 'barney'], [30, 40], [true, false]]
56780            */
56781           function unzip(array) {
56782             if (!(array && array.length)) {
56783               return [];
56784             }
56785             var index = -1,
56786               length = 0;
56787
56788             array = arrayFilter(array, function(group) {
56789               if (isArrayLike(group)) {
56790                 length = nativeMax(group.length, length);
56791                 return true;
56792               }
56793             });
56794             var result = Array(length);
56795             while (++index < length) {
56796               result[index] = arrayMap(array, baseProperty(index));
56797             }
56798             return result;
56799           }
56800
56801           /**
56802            * This method is like `_.unzip` except that it accepts an iteratee to
56803            * specify how regrouped values should be combined. The `iteratee` is bound
56804            * to `thisArg` and invoked with four arguments: (accumulator, value, index,
56805            * group).
56806            *
56807            * @static
56808            * @memberOf _
56809            * @category Array
56810            * @param {Array}
56811            *            array The array of grouped elements to process.
56812            * @param {Function}
56813            *            [iteratee] The function to combine regrouped values.
56814            * @param {*}
56815            *            [thisArg] The `this` binding of `iteratee`.
56816            * @returns {Array} Returns the new array of regrouped elements.
56817            * @example
56818            *
56819            * var zipped = _.zip([1, 2], [10, 20], [100, 200]); // => [[1, 10, 100],
56820            * [2, 20, 200]]
56821            *
56822            * _.unzipWith(zipped, _.add); // => [3, 30, 300]
56823            */
56824           function unzipWith(array, iteratee, thisArg) {
56825             var length = array ? array.length : 0;
56826             if (!length) {
56827               return [];
56828             }
56829             var result = unzip(array);
56830             if (iteratee == null) {
56831               return result;
56832             }
56833             iteratee = bindCallback(iteratee, thisArg, 4);
56834             return arrayMap(result, function(group) {
56835               return arrayReduce(group, iteratee, undefined, true);
56836             });
56837           }
56838
56839           /**
56840            * Creates an array excluding all provided values using
56841            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56842            * for equality comparisons.
56843            *
56844            * @static
56845            * @memberOf _
56846            * @category Array
56847            * @param {Array}
56848            *            array The array to filter.
56849            * @param {...*}
56850            *            [values] The values to exclude.
56851            * @returns {Array} Returns the new array of filtered values.
56852            * @example
56853            *
56854            * _.without([1, 2, 1, 3], 1, 2); // => [3]
56855            */
56856           var without = restParam(function(array, values) {
56857             return isArrayLike(array) ? baseDifference(array, values) : [];
56858           });
56859
56860           /**
56861            * Creates an array of unique values that is the [symmetric
56862            * difference](https://en.wikipedia.org/wiki/Symmetric_difference) of the
56863            * provided arrays.
56864            *
56865            * @static
56866            * @memberOf _
56867            * @category Array
56868            * @param {...Array}
56869            *            [arrays] The arrays to inspect.
56870            * @returns {Array} Returns the new array of values.
56871            * @example
56872            *
56873            * _.xor([1, 2], [4, 2]); // => [1, 4]
56874            */
56875           function xor() {
56876             var index = -1,
56877               length = arguments.length;
56878
56879             while (++index < length) {
56880               var array = arguments[index];
56881               if (isArrayLike(array)) {
56882                 var result = result ? arrayPush(baseDifference(result, array), baseDifference(array, result)) : array;
56883               }
56884             }
56885             return result ? baseUniq(result) : [];
56886           }
56887
56888           /**
56889            * Creates an array of grouped elements, the first of which contains the
56890            * first elements of the given arrays, the second of which contains the
56891            * second elements of the given arrays, and so on.
56892            *
56893            * @static
56894            * @memberOf _
56895            * @category Array
56896            * @param {...Array}
56897            *            [arrays] The arrays to process.
56898            * @returns {Array} Returns the new array of grouped elements.
56899            * @example
56900            *
56901            * _.zip(['fred', 'barney'], [30, 40], [true, false]); // => [['fred', 30,
56902            * true], ['barney', 40, false]]
56903            */
56904           var zip = restParam(unzip);
56905
56906           /**
56907            * The inverse of `_.pairs`; this method returns an object composed from
56908            * arrays of property names and values. Provide either a single two
56909            * dimensional array, e.g. `[[key1, value1], [key2, value2]]` or two arrays,
56910            * one of property names and one of corresponding values.
56911            *
56912            * @static
56913            * @memberOf _
56914            * @alias object
56915            * @category Array
56916            * @param {Array}
56917            *            props The property names.
56918            * @param {Array}
56919            *            [values=[]] The property values.
56920            * @returns {Object} Returns the new object.
56921            * @example
56922            *
56923            * _.zipObject([['fred', 30], ['barney', 40]]); // => { 'fred': 30,
56924            * 'barney': 40 }
56925            *
56926            * _.zipObject(['fred', 'barney'], [30, 40]); // => { 'fred': 30, 'barney':
56927            * 40 }
56928            */
56929           function zipObject(props, values) {
56930             var index = -1,
56931               length = props ? props.length : 0,
56932               result = {};
56933
56934             if (length && !values && !isArray(props[0])) {
56935               values = [];
56936             }
56937             while (++index < length) {
56938               var key = props[index];
56939               if (values) {
56940                 result[key] = values[index];
56941               } else if (key) {
56942                 result[key[0]] = key[1];
56943               }
56944             }
56945             return result;
56946           }
56947
56948           /**
56949            * This method is like `_.zip` except that it accepts an iteratee to specify
56950            * how grouped values should be combined. The `iteratee` is bound to
56951            * `thisArg` and invoked with four arguments: (accumulator, value, index,
56952            * group).
56953            *
56954            * @static
56955            * @memberOf _
56956            * @category Array
56957            * @param {...Array}
56958            *            [arrays] The arrays to process.
56959            * @param {Function}
56960            *            [iteratee] The function to combine grouped values.
56961            * @param {*}
56962            *            [thisArg] The `this` binding of `iteratee`.
56963            * @returns {Array} Returns the new array of grouped elements.
56964            * @example
56965            *
56966            * _.zipWith([1, 2], [10, 20], [100, 200], _.add); // => [111, 222]
56967            */
56968           var zipWith = restParam(function(arrays) {
56969             var length = arrays.length,
56970               iteratee = length > 2 ? arrays[length - 2] : undefined,
56971               thisArg = length > 1 ? arrays[length - 1] : undefined;
56972
56973             if (length > 2 && typeof iteratee == 'function') {
56974               length -= 2;
56975             } else {
56976               iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
56977               thisArg = undefined;
56978             }
56979             arrays.length = length;
56980             return unzipWith(arrays, iteratee, thisArg);
56981           });
56982
56983           /*------------------------------------------------------------------------*/
56984
56985           /**
56986            * Creates a `lodash` object that wraps `value` with explicit method
56987            * chaining enabled.
56988            *
56989            * @static
56990            * @memberOf _
56991            * @category Chain
56992            * @param {*}
56993            *            value The value to wrap.
56994            * @returns {Object} Returns the new `lodash` wrapper instance.
56995            * @example
56996            *
56997            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
56998            * 40 }, { 'user': 'pebbles', 'age': 1 } ];
56999            *
57000            * var youngest = _.chain(users) .sortBy('age') .map(function(chr) { return
57001            * chr.user + ' is ' + chr.age; }) .first() .value(); // => 'pebbles is 1'
57002            */
57003           function chain(value) {
57004             var result = lodash(value);
57005             result.__chain__ = true;
57006             return result;
57007           }
57008
57009           /**
57010            * This method invokes `interceptor` and returns `value`. The interceptor is
57011            * bound to `thisArg` and invoked with one argument; (value). The purpose of
57012            * this method is to "tap into" a method chain in order to perform
57013            * operations on intermediate results within the chain.
57014            *
57015            * @static
57016            * @memberOf _
57017            * @category Chain
57018            * @param {*}
57019            *            value The value to provide to `interceptor`.
57020            * @param {Function}
57021            *            interceptor The function to invoke.
57022            * @param {*}
57023            *            [thisArg] The `this` binding of `interceptor`.
57024            * @returns {*} Returns `value`.
57025            * @example
57026            *
57027            * _([1, 2, 3]) .tap(function(array) { array.pop(); }) .reverse() .value(); // =>
57028            * [2, 1]
57029            */
57030           function tap(value, interceptor, thisArg) {
57031             interceptor.call(thisArg, value);
57032             return value;
57033           }
57034
57035           /**
57036            * This method is like `_.tap` except that it returns the result of
57037            * `interceptor`.
57038            *
57039            * @static
57040            * @memberOf _
57041            * @category Chain
57042            * @param {*}
57043            *            value The value to provide to `interceptor`.
57044            * @param {Function}
57045            *            interceptor The function to invoke.
57046            * @param {*}
57047            *            [thisArg] The `this` binding of `interceptor`.
57048            * @returns {*} Returns the result of `interceptor`.
57049            * @example
57050            *
57051            * _(' abc ') .chain() .trim() .thru(function(value) { return [value]; })
57052            * .value(); // => ['abc']
57053            */
57054           function thru(value, interceptor, thisArg) {
57055             return interceptor.call(thisArg, value);
57056           }
57057
57058           /**
57059            * Enables explicit method chaining on the wrapper object.
57060            *
57061            * @name chain
57062            * @memberOf _
57063            * @category Chain
57064            * @returns {Object} Returns the new `lodash` wrapper instance.
57065            * @example
57066            *
57067            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57068            * 40 } ];
57069            *  // without explicit chaining _(users).first(); // => { 'user': 'barney',
57070            * 'age': 36 }
57071            *  // with explicit chaining _(users).chain() .first() .pick('user')
57072            * .value(); // => { 'user': 'barney' }
57073            */
57074           function wrapperChain() {
57075             return chain(this);
57076           }
57077
57078           /**
57079            * Executes the chained sequence and returns the wrapped result.
57080            *
57081            * @name commit
57082            * @memberOf _
57083            * @category Chain
57084            * @returns {Object} Returns the new `lodash` wrapper instance.
57085            * @example
57086            *
57087            * var array = [1, 2]; var wrapped = _(array).push(3);
57088            *
57089            * console.log(array); // => [1, 2]
57090            *
57091            * wrapped = wrapped.commit(); console.log(array); // => [1, 2, 3]
57092            *
57093            * wrapped.last(); // => 3
57094            *
57095            * console.log(array); // => [1, 2, 3]
57096            */
57097           function wrapperCommit() {
57098             return new LodashWrapper(this.value(), this.__chain__);
57099           }
57100
57101           /**
57102            * Creates a new array joining a wrapped array with any additional arrays
57103            * and/or values.
57104            *
57105            * @name concat
57106            * @memberOf _
57107            * @category Chain
57108            * @param {...*}
57109            *            [values] The values to concatenate.
57110            * @returns {Array} Returns the new concatenated array.
57111            * @example
57112            *
57113            * var array = [1]; var wrapped = _(array).concat(2, [3], [[4]]);
57114            *
57115            * console.log(wrapped.value()); // => [1, 2, 3, [4]]
57116            *
57117            * console.log(array); // => [1]
57118            */
57119           var wrapperConcat = restParam(function(values) {
57120             values = baseFlatten(values);
57121             return this.thru(function(array) {
57122               return arrayConcat(isArray(array) ? array : [toObject(array)], values);
57123             });
57124           });
57125
57126           /**
57127            * Creates a clone of the chained sequence planting `value` as the wrapped
57128            * value.
57129            *
57130            * @name plant
57131            * @memberOf _
57132            * @category Chain
57133            * @returns {Object} Returns the new `lodash` wrapper instance.
57134            * @example
57135            *
57136            * var array = [1, 2]; var wrapped = _(array).map(function(value) { return
57137            * Math.pow(value, 2); });
57138            *
57139            * var other = [3, 4]; var otherWrapped = wrapped.plant(other);
57140            *
57141            * otherWrapped.value(); // => [9, 16]
57142            *
57143            * wrapped.value(); // => [1, 4]
57144            */
57145           function wrapperPlant(value) {
57146             var result,
57147               parent = this;
57148
57149             while (parent instanceof baseLodash) {
57150               var clone = wrapperClone(parent);
57151               if (result) {
57152                 previous.__wrapped__ = clone;
57153               } else {
57154                 result = clone;
57155               }
57156               var previous = clone;
57157               parent = parent.__wrapped__;
57158             }
57159             previous.__wrapped__ = value;
57160             return result;
57161           }
57162
57163           /**
57164            * Reverses the wrapped array so the first element becomes the last, the
57165            * second element becomes the second to last, and so on.
57166            *
57167            * **Note:** This method mutates the wrapped array.
57168            *
57169            * @name reverse
57170            * @memberOf _
57171            * @category Chain
57172            * @returns {Object} Returns the new reversed `lodash` wrapper instance.
57173            * @example
57174            *
57175            * var array = [1, 2, 3];
57176            *
57177            * _(array).reverse().value() // => [3, 2, 1]
57178            *
57179            * console.log(array); // => [3, 2, 1]
57180            */
57181           function wrapperReverse() {
57182             var value = this.__wrapped__;
57183
57184             var interceptor = function(value) {
57185               return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();
57186             };
57187             if (value instanceof LazyWrapper) {
57188               var wrapped = value;
57189               if (this.__actions__.length) {
57190                 wrapped = new LazyWrapper(this);
57191               }
57192               wrapped = wrapped.reverse();
57193               wrapped.__actions__.push({
57194                 'func': thru,
57195                 'args': [interceptor],
57196                 'thisArg': undefined
57197               });
57198               return new LodashWrapper(wrapped, this.__chain__);
57199             }
57200             return this.thru(interceptor);
57201           }
57202
57203           /**
57204            * Produces the result of coercing the unwrapped value to a string.
57205            *
57206            * @name toString
57207            * @memberOf _
57208            * @category Chain
57209            * @returns {string} Returns the coerced string value.
57210            * @example
57211            *
57212            * _([1, 2, 3]).toString(); // => '1,2,3'
57213            */
57214           function wrapperToString() {
57215             return (this.value() + '');
57216           }
57217
57218           /**
57219            * Executes the chained sequence to extract the unwrapped value.
57220            *
57221            * @name value
57222            * @memberOf _
57223            * @alias run, toJSON, valueOf
57224            * @category Chain
57225            * @returns {*} Returns the resolved unwrapped value.
57226            * @example
57227            *
57228            * _([1, 2, 3]).value(); // => [1, 2, 3]
57229            */
57230           function wrapperValue() {
57231             return baseWrapperValue(this.__wrapped__, this.__actions__);
57232           }
57233
57234           /*------------------------------------------------------------------------*/
57235
57236           /**
57237            * Creates an array of elements corresponding to the given keys, or indexes,
57238            * of `collection`. Keys may be specified as individual arguments or as
57239            * arrays of keys.
57240            *
57241            * @static
57242            * @memberOf _
57243            * @category Collection
57244            * @param {Array|Object|string}
57245            *            collection The collection to iterate over.
57246            * @param {...(number|number[]|string|string[])}
57247            *            [props] The property names or indexes of elements to pick,
57248            *            specified individually or in arrays.
57249            * @returns {Array} Returns the new array of picked elements.
57250            * @example
57251            *
57252            * _.at(['a', 'b', 'c'], [0, 2]); // => ['a', 'c']
57253            *
57254            * _.at(['barney', 'fred', 'pebbles'], 0, 2); // => ['barney', 'pebbles']
57255            */
57256           var at = restParam(function(collection, props) {
57257             return baseAt(collection, baseFlatten(props));
57258           });
57259
57260           /**
57261            * Creates an object composed of keys generated from the results of running
57262            * each element of `collection` through `iteratee`. The corresponding value
57263            * of each key is the number of times the key was returned by `iteratee`.
57264            * The `iteratee` is bound to `thisArg` and invoked with three arguments:
57265            * (value, index|key, collection).
57266            *
57267            * If a property name is provided for `iteratee` the created `_.property`
57268            * style callback returns the property value of the given element.
57269            *
57270            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57271            * style callback returns `true` for elements that have a matching property
57272            * value, else `false`.
57273            *
57274            * If an object is provided for `iteratee` the created `_.matches` style
57275            * callback returns `true` for elements that have the properties of the
57276            * given object, else `false`.
57277            *
57278            * @static
57279            * @memberOf _
57280            * @category Collection
57281            * @param {Array|Object|string}
57282            *            collection The collection to iterate over.
57283            * @param {Function|Object|string}
57284            *            [iteratee=_.identity] The function invoked per iteration.
57285            * @param {*}
57286            *            [thisArg] The `this` binding of `iteratee`.
57287            * @returns {Object} Returns the composed aggregate object.
57288            * @example
57289            *
57290            * _.countBy([4.3, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
57291            * '4': 1, '6': 2 }
57292            *
57293            * _.countBy([4.3, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
57294            * '4': 1, '6': 2 }
57295            *
57296            * _.countBy(['one', 'two', 'three'], 'length'); // => { '3': 2, '5': 1 }
57297            */
57298           var countBy = createAggregator(function(result, value, key) {
57299             hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
57300           });
57301
57302           /**
57303            * Checks if `predicate` returns truthy for **all** elements of
57304            * `collection`. The predicate is bound to `thisArg` and invoked with three
57305            * arguments: (value, index|key, collection).
57306            *
57307            * If a property name is provided for `predicate` the created `_.property`
57308            * style callback returns the property value of the given element.
57309            *
57310            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57311            * style callback returns `true` for elements that have a matching property
57312            * value, else `false`.
57313            *
57314            * If an object is provided for `predicate` the created `_.matches` style
57315            * callback returns `true` for elements that have the properties of the
57316            * given object, else `false`.
57317            *
57318            * @static
57319            * @memberOf _
57320            * @alias all
57321            * @category Collection
57322            * @param {Array|Object|string}
57323            *            collection The collection to iterate over.
57324            * @param {Function|Object|string}
57325            *            [predicate=_.identity] The function invoked per iteration.
57326            * @param {*}
57327            *            [thisArg] The `this` binding of `predicate`.
57328            * @returns {boolean} Returns `true` if all elements pass the predicate
57329            *          check, else `false`.
57330            * @example
57331            *
57332            * _.every([true, 1, null, 'yes'], Boolean); // => false
57333            *
57334            * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
57335            * 'active': false } ];
57336            *  // using the `_.matches` callback shorthand _.every(users, { 'user':
57337            * 'barney', 'active': false }); // => false
57338            *  // using the `_.matchesProperty` callback shorthand _.every(users,
57339            * 'active', false); // => true
57340            *  // using the `_.property` callback shorthand _.every(users, 'active'); // =>
57341            * false
57342            */
57343           function every(collection, predicate, thisArg) {
57344             var func = isArray(collection) ? arrayEvery : baseEvery;
57345             if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
57346               predicate = undefined;
57347             }
57348             if (typeof predicate != 'function' || thisArg !== undefined) {
57349               predicate = getCallback(predicate, thisArg, 3);
57350             }
57351             return func(collection, predicate);
57352           }
57353
57354           /**
57355            * Iterates over elements of `collection`, returning an array of all
57356            * elements `predicate` returns truthy for. The predicate is bound to
57357            * `thisArg` and invoked with three arguments: (value, index|key,
57358            * collection).
57359            *
57360            * If a property name is provided for `predicate` the created `_.property`
57361            * style callback returns the property value of the given element.
57362            *
57363            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57364            * style callback returns `true` for elements that have a matching property
57365            * value, else `false`.
57366            *
57367            * If an object is provided for `predicate` the created `_.matches` style
57368            * callback returns `true` for elements that have the properties of the
57369            * given object, else `false`.
57370            *
57371            * @static
57372            * @memberOf _
57373            * @alias select
57374            * @category Collection
57375            * @param {Array|Object|string}
57376            *            collection The collection to iterate over.
57377            * @param {Function|Object|string}
57378            *            [predicate=_.identity] The function invoked per iteration.
57379            * @param {*}
57380            *            [thisArg] The `this` binding of `predicate`.
57381            * @returns {Array} Returns the new filtered array.
57382            * @example
57383            *
57384            * _.filter([4, 5, 6], function(n) { return n % 2 == 0; }); // => [4, 6]
57385            *
57386            * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57387            * 'fred', 'age': 40, 'active': false } ];
57388            *  // using the `_.matches` callback shorthand _.pluck(_.filter(users, {
57389            * 'age': 36, 'active': true }), 'user'); // => ['barney']
57390            *  // using the `_.matchesProperty` callback shorthand
57391            * _.pluck(_.filter(users, 'active', false), 'user'); // => ['fred']
57392            *  // using the `_.property` callback shorthand _.pluck(_.filter(users,
57393            * 'active'), 'user'); // => ['barney']
57394            */
57395           function filter(collection, predicate, thisArg) {
57396             var func = isArray(collection) ? arrayFilter : baseFilter;
57397             predicate = getCallback(predicate, thisArg, 3);
57398             return func(collection, predicate);
57399           }
57400
57401           /**
57402            * Iterates over elements of `collection`, returning the first element
57403            * `predicate` returns truthy for. The predicate is bound to `thisArg` and
57404            * invoked with three arguments: (value, index|key, collection).
57405            *
57406            * If a property name is provided for `predicate` the created `_.property`
57407            * style callback returns the property value of the given element.
57408            *
57409            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57410            * style callback returns `true` for elements that have a matching property
57411            * value, else `false`.
57412            *
57413            * If an object is provided for `predicate` the created `_.matches` style
57414            * callback returns `true` for elements that have the properties of the
57415            * given object, else `false`.
57416            *
57417            * @static
57418            * @memberOf _
57419            * @alias detect
57420            * @category Collection
57421            * @param {Array|Object|string}
57422            *            collection The collection to search.
57423            * @param {Function|Object|string}
57424            *            [predicate=_.identity] The function invoked per iteration.
57425            * @param {*}
57426            *            [thisArg] The `this` binding of `predicate`.
57427            * @returns {*} Returns the matched element, else `undefined`.
57428            * @example
57429            *
57430            * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57431            * 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1,
57432            * 'active': true } ];
57433            *
57434            * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); // =>
57435            * 'barney'
57436            *  // using the `_.matches` callback shorthand _.result(_.find(users, {
57437            * 'age': 1, 'active': true }), 'user'); // => 'pebbles'
57438            *  // using the `_.matchesProperty` callback shorthand
57439            * _.result(_.find(users, 'active', false), 'user'); // => 'fred'
57440            *  // using the `_.property` callback shorthand _.result(_.find(users,
57441            * 'active'), 'user'); // => 'barney'
57442            */
57443           var find = createFind(baseEach);
57444
57445           /**
57446            * This method is like `_.find` except that it iterates over elements of
57447            * `collection` from right to left.
57448            *
57449            * @static
57450            * @memberOf _
57451            * @category Collection
57452            * @param {Array|Object|string}
57453            *            collection The collection to search.
57454            * @param {Function|Object|string}
57455            *            [predicate=_.identity] The function invoked per iteration.
57456            * @param {*}
57457            *            [thisArg] The `this` binding of `predicate`.
57458            * @returns {*} Returns the matched element, else `undefined`.
57459            * @example
57460            *
57461            * _.findLast([1, 2, 3, 4], function(n) { return n % 2 == 1; }); // => 3
57462            */
57463           var findLast = createFind(baseEachRight, true);
57464
57465           /**
57466            * Performs a deep comparison between each element in `collection` and the
57467            * source object, returning the first element that has equivalent property
57468            * values.
57469            *
57470            * **Note:** This method supports comparing arrays, booleans, `Date`
57471            * objects, numbers, `Object` objects, regexes, and strings. Objects are
57472            * compared by their own, not inherited, enumerable properties. For
57473            * comparing a single own or inherited property value see
57474            * `_.matchesProperty`.
57475            *
57476            * @static
57477            * @memberOf _
57478            * @category Collection
57479            * @param {Array|Object|string}
57480            *            collection The collection to search.
57481            * @param {Object}
57482            *            source The object of property values to match.
57483            * @returns {*} Returns the matched element, else `undefined`.
57484            * @example
57485            *
57486            * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57487            * 'fred', 'age': 40, 'active': false } ];
57488            *
57489            * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); // =>
57490            * 'barney'
57491            *
57492            * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); // =>
57493            * 'fred'
57494            */
57495           function findWhere(collection, source) {
57496             return find(collection, baseMatches(source));
57497           }
57498
57499           /**
57500            * Iterates over elements of `collection` invoking `iteratee` for each
57501            * element. The `iteratee` is bound to `thisArg` and invoked with three
57502            * arguments: (value, index|key, collection). Iteratee functions may exit
57503            * iteration early by explicitly returning `false`.
57504            *
57505            * **Note:** As with other "Collections" methods, objects with a "length"
57506            * property are iterated like arrays. To avoid this behavior `_.forIn` or
57507            * `_.forOwn` may be used for object iteration.
57508            *
57509            * @static
57510            * @memberOf _
57511            * @alias each
57512            * @category Collection
57513            * @param {Array|Object|string}
57514            *            collection The collection to iterate over.
57515            * @param {Function}
57516            *            [iteratee=_.identity] The function invoked per iteration.
57517            * @param {*}
57518            *            [thisArg] The `this` binding of `iteratee`.
57519            * @returns {Array|Object|string} Returns `collection`.
57520            * @example
57521            *
57522            * _([1, 2]).forEach(function(n) { console.log(n); }).value(); // => logs
57523            * each value from left to right and returns the array
57524            *
57525            * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { console.log(n, key); }); // =>
57526            * logs each value-key pair and returns the object (iteration order is not
57527            * guaranteed)
57528            */
57529           var forEach = createForEach(arrayEach, baseEach);
57530
57531           /**
57532            * This method is like `_.forEach` except that it iterates over elements of
57533            * `collection` from right to left.
57534            *
57535            * @static
57536            * @memberOf _
57537            * @alias eachRight
57538            * @category Collection
57539            * @param {Array|Object|string}
57540            *            collection The collection to iterate over.
57541            * @param {Function}
57542            *            [iteratee=_.identity] The function invoked per iteration.
57543            * @param {*}
57544            *            [thisArg] The `this` binding of `iteratee`.
57545            * @returns {Array|Object|string} Returns `collection`.
57546            * @example
57547            *
57548            * _([1, 2]).forEachRight(function(n) { console.log(n); }).value(); // =>
57549            * logs each value from right to left and returns the array
57550            */
57551           var forEachRight = createForEach(arrayEachRight, baseEachRight);
57552
57553           /**
57554            * Creates an object composed of keys generated from the results of running
57555            * each element of `collection` through `iteratee`. The corresponding value
57556            * of each key is an array of the elements responsible for generating the
57557            * key. The `iteratee` is bound to `thisArg` and invoked with three
57558            * arguments: (value, index|key, collection).
57559            *
57560            * If a property name is provided for `iteratee` the created `_.property`
57561            * style callback returns the property value of the given element.
57562            *
57563            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57564            * style callback returns `true` for elements that have a matching property
57565            * value, else `false`.
57566            *
57567            * If an object is provided for `iteratee` the created `_.matches` style
57568            * callback returns `true` for elements that have the properties of the
57569            * given object, else `false`.
57570            *
57571            * @static
57572            * @memberOf _
57573            * @category Collection
57574            * @param {Array|Object|string}
57575            *            collection The collection to iterate over.
57576            * @param {Function|Object|string}
57577            *            [iteratee=_.identity] The function invoked per iteration.
57578            * @param {*}
57579            *            [thisArg] The `this` binding of `iteratee`.
57580            * @returns {Object} Returns the composed aggregate object.
57581            * @example
57582            *
57583            * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
57584            * '4': [4.2], '6': [6.1, 6.4] }
57585            *
57586            * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
57587            * '4': [4.2], '6': [6.1, 6.4] }
57588            *  // using the `_.property` callback shorthand _.groupBy(['one', 'two',
57589            * 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] }
57590            */
57591           var groupBy = createAggregator(function(result, value, key) {
57592             if (hasOwnProperty.call(result, key)) {
57593               result[key].push(value);
57594             } else {
57595               result[key] = [value];
57596             }
57597           });
57598
57599           /**
57600            * Checks if `value` is in `collection` using
57601            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
57602            * for equality comparisons. If `fromIndex` is negative, it is used as the
57603            * offset from the end of `collection`.
57604            *
57605            * @static
57606            * @memberOf _
57607            * @alias contains, include
57608            * @category Collection
57609            * @param {Array|Object|string}
57610            *            collection The collection to search.
57611            * @param {*}
57612            *            target The value to search for.
57613            * @param {number}
57614            *            [fromIndex=0] The index to search from.
57615            * @param- {Object} [guard] Enables use as a callback for functions like
57616            *         `_.reduce`.
57617            * @returns {boolean} Returns `true` if a matching element is found, else
57618            *          `false`.
57619            * @example
57620            *
57621            * _.includes([1, 2, 3], 1); // => true
57622            *
57623            * _.includes([1, 2, 3], 1, 2); // => false
57624            *
57625            * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); // => true
57626            *
57627            * _.includes('pebbles', 'eb'); // => true
57628            */
57629           function includes(collection, target, fromIndex, guard) {
57630             var length = collection ? getLength(collection) : 0;
57631             if (!isLength(length)) {
57632               collection = values(collection);
57633               length = collection.length;
57634             }
57635             if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
57636               fromIndex = 0;
57637             } else {
57638               fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
57639             }
57640             return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) : (!!length && getIndexOf(collection, target, fromIndex) > -1);
57641           }
57642
57643           /**
57644            * Creates an object composed of keys generated from the results of running
57645            * each element of `collection` through `iteratee`. The corresponding value
57646            * of each key is the last element responsible for generating the key. The
57647            * iteratee function is bound to `thisArg` and invoked with three arguments:
57648            * (value, index|key, collection).
57649            *
57650            * If a property name is provided for `iteratee` the created `_.property`
57651            * style callback returns the property value of the given element.
57652            *
57653            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57654            * style callback returns `true` for elements that have a matching property
57655            * value, else `false`.
57656            *
57657            * If an object is provided for `iteratee` the created `_.matches` style
57658            * callback returns `true` for elements that have the properties of the
57659            * given object, else `false`.
57660            *
57661            * @static
57662            * @memberOf _
57663            * @category Collection
57664            * @param {Array|Object|string}
57665            *            collection The collection to iterate over.
57666            * @param {Function|Object|string}
57667            *            [iteratee=_.identity] The function invoked per iteration.
57668            * @param {*}
57669            *            [thisArg] The `this` binding of `iteratee`.
57670            * @returns {Object} Returns the composed aggregate object.
57671            * @example
57672            *
57673            * var keyData = [ { 'dir': 'left', 'code': 97 }, { 'dir': 'right', 'code':
57674            * 100 } ];
57675            *
57676            * _.indexBy(keyData, 'dir'); // => { 'left': { 'dir': 'left', 'code': 97 },
57677            * 'right': { 'dir': 'right', 'code': 100 } }
57678            *
57679            * _.indexBy(keyData, function(object) { return
57680            * String.fromCharCode(object.code); }); // => { 'a': { 'dir': 'left',
57681            * 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
57682            *
57683            * _.indexBy(keyData, function(object) { return
57684            * this.fromCharCode(object.code); }, String); // => { 'a': { 'dir': 'left',
57685            * 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
57686            */
57687           var indexBy = createAggregator(function(result, value, key) {
57688             result[key] = value;
57689           });
57690
57691           /**
57692            * Invokes the method at `path` of each element in `collection`, returning
57693            * an array of the results of each invoked method. Any additional arguments
57694            * are provided to each invoked method. If `methodName` is a function it is
57695            * invoked for, and `this` bound to, each element in `collection`.
57696            *
57697            * @static
57698            * @memberOf _
57699            * @category Collection
57700            * @param {Array|Object|string}
57701            *            collection The collection to iterate over.
57702            * @param {Array|Function|string}
57703            *            path The path of the method to invoke or the function invoked
57704            *            per iteration.
57705            * @param {...*}
57706            *            [args] The arguments to invoke the method with.
57707            * @returns {Array} Returns the array of results.
57708            * @example
57709            *
57710            * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); // => [[1, 5, 7], [1, 2, 3]]
57711            *
57712            * _.invoke([123, 456], String.prototype.split, ''); // => [['1', '2', '3'],
57713            * ['4', '5', '6']]
57714            */
57715           var invoke = restParam(function(collection, path, args) {
57716             var index = -1,
57717               isFunc = typeof path == 'function',
57718               isProp = isKey(path),
57719               result = isArrayLike(collection) ? Array(collection.length) : [];
57720
57721             baseEach(collection, function(value) {
57722               var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
57723               result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
57724             });
57725             return result;
57726           });
57727
57728           /**
57729            * Creates an array of values by running each element in `collection`
57730            * through `iteratee`. The `iteratee` is bound to `thisArg` and invoked with
57731            * three arguments: (value, index|key, collection).
57732            *
57733            * If a property name is provided for `iteratee` the created `_.property`
57734            * style callback returns the property value of the given element.
57735            *
57736            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57737            * style callback returns `true` for elements that have a matching property
57738            * value, else `false`.
57739            *
57740            * If an object is provided for `iteratee` the created `_.matches` style
57741            * callback returns `true` for elements that have the properties of the
57742            * given object, else `false`.
57743            *
57744            * Many lodash methods are guarded to work as iteratees for methods like
57745            * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
57746            *
57747            * The guarded methods are: `ary`, `callback`, `chunk`, `clone`, `create`,
57748            * `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `flatten`,
57749            * `invert`, `max`, `min`, `parseInt`, `slice`, `sortBy`, `take`,
57750            * `takeRight`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
57751            * `random`, `range`, `sample`, `some`, `sum`, `uniq`, and `words`
57752            *
57753            * @static
57754            * @memberOf _
57755            * @alias collect
57756            * @category Collection
57757            * @param {Array|Object|string}
57758            *            collection The collection to iterate over.
57759            * @param {Function|Object|string}
57760            *            [iteratee=_.identity] The function invoked per iteration.
57761            * @param {*}
57762            *            [thisArg] The `this` binding of `iteratee`.
57763            * @returns {Array} Returns the new mapped array.
57764            * @example
57765            *
57766            * function timesThree(n) { return n * 3; }
57767            *
57768            * _.map([1, 2], timesThree); // => [3, 6]
57769            *
57770            * _.map({ 'a': 1, 'b': 2 }, timesThree); // => [3, 6] (iteration order is
57771            * not guaranteed)
57772            *
57773            * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
57774            *  // using the `_.property` callback shorthand _.map(users, 'user'); // =>
57775            * ['barney', 'fred']
57776            */
57777           function map(collection, iteratee, thisArg) {
57778             var func = isArray(collection) ? arrayMap : baseMap;
57779             iteratee = getCallback(iteratee, thisArg, 3);
57780             return func(collection, iteratee);
57781           }
57782
57783           /**
57784            * Creates an array of elements split into two groups, the first of which
57785            * contains elements `predicate` returns truthy for, while the second of
57786            * which contains elements `predicate` returns falsey for. The predicate is
57787            * bound to `thisArg` and invoked with three arguments: (value, index|key,
57788            * collection).
57789            *
57790            * If a property name is provided for `predicate` the created `_.property`
57791            * style callback returns the property value of the given element.
57792            *
57793            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57794            * style callback returns `true` for elements that have a matching property
57795            * value, else `false`.
57796            *
57797            * If an object is provided for `predicate` the created `_.matches` style
57798            * callback returns `true` for elements that have the properties of the
57799            * given object, else `false`.
57800            *
57801            * @static
57802            * @memberOf _
57803            * @category Collection
57804            * @param {Array|Object|string}
57805            *            collection The collection to iterate over.
57806            * @param {Function|Object|string}
57807            *            [predicate=_.identity] The function invoked per iteration.
57808            * @param {*}
57809            *            [thisArg] The `this` binding of `predicate`.
57810            * @returns {Array} Returns the array of grouped elements.
57811            * @example
57812            *
57813            * _.partition([1, 2, 3], function(n) { return n % 2; }); // => [[1, 3],
57814            * [2]]
57815            *
57816            * _.partition([1.2, 2.3, 3.4], function(n) { return this.floor(n) % 2; },
57817            * Math); // => [[1.2, 3.4], [2.3]]
57818            *
57819            * var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user':
57820            * 'fred', 'age': 40, 'active': true }, { 'user': 'pebbles', 'age': 1,
57821            * 'active': false } ];
57822            *
57823            * var mapper = function(array) { return _.pluck(array, 'user'); };
57824            *  // using the `_.matches` callback shorthand _.map(_.partition(users, {
57825            * 'age': 1, 'active': false }), mapper); // => [['pebbles'], ['barney',
57826            * 'fred']]
57827            *  // using the `_.matchesProperty` callback shorthand
57828            * _.map(_.partition(users, 'active', false), mapper); // => [['barney',
57829            * 'pebbles'], ['fred']]
57830            *  // using the `_.property` callback shorthand _.map(_.partition(users,
57831            * 'active'), mapper); // => [['fred'], ['barney', 'pebbles']]
57832            */
57833           var partition = createAggregator(function(result, value, key) {
57834             result[key ? 0 : 1].push(value);
57835           }, function() {
57836             return [
57837               [],
57838               []
57839             ];
57840           });
57841
57842           /**
57843            * Gets the property value of `path` from all elements in `collection`.
57844            *
57845            * @static
57846            * @memberOf _
57847            * @category Collection
57848            * @param {Array|Object|string}
57849            *            collection The collection to iterate over.
57850            * @param {Array|string}
57851            *            path The path of the property to pluck.
57852            * @returns {Array} Returns the property values.
57853            * @example
57854            *
57855            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57856            * 40 } ];
57857            *
57858            * _.pluck(users, 'user'); // => ['barney', 'fred']
57859            *
57860            * var userIndex = _.indexBy(users, 'user'); _.pluck(userIndex, 'age'); // =>
57861            * [36, 40] (iteration order is not guaranteed)
57862            */
57863           function pluck(collection, path) {
57864             return map(collection, property(path));
57865           }
57866
57867           /**
57868            * Reduces `collection` to a value which is the accumulated result of
57869            * running each element in `collection` through `iteratee`, where each
57870            * successive invocation is supplied the return value of the previous. If
57871            * `accumulator` is not provided the first element of `collection` is used
57872            * as the initial value. The `iteratee` is bound to `thisArg` and invoked
57873            * with four arguments: (accumulator, value, index|key, collection).
57874            *
57875            * Many lodash methods are guarded to work as iteratees for methods like
57876            * `_.reduce`, `_.reduceRight`, and `_.transform`.
57877            *
57878            * The guarded methods are: `assign`, `defaults`, `defaultsDeep`,
57879            * `includes`, `merge`, `sortByAll`, and `sortByOrder`
57880            *
57881            * @static
57882            * @memberOf _
57883            * @alias foldl, inject
57884            * @category Collection
57885            * @param {Array|Object|string}
57886            *            collection The collection to iterate over.
57887            * @param {Function}
57888            *            [iteratee=_.identity] The function invoked per iteration.
57889            * @param {*}
57890            *            [accumulator] The initial value.
57891            * @param {*}
57892            *            [thisArg] The `this` binding of `iteratee`.
57893            * @returns {*} Returns the accumulated value.
57894            * @example
57895            *
57896            * _.reduce([1, 2], function(total, n) { return total + n; }); // => 3
57897            *
57898            * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] = n *
57899            * 3; return result; }, {}); // => { 'a': 3, 'b': 6 } (iteration order is
57900            * not guaranteed)
57901            */
57902           var reduce = createReduce(arrayReduce, baseEach);
57903
57904           /**
57905            * This method is like `_.reduce` except that it iterates over elements of
57906            * `collection` from right to left.
57907            *
57908            * @static
57909            * @memberOf _
57910            * @alias foldr
57911            * @category Collection
57912            * @param {Array|Object|string}
57913            *            collection The collection to iterate over.
57914            * @param {Function}
57915            *            [iteratee=_.identity] The function invoked per iteration.
57916            * @param {*}
57917            *            [accumulator] The initial value.
57918            * @param {*}
57919            *            [thisArg] The `this` binding of `iteratee`.
57920            * @returns {*} Returns the accumulated value.
57921            * @example
57922            *
57923            * var array = [[0, 1], [2, 3], [4, 5]];
57924            *
57925            * _.reduceRight(array, function(flattened, other) { return
57926            * flattened.concat(other); }, []); // => [4, 5, 2, 3, 0, 1]
57927            */
57928           var reduceRight = createReduce(arrayReduceRight, baseEachRight);
57929
57930           /**
57931            * The opposite of `_.filter`; this method returns the elements of
57932            * `collection` that `predicate` does **not** return truthy for.
57933            *
57934            * @static
57935            * @memberOf _
57936            * @category Collection
57937            * @param {Array|Object|string}
57938            *            collection The collection to iterate over.
57939            * @param {Function|Object|string}
57940            *            [predicate=_.identity] The function invoked per iteration.
57941            * @param {*}
57942            *            [thisArg] The `this` binding of `predicate`.
57943            * @returns {Array} Returns the new filtered array.
57944            * @example
57945            *
57946            * _.reject([1, 2, 3, 4], function(n) { return n % 2 == 0; }); // => [1, 3]
57947            *
57948            * var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user':
57949            * 'fred', 'age': 40, 'active': true } ];
57950            *  // using the `_.matches` callback shorthand _.pluck(_.reject(users, {
57951            * 'age': 40, 'active': true }), 'user'); // => ['barney']
57952            *  // using the `_.matchesProperty` callback shorthand
57953            * _.pluck(_.reject(users, 'active', false), 'user'); // => ['fred']
57954            *  // using the `_.property` callback shorthand _.pluck(_.reject(users,
57955            * 'active'), 'user'); // => ['barney']
57956            */
57957           function reject(collection, predicate, thisArg) {
57958             var func = isArray(collection) ? arrayFilter : baseFilter;
57959             predicate = getCallback(predicate, thisArg, 3);
57960             return func(collection, function(value, index, collection) {
57961               return !predicate(value, index, collection);
57962             });
57963           }
57964
57965           /**
57966            * Gets a random element or `n` random elements from a collection.
57967            *
57968            * @static
57969            * @memberOf _
57970            * @category Collection
57971            * @param {Array|Object|string}
57972            *            collection The collection to sample.
57973            * @param {number}
57974            *            [n] The number of elements to sample.
57975            * @param- {Object} [guard] Enables use as a callback for functions like
57976            *         `_.map`.
57977            * @returns {*} Returns the random sample(s).
57978            * @example
57979            *
57980            * _.sample([1, 2, 3, 4]); // => 2
57981            *
57982            * _.sample([1, 2, 3, 4], 2); // => [3, 1]
57983            */
57984           function sample(collection, n, guard) {
57985             if (guard ? isIterateeCall(collection, n, guard) : n == null) {
57986               collection = toIterable(collection);
57987               var length = collection.length;
57988               return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
57989             }
57990             var index = -1,
57991               result = toArray(collection),
57992               length = result.length,
57993               lastIndex = length - 1;
57994
57995             n = nativeMin(n < 0 ? 0 : (+n || 0), length);
57996             while (++index < n) {
57997               var rand = baseRandom(index, lastIndex),
57998                 value = result[rand];
57999
58000               result[rand] = result[index];
58001               result[index] = value;
58002             }
58003             result.length = n;
58004             return result;
58005           }
58006
58007           /**
58008            * Creates an array of shuffled values, using a version of the [Fisher-Yates
58009            * shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
58010            *
58011            * @static
58012            * @memberOf _
58013            * @category Collection
58014            * @param {Array|Object|string}
58015            *            collection The collection to shuffle.
58016            * @returns {Array} Returns the new shuffled array.
58017            * @example
58018            *
58019            * _.shuffle([1, 2, 3, 4]); // => [4, 1, 3, 2]
58020            */
58021           function shuffle(collection) {
58022             return sample(collection, POSITIVE_INFINITY);
58023           }
58024
58025           /**
58026            * Gets the size of `collection` by returning its length for array-like
58027            * values or the number of own enumerable properties for objects.
58028            *
58029            * @static
58030            * @memberOf _
58031            * @category Collection
58032            * @param {Array|Object|string}
58033            *            collection The collection to inspect.
58034            * @returns {number} Returns the size of `collection`.
58035            * @example
58036            *
58037            * _.size([1, 2, 3]); // => 3
58038            *
58039            * _.size({ 'a': 1, 'b': 2 }); // => 2
58040            *
58041            * _.size('pebbles'); // => 7
58042            */
58043           function size(collection) {
58044             var length = collection ? getLength(collection) : 0;
58045             return isLength(length) ? length : keys(collection).length;
58046           }
58047
58048           /**
58049            * Checks if `predicate` returns truthy for **any** element of `collection`.
58050            * The function returns as soon as it finds a passing value and does not
58051            * iterate over the entire collection. The predicate is bound to `thisArg`
58052            * and invoked with three arguments: (value, index|key, collection).
58053            *
58054            * If a property name is provided for `predicate` the created `_.property`
58055            * style callback returns the property value of the given element.
58056            *
58057            * If a value is also provided for `thisArg` the created `_.matchesProperty`
58058            * style callback returns `true` for elements that have a matching property
58059            * value, else `false`.
58060            *
58061            * If an object is provided for `predicate` the created `_.matches` style
58062            * callback returns `true` for elements that have the properties of the
58063            * given object, else `false`.
58064            *
58065            * @static
58066            * @memberOf _
58067            * @alias any
58068            * @category Collection
58069            * @param {Array|Object|string}
58070            *            collection The collection to iterate over.
58071            * @param {Function|Object|string}
58072            *            [predicate=_.identity] The function invoked per iteration.
58073            * @param {*}
58074            *            [thisArg] The `this` binding of `predicate`.
58075            * @returns {boolean} Returns `true` if any element passes the predicate
58076            *          check, else `false`.
58077            * @example
58078            *
58079            * _.some([null, 0, 'yes', false], Boolean); // => true
58080            *
58081            * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
58082            * 'active': false } ];
58083            *  // using the `_.matches` callback shorthand _.some(users, { 'user':
58084            * 'barney', 'active': false }); // => false
58085            *  // using the `_.matchesProperty` callback shorthand _.some(users,
58086            * 'active', false); // => true
58087            *  // using the `_.property` callback shorthand _.some(users, 'active'); // =>
58088            * true
58089            */
58090           function some(collection, predicate, thisArg) {
58091             var func = isArray(collection) ? arraySome : baseSome;
58092             if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
58093               predicate = undefined;
58094             }
58095             if (typeof predicate != 'function' || thisArg !== undefined) {
58096               predicate = getCallback(predicate, thisArg, 3);
58097             }
58098             return func(collection, predicate);
58099           }
58100
58101           /**
58102            * Creates an array of elements, sorted in ascending order by the results of
58103            * running each element in a collection through `iteratee`. This method
58104            * performs a stable sort, that is, it preserves the original sort order of
58105            * equal elements. The `iteratee` is bound to `thisArg` and invoked with
58106            * three arguments: (value, index|key, collection).
58107            *
58108            * If a property name is provided for `iteratee` the created `_.property`
58109            * style callback returns the property value of the given element.
58110            *
58111            * If a value is also provided for `thisArg` the created `_.matchesProperty`
58112            * style callback returns `true` for elements that have a matching property
58113            * value, else `false`.
58114            *
58115            * If an object is provided for `iteratee` the created `_.matches` style
58116            * callback returns `true` for elements that have the properties of the
58117            * given object, else `false`.
58118            *
58119            * @static
58120            * @memberOf _
58121            * @category Collection
58122            * @param {Array|Object|string}
58123            *            collection The collection to iterate over.
58124            * @param {Function|Object|string}
58125            *            [iteratee=_.identity] The function invoked per iteration.
58126            * @param {*}
58127            *            [thisArg] The `this` binding of `iteratee`.
58128            * @returns {Array} Returns the new sorted array.
58129            * @example
58130            *
58131            * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); // => [3, 1, 2]
58132            *
58133            * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); // => [3,
58134            * 1, 2]
58135            *
58136            * var users = [ { 'user': 'fred' }, { 'user': 'pebbles' }, { 'user':
58137            * 'barney' } ];
58138            *  // using the `_.property` callback shorthand _.pluck(_.sortBy(users,
58139            * 'user'), 'user'); // => ['barney', 'fred', 'pebbles']
58140            */
58141           function sortBy(collection, iteratee, thisArg) {
58142             if (collection == null) {
58143               return [];
58144             }
58145             if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
58146               iteratee = undefined;
58147             }
58148             var index = -1;
58149             iteratee = getCallback(iteratee, thisArg, 3);
58150
58151             var result = baseMap(collection, function(value, key, collection) {
58152               return {
58153                 'criteria': iteratee(value, key, collection),
58154                 'index': ++index,
58155                 'value': value
58156               };
58157             });
58158             return baseSortBy(result, compareAscending);
58159           }
58160
58161           /**
58162            * This method is like `_.sortBy` except that it can sort by multiple
58163            * iteratees or property names.
58164            *
58165            * If a property name is provided for an iteratee the created `_.property`
58166            * style callback returns the property value of the given element.
58167            *
58168            * If an object is provided for an iteratee the created `_.matches` style
58169            * callback returns `true` for elements that have the properties of the
58170            * given object, else `false`.
58171            *
58172            * @static
58173            * @memberOf _
58174            * @category Collection
58175            * @param {Array|Object|string}
58176            *            collection The collection to iterate over.
58177            * @param {...(Function|Function[]|Object|Object[]|string|string[])}
58178            *            iteratees The iteratees to sort by, specified as individual
58179            *            values or arrays of values.
58180            * @returns {Array} Returns the new sorted array.
58181            * @example
58182            *
58183            * var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age':
58184            * 36 }, { 'user': 'fred', 'age': 42 }, { 'user': 'barney', 'age': 34 } ];
58185            *
58186            * _.map(_.sortByAll(users, ['user', 'age']), _.values); // => [['barney',
58187            * 34], ['barney', 36], ['fred', 42], ['fred', 48]]
58188            *
58189            * _.map(_.sortByAll(users, 'user', function(chr) { return
58190            * Math.floor(chr.age / 10); }), _.values); // => [['barney', 36],
58191            * ['barney', 34], ['fred', 48], ['fred', 42]]
58192            */
58193           var sortByAll = restParam(function(collection, iteratees) {
58194             if (collection == null) {
58195               return [];
58196             }
58197             var guard = iteratees[2];
58198             if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
58199               iteratees.length = 1;
58200             }
58201             return baseSortByOrder(collection, baseFlatten(iteratees), []);
58202           });
58203
58204           /**
58205            * This method is like `_.sortByAll` except that it allows specifying the
58206            * sort orders of the iteratees to sort by. If `orders` is unspecified, all
58207            * values are sorted in ascending order. Otherwise, a value is sorted in
58208            * ascending order if its corresponding order is "asc", and descending if
58209            * "desc".
58210            *
58211            * If a property name is provided for an iteratee the created `_.property`
58212            * style callback returns the property value of the given element.
58213            *
58214            * If an object is provided for an iteratee the created `_.matches` style
58215            * callback returns `true` for elements that have the properties of the
58216            * given object, else `false`.
58217            *
58218            * @static
58219            * @memberOf _
58220            * @category Collection
58221            * @param {Array|Object|string}
58222            *            collection The collection to iterate over.
58223            * @param {Function[]|Object[]|string[]}
58224            *            iteratees The iteratees to sort by.
58225            * @param {boolean[]}
58226            *            [orders] The sort orders of `iteratees`.
58227            * @param- {Object} [guard] Enables use as a callback for functions like
58228            *         `_.reduce`.
58229            * @returns {Array} Returns the new sorted array.
58230            * @example
58231            *
58232            * var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age':
58233            * 34 }, { 'user': 'fred', 'age': 42 }, { 'user': 'barney', 'age': 36 } ];
58234            *  // sort by `user` in ascending order and by `age` in descending order
58235            * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values); // =>
58236            * [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
58237            */
58238           function sortByOrder(collection, iteratees, orders, guard) {
58239             if (collection == null) {
58240               return [];
58241             }
58242             if (guard && isIterateeCall(iteratees, orders, guard)) {
58243               orders = undefined;
58244             }
58245             if (!isArray(iteratees)) {
58246               iteratees = iteratees == null ? [] : [iteratees];
58247             }
58248             if (!isArray(orders)) {
58249               orders = orders == null ? [] : [orders];
58250             }
58251             return baseSortByOrder(collection, iteratees, orders);
58252           }
58253
58254           /**
58255            * Performs a deep comparison between each element in `collection` and the
58256            * source object, returning an array of all elements that have equivalent
58257            * property values.
58258            *
58259            * **Note:** This method supports comparing arrays, booleans, `Date`
58260            * objects, numbers, `Object` objects, regexes, and strings. Objects are
58261            * compared by their own, not inherited, enumerable properties. For
58262            * comparing a single own or inherited property value see
58263            * `_.matchesProperty`.
58264            *
58265            * @static
58266            * @memberOf _
58267            * @category Collection
58268            * @param {Array|Object|string}
58269            *            collection The collection to search.
58270            * @param {Object}
58271            *            source The object of property values to match.
58272            * @returns {Array} Returns the new filtered array.
58273            * @example
58274            *
58275            * var users = [ { 'user': 'barney', 'age': 36, 'active': false, 'pets':
58276            * ['hoppy'] }, { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby
58277            * puss', 'dino'] } ];
58278            *
58279            * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); // =>
58280            * ['barney']
58281            *
58282            * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); // => ['fred']
58283            */
58284           function where(collection, source) {
58285             return filter(collection, baseMatches(source));
58286           }
58287
58288           /*------------------------------------------------------------------------*/
58289
58290           /**
58291            * Gets the number of milliseconds that have elapsed since the Unix epoch (1
58292            * January 1970 00:00:00 UTC).
58293            *
58294            * @static
58295            * @memberOf _
58296            * @category Date
58297            * @example
58298            *
58299            * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // =>
58300            * logs the number of milliseconds it took for the deferred function to be
58301            * invoked
58302            */
58303           var now = nativeNow || function() {
58304             return new Date().getTime();
58305           };
58306
58307           /*------------------------------------------------------------------------*/
58308
58309           /**
58310            * The opposite of `_.before`; this method creates a function that invokes
58311            * `func` once it is called `n` or more times.
58312            *
58313            * @static
58314            * @memberOf _
58315            * @category Function
58316            * @param {number}
58317            *            n The number of calls before `func` is invoked.
58318            * @param {Function}
58319            *            func The function to restrict.
58320            * @returns {Function} Returns the new restricted function.
58321            * @example
58322            *
58323            * var saves = ['profile', 'settings'];
58324            *
58325            * var done = _.after(saves.length, function() { console.log('done
58326            * saving!'); });
58327            *
58328            * _.forEach(saves, function(type) { asyncSave({ 'type': type, 'complete':
58329            * done }); }); // => logs 'done saving!' after the two async saves have
58330            * completed
58331            */
58332           function after(n, func) {
58333             if (typeof func != 'function') {
58334               if (typeof n == 'function') {
58335                 var temp = n;
58336                 n = func;
58337                 func = temp;
58338               } else {
58339                 throw new TypeError(FUNC_ERROR_TEXT);
58340               }
58341             }
58342             n = nativeIsFinite(n = +n) ? n : 0;
58343             return function() {
58344               if (--n < 1) {
58345                 return func.apply(this, arguments);
58346               }
58347             };
58348           }
58349
58350           /**
58351            * Creates a function that accepts up to `n` arguments ignoring any
58352            * additional arguments.
58353            *
58354            * @static
58355            * @memberOf _
58356            * @category Function
58357            * @param {Function}
58358            *            func The function to cap arguments for.
58359            * @param {number}
58360            *            [n=func.length] The arity cap.
58361            * @param- {Object} [guard] Enables use as a callback for functions like
58362            *         `_.map`.
58363            * @returns {Function} Returns the new function.
58364            * @example
58365            *
58366            * _.map(['6', '8', '10'], _.ary(parseInt, 1)); // => [6, 8, 10]
58367            */
58368           function ary(func, n, guard) {
58369             if (guard && isIterateeCall(func, n, guard)) {
58370               n = undefined;
58371             }
58372             n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
58373             return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
58374           }
58375
58376           /**
58377            * Creates a function that invokes `func`, with the `this` binding and
58378            * arguments of the created function, while it is called less than `n`
58379            * times. Subsequent calls to the created function return the result of the
58380            * last `func` invocation.
58381            *
58382            * @static
58383            * @memberOf _
58384            * @category Function
58385            * @param {number}
58386            *            n The number of calls at which `func` is no longer invoked.
58387            * @param {Function}
58388            *            func The function to restrict.
58389            * @returns {Function} Returns the new restricted function.
58390            * @example
58391            *
58392            * jQuery('#add').on('click', _.before(5, addContactToList)); // => allows
58393            * adding up to 4 contacts to the list
58394            */
58395           function before(n, func) {
58396             var result;
58397             if (typeof func != 'function') {
58398               if (typeof n == 'function') {
58399                 var temp = n;
58400                 n = func;
58401                 func = temp;
58402               } else {
58403                 throw new TypeError(FUNC_ERROR_TEXT);
58404               }
58405             }
58406             return function() {
58407               if (--n > 0) {
58408                 result = func.apply(this, arguments);
58409               }
58410               if (n <= 1) {
58411                 func = undefined;
58412               }
58413               return result;
58414             };
58415           }
58416
58417           /**
58418            * Creates a function that invokes `func` with the `this` binding of
58419            * `thisArg` and prepends any additional `_.bind` arguments to those
58420            * provided to the bound function.
58421            *
58422            * The `_.bind.placeholder` value, which defaults to `_` in monolithic
58423            * builds, may be used as a placeholder for partially applied arguments.
58424            *
58425            * **Note:** Unlike native `Function#bind` this method does not set the
58426            * "length" property of bound functions.
58427            *
58428            * @static
58429            * @memberOf _
58430            * @category Function
58431            * @param {Function}
58432            *            func The function to bind.
58433            * @param {*}
58434            *            thisArg The `this` binding of `func`.
58435            * @param {...*}
58436            *            [partials] The arguments to be partially applied.
58437            * @returns {Function} Returns the new bound function.
58438            * @example
58439            *
58440            * var greet = function(greeting, punctuation) { return greeting + ' ' +
58441            * this.user + punctuation; };
58442            *
58443            * var object = { 'user': 'fred' };
58444            *
58445            * var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!'
58446            *  // using placeholders var bound = _.bind(greet, object, _, '!');
58447            * bound('hi'); // => 'hi fred!'
58448            */
58449           var bind = restParam(function(func, thisArg, partials) {
58450             var bitmask = BIND_FLAG;
58451             if (partials.length) {
58452               var holders = replaceHolders(partials, bind.placeholder);
58453               bitmask |= PARTIAL_FLAG;
58454             }
58455             return createWrapper(func, bitmask, thisArg, partials, holders);
58456           });
58457
58458           /**
58459            * Binds methods of an object to the object itself, overwriting the existing
58460            * method. Method names may be specified as individual arguments or as
58461            * arrays of method names. If no method names are provided all enumerable
58462            * function properties, own and inherited, of `object` are bound.
58463            *
58464            * **Note:** This method does not set the "length" property of bound
58465            * functions.
58466            *
58467            * @static
58468            * @memberOf _
58469            * @category Function
58470            * @param {Object}
58471            *            object The object to bind and assign the bound methods to.
58472            * @param {...(string|string[])}
58473            *            [methodNames] The object method names to bind, specified as
58474            *            individual method names or arrays of method names.
58475            * @returns {Object} Returns `object`.
58476            * @example
58477            *
58478            * var view = { 'label': 'docs', 'onClick': function() {
58479            * console.log('clicked ' + this.label); } };
58480            *
58481            * _.bindAll(view); jQuery('#docs').on('click', view.onClick); // => logs
58482            * 'clicked docs' when the element is clicked
58483            */
58484           var bindAll = restParam(function(object, methodNames) {
58485             methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
58486
58487             var index = -1,
58488               length = methodNames.length;
58489
58490             while (++index < length) {
58491               var key = methodNames[index];
58492               object[key] = createWrapper(object[key], BIND_FLAG, object);
58493             }
58494             return object;
58495           });
58496
58497           /**
58498            * Creates a function that invokes the method at `object[key]` and prepends
58499            * any additional `_.bindKey` arguments to those provided to the bound
58500            * function.
58501            *
58502            * This method differs from `_.bind` by allowing bound functions to
58503            * reference methods that may be redefined or don't yet exist. See [Peter
58504            * Michaux's
58505            * article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
58506            * for more details.
58507            *
58508            * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
58509            * builds, may be used as a placeholder for partially applied arguments.
58510            *
58511            * @static
58512            * @memberOf _
58513            * @category Function
58514            * @param {Object}
58515            *            object The object the method belongs to.
58516            * @param {string}
58517            *            key The key of the method.
58518            * @param {...*}
58519            *            [partials] The arguments to be partially applied.
58520            * @returns {Function} Returns the new bound function.
58521            * @example
58522            *
58523            * var object = { 'user': 'fred', 'greet': function(greeting, punctuation) {
58524            * return greeting + ' ' + this.user + punctuation; } };
58525            *
58526            * var bound = _.bindKey(object, 'greet', 'hi'); bound('!'); // => 'hi
58527            * fred!'
58528            *
58529            * object.greet = function(greeting, punctuation) { return greeting + 'ya ' +
58530            * this.user + punctuation; };
58531            *
58532            * bound('!'); // => 'hiya fred!'
58533            *  // using placeholders var bound = _.bindKey(object, 'greet', _, '!');
58534            * bound('hi'); // => 'hiya fred!'
58535            */
58536           var bindKey = restParam(function(object, key, partials) {
58537             var bitmask = BIND_FLAG | BIND_KEY_FLAG;
58538             if (partials.length) {
58539               var holders = replaceHolders(partials, bindKey.placeholder);
58540               bitmask |= PARTIAL_FLAG;
58541             }
58542             return createWrapper(key, bitmask, object, partials, holders);
58543           });
58544
58545           /**
58546            * Creates a function that accepts one or more arguments of `func` that when
58547            * called either invokes `func` returning its result, if all `func`
58548            * arguments have been provided, or returns a function that accepts one or
58549            * more of the remaining `func` arguments, and so on. The arity of `func`
58550            * may be specified if `func.length` is not sufficient.
58551            *
58552            * The `_.curry.placeholder` value, which defaults to `_` in monolithic
58553            * builds, may be used as a placeholder for provided arguments.
58554            *
58555            * **Note:** This method does not set the "length" property of curried
58556            * functions.
58557            *
58558            * @static
58559            * @memberOf _
58560            * @category Function
58561            * @param {Function}
58562            *            func The function to curry.
58563            * @param {number}
58564            *            [arity=func.length] The arity of `func`.
58565            * @param- {Object} [guard] Enables use as a callback for functions like
58566            *         `_.map`.
58567            * @returns {Function} Returns the new curried function.
58568            * @example
58569            *
58570            * var abc = function(a, b, c) { return [a, b, c]; };
58571            *
58572            * var curried = _.curry(abc);
58573            *
58574            * curried(1)(2)(3); // => [1, 2, 3]
58575            *
58576            * curried(1, 2)(3); // => [1, 2, 3]
58577            *
58578            * curried(1, 2, 3); // => [1, 2, 3]
58579            *  // using placeholders curried(1)(_, 3)(2); // => [1, 2, 3]
58580            */
58581           var curry = createCurry(CURRY_FLAG);
58582
58583           /**
58584            * This method is like `_.curry` except that arguments are applied to `func`
58585            * in the manner of `_.partialRight` instead of `_.partial`.
58586            *
58587            * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
58588            * builds, may be used as a placeholder for provided arguments.
58589            *
58590            * **Note:** This method does not set the "length" property of curried
58591            * functions.
58592            *
58593            * @static
58594            * @memberOf _
58595            * @category Function
58596            * @param {Function}
58597            *            func The function to curry.
58598            * @param {number}
58599            *            [arity=func.length] The arity of `func`.
58600            * @param- {Object} [guard] Enables use as a callback for functions like
58601            *         `_.map`.
58602            * @returns {Function} Returns the new curried function.
58603            * @example
58604            *
58605            * var abc = function(a, b, c) { return [a, b, c]; };
58606            *
58607            * var curried = _.curryRight(abc);
58608            *
58609            * curried(3)(2)(1); // => [1, 2, 3]
58610            *
58611            * curried(2, 3)(1); // => [1, 2, 3]
58612            *
58613            * curried(1, 2, 3); // => [1, 2, 3]
58614            *  // using placeholders curried(3)(1, _)(2); // => [1, 2, 3]
58615            */
58616           var curryRight = createCurry(CURRY_RIGHT_FLAG);
58617
58618           /**
58619            * Creates a debounced function that delays invoking `func` until after
58620            * `wait` milliseconds have elapsed since the last time the debounced
58621            * function was invoked. The debounced function comes with a `cancel` method
58622            * to cancel delayed invocations. Provide an options object to indicate that
58623            * `func` should be invoked on the leading and/or trailing edge of the
58624            * `wait` timeout. Subsequent calls to the debounced function return the
58625            * result of the last `func` invocation.
58626            *
58627            * **Note:** If `leading` and `trailing` options are `true`, `func` is
58628            * invoked on the trailing edge of the timeout only if the the debounced
58629            * function is invoked more than once during the `wait` timeout.
58630            *
58631            * See [David Corbacho's
58632            * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
58633            * for details over the differences between `_.debounce` and `_.throttle`.
58634            *
58635            * @static
58636            * @memberOf _
58637            * @category Function
58638            * @param {Function}
58639            *            func The function to debounce.
58640            * @param {number}
58641            *            [wait=0] The number of milliseconds to delay.
58642            * @param {Object}
58643            *            [options] The options object.
58644            * @param {boolean}
58645            *            [options.leading=false] Specify invoking on the leading edge
58646            *            of the timeout.
58647            * @param {number}
58648            *            [options.maxWait] The maximum time `func` is allowed to be
58649            *            delayed before it is invoked.
58650            * @param {boolean}
58651            *            [options.trailing=true] Specify invoking on the trailing edge
58652            *            of the timeout.
58653            * @returns {Function} Returns the new debounced function.
58654            * @example
58655            *  // avoid costly calculations while the window size is in flux
58656            * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
58657            *  // invoke `sendMail` when the click event is fired, debouncing
58658            * subsequent calls jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
58659            * 'leading': true, 'trailing': false }));
58660            *  // ensure `batchLog` is invoked once after 1 second of debounced calls
58661            * var source = new EventSource('/stream'); jQuery(source).on('message',
58662            * _.debounce(batchLog, 250, { 'maxWait': 1000 }));
58663            *  // cancel a debounced call var todoChanges = _.debounce(batchLog, 1000);
58664            * Object.observe(models.todo, todoChanges);
58665            *
58666            * Object.observe(models, function(changes) { if (_.find(changes, { 'user':
58667            * 'todo', 'type': 'delete'})) { todoChanges.cancel(); } }, ['delete']);
58668            *  // ...at some point `models.todo` is changed models.todo.completed =
58669            * true;
58670            *  // ...before 1 second has passed `models.todo` is deleted // which
58671            * cancels the debounced `todoChanges` call delete models.todo;
58672            */
58673           function debounce(func, wait, options) {
58674             var args,
58675               maxTimeoutId,
58676               result,
58677               stamp,
58678               thisArg,
58679               timeoutId,
58680               trailingCall,
58681               lastCalled = 0,
58682               maxWait = false,
58683               trailing = true;
58684
58685             if (typeof func != 'function') {
58686               throw new TypeError(FUNC_ERROR_TEXT);
58687             }
58688             wait = wait < 0 ? 0 : (+wait || 0);
58689             if (options === true) {
58690               var leading = true;
58691               trailing = false;
58692             } else if (isObject(options)) {
58693               leading = !!options.leading;
58694               maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
58695               trailing = 'trailing' in options ? !!options.trailing : trailing;
58696             }
58697
58698             function cancel() {
58699               if (timeoutId) {
58700                 clearTimeout(timeoutId);
58701               }
58702               if (maxTimeoutId) {
58703                 clearTimeout(maxTimeoutId);
58704               }
58705               lastCalled = 0;
58706               maxTimeoutId = timeoutId = trailingCall = undefined;
58707             }
58708
58709             function complete(isCalled, id) {
58710               if (id) {
58711                 clearTimeout(id);
58712               }
58713               maxTimeoutId = timeoutId = trailingCall = undefined;
58714               if (isCalled) {
58715                 lastCalled = now();
58716                 result = func.apply(thisArg, args);
58717                 if (!timeoutId && !maxTimeoutId) {
58718                   args = thisArg = undefined;
58719                 }
58720               }
58721             }
58722
58723             function delayed() {
58724               var remaining = wait - (now() - stamp);
58725               if (remaining <= 0 || remaining > wait) {
58726                 complete(trailingCall, maxTimeoutId);
58727               } else {
58728                 timeoutId = setTimeout(delayed, remaining);
58729               }
58730             }
58731
58732             function maxDelayed() {
58733               complete(trailing, timeoutId);
58734             }
58735
58736             function debounced() {
58737               args = arguments;
58738               stamp = now();
58739               thisArg = this;
58740               trailingCall = trailing && (timeoutId || !leading);
58741
58742               if (maxWait === false) {
58743                 var leadingCall = leading && !timeoutId;
58744               } else {
58745                 if (!maxTimeoutId && !leading) {
58746                   lastCalled = stamp;
58747                 }
58748                 var remaining = maxWait - (stamp - lastCalled),
58749                   isCalled = remaining <= 0 || remaining > maxWait;
58750
58751                 if (isCalled) {
58752                   if (maxTimeoutId) {
58753                     maxTimeoutId = clearTimeout(maxTimeoutId);
58754                   }
58755                   lastCalled = stamp;
58756                   result = func.apply(thisArg, args);
58757                 } else if (!maxTimeoutId) {
58758                   maxTimeoutId = setTimeout(maxDelayed, remaining);
58759                 }
58760               }
58761               if (isCalled && timeoutId) {
58762                 timeoutId = clearTimeout(timeoutId);
58763               } else if (!timeoutId && wait !== maxWait) {
58764                 timeoutId = setTimeout(delayed, wait);
58765               }
58766               if (leadingCall) {
58767                 isCalled = true;
58768                 result = func.apply(thisArg, args);
58769               }
58770               if (isCalled && !timeoutId && !maxTimeoutId) {
58771                 args = thisArg = undefined;
58772               }
58773               return result;
58774             }
58775             debounced.cancel = cancel;
58776             return debounced;
58777           }
58778
58779           /**
58780            * Defers invoking the `func` until the current call stack has cleared. Any
58781            * additional arguments are provided to `func` when it is invoked.
58782            *
58783            * @static
58784            * @memberOf _
58785            * @category Function
58786            * @param {Function}
58787            *            func The function to defer.
58788            * @param {...*}
58789            *            [args] The arguments to invoke the function with.
58790            * @returns {number} Returns the timer id.
58791            * @example
58792            *
58793            * _.defer(function(text) { console.log(text); }, 'deferred'); // logs
58794            * 'deferred' after one or more milliseconds
58795            */
58796           var defer = restParam(function(func, args) {
58797             return baseDelay(func, 1, args);
58798           });
58799
58800           /**
58801            * Invokes `func` after `wait` milliseconds. Any additional arguments are
58802            * provided to `func` when it is invoked.
58803            *
58804            * @static
58805            * @memberOf _
58806            * @category Function
58807            * @param {Function}
58808            *            func The function to delay.
58809            * @param {number}
58810            *            wait The number of milliseconds to delay invocation.
58811            * @param {...*}
58812            *            [args] The arguments to invoke the function with.
58813            * @returns {number} Returns the timer id.
58814            * @example
58815            *
58816            * _.delay(function(text) { console.log(text); }, 1000, 'later'); // => logs
58817            * 'later' after one second
58818            */
58819           var delay = restParam(function(func, wait, args) {
58820             return baseDelay(func, wait, args);
58821           });
58822
58823           /**
58824            * Creates a function that returns the result of invoking the provided
58825            * functions with the `this` binding of the created function, where each
58826            * successive invocation is supplied the return value of the previous.
58827            *
58828            * @static
58829            * @memberOf _
58830            * @category Function
58831            * @param {...Function}
58832            *            [funcs] Functions to invoke.
58833            * @returns {Function} Returns the new function.
58834            * @example
58835            *
58836            * function square(n) { return n * n; }
58837            *
58838            * var addSquare = _.flow(_.add, square); addSquare(1, 2); // => 9
58839            */
58840           var flow = createFlow();
58841
58842           /**
58843            * This method is like `_.flow` except that it creates a function that
58844            * invokes the provided functions from right to left.
58845            *
58846            * @static
58847            * @memberOf _
58848            * @alias backflow, compose
58849            * @category Function
58850            * @param {...Function}
58851            *            [funcs] Functions to invoke.
58852            * @returns {Function} Returns the new function.
58853            * @example
58854            *
58855            * function square(n) { return n * n; }
58856            *
58857            * var addSquare = _.flowRight(square, _.add); addSquare(1, 2); // => 9
58858            */
58859           var flowRight = createFlow(true);
58860
58861           /**
58862            * Creates a function that memoizes the result of `func`. If `resolver` is
58863            * provided it determines the cache key for storing the result based on the
58864            * arguments provided to the memoized function. By default, the first
58865            * argument provided to the memoized function is coerced to a string and
58866            * used as the cache key. The `func` is invoked with the `this` binding of
58867            * the memoized function.
58868            *
58869            * **Note:** The cache is exposed as the `cache` property on the memoized
58870            * function. Its creation may be customized by replacing the
58871            * `_.memoize.Cache` constructor with one whose instances implement the
58872            * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
58873            * method interface of `get`, `has`, and `set`.
58874            *
58875            * @static
58876            * @memberOf _
58877            * @category Function
58878            * @param {Function}
58879            *            func The function to have its output memoized.
58880            * @param {Function}
58881            *            [resolver] The function to resolve the cache key.
58882            * @returns {Function} Returns the new memoizing function.
58883            * @example
58884            *
58885            * var upperCase = _.memoize(function(string) { return string.toUpperCase();
58886            * });
58887            *
58888            * upperCase('fred'); // => 'FRED'
58889            *  // modifying the result cache upperCase.cache.set('fred', 'BARNEY');
58890            * upperCase('fred'); // => 'BARNEY'
58891            *  // replacing `_.memoize.Cache` var object = { 'user': 'fred' }; var
58892            * other = { 'user': 'barney' }; var identity = _.memoize(_.identity);
58893            *
58894            * identity(object); // => { 'user': 'fred' } identity(other); // => {
58895            * 'user': 'fred' }
58896            *
58897            * _.memoize.Cache = WeakMap; var identity = _.memoize(_.identity);
58898            *
58899            * identity(object); // => { 'user': 'fred' } identity(other); // => {
58900            * 'user': 'barney' }
58901            */
58902           function memoize(func, resolver) {
58903             if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
58904               throw new TypeError(FUNC_ERROR_TEXT);
58905             }
58906             var memoized = function() {
58907               var args = arguments,
58908                 key = resolver ? resolver.apply(this, args) : args[0],
58909                 cache = memoized.cache;
58910
58911               if (cache.has(key)) {
58912                 return cache.get(key);
58913               }
58914               var result = func.apply(this, args);
58915               memoized.cache = cache.set(key, result);
58916               return result;
58917             };
58918             memoized.cache = new memoize.Cache;
58919             return memoized;
58920           }
58921
58922           /**
58923            * Creates a function that runs each argument through a corresponding
58924            * transform function.
58925            *
58926            * @static
58927            * @memberOf _
58928            * @category Function
58929            * @param {Function}
58930            *            func The function to wrap.
58931            * @param {...(Function|Function[])}
58932            *            [transforms] The functions to transform arguments, specified
58933            *            as individual functions or arrays of functions.
58934            * @returns {Function} Returns the new function.
58935            * @example
58936            *
58937            * function doubled(n) { return n * 2; }
58938            *
58939            * function square(n) { return n * n; }
58940            *
58941            * var modded = _.modArgs(function(x, y) { return [x, y]; }, square,
58942            * doubled);
58943            *
58944            * modded(1, 2); // => [1, 4]
58945            *
58946            * modded(5, 10); // => [25, 20]
58947            */
58948           var modArgs = restParam(function(func, transforms) {
58949             transforms = baseFlatten(transforms);
58950             if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
58951               throw new TypeError(FUNC_ERROR_TEXT);
58952             }
58953             var length = transforms.length;
58954             return restParam(function(args) {
58955               var index = nativeMin(args.length, length);
58956               while (index--) {
58957                 args[index] = transforms[index](args[index]);
58958               }
58959               return func.apply(this, args);
58960             });
58961           });
58962
58963           /**
58964            * Creates a function that negates the result of the predicate `func`. The
58965            * `func` predicate is invoked with the `this` binding and arguments of the
58966            * created function.
58967            *
58968            * @static
58969            * @memberOf _
58970            * @category Function
58971            * @param {Function}
58972            *            predicate The predicate to negate.
58973            * @returns {Function} Returns the new function.
58974            * @example
58975            *
58976            * function isEven(n) { return n % 2 == 0; }
58977            *
58978            * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); // => [1, 3, 5]
58979            */
58980           function negate(predicate) {
58981             if (typeof predicate != 'function') {
58982               throw new TypeError(FUNC_ERROR_TEXT);
58983             }
58984             return function() {
58985               return !predicate.apply(this, arguments);
58986             };
58987           }
58988
58989           /**
58990            * Creates a function that is restricted to invoking `func` once. Repeat
58991            * calls to the function return the value of the first call. The `func` is
58992            * invoked with the `this` binding and arguments of the created function.
58993            *
58994            * @static
58995            * @memberOf _
58996            * @category Function
58997            * @param {Function}
58998            *            func The function to restrict.
58999            * @returns {Function} Returns the new restricted function.
59000            * @example
59001            *
59002            * var initialize = _.once(createApplication); initialize(); initialize(); //
59003            * `initialize` invokes `createApplication` once
59004            */
59005           function once(func) {
59006             return before(2, func);
59007           }
59008
59009           /**
59010            * Creates a function that invokes `func` with `partial` arguments prepended
59011            * to those provided to the new function. This method is like `_.bind`
59012            * except it does **not** alter the `this` binding.
59013            *
59014            * The `_.partial.placeholder` value, which defaults to `_` in monolithic
59015            * builds, may be used as a placeholder for partially applied arguments.
59016            *
59017            * **Note:** This method does not set the "length" property of partially
59018            * applied functions.
59019            *
59020            * @static
59021            * @memberOf _
59022            * @category Function
59023            * @param {Function}
59024            *            func The function to partially apply arguments to.
59025            * @param {...*}
59026            *            [partials] The arguments to be partially applied.
59027            * @returns {Function} Returns the new partially applied function.
59028            * @example
59029            *
59030            * var greet = function(greeting, name) { return greeting + ' ' + name; };
59031            *
59032            * var sayHelloTo = _.partial(greet, 'hello'); sayHelloTo('fred'); // =>
59033            * 'hello fred'
59034            *  // using placeholders var greetFred = _.partial(greet, _, 'fred');
59035            * greetFred('hi'); // => 'hi fred'
59036            */
59037           var partial = createPartial(PARTIAL_FLAG);
59038
59039           /**
59040            * This method is like `_.partial` except that partially applied arguments
59041            * are appended to those provided to the new function.
59042            *
59043            * The `_.partialRight.placeholder` value, which defaults to `_` in
59044            * monolithic builds, may be used as a placeholder for partially applied
59045            * arguments.
59046            *
59047            * **Note:** This method does not set the "length" property of partially
59048            * applied functions.
59049            *
59050            * @static
59051            * @memberOf _
59052            * @category Function
59053            * @param {Function}
59054            *            func The function to partially apply arguments to.
59055            * @param {...*}
59056            *            [partials] The arguments to be partially applied.
59057            * @returns {Function} Returns the new partially applied function.
59058            * @example
59059            *
59060            * var greet = function(greeting, name) { return greeting + ' ' + name; };
59061            *
59062            * var greetFred = _.partialRight(greet, 'fred'); greetFred('hi'); // => 'hi
59063            * fred'
59064            *  // using placeholders var sayHelloTo = _.partialRight(greet, 'hello',
59065            * _); sayHelloTo('fred'); // => 'hello fred'
59066            */
59067           var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
59068
59069           /**
59070            * Creates a function that invokes `func` with arguments arranged according
59071            * to the specified indexes where the argument value at the first index is
59072            * provided as the first argument, the argument value at the second index is
59073            * provided as the second argument, and so on.
59074            *
59075            * @static
59076            * @memberOf _
59077            * @category Function
59078            * @param {Function}
59079            *            func The function to rearrange arguments for.
59080            * @param {...(number|number[])}
59081            *            indexes The arranged argument indexes, specified as individual
59082            *            indexes or arrays of indexes.
59083            * @returns {Function} Returns the new function.
59084            * @example
59085            *
59086            * var rearged = _.rearg(function(a, b, c) { return [a, b, c]; }, 2, 0, 1);
59087            *
59088            * rearged('b', 'c', 'a') // => ['a', 'b', 'c']
59089            *
59090            * var map = _.rearg(_.map, [1, 0]); map(function(n) { return n * 3; }, [1,
59091            * 2, 3]); // => [3, 6, 9]
59092            */
59093           var rearg = restParam(function(func, indexes) {
59094             return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
59095           });
59096
59097           /**
59098            * Creates a function that invokes `func` with the `this` binding of the
59099            * created function and arguments from `start` and beyond provided as an
59100            * array.
59101            *
59102            * **Note:** This method is based on the [rest
59103            * parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
59104            *
59105            * @static
59106            * @memberOf _
59107            * @category Function
59108            * @param {Function}
59109            *            func The function to apply a rest parameter to.
59110            * @param {number}
59111            *            [start=func.length-1] The start position of the rest
59112            *            parameter.
59113            * @returns {Function} Returns the new function.
59114            * @example
59115            *
59116            * var say = _.restParam(function(what, names) { return what + ' ' +
59117            * _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') +
59118            * _.last(names); });
59119            *
59120            * say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, &
59121            * pebbles'
59122            */
59123           function restParam(func, start) {
59124             if (typeof func != 'function') {
59125               throw new TypeError(FUNC_ERROR_TEXT);
59126             }
59127             start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
59128             return function() {
59129               var args = arguments,
59130                 index = -1,
59131                 length = nativeMax(args.length - start, 0),
59132                 rest = Array(length);
59133
59134               while (++index < length) {
59135                 rest[index] = args[start + index];
59136               }
59137               switch (start) {
59138                 case 0:
59139                   return func.call(this, rest);
59140                 case 1:
59141                   return func.call(this, args[0], rest);
59142                 case 2:
59143                   return func.call(this, args[0], args[1], rest);
59144               }
59145               var otherArgs = Array(start + 1);
59146               index = -1;
59147               while (++index < start) {
59148                 otherArgs[index] = args[index];
59149               }
59150               otherArgs[start] = rest;
59151               return func.apply(this, otherArgs);
59152             };
59153           }
59154
59155           /**
59156            * Creates a function that invokes `func` with the `this` binding of the
59157            * created function and an array of arguments much like
59158            * [`Function#apply`](https://es5.github.io/#x15.3.4.3).
59159            *
59160            * **Note:** This method is based on the [spread
59161            * operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
59162            *
59163            * @static
59164            * @memberOf _
59165            * @category Function
59166            * @param {Function}
59167            *            func The function to spread arguments over.
59168            * @returns {Function} Returns the new function.
59169            * @example
59170            *
59171            * var say = _.spread(function(who, what) { return who + ' says ' + what;
59172            * });
59173            *
59174            * say(['fred', 'hello']); // => 'fred says hello'
59175            *  // with a Promise var numbers = Promise.all([ Promise.resolve(40),
59176            * Promise.resolve(36) ]);
59177            *
59178            * numbers.then(_.spread(function(x, y) { return x + y; })); // => a Promise
59179            * of 76
59180            */
59181           function spread(func) {
59182             if (typeof func != 'function') {
59183               throw new TypeError(FUNC_ERROR_TEXT);
59184             }
59185             return function(array) {
59186               return func.apply(this, array);
59187             };
59188           }
59189
59190           /**
59191            * Creates a throttled function that only invokes `func` at most once per
59192            * every `wait` milliseconds. The throttled function comes with a `cancel`
59193            * method to cancel delayed invocations. Provide an options object to
59194            * indicate that `func` should be invoked on the leading and/or trailing
59195            * edge of the `wait` timeout. Subsequent calls to the throttled function
59196            * return the result of the last `func` call.
59197            *
59198            * **Note:** If `leading` and `trailing` options are `true`, `func` is
59199            * invoked on the trailing edge of the timeout only if the the throttled
59200            * function is invoked more than once during the `wait` timeout.
59201            *
59202            * See [David Corbacho's
59203            * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
59204            * for details over the differences between `_.throttle` and `_.debounce`.
59205            *
59206            * @static
59207            * @memberOf _
59208            * @category Function
59209            * @param {Function}
59210            *            func The function to throttle.
59211            * @param {number}
59212            *            [wait=0] The number of milliseconds to throttle invocations
59213            *            to.
59214            * @param {Object}
59215            *            [options] The options object.
59216            * @param {boolean}
59217            *            [options.leading=true] Specify invoking on the leading edge of
59218            *            the timeout.
59219            * @param {boolean}
59220            *            [options.trailing=true] Specify invoking on the trailing edge
59221            *            of the timeout.
59222            * @returns {Function} Returns the new throttled function.
59223            * @example
59224            *  // avoid excessively updating the position while scrolling
59225            * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
59226            *  // invoke `renewToken` when the click event is fired, but not more than
59227            * once every 5 minutes jQuery('.interactive').on('click',
59228            * _.throttle(renewToken, 300000, { 'trailing': false }));
59229            *  // cancel a trailing throttled call jQuery(window).on('popstate',
59230            * throttled.cancel);
59231            */
59232           function throttle(func, wait, options) {
59233             var leading = true,
59234               trailing = true;
59235
59236             if (typeof func != 'function') {
59237               throw new TypeError(FUNC_ERROR_TEXT);
59238             }
59239             if (options === false) {
59240               leading = false;
59241             } else if (isObject(options)) {
59242               leading = 'leading' in options ? !!options.leading : leading;
59243               trailing = 'trailing' in options ? !!options.trailing : trailing;
59244             }
59245             return debounce(func, wait, {
59246               'leading': leading,
59247               'maxWait': +wait,
59248               'trailing': trailing
59249             });
59250           }
59251
59252           /**
59253            * Creates a function that provides `value` to the wrapper function as its
59254            * first argument. Any additional arguments provided to the function are
59255            * appended to those provided to the wrapper function. The wrapper is
59256            * invoked with the `this` binding of the created function.
59257            *
59258            * @static
59259            * @memberOf _
59260            * @category Function
59261            * @param {*}
59262            *            value The value to wrap.
59263            * @param {Function}
59264            *            wrapper The wrapper function.
59265            * @returns {Function} Returns the new function.
59266            * @example
59267            *
59268            * var p = _.wrap(_.escape, function(func, text) { return '
59269            * <p>' + func(text) + '
59270            * </p>'; });
59271            *
59272            * p('fred, barney, & pebbles'); // => '
59273            * <p>
59274            * fred, barney, &amp; pebbles
59275            * </p>'
59276            */
59277           function wrap(value, wrapper) {
59278             wrapper = wrapper == null ? identity : wrapper;
59279             return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
59280           }
59281
59282           /*------------------------------------------------------------------------*/
59283
59284           /**
59285            * Creates a clone of `value`. If `isDeep` is `true` nested objects are
59286            * cloned, otherwise they are assigned by reference. If `customizer` is
59287            * provided it is invoked to produce the cloned values. If `customizer`
59288            * returns `undefined` cloning is handled by the method instead. The
59289            * `customizer` is bound to `thisArg` and invoked with two argument; (value [,
59290            * index|key, object]).
59291            *
59292            * **Note:** This method is loosely based on the [structured clone
59293            * algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
59294            * The enumerable properties of `arguments` objects and objects created by
59295            * constructors other than `Object` are cloned to plain `Object` objects. An
59296            * empty object is returned for uncloneable values such as functions, DOM
59297            * nodes, Maps, Sets, and WeakMaps.
59298            *
59299            * @static
59300            * @memberOf _
59301            * @category Lang
59302            * @param {*}
59303            *            value The value to clone.
59304            * @param {boolean}
59305            *            [isDeep] Specify a deep clone.
59306            * @param {Function}
59307            *            [customizer] The function to customize cloning values.
59308            * @param {*}
59309            *            [thisArg] The `this` binding of `customizer`.
59310            * @returns {*} Returns the cloned value.
59311            * @example
59312            *
59313            * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
59314            *
59315            * var shallow = _.clone(users); shallow[0] === users[0]; // => true
59316            *
59317            * var deep = _.clone(users, true); deep[0] === users[0]; // => false
59318            *  // using a customizer callback var el = _.clone(document.body,
59319            * function(value) { if (_.isElement(value)) { return
59320            * value.cloneNode(false); } });
59321            *
59322            * el === document.body // => false el.nodeName // => BODY
59323            * el.childNodes.length; // => 0
59324            */
59325           function clone(value, isDeep, customizer, thisArg) {
59326             if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
59327               isDeep = false;
59328             } else if (typeof isDeep == 'function') {
59329               thisArg = customizer;
59330               customizer = isDeep;
59331               isDeep = false;
59332             }
59333             return typeof customizer == 'function' ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1)) : baseClone(value, isDeep);
59334           }
59335
59336           /**
59337            * Creates a deep clone of `value`. If `customizer` is provided it is
59338            * invoked to produce the cloned values. If `customizer` returns `undefined`
59339            * cloning is handled by the method instead. The `customizer` is bound to
59340            * `thisArg` and invoked with two argument; (value [, index|key, object]).
59341            *
59342            * **Note:** This method is loosely based on the [structured clone
59343            * algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
59344            * The enumerable properties of `arguments` objects and objects created by
59345            * constructors other than `Object` are cloned to plain `Object` objects. An
59346            * empty object is returned for uncloneable values such as functions, DOM
59347            * nodes, Maps, Sets, and WeakMaps.
59348            *
59349            * @static
59350            * @memberOf _
59351            * @category Lang
59352            * @param {*}
59353            *            value The value to deep clone.
59354            * @param {Function}
59355            *            [customizer] The function to customize cloning values.
59356            * @param {*}
59357            *            [thisArg] The `this` binding of `customizer`.
59358            * @returns {*} Returns the deep cloned value.
59359            * @example
59360            *
59361            * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
59362            *
59363            * var deep = _.cloneDeep(users); deep[0] === users[0]; // => false
59364            *  // using a customizer callback var el = _.cloneDeep(document.body,
59365            * function(value) { if (_.isElement(value)) { return value.cloneNode(true); }
59366            * });
59367            *
59368            * el === document.body // => false el.nodeName // => BODY
59369            * el.childNodes.length; // => 20
59370            */
59371           function cloneDeep(value, customizer, thisArg) {
59372             return typeof customizer == 'function' ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) : baseClone(value, true);
59373           }
59374
59375           /**
59376            * Checks if `value` is greater than `other`.
59377            *
59378            * @static
59379            * @memberOf _
59380            * @category Lang
59381            * @param {*}
59382            *            value The value to compare.
59383            * @param {*}
59384            *            other The other value to compare.
59385            * @returns {boolean} Returns `true` if `value` is greater than `other`,
59386            *          else `false`.
59387            * @example
59388            *
59389            * _.gt(3, 1); // => true
59390            *
59391            * _.gt(3, 3); // => false
59392            *
59393            * _.gt(1, 3); // => false
59394            */
59395           function gt(value, other) {
59396             return value > other;
59397           }
59398
59399           /**
59400            * Checks if `value` is greater than or equal to `other`.
59401            *
59402            * @static
59403            * @memberOf _
59404            * @category Lang
59405            * @param {*}
59406            *            value The value to compare.
59407            * @param {*}
59408            *            other The other value to compare.
59409            * @returns {boolean} Returns `true` if `value` is greater than or equal to
59410            *          `other`, else `false`.
59411            * @example
59412            *
59413            * _.gte(3, 1); // => true
59414            *
59415            * _.gte(3, 3); // => true
59416            *
59417            * _.gte(1, 3); // => false
59418            */
59419           function gte(value, other) {
59420             return value >= other;
59421           }
59422
59423           /**
59424            * Checks if `value` is classified as an `arguments` object.
59425            *
59426            * @static
59427            * @memberOf _
59428            * @category Lang
59429            * @param {*}
59430            *            value The value to check.
59431            * @returns {boolean} Returns `true` if `value` is correctly classified,
59432            *          else `false`.
59433            * @example
59434            *
59435            * _.isArguments(function() { return arguments; }()); // => true
59436            *
59437            * _.isArguments([1, 2, 3]); // => false
59438            */
59439           function isArguments(value) {
59440             return isObjectLike(value) && isArrayLike(value) &&
59441               hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
59442           }
59443
59444           /**
59445            * Checks if `value` is classified as an `Array` object.
59446            *
59447            * @static
59448            * @memberOf _
59449            * @category Lang
59450            * @param {*}
59451            *            value The value to check.
59452            * @returns {boolean} Returns `true` if `value` is correctly classified,
59453            *          else `false`.
59454            * @example
59455            *
59456            * _.isArray([1, 2, 3]); // => true
59457            *
59458            * _.isArray(function() { return arguments; }()); // => false
59459            */
59460           var isArray = nativeIsArray || function(value) {
59461             return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
59462           };
59463
59464           /**
59465            * Checks if `value` is classified as a boolean primitive or object.
59466            *
59467            * @static
59468            * @memberOf _
59469            * @category Lang
59470            * @param {*}
59471            *            value The value to check.
59472            * @returns {boolean} Returns `true` if `value` is correctly classified,
59473            *          else `false`.
59474            * @example
59475            *
59476            * _.isBoolean(false); // => true
59477            *
59478            * _.isBoolean(null); // => false
59479            */
59480           function isBoolean(value) {
59481             return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
59482           }
59483
59484           /**
59485            * Checks if `value` is classified as a `Date` object.
59486            *
59487            * @static
59488            * @memberOf _
59489            * @category Lang
59490            * @param {*}
59491            *            value The value to check.
59492            * @returns {boolean} Returns `true` if `value` is correctly classified,
59493            *          else `false`.
59494            * @example
59495            *
59496            * _.isDate(new Date); // => true
59497            *
59498            * _.isDate('Mon April 23 2012'); // => false
59499            */
59500           function isDate(value) {
59501             return isObjectLike(value) && objToString.call(value) == dateTag;
59502           }
59503
59504           /**
59505            * Checks if `value` is a DOM element.
59506            *
59507            * @static
59508            * @memberOf _
59509            * @category Lang
59510            * @param {*}
59511            *            value The value to check.
59512            * @returns {boolean} Returns `true` if `value` is a DOM element, else
59513            *          `false`.
59514            * @example
59515            *
59516            * _.isElement(document.body); // => true
59517            *
59518            * _.isElement('<body>'); // => false
59519            */
59520           function isElement(value) {
59521             return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
59522           }
59523
59524           /**
59525            * Checks if `value` is empty. A value is considered empty unless it is an
59526            * `arguments` object, array, string, or jQuery-like collection with a
59527            * length greater than `0` or an object with own enumerable properties.
59528            *
59529            * @static
59530            * @memberOf _
59531            * @category Lang
59532            * @param {Array|Object|string}
59533            *            value The value to inspect.
59534            * @returns {boolean} Returns `true` if `value` is empty, else `false`.
59535            * @example
59536            *
59537            * _.isEmpty(null); // => true
59538            *
59539            * _.isEmpty(true); // => true
59540            *
59541            * _.isEmpty(1); // => true
59542            *
59543            * _.isEmpty([1, 2, 3]); // => false
59544            *
59545            * _.isEmpty({ 'a': 1 }); // => false
59546            */
59547           function isEmpty(value) {
59548             if (value == null) {
59549               return true;
59550             }
59551             if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
59552                 (isObjectLike(value) && isFunction(value.splice)))) {
59553               return !value.length;
59554             }
59555             return !keys(value).length;
59556           }
59557
59558           /**
59559            * Performs a deep comparison between two values to determine if they are
59560            * equivalent. If `customizer` is provided it is invoked to compare values.
59561            * If `customizer` returns `undefined` comparisons are handled by the method
59562            * instead. The `customizer` is bound to `thisArg` and invoked with three
59563            * arguments: (value, other [, index|key]).
59564            *
59565            * **Note:** This method supports comparing arrays, booleans, `Date`
59566            * objects, numbers, `Object` objects, regexes, and strings. Objects are
59567            * compared by their own, not inherited, enumerable properties. Functions
59568            * and DOM nodes are **not** supported. Provide a customizer function to
59569            * extend support for comparing other values.
59570            *
59571            * @static
59572            * @memberOf _
59573            * @alias eq
59574            * @category Lang
59575            * @param {*}
59576            *            value The value to compare.
59577            * @param {*}
59578            *            other The other value to compare.
59579            * @param {Function}
59580            *            [customizer] The function to customize value comparisons.
59581            * @param {*}
59582            *            [thisArg] The `this` binding of `customizer`.
59583            * @returns {boolean} Returns `true` if the values are equivalent, else
59584            *          `false`.
59585            * @example
59586            *
59587            * var object = { 'user': 'fred' }; var other = { 'user': 'fred' };
59588            *
59589            * object == other; // => false
59590            *
59591            * _.isEqual(object, other); // => true
59592            *  // using a customizer callback var array = ['hello', 'goodbye']; var
59593            * other = ['hi', 'goodbye'];
59594            *
59595            * _.isEqual(array, other, function(value, other) { if (_.every([value,
59596            * other], RegExp.prototype.test, /^h(?:i|ello)$/)) { return true; } }); // =>
59597            * true
59598            */
59599           function isEqual(value, other, customizer, thisArg) {
59600             customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
59601             var result = customizer ? customizer(value, other) : undefined;
59602             return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
59603           }
59604
59605           /**
59606            * Checks if `value` is an `Error`, `EvalError`, `RangeError`,
59607            * `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object.
59608            *
59609            * @static
59610            * @memberOf _
59611            * @category Lang
59612            * @param {*}
59613            *            value The value to check.
59614            * @returns {boolean} Returns `true` if `value` is an error object, else
59615            *          `false`.
59616            * @example
59617            *
59618            * _.isError(new Error); // => true
59619            *
59620            * _.isError(Error); // => false
59621            */
59622           function isError(value) {
59623             return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
59624           }
59625
59626           /**
59627            * Checks if `value` is a finite primitive number.
59628            *
59629            * **Note:** This method is based on
59630            * [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).
59631            *
59632            * @static
59633            * @memberOf _
59634            * @category Lang
59635            * @param {*}
59636            *            value The value to check.
59637            * @returns {boolean} Returns `true` if `value` is a finite number, else
59638            *          `false`.
59639            * @example
59640            *
59641            * _.isFinite(10); // => true
59642            *
59643            * _.isFinite('10'); // => false
59644            *
59645            * _.isFinite(true); // => false
59646            *
59647            * _.isFinite(Object(10)); // => false
59648            *
59649            * _.isFinite(Infinity); // => false
59650            */
59651           function isFinite(value) {
59652             return typeof value == 'number' && nativeIsFinite(value);
59653           }
59654
59655           /**
59656            * Checks if `value` is classified as a `Function` object.
59657            *
59658            * @static
59659            * @memberOf _
59660            * @category Lang
59661            * @param {*}
59662            *            value The value to check.
59663            * @returns {boolean} Returns `true` if `value` is correctly classified,
59664            *          else `false`.
59665            * @example
59666            *
59667            * _.isFunction(_); // => true
59668            *
59669            * _.isFunction(/abc/); // => false
59670            */
59671           function isFunction(value) {
59672             // The use of `Object#toString` avoids issues with the `typeof` operator
59673             // in older versions of Chrome and Safari which return 'function' for
59674             // regexes
59675             // and Safari 8 equivalents which return 'object' for typed array
59676             // constructors.
59677             return isObject(value) && objToString.call(value) == funcTag;
59678           }
59679
59680           /**
59681            * Checks if `value` is the [language type](https://es5.github.io/#x8) of
59682            * `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and
59683            * `new String('')`)
59684            *
59685            * @static
59686            * @memberOf _
59687            * @category Lang
59688            * @param {*}
59689            *            value The value to check.
59690            * @returns {boolean} Returns `true` if `value` is an object, else `false`.
59691            * @example
59692            *
59693            * _.isObject({}); // => true
59694            *
59695            * _.isObject([1, 2, 3]); // => true
59696            *
59697            * _.isObject(1); // => false
59698            */
59699           function isObject(value) {
59700             // Avoid a V8 JIT bug in Chrome 19-20.
59701             // See https://code.google.com/p/v8/issues/detail?id=2291 for more
59702             // details.
59703             var type = typeof value;
59704             return !!value && (type == 'object' || type == 'function');
59705           }
59706
59707           /**
59708            * Performs a deep comparison between `object` and `source` to determine if
59709            * `object` contains equivalent property values. If `customizer` is provided
59710            * it is invoked to compare values. If `customizer` returns `undefined`
59711            * comparisons are handled by the method instead. The `customizer` is bound
59712            * to `thisArg` and invoked with three arguments: (value, other, index|key).
59713            *
59714            * **Note:** This method supports comparing properties of arrays, booleans,
59715            * `Date` objects, numbers, `Object` objects, regexes, and strings.
59716            * Functions and DOM nodes are **not** supported. Provide a customizer
59717            * function to extend support for comparing other values.
59718            *
59719            * @static
59720            * @memberOf _
59721            * @category Lang
59722            * @param {Object}
59723            *            object The object to inspect.
59724            * @param {Object}
59725            *            source The object of property values to match.
59726            * @param {Function}
59727            *            [customizer] The function to customize value comparisons.
59728            * @param {*}
59729            *            [thisArg] The `this` binding of `customizer`.
59730            * @returns {boolean} Returns `true` if `object` is a match, else `false`.
59731            * @example
59732            *
59733            * var object = { 'user': 'fred', 'age': 40 };
59734            *
59735            * _.isMatch(object, { 'age': 40 }); // => true
59736            *
59737            * _.isMatch(object, { 'age': 36 }); // => false
59738            *  // using a customizer callback var object = { 'greeting': 'hello' }; var
59739            * source = { 'greeting': 'hi' };
59740            *
59741            * _.isMatch(object, source, function(value, other) { return _.every([value,
59742            * other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; }); // =>
59743            * true
59744            */
59745           function isMatch(object, source, customizer, thisArg) {
59746             customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
59747             return baseIsMatch(object, getMatchData(source), customizer);
59748           }
59749
59750           /**
59751            * Checks if `value` is `NaN`.
59752            *
59753            * **Note:** This method is not the same as
59754            * [`isNaN`](https://es5.github.io/#x15.1.2.4) which returns `true` for
59755            * `undefined` and other non-numeric values.
59756            *
59757            * @static
59758            * @memberOf _
59759            * @category Lang
59760            * @param {*}
59761            *            value The value to check.
59762            * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
59763            * @example
59764            *
59765            * _.isNaN(NaN); // => true
59766            *
59767            * _.isNaN(new Number(NaN)); // => true
59768            *
59769            * isNaN(undefined); // => true
59770            *
59771            * _.isNaN(undefined); // => false
59772            */
59773           function isNaN(value) {
59774             // An `NaN` primitive is the only value that is not equal to itself.
59775             // Perform the `toStringTag` check first to avoid errors with some host
59776             // objects in IE.
59777             return isNumber(value) && value != +value;
59778           }
59779
59780           /**
59781            * Checks if `value` is a native function.
59782            *
59783            * @static
59784            * @memberOf _
59785            * @category Lang
59786            * @param {*}
59787            *            value The value to check.
59788            * @returns {boolean} Returns `true` if `value` is a native function, else
59789            *          `false`.
59790            * @example
59791            *
59792            * _.isNative(Array.prototype.push); // => true
59793            *
59794            * _.isNative(_); // => false
59795            */
59796           function isNative(value) {
59797             if (value == null) {
59798               return false;
59799             }
59800             if (isFunction(value)) {
59801               return reIsNative.test(fnToString.call(value));
59802             }
59803             return isObjectLike(value) && reIsHostCtor.test(value);
59804           }
59805
59806           /**
59807            * Checks if `value` is `null`.
59808            *
59809            * @static
59810            * @memberOf _
59811            * @category Lang
59812            * @param {*}
59813            *            value The value to check.
59814            * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
59815            * @example
59816            *
59817            * _.isNull(null); // => true
59818            *
59819            * _.isNull(void 0); // => false
59820            */
59821           function isNull(value) {
59822             return value === null;
59823           }
59824
59825           /**
59826            * Checks if `value` is classified as a `Number` primitive or object.
59827            *
59828            * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
59829            * classified as numbers, use the `_.isFinite` method.
59830            *
59831            * @static
59832            * @memberOf _
59833            * @category Lang
59834            * @param {*}
59835            *            value The value to check.
59836            * @returns {boolean} Returns `true` if `value` is correctly classified,
59837            *          else `false`.
59838            * @example
59839            *
59840            * _.isNumber(8.4); // => true
59841            *
59842            * _.isNumber(NaN); // => true
59843            *
59844            * _.isNumber('8.4'); // => false
59845            */
59846           function isNumber(value) {
59847             return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
59848           }
59849
59850           /**
59851            * Checks if `value` is a plain object, that is, an object created by the
59852            * `Object` constructor or one with a `[[Prototype]]` of `null`.
59853            *
59854            * **Note:** This method assumes objects created by the `Object` constructor
59855            * have no inherited enumerable properties.
59856            *
59857            * @static
59858            * @memberOf _
59859            * @category Lang
59860            * @param {*}
59861            *            value The value to check.
59862            * @returns {boolean} Returns `true` if `value` is a plain object, else
59863            *          `false`.
59864            * @example
59865            *
59866            * function Foo() { this.a = 1; }
59867            *
59868            * _.isPlainObject(new Foo); // => false
59869            *
59870            * _.isPlainObject([1, 2, 3]); // => false
59871            *
59872            * _.isPlainObject({ 'x': 0, 'y': 0 }); // => true
59873            *
59874            * _.isPlainObject(Object.create(null)); // => true
59875            */
59876           function isPlainObject(value) {
59877             var Ctor;
59878
59879             // Exit early for non `Object` objects.
59880             if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
59881               (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
59882               return false;
59883             }
59884             // IE < 9 iterates inherited properties before own properties. If the
59885             // first
59886             // iterated property is an object's own property then there are no
59887             // inherited
59888             // enumerable properties.
59889             var result;
59890             // In most environments an object's own properties are iterated before
59891             // its inherited properties. If the last iterated property is an
59892             // object's
59893             // own property then there are no inherited enumerable properties.
59894             baseForIn(value, function(subValue, key) {
59895               result = key;
59896             });
59897             return result === undefined || hasOwnProperty.call(value, result);
59898           }
59899
59900           /**
59901            * Checks if `value` is classified as a `RegExp` object.
59902            *
59903            * @static
59904            * @memberOf _
59905            * @category Lang
59906            * @param {*}
59907            *            value The value to check.
59908            * @returns {boolean} Returns `true` if `value` is correctly classified,
59909            *          else `false`.
59910            * @example
59911            *
59912            * _.isRegExp(/abc/); // => true
59913            *
59914            * _.isRegExp('/abc/'); // => false
59915            */
59916           function isRegExp(value) {
59917             return isObject(value) && objToString.call(value) == regexpTag;
59918           }
59919
59920           /**
59921            * Checks if `value` is classified as a `String` primitive or object.
59922            *
59923            * @static
59924            * @memberOf _
59925            * @category Lang
59926            * @param {*}
59927            *            value The value to check.
59928            * @returns {boolean} Returns `true` if `value` is correctly classified,
59929            *          else `false`.
59930            * @example
59931            *
59932            * _.isString('abc'); // => true
59933            *
59934            * _.isString(1); // => false
59935            */
59936           function isString(value) {
59937             return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
59938           }
59939
59940           /**
59941            * Checks if `value` is classified as a typed array.
59942            *
59943            * @static
59944            * @memberOf _
59945            * @category Lang
59946            * @param {*}
59947            *            value The value to check.
59948            * @returns {boolean} Returns `true` if `value` is correctly classified,
59949            *          else `false`.
59950            * @example
59951            *
59952            * _.isTypedArray(new Uint8Array); // => true
59953            *
59954            * _.isTypedArray([]); // => false
59955            */
59956           function isTypedArray(value) {
59957             return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
59958           }
59959
59960           /**
59961            * Checks if `value` is `undefined`.
59962            *
59963            * @static
59964            * @memberOf _
59965            * @category Lang
59966            * @param {*}
59967            *            value The value to check.
59968            * @returns {boolean} Returns `true` if `value` is `undefined`, else
59969            *          `false`.
59970            * @example
59971            *
59972            * _.isUndefined(void 0); // => true
59973            *
59974            * _.isUndefined(null); // => false
59975            */
59976           function isUndefined(value) {
59977             return value === undefined;
59978           }
59979
59980           /**
59981            * Checks if `value` is less than `other`.
59982            *
59983            * @static
59984            * @memberOf _
59985            * @category Lang
59986            * @param {*}
59987            *            value The value to compare.
59988            * @param {*}
59989            *            other The other value to compare.
59990            * @returns {boolean} Returns `true` if `value` is less than `other`, else
59991            *          `false`.
59992            * @example
59993            *
59994            * _.lt(1, 3); // => true
59995            *
59996            * _.lt(3, 3); // => false
59997            *
59998            * _.lt(3, 1); // => false
59999            */
60000           function lt(value, other) {
60001             return value < other;
60002           }
60003
60004           /**
60005            * Checks if `value` is less than or equal to `other`.
60006            *
60007            * @static
60008            * @memberOf _
60009            * @category Lang
60010            * @param {*}
60011            *            value The value to compare.
60012            * @param {*}
60013            *            other The other value to compare.
60014            * @returns {boolean} Returns `true` if `value` is less than or equal to
60015            *          `other`, else `false`.
60016            * @example
60017            *
60018            * _.lte(1, 3); // => true
60019            *
60020            * _.lte(3, 3); // => true
60021            *
60022            * _.lte(3, 1); // => false
60023            */
60024           function lte(value, other) {
60025             return value <= other;
60026           }
60027
60028           /**
60029            * Converts `value` to an array.
60030            *
60031            * @static
60032            * @memberOf _
60033            * @category Lang
60034            * @param {*}
60035            *            value The value to convert.
60036            * @returns {Array} Returns the converted array.
60037            * @example
60038            *
60039            * (function() { return _.toArray(arguments).slice(1); }(1, 2, 3)); // =>
60040            * [2, 3]
60041            */
60042           function toArray(value) {
60043             var length = value ? getLength(value) : 0;
60044             if (!isLength(length)) {
60045               return values(value);
60046             }
60047             if (!length) {
60048               return [];
60049             }
60050             return arrayCopy(value);
60051           }
60052
60053           /**
60054            * Converts `value` to a plain object flattening inherited enumerable
60055            * properties of `value` to own properties of the plain object.
60056            *
60057            * @static
60058            * @memberOf _
60059            * @category Lang
60060            * @param {*}
60061            *            value The value to convert.
60062            * @returns {Object} Returns the converted plain object.
60063            * @example
60064            *
60065            * function Foo() { this.b = 2; }
60066            *
60067            * Foo.prototype.c = 3;
60068            *
60069            * _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 }
60070            *
60071            * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2,
60072            * 'c': 3 }
60073            */
60074           function toPlainObject(value) {
60075             return baseCopy(value, keysIn(value));
60076           }
60077
60078           /*------------------------------------------------------------------------*/
60079
60080           /**
60081            * Recursively merges own enumerable properties of the source object(s),
60082            * that don't resolve to `undefined` into the destination object. Subsequent
60083            * sources overwrite property assignments of previous sources. If
60084            * `customizer` is provided it is invoked to produce the merged values of
60085            * the destination and source properties. If `customizer` returns
60086            * `undefined` merging is handled by the method instead. The `customizer` is
60087            * bound to `thisArg` and invoked with five arguments: (objectValue,
60088            * sourceValue, key, object, source).
60089            *
60090            * @static
60091            * @memberOf _
60092            * @category Object
60093            * @param {Object}
60094            *            object The destination object.
60095            * @param {...Object}
60096            *            [sources] The source objects.
60097            * @param {Function}
60098            *            [customizer] The function to customize assigned values.
60099            * @param {*}
60100            *            [thisArg] The `this` binding of `customizer`.
60101            * @returns {Object} Returns `object`.
60102            * @example
60103            *
60104            * var users = { 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] };
60105            *
60106            * var ages = { 'data': [{ 'age': 36 }, { 'age': 40 }] };
60107            *
60108            * _.merge(users, ages); // => { 'data': [{ 'user': 'barney', 'age': 36 }, {
60109            * 'user': 'fred', 'age': 40 }] }
60110            *  // using a customizer callback var object = { 'fruits': ['apple'],
60111            * 'vegetables': ['beet'] };
60112            *
60113            * var other = { 'fruits': ['banana'], 'vegetables': ['carrot'] };
60114            *
60115            * _.merge(object, other, function(a, b) { if (_.isArray(a)) { return
60116            * a.concat(b); } }); // => { 'fruits': ['apple', 'banana'], 'vegetables':
60117            * ['beet', 'carrot'] }
60118            */
60119           var merge = createAssigner(baseMerge);
60120
60121           /**
60122            * Assigns own enumerable properties of source object(s) to the destination
60123            * object. Subsequent sources overwrite property assignments of previous
60124            * sources. If `customizer` is provided it is invoked to produce the
60125            * assigned values. The `customizer` is bound to `thisArg` and invoked with
60126            * five arguments: (objectValue, sourceValue, key, object, source).
60127            *
60128            * **Note:** This method mutates `object` and is based on
60129            * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
60130            *
60131            * @static
60132            * @memberOf _
60133            * @alias extend
60134            * @category Object
60135            * @param {Object}
60136            *            object The destination object.
60137            * @param {...Object}
60138            *            [sources] The source objects.
60139            * @param {Function}
60140            *            [customizer] The function to customize assigned values.
60141            * @param {*}
60142            *            [thisArg] The `this` binding of `customizer`.
60143            * @returns {Object} Returns `object`.
60144            * @example
60145            *
60146            * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); // => {
60147            * 'user': 'fred', 'age': 40 }
60148            *  // using a customizer callback var defaults = _.partialRight(_.assign,
60149            * function(value, other) { return _.isUndefined(value) ? other : value; });
60150            *
60151            * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
60152            * 'user': 'barney', 'age': 36 }
60153            */
60154           var assign = createAssigner(function(object, source, customizer) {
60155             return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
60156           });
60157
60158           /**
60159            * Creates an object that inherits from the given `prototype` object. If a
60160            * `properties` object is provided its own enumerable properties are
60161            * assigned to the created object.
60162            *
60163            * @static
60164            * @memberOf _
60165            * @category Object
60166            * @param {Object}
60167            *            prototype The object to inherit from.
60168            * @param {Object}
60169            *            [properties] The properties to assign to the object.
60170            * @param- {Object} [guard] Enables use as a callback for functions like
60171            *         `_.map`.
60172            * @returns {Object} Returns the new object.
60173            * @example
60174            *
60175            * function Shape() { this.x = 0; this.y = 0; }
60176            *
60177            * function Circle() { Shape.call(this); }
60178            *
60179            * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle });
60180            *
60181            * var circle = new Circle; circle instanceof Circle; // => true
60182            *
60183            * circle instanceof Shape; // => true
60184            */
60185           function create(prototype, properties, guard) {
60186             var result = baseCreate(prototype);
60187             if (guard && isIterateeCall(prototype, properties, guard)) {
60188               properties = undefined;
60189             }
60190             return properties ? baseAssign(result, properties) : result;
60191           }
60192
60193           /**
60194            * Assigns own enumerable properties of source object(s) to the destination
60195            * object for all destination properties that resolve to `undefined`. Once a
60196            * property is set, additional values of the same property are ignored.
60197            *
60198            * **Note:** This method mutates `object`.
60199            *
60200            * @static
60201            * @memberOf _
60202            * @category Object
60203            * @param {Object}
60204            *            object The destination object.
60205            * @param {...Object}
60206            *            [sources] The source objects.
60207            * @returns {Object} Returns `object`.
60208            * @example
60209            *
60210            * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
60211            * 'user': 'barney', 'age': 36 }
60212            */
60213           var defaults = createDefaults(assign, assignDefaults);
60214
60215           /**
60216            * This method is like `_.defaults` except that it recursively assigns
60217            * default properties.
60218            *
60219            * **Note:** This method mutates `object`.
60220            *
60221            * @static
60222            * @memberOf _
60223            * @category Object
60224            * @param {Object}
60225            *            object The destination object.
60226            * @param {...Object}
60227            *            [sources] The source objects.
60228            * @returns {Object} Returns `object`.
60229            * @example
60230            *
60231            * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name':
60232            * 'fred', 'age': 36 } }); // => { 'user': { 'name': 'barney', 'age': 36 } }
60233            *
60234            */
60235           var defaultsDeep = createDefaults(merge, mergeDefaults);
60236
60237           /**
60238            * This method is like `_.find` except that it returns the key of the first
60239            * element `predicate` returns truthy for instead of the element itself.
60240            *
60241            * If a property name is provided for `predicate` the created `_.property`
60242            * style callback returns the property value of the given element.
60243            *
60244            * If a value is also provided for `thisArg` the created `_.matchesProperty`
60245            * style callback returns `true` for elements that have a matching property
60246            * value, else `false`.
60247            *
60248            * If an object is provided for `predicate` the created `_.matches` style
60249            * callback returns `true` for elements that have the properties of the
60250            * given object, else `false`.
60251            *
60252            * @static
60253            * @memberOf _
60254            * @category Object
60255            * @param {Object}
60256            *            object The object to search.
60257            * @param {Function|Object|string}
60258            *            [predicate=_.identity] The function invoked per iteration.
60259            * @param {*}
60260            *            [thisArg] The `this` binding of `predicate`.
60261            * @returns {string|undefined} Returns the key of the matched element, else
60262            *          `undefined`.
60263            * @example
60264            *
60265            * var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age':
60266            * 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } };
60267            *
60268            * _.findKey(users, function(chr) { return chr.age < 40; }); // => 'barney'
60269            * (iteration order is not guaranteed)
60270            *  // using the `_.matches` callback shorthand _.findKey(users, { 'age': 1,
60271            * 'active': true }); // => 'pebbles'
60272            *  // using the `_.matchesProperty` callback shorthand _.findKey(users,
60273            * 'active', false); // => 'fred'
60274            *  // using the `_.property` callback shorthand _.findKey(users, 'active'); // =>
60275            * 'barney'
60276            */
60277           var findKey = createFindKey(baseForOwn);
60278
60279           /**
60280            * This method is like `_.findKey` except that it iterates over elements of
60281            * a collection in the opposite order.
60282            *
60283            * If a property name is provided for `predicate` the created `_.property`
60284            * style callback returns the property value of the given element.
60285            *
60286            * If a value is also provided for `thisArg` the created `_.matchesProperty`
60287            * style callback returns `true` for elements that have a matching property
60288            * value, else `false`.
60289            *
60290            * If an object is provided for `predicate` the created `_.matches` style
60291            * callback returns `true` for elements that have the properties of the
60292            * given object, else `false`.
60293            *
60294            * @static
60295            * @memberOf _
60296            * @category Object
60297            * @param {Object}
60298            *            object The object to search.
60299            * @param {Function|Object|string}
60300            *            [predicate=_.identity] The function invoked per iteration.
60301            * @param {*}
60302            *            [thisArg] The `this` binding of `predicate`.
60303            * @returns {string|undefined} Returns the key of the matched element, else
60304            *          `undefined`.
60305            * @example
60306            *
60307            * var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age':
60308            * 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } };
60309            *
60310            * _.findLastKey(users, function(chr) { return chr.age < 40; }); // =>
60311            * returns `pebbles` assuming `_.findKey` returns `barney`
60312            *  // using the `_.matches` callback shorthand _.findLastKey(users, {
60313            * 'age': 36, 'active': true }); // => 'barney'
60314            *  // using the `_.matchesProperty` callback shorthand _.findLastKey(users,
60315            * 'active', false); // => 'fred'
60316            *  // using the `_.property` callback shorthand _.findLastKey(users,
60317            * 'active'); // => 'pebbles'
60318            */
60319           var findLastKey = createFindKey(baseForOwnRight);
60320
60321           /**
60322            * Iterates over own and inherited enumerable properties of an object
60323            * invoking `iteratee` for each property. The `iteratee` is bound to
60324            * `thisArg` and invoked with three arguments: (value, key, object).
60325            * Iteratee functions may exit iteration early by explicitly returning
60326            * `false`.
60327            *
60328            * @static
60329            * @memberOf _
60330            * @category Object
60331            * @param {Object}
60332            *            object The object to iterate over.
60333            * @param {Function}
60334            *            [iteratee=_.identity] The function invoked per iteration.
60335            * @param {*}
60336            *            [thisArg] The `this` binding of `iteratee`.
60337            * @returns {Object} Returns `object`.
60338            * @example
60339            *
60340            * function Foo() { this.a = 1; this.b = 2; }
60341            *
60342            * Foo.prototype.c = 3;
60343            *
60344            * _.forIn(new Foo, function(value, key) { console.log(key); }); // => logs
60345            * 'a', 'b', and 'c' (iteration order is not guaranteed)
60346            */
60347           var forIn = createForIn(baseFor);
60348
60349           /**
60350            * This method is like `_.forIn` except that it iterates over properties of
60351            * `object` in the opposite order.
60352            *
60353            * @static
60354            * @memberOf _
60355            * @category Object
60356            * @param {Object}
60357            *            object The object to iterate over.
60358            * @param {Function}
60359            *            [iteratee=_.identity] The function invoked per iteration.
60360            * @param {*}
60361            *            [thisArg] The `this` binding of `iteratee`.
60362            * @returns {Object} Returns `object`.
60363            * @example
60364            *
60365            * function Foo() { this.a = 1; this.b = 2; }
60366            *
60367            * Foo.prototype.c = 3;
60368            *
60369            * _.forInRight(new Foo, function(value, key) { console.log(key); }); // =>
60370            * logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
60371            */
60372           var forInRight = createForIn(baseForRight);
60373
60374           /**
60375            * Iterates over own enumerable properties of an object invoking `iteratee`
60376            * for each property. The `iteratee` is bound to `thisArg` and invoked with
60377            * three arguments: (value, key, object). Iteratee functions may exit
60378            * iteration early by explicitly returning `false`.
60379            *
60380            * @static
60381            * @memberOf _
60382            * @category Object
60383            * @param {Object}
60384            *            object The object to iterate over.
60385            * @param {Function}
60386            *            [iteratee=_.identity] The function invoked per iteration.
60387            * @param {*}
60388            *            [thisArg] The `this` binding of `iteratee`.
60389            * @returns {Object} Returns `object`.
60390            * @example
60391            *
60392            * function Foo() { this.a = 1; this.b = 2; }
60393            *
60394            * Foo.prototype.c = 3;
60395            *
60396            * _.forOwn(new Foo, function(value, key) { console.log(key); }); // => logs
60397            * 'a' and 'b' (iteration order is not guaranteed)
60398            */
60399           var forOwn = createForOwn(baseForOwn);
60400
60401           /**
60402            * This method is like `_.forOwn` except that it iterates over properties of
60403            * `object` in the opposite order.
60404            *
60405            * @static
60406            * @memberOf _
60407            * @category Object
60408            * @param {Object}
60409            *            object The object to iterate over.
60410            * @param {Function}
60411            *            [iteratee=_.identity] The function invoked per iteration.
60412            * @param {*}
60413            *            [thisArg] The `this` binding of `iteratee`.
60414            * @returns {Object} Returns `object`.
60415            * @example
60416            *
60417            * function Foo() { this.a = 1; this.b = 2; }
60418            *
60419            * Foo.prototype.c = 3;
60420            *
60421            * _.forOwnRight(new Foo, function(value, key) { console.log(key); }); // =>
60422            * logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
60423            */
60424           var forOwnRight = createForOwn(baseForOwnRight);
60425
60426           /**
60427            * Creates an array of function property names from all enumerable
60428            * properties, own and inherited, of `object`.
60429            *
60430            * @static
60431            * @memberOf _
60432            * @alias methods
60433            * @category Object
60434            * @param {Object}
60435            *            object The object to inspect.
60436            * @returns {Array} Returns the new array of property names.
60437            * @example
60438            *
60439            * _.functions(_); // => ['after', 'ary', 'assign', ...]
60440            */
60441           function functions(object) {
60442             return baseFunctions(object, keysIn(object));
60443           }
60444
60445           /**
60446            * Gets the property value at `path` of `object`. If the resolved value is
60447            * `undefined` the `defaultValue` is used in its place.
60448            *
60449            * @static
60450            * @memberOf _
60451            * @category Object
60452            * @param {Object}
60453            *            object The object to query.
60454            * @param {Array|string}
60455            *            path The path of the property to get.
60456            * @param {*}
60457            *            [defaultValue] The value returned if the resolved value is
60458            *            `undefined`.
60459            * @returns {*} Returns the resolved value.
60460            * @example
60461            *
60462            * var object = { 'a': [{ 'b': { 'c': 3 } }] };
60463            *
60464            * _.get(object, 'a[0].b.c'); // => 3
60465            *
60466            * _.get(object, ['a', '0', 'b', 'c']); // => 3
60467            *
60468            * _.get(object, 'a.b.c', 'default'); // => 'default'
60469            */
60470           function get(object, path, defaultValue) {
60471             var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
60472             return result === undefined ? defaultValue : result;
60473           }
60474
60475           /**
60476            * Checks if `path` is a direct property.
60477            *
60478            * @static
60479            * @memberOf _
60480            * @category Object
60481            * @param {Object}
60482            *            object The object to query.
60483            * @param {Array|string}
60484            *            path The path to check.
60485            * @returns {boolean} Returns `true` if `path` is a direct property, else
60486            *          `false`.
60487            * @example
60488            *
60489            * var object = { 'a': { 'b': { 'c': 3 } } };
60490            *
60491            * _.has(object, 'a'); // => true
60492            *
60493            * _.has(object, 'a.b.c'); // => true
60494            *
60495            * _.has(object, ['a', 'b', 'c']); // => true
60496            */
60497           function has(object, path) {
60498             if (object == null) {
60499               return false;
60500             }
60501             var result = hasOwnProperty.call(object, path);
60502             if (!result && !isKey(path)) {
60503               path = toPath(path);
60504               object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
60505               if (object == null) {
60506                 return false;
60507               }
60508               path = last(path);
60509               result = hasOwnProperty.call(object, path);
60510             }
60511             return result || (isLength(object.length) && isIndex(path, object.length) &&
60512               (isArray(object) || isArguments(object)));
60513           }
60514
60515           /**
60516            * Creates an object composed of the inverted keys and values of `object`.
60517            * If `object` contains duplicate values, subsequent values overwrite
60518            * property assignments of previous values unless `multiValue` is `true`.
60519            *
60520            * @static
60521            * @memberOf _
60522            * @category Object
60523            * @param {Object}
60524            *            object The object to invert.
60525            * @param {boolean}
60526            *            [multiValue] Allow multiple values per key.
60527            * @param- {Object} [guard] Enables use as a callback for functions like
60528            *         `_.map`.
60529            * @returns {Object} Returns the new inverted object.
60530            * @example
60531            *
60532            * var object = { 'a': 1, 'b': 2, 'c': 1 };
60533            *
60534            * _.invert(object); // => { '1': 'c', '2': 'b' }
60535            *  // with `multiValue` _.invert(object, true); // => { '1': ['a', 'c'],
60536            * '2': ['b'] }
60537            */
60538           function invert(object, multiValue, guard) {
60539             if (guard && isIterateeCall(object, multiValue, guard)) {
60540               multiValue = undefined;
60541             }
60542             var index = -1,
60543               props = keys(object),
60544               length = props.length,
60545               result = {};
60546
60547             while (++index < length) {
60548               var key = props[index],
60549                 value = object[key];
60550
60551               if (multiValue) {
60552                 if (hasOwnProperty.call(result, value)) {
60553                   result[value].push(key);
60554                 } else {
60555                   result[value] = [key];
60556                 }
60557               } else {
60558                 result[value] = key;
60559               }
60560             }
60561             return result;
60562           }
60563
60564           /**
60565            * Creates an array of the own enumerable property names of `object`.
60566            *
60567            * **Note:** Non-object values are coerced to objects. See the [ES
60568            * spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for
60569            * more details.
60570            *
60571            * @static
60572            * @memberOf _
60573            * @category Object
60574            * @param {Object}
60575            *            object The object to query.
60576            * @returns {Array} Returns the array of property names.
60577            * @example
60578            *
60579            * function Foo() { this.a = 1; this.b = 2; }
60580            *
60581            * Foo.prototype.c = 3;
60582            *
60583            * _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed)
60584            *
60585            * _.keys('hi'); // => ['0', '1']
60586            */
60587           var keys = !nativeKeys ? shimKeys : function(object) {
60588             var Ctor = object == null ? undefined : object.constructor;
60589             if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
60590               (typeof object != 'function' && isArrayLike(object))) {
60591               return shimKeys(object);
60592             }
60593             return isObject(object) ? nativeKeys(object) : [];
60594           };
60595
60596           /**
60597            * Creates an array of the own and inherited enumerable property names of
60598            * `object`.
60599            *
60600            * **Note:** Non-object values are coerced to objects.
60601            *
60602            * @static
60603            * @memberOf _
60604            * @category Object
60605            * @param {Object}
60606            *            object The object to query.
60607            * @returns {Array} Returns the array of property names.
60608            * @example
60609            *
60610            * function Foo() { this.a = 1; this.b = 2; }
60611            *
60612            * Foo.prototype.c = 3;
60613            *
60614            * _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not
60615            * guaranteed)
60616            */
60617           function keysIn(object) {
60618             if (object == null) {
60619               return [];
60620             }
60621             if (!isObject(object)) {
60622               object = Object(object);
60623             }
60624             var length = object.length;
60625             length = (length && isLength(length) &&
60626               (isArray(object) || isArguments(object)) && length) || 0;
60627
60628             var Ctor = object.constructor,
60629               index = -1,
60630               isProto = typeof Ctor == 'function' && Ctor.prototype === object,
60631               result = Array(length),
60632               skipIndexes = length > 0;
60633
60634             while (++index < length) {
60635               result[index] = (index + '');
60636             }
60637             for (var key in object) {
60638               if (!(skipIndexes && isIndex(key, length)) &&
60639                 !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
60640                 result.push(key);
60641               }
60642             }
60643             return result;
60644           }
60645
60646           /**
60647            * The opposite of `_.mapValues`; this method creates an object with the
60648            * same values as `object` and keys generated by running each own enumerable
60649            * property of `object` through `iteratee`.
60650            *
60651            * @static
60652            * @memberOf _
60653            * @category Object
60654            * @param {Object}
60655            *            object The object to iterate over.
60656            * @param {Function|Object|string}
60657            *            [iteratee=_.identity] The function invoked per iteration.
60658            * @param {*}
60659            *            [thisArg] The `this` binding of `iteratee`.
60660            * @returns {Object} Returns the new mapped object.
60661            * @example
60662            *
60663            * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { return key + value;
60664            * }); // => { 'a1': 1, 'b2': 2 }
60665            */
60666           var mapKeys = createObjectMapper(true);
60667
60668           /**
60669            * Creates an object with the same keys as `object` and values generated by
60670            * running each own enumerable property of `object` through `iteratee`. The
60671            * iteratee function is bound to `thisArg` and invoked with three arguments:
60672            * (value, key, object).
60673            *
60674            * If a property name is provided for `iteratee` the created `_.property`
60675            * style callback returns the property value of the given element.
60676            *
60677            * If a value is also provided for `thisArg` the created `_.matchesProperty`
60678            * style callback returns `true` for elements that have a matching property
60679            * value, else `false`.
60680            *
60681            * If an object is provided for `iteratee` the created `_.matches` style
60682            * callback returns `true` for elements that have the properties of the
60683            * given object, else `false`.
60684            *
60685            * @static
60686            * @memberOf _
60687            * @category Object
60688            * @param {Object}
60689            *            object The object to iterate over.
60690            * @param {Function|Object|string}
60691            *            [iteratee=_.identity] The function invoked per iteration.
60692            * @param {*}
60693            *            [thisArg] The `this` binding of `iteratee`.
60694            * @returns {Object} Returns the new mapped object.
60695            * @example
60696            *
60697            * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { return n * 3; }); // => {
60698            * 'a': 3, 'b': 6 }
60699            *
60700            * var users = { 'fred': { 'user': 'fred', 'age': 40 }, 'pebbles': { 'user':
60701            * 'pebbles', 'age': 1 } };
60702            *  // using the `_.property` callback shorthand _.mapValues(users, 'age'); // => {
60703            * 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
60704            */
60705           var mapValues = createObjectMapper();
60706
60707           /**
60708            * The opposite of `_.pick`; this method creates an object composed of the
60709            * own and inherited enumerable properties of `object` that are not omitted.
60710            *
60711            * @static
60712            * @memberOf _
60713            * @category Object
60714            * @param {Object}
60715            *            object The source object.
60716            * @param {Function|...(string|string[])}
60717            *            [predicate] The function invoked per iteration or property
60718            *            names to omit, specified as individual property names or
60719            *            arrays of property names.
60720            * @param {*}
60721            *            [thisArg] The `this` binding of `predicate`.
60722            * @returns {Object} Returns the new object.
60723            * @example
60724            *
60725            * var object = { 'user': 'fred', 'age': 40 };
60726            *
60727            * _.omit(object, 'age'); // => { 'user': 'fred' }
60728            *
60729            * _.omit(object, _.isNumber); // => { 'user': 'fred' }
60730            */
60731           var omit = restParam(function(object, props) {
60732             if (object == null) {
60733               return {};
60734             }
60735             if (typeof props[0] != 'function') {
60736               var props = arrayMap(baseFlatten(props), String);
60737               return pickByArray(object, baseDifference(keysIn(object), props));
60738             }
60739             var predicate = bindCallback(props[0], props[1], 3);
60740             return pickByCallback(object, function(value, key, object) {
60741               return !predicate(value, key, object);
60742             });
60743           });
60744
60745           /**
60746            * Creates a two dimensional array of the key-value pairs for `object`, e.g.
60747            * `[[key1, value1], [key2, value2]]`.
60748            *
60749            * @static
60750            * @memberOf _
60751            * @category Object
60752            * @param {Object}
60753            *            object The object to query.
60754            * @returns {Array} Returns the new array of key-value pairs.
60755            * @example
60756            *
60757            * _.pairs({ 'barney': 36, 'fred': 40 }); // => [['barney', 36], ['fred',
60758            * 40]] (iteration order is not guaranteed)
60759            */
60760           function pairs(object) {
60761             object = toObject(object);
60762
60763             var index = -1,
60764               props = keys(object),
60765               length = props.length,
60766               result = Array(length);
60767
60768             while (++index < length) {
60769               var key = props[index];
60770               result[index] = [key, object[key]];
60771             }
60772             return result;
60773           }
60774
60775           /**
60776            * Creates an object composed of the picked `object` properties. Property
60777            * names may be specified as individual arguments or as arrays of property
60778            * names. If `predicate` is provided it is invoked for each property of
60779            * `object` picking the properties `predicate` returns truthy for. The
60780            * predicate is bound to `thisArg` and invoked with three arguments: (value,
60781            * key, object).
60782            *
60783            * @static
60784            * @memberOf _
60785            * @category Object
60786            * @param {Object}
60787            *            object The source object.
60788            * @param {Function|...(string|string[])}
60789            *            [predicate] The function invoked per iteration or property
60790            *            names to pick, specified as individual property names or
60791            *            arrays of property names.
60792            * @param {*}
60793            *            [thisArg] The `this` binding of `predicate`.
60794            * @returns {Object} Returns the new object.
60795            * @example
60796            *
60797            * var object = { 'user': 'fred', 'age': 40 };
60798            *
60799            * _.pick(object, 'user'); // => { 'user': 'fred' }
60800            *
60801            * _.pick(object, _.isString); // => { 'user': 'fred' }
60802            */
60803           var pick = restParam(function(object, props) {
60804             if (object == null) {
60805               return {};
60806             }
60807             return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
60808           });
60809
60810           /**
60811            * This method is like `_.get` except that if the resolved value is a
60812            * function it is invoked with the `this` binding of its parent object and
60813            * its result is returned.
60814            *
60815            * @static
60816            * @memberOf _
60817            * @category Object
60818            * @param {Object}
60819            *            object The object to query.
60820            * @param {Array|string}
60821            *            path The path of the property to resolve.
60822            * @param {*}
60823            *            [defaultValue] The value returned if the resolved value is
60824            *            `undefined`.
60825            * @returns {*} Returns the resolved value.
60826            * @example
60827            *
60828            * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
60829            *
60830            * _.result(object, 'a[0].b.c1'); // => 3
60831            *
60832            * _.result(object, 'a[0].b.c2'); // => 4
60833            *
60834            * _.result(object, 'a.b.c', 'default'); // => 'default'
60835            *
60836            * _.result(object, 'a.b.c', _.constant('default')); // => 'default'
60837            */
60838           function result(object, path, defaultValue) {
60839             var result = object == null ? undefined : object[path];
60840             if (result === undefined) {
60841               if (object != null && !isKey(path, object)) {
60842                 path = toPath(path);
60843                 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
60844                 result = object == null ? undefined : object[last(path)];
60845               }
60846               result = result === undefined ? defaultValue : result;
60847             }
60848             return isFunction(result) ? result.call(object) : result;
60849           }
60850
60851           /**
60852            * Sets the property value of `path` on `object`. If a portion of `path`
60853            * does not exist it is created.
60854            *
60855            * @static
60856            * @memberOf _
60857            * @category Object
60858            * @param {Object}
60859            *            object The object to augment.
60860            * @param {Array|string}
60861            *            path The path of the property to set.
60862            * @param {*}
60863            *            value The value to set.
60864            * @returns {Object} Returns `object`.
60865            * @example
60866            *
60867            * var object = { 'a': [{ 'b': { 'c': 3 } }] };
60868            *
60869            * _.set(object, 'a[0].b.c', 4); console.log(object.a[0].b.c); // => 4
60870            *
60871            * _.set(object, 'x[0].y.z', 5); console.log(object.x[0].y.z); // => 5
60872            */
60873           function set(object, path, value) {
60874             if (object == null) {
60875               return object;
60876             }
60877             var pathKey = (path + '');
60878             path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);
60879
60880             var index = -1,
60881               length = path.length,
60882               lastIndex = length - 1,
60883               nested = object;
60884
60885             while (nested != null && ++index < length) {
60886               var key = path[index];
60887               if (isObject(nested)) {
60888                 if (index == lastIndex) {
60889                   nested[key] = value;
60890                 } else if (nested[key] == null) {
60891                   nested[key] = isIndex(path[index + 1]) ? [] : {};
60892                 }
60893               }
60894               nested = nested[key];
60895             }
60896             return object;
60897           }
60898
60899           /**
60900            * An alternative to `_.reduce`; this method transforms `object` to a new
60901            * `accumulator` object which is the result of running each of its own
60902            * enumerable properties through `iteratee`, with each invocation
60903            * potentially mutating the `accumulator` object. The `iteratee` is bound to
60904            * `thisArg` and invoked with four arguments: (accumulator, value, key,
60905            * object). Iteratee functions may exit iteration early by explicitly
60906            * returning `false`.
60907            *
60908            * @static
60909            * @memberOf _
60910            * @category Object
60911            * @param {Array|Object}
60912            *            object The object to iterate over.
60913            * @param {Function}
60914            *            [iteratee=_.identity] The function invoked per iteration.
60915            * @param {*}
60916            *            [accumulator] The custom accumulator value.
60917            * @param {*}
60918            *            [thisArg] The `this` binding of `iteratee`.
60919            * @returns {*} Returns the accumulated value.
60920            * @example
60921            *
60922            * _.transform([2, 3, 4], function(result, n) { result.push(n *= n); return
60923            * n % 2 == 0; }); // => [4, 9]
60924            *
60925            * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] =
60926            * n * 3; }); // => { 'a': 3, 'b': 6 }
60927            */
60928           function transform(object, iteratee, accumulator, thisArg) {
60929             var isArr = isArray(object) || isTypedArray(object);
60930             iteratee = getCallback(iteratee, thisArg, 4);
60931
60932             if (accumulator == null) {
60933               if (isArr || isObject(object)) {
60934                 var Ctor = object.constructor;
60935                 if (isArr) {
60936                   accumulator = isArray(object) ? new Ctor : [];
60937                 } else {
60938                   accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
60939                 }
60940               } else {
60941                 accumulator = {};
60942               }
60943             }
60944             (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
60945               return iteratee(accumulator, value, index, object);
60946             });
60947             return accumulator;
60948           }
60949
60950           /**
60951            * Creates an array of the own enumerable property values of `object`.
60952            *
60953            * **Note:** Non-object values are coerced to objects.
60954            *
60955            * @static
60956            * @memberOf _
60957            * @category Object
60958            * @param {Object}
60959            *            object The object to query.
60960            * @returns {Array} Returns the array of property values.
60961            * @example
60962            *
60963            * function Foo() { this.a = 1; this.b = 2; }
60964            *
60965            * Foo.prototype.c = 3;
60966            *
60967            * _.values(new Foo); // => [1, 2] (iteration order is not guaranteed)
60968            *
60969            * _.values('hi'); // => ['h', 'i']
60970            */
60971           function values(object) {
60972             return baseValues(object, keys(object));
60973           }
60974
60975           /**
60976            * Creates an array of the own and inherited enumerable property values of
60977            * `object`.
60978            *
60979            * **Note:** Non-object values are coerced to objects.
60980            *
60981            * @static
60982            * @memberOf _
60983            * @category Object
60984            * @param {Object}
60985            *            object The object to query.
60986            * @returns {Array} Returns the array of property values.
60987            * @example
60988            *
60989            * function Foo() { this.a = 1; this.b = 2; }
60990            *
60991            * Foo.prototype.c = 3;
60992            *
60993            * _.valuesIn(new Foo); // => [1, 2, 3] (iteration order is not guaranteed)
60994            */
60995           function valuesIn(object) {
60996             return baseValues(object, keysIn(object));
60997           }
60998
60999           /*------------------------------------------------------------------------*/
61000
61001           /**
61002            * Checks if `n` is between `start` and up to but not including, `end`. If
61003            * `end` is not specified it is set to `start` with `start` then set to `0`.
61004            *
61005            * @static
61006            * @memberOf _
61007            * @category Number
61008            * @param {number}
61009            *            n The number to check.
61010            * @param {number}
61011            *            [start=0] The start of the range.
61012            * @param {number}
61013            *            end The end of the range.
61014            * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
61015            * @example
61016            *
61017            * _.inRange(3, 2, 4); // => true
61018            *
61019            * _.inRange(4, 8); // => true
61020            *
61021            * _.inRange(4, 2); // => false
61022            *
61023            * _.inRange(2, 2); // => false
61024            *
61025            * _.inRange(1.2, 2); // => true
61026            *
61027            * _.inRange(5.2, 4); // => false
61028            */
61029           function inRange(value, start, end) {
61030             start = +start || 0;
61031             if (end === undefined) {
61032               end = start;
61033               start = 0;
61034             } else {
61035               end = +end || 0;
61036             }
61037             return value >= nativeMin(start, end) && value < nativeMax(start, end);
61038           }
61039
61040           /**
61041            * Produces a random number between `min` and `max` (inclusive). If only one
61042            * argument is provided a number between `0` and the given number is
61043            * returned. If `floating` is `true`, or either `min` or `max` are floats, a
61044            * floating-point number is returned instead of an integer.
61045            *
61046            * @static
61047            * @memberOf _
61048            * @category Number
61049            * @param {number}
61050            *            [min=0] The minimum possible value.
61051            * @param {number}
61052            *            [max=1] The maximum possible value.
61053            * @param {boolean}
61054            *            [floating] Specify returning a floating-point number.
61055            * @returns {number} Returns the random number.
61056            * @example
61057            *
61058            * _.random(0, 5); // => an integer between 0 and 5
61059            *
61060            * _.random(5); // => also an integer between 0 and 5
61061            *
61062            * _.random(5, true); // => a floating-point number between 0 and 5
61063            *
61064            * _.random(1.2, 5.2); // => a floating-point number between 1.2 and 5.2
61065            */
61066           function random(min, max, floating) {
61067             if (floating && isIterateeCall(min, max, floating)) {
61068               max = floating = undefined;
61069             }
61070             var noMin = min == null,
61071               noMax = max == null;
61072
61073             if (floating == null) {
61074               if (noMax && typeof min == 'boolean') {
61075                 floating = min;
61076                 min = 1;
61077               } else if (typeof max == 'boolean') {
61078                 floating = max;
61079                 noMax = true;
61080               }
61081             }
61082             if (noMin && noMax) {
61083               max = 1;
61084               noMax = false;
61085             }
61086             min = +min || 0;
61087             if (noMax) {
61088               max = min;
61089               min = 0;
61090             } else {
61091               max = +max || 0;
61092             }
61093             if (floating || min % 1 || max % 1) {
61094               var rand = nativeRandom();
61095               return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
61096             }
61097             return baseRandom(min, max);
61098           }
61099
61100           /*------------------------------------------------------------------------*/
61101
61102           /**
61103            * Converts `string` to [camel
61104            * case](https://en.wikipedia.org/wiki/CamelCase).
61105            *
61106            * @static
61107            * @memberOf _
61108            * @category String
61109            * @param {string}
61110            *            [string=''] The string to convert.
61111            * @returns {string} Returns the camel cased string.
61112            * @example
61113            *
61114            * _.camelCase('Foo Bar'); // => 'fooBar'
61115            *
61116            * _.camelCase('--foo-bar'); // => 'fooBar'
61117            *
61118            * _.camelCase('__foo_bar__'); // => 'fooBar'
61119            */
61120           var camelCase = createCompounder(function(result, word, index) {
61121             word = word.toLowerCase();
61122             return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
61123           });
61124
61125           /**
61126            * Capitalizes the first character of `string`.
61127            *
61128            * @static
61129            * @memberOf _
61130            * @category String
61131            * @param {string}
61132            *            [string=''] The string to capitalize.
61133            * @returns {string} Returns the capitalized string.
61134            * @example
61135            *
61136            * _.capitalize('fred'); // => 'Fred'
61137            */
61138           function capitalize(string) {
61139             string = baseToString(string);
61140             return string && (string.charAt(0).toUpperCase() + string.slice(1));
61141           }
61142
61143           /**
61144            * Deburrs `string` by converting [latin-1 supplementary
61145            * letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
61146            * to basic latin letters and removing [combining diacritical
61147            * marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
61148            *
61149            * @static
61150            * @memberOf _
61151            * @category String
61152            * @param {string}
61153            *            [string=''] The string to deburr.
61154            * @returns {string} Returns the deburred string.
61155            * @example
61156            *
61157            * _.deburr('déjà vu'); // => 'deja vu'
61158            */
61159           function deburr(string) {
61160             string = baseToString(string);
61161             return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
61162           }
61163
61164           /**
61165            * Checks if `string` ends with the given target string.
61166            *
61167            * @static
61168            * @memberOf _
61169            * @category String
61170            * @param {string}
61171            *            [string=''] The string to search.
61172            * @param {string}
61173            *            [target] The string to search for.
61174            * @param {number}
61175            *            [position=string.length] The position to search from.
61176            * @returns {boolean} Returns `true` if `string` ends with `target`, else
61177            *          `false`.
61178            * @example
61179            *
61180            * _.endsWith('abc', 'c'); // => true
61181            *
61182            * _.endsWith('abc', 'b'); // => false
61183            *
61184            * _.endsWith('abc', 'b', 2); // => true
61185            */
61186           function endsWith(string, target, position) {
61187             string = baseToString(string);
61188             target = (target + '');
61189
61190             var length = string.length;
61191             position = position === undefined ? length : nativeMin(position < 0 ? 0 : (+position || 0), length);
61192
61193             position -= target.length;
61194             return position >= 0 && string.indexOf(target, position) == position;
61195           }
61196
61197           /**
61198            * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string`
61199            * to their corresponding HTML entities.
61200            *
61201            * **Note:** No other characters are escaped. To escape additional
61202            * characters use a third-party library like [_he_](https://mths.be/he).
61203            *
61204            * Though the ">" character is escaped for symmetry, characters like ">" and
61205            * "/" don't need escaping in HTML and have no special meaning unless
61206            * they're part of a tag or unquoted attribute value. See [Mathias Bynens's
61207            * article](https://mathiasbynens.be/notes/ambiguous-ampersands) (under
61208            * "semi-related fun fact") for more details.
61209            *
61210            * Backticks are escaped because in Internet Explorer < 9, they can break
61211            * out of attribute values or HTML comments. See
61212            * [#59](https://html5sec.org/#59), [#102](https://html5sec.org/#102),
61213            * [#108](https://html5sec.org/#108), and [#133](https://html5sec.org/#133)
61214            * of the [HTML5 Security Cheatsheet](https://html5sec.org/) for more
61215            * details.
61216            *
61217            * When working with HTML you should always [quote attribute
61218            * values](http://wonko.com/post/html-escaping) to reduce XSS vectors.
61219            *
61220            * @static
61221            * @memberOf _
61222            * @category String
61223            * @param {string}
61224            *            [string=''] The string to escape.
61225            * @returns {string} Returns the escaped string.
61226            * @example
61227            *
61228            * _.escape('fred, barney, & pebbles'); // => 'fred, barney, &amp; pebbles'
61229            */
61230           function escape(string) {
61231             // Reset `lastIndex` because in IE < 9 `String#replace` does not.
61232             string = baseToString(string);
61233             return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
61234           }
61235
61236           /**
61237            * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|",
61238            * "?", "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
61239            *
61240            * @static
61241            * @memberOf _
61242            * @category String
61243            * @param {string}
61244            *            [string=''] The string to escape.
61245            * @returns {string} Returns the escaped string.
61246            * @example
61247            *
61248            * _.escapeRegExp('[lodash](https://lodash.com/)'); // =>
61249            * '\[lodash\]\(https:\/\/lodash\.com\/\)'
61250            */
61251           function escapeRegExp(string) {
61252             string = baseToString(string);
61253             return (string && reHasRegExpChars.test(string)) ? string.replace(reRegExpChars, escapeRegExpChar) : (string || '(?:)');
61254           }
61255
61256           /**
61257            * Converts `string` to [kebab
61258            * case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
61259            *
61260            * @static
61261            * @memberOf _
61262            * @category String
61263            * @param {string}
61264            *            [string=''] The string to convert.
61265            * @returns {string} Returns the kebab cased string.
61266            * @example
61267            *
61268            * _.kebabCase('Foo Bar'); // => 'foo-bar'
61269            *
61270            * _.kebabCase('fooBar'); // => 'foo-bar'
61271            *
61272            * _.kebabCase('__foo_bar__'); // => 'foo-bar'
61273            */
61274           var kebabCase = createCompounder(function(result, word, index) {
61275             return result + (index ? '-' : '') + word.toLowerCase();
61276           });
61277
61278           /**
61279            * Pads `string` on the left and right sides if it's shorter than `length`.
61280            * Padding characters are truncated if they can't be evenly divided by
61281            * `length`.
61282            *
61283            * @static
61284            * @memberOf _
61285            * @category String
61286            * @param {string}
61287            *            [string=''] The string to pad.
61288            * @param {number}
61289            *            [length=0] The padding length.
61290            * @param {string}
61291            *            [chars=' '] The string used as padding.
61292            * @returns {string} Returns the padded string.
61293            * @example
61294            *
61295            * _.pad('abc', 8); // => ' abc '
61296            *
61297            * _.pad('abc', 8, '_-'); // => '_-abc_-_'
61298            *
61299            * _.pad('abc', 3); // => 'abc'
61300            */
61301           function pad(string, length, chars) {
61302             string = baseToString(string);
61303             length = +length;
61304
61305             var strLength = string.length;
61306             if (strLength >= length || !nativeIsFinite(length)) {
61307               return string;
61308             }
61309             var mid = (length - strLength) / 2,
61310               leftLength = nativeFloor(mid),
61311               rightLength = nativeCeil(mid);
61312
61313             chars = createPadding('', rightLength, chars);
61314             return chars.slice(0, leftLength) + string + chars;
61315           }
61316
61317           /**
61318            * Pads `string` on the left side if it's shorter than `length`. Padding
61319            * characters are truncated if they exceed `length`.
61320            *
61321            * @static
61322            * @memberOf _
61323            * @category String
61324            * @param {string}
61325            *            [string=''] The string to pad.
61326            * @param {number}
61327            *            [length=0] The padding length.
61328            * @param {string}
61329            *            [chars=' '] The string used as padding.
61330            * @returns {string} Returns the padded string.
61331            * @example
61332            *
61333            * _.padLeft('abc', 6); // => ' abc'
61334            *
61335            * _.padLeft('abc', 6, '_-'); // => '_-_abc'
61336            *
61337            * _.padLeft('abc', 3); // => 'abc'
61338            */
61339           var padLeft = createPadDir();
61340
61341           /**
61342            * Pads `string` on the right side if it's shorter than `length`. Padding
61343            * characters are truncated if they exceed `length`.
61344            *
61345            * @static
61346            * @memberOf _
61347            * @category String
61348            * @param {string}
61349            *            [string=''] The string to pad.
61350            * @param {number}
61351            *            [length=0] The padding length.
61352            * @param {string}
61353            *            [chars=' '] The string used as padding.
61354            * @returns {string} Returns the padded string.
61355            * @example
61356            *
61357            * _.padRight('abc', 6); // => 'abc '
61358            *
61359            * _.padRight('abc', 6, '_-'); // => 'abc_-_'
61360            *
61361            * _.padRight('abc', 3); // => 'abc'
61362            */
61363           var padRight = createPadDir(true);
61364
61365           /**
61366            * Converts `string` to an integer of the specified radix. If `radix` is
61367            * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
61368            * hexadecimal, in which case a `radix` of `16` is used.
61369            *
61370            * **Note:** This method aligns with the [ES5
61371            * implementation](https://es5.github.io/#E) of `parseInt`.
61372            *
61373            * @static
61374            * @memberOf _
61375            * @category String
61376            * @param {string}
61377            *            string The string to convert.
61378            * @param {number}
61379            *            [radix] The radix to interpret `value` by.
61380            * @param- {Object} [guard] Enables use as a callback for functions like
61381            *         `_.map`.
61382            * @returns {number} Returns the converted integer.
61383            * @example
61384            *
61385            * _.parseInt('08'); // => 8
61386            *
61387            * _.map(['6', '08', '10'], _.parseInt); // => [6, 8, 10]
61388            */
61389           function parseInt(string, radix, guard) {
61390             // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
61391             // Chrome fails to trim leading <BOM> whitespace characters.
61392             // See https://code.google.com/p/v8/issues/detail?id=3109 for more
61393             // details.
61394             if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
61395               radix = 0;
61396             } else if (radix) {
61397               radix = +radix;
61398             }
61399             string = trim(string);
61400             return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
61401           }
61402
61403           /**
61404            * Repeats the given string `n` times.
61405            *
61406            * @static
61407            * @memberOf _
61408            * @category String
61409            * @param {string}
61410            *            [string=''] The string to repeat.
61411            * @param {number}
61412            *            [n=0] The number of times to repeat the string.
61413            * @returns {string} Returns the repeated string.
61414            * @example
61415            *
61416            * _.repeat('*', 3); // => '***'
61417            *
61418            * _.repeat('abc', 2); // => 'abcabc'
61419            *
61420            * _.repeat('abc', 0); // => ''
61421            */
61422           function repeat(string, n) {
61423             var result = '';
61424             string = baseToString(string);
61425             n = +n;
61426             if (n < 1 || !string || !nativeIsFinite(n)) {
61427               return result;
61428             }
61429             // Leverage the exponentiation by squaring algorithm for a faster
61430             // repeat.
61431             // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more
61432             // details.
61433             do {
61434               if (n % 2) {
61435                 result += string;
61436               }
61437               n = nativeFloor(n / 2);
61438               string += string;
61439             } while (n);
61440
61441             return result;
61442           }
61443
61444           /**
61445            * Converts `string` to [snake
61446            * case](https://en.wikipedia.org/wiki/Snake_case).
61447            *
61448            * @static
61449            * @memberOf _
61450            * @category String
61451            * @param {string}
61452            *            [string=''] The string to convert.
61453            * @returns {string} Returns the snake cased string.
61454            * @example
61455            *
61456            * _.snakeCase('Foo Bar'); // => 'foo_bar'
61457            *
61458            * _.snakeCase('fooBar'); // => 'foo_bar'
61459            *
61460            * _.snakeCase('--foo-bar'); // => 'foo_bar'
61461            */
61462           var snakeCase = createCompounder(function(result, word, index) {
61463             return result + (index ? '_' : '') + word.toLowerCase();
61464           });
61465
61466           /**
61467            * Converts `string` to [start
61468            * case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
61469            *
61470            * @static
61471            * @memberOf _
61472            * @category String
61473            * @param {string}
61474            *            [string=''] The string to convert.
61475            * @returns {string} Returns the start cased string.
61476            * @example
61477            *
61478            * _.startCase('--foo-bar'); // => 'Foo Bar'
61479            *
61480            * _.startCase('fooBar'); // => 'Foo Bar'
61481            *
61482            * _.startCase('__foo_bar__'); // => 'Foo Bar'
61483            */
61484           var startCase = createCompounder(function(result, word, index) {
61485             return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
61486           });
61487
61488           /**
61489            * Checks if `string` starts with the given target string.
61490            *
61491            * @static
61492            * @memberOf _
61493            * @category String
61494            * @param {string}
61495            *            [string=''] The string to search.
61496            * @param {string}
61497            *            [target] The string to search for.
61498            * @param {number}
61499            *            [position=0] The position to search from.
61500            * @returns {boolean} Returns `true` if `string` starts with `target`, else
61501            *          `false`.
61502            * @example
61503            *
61504            * _.startsWith('abc', 'a'); // => true
61505            *
61506            * _.startsWith('abc', 'b'); // => false
61507            *
61508            * _.startsWith('abc', 'b', 1); // => true
61509            */
61510           function startsWith(string, target, position) {
61511             string = baseToString(string);
61512             position = position == null ? 0 : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
61513
61514             return string.lastIndexOf(target, position) == position;
61515           }
61516
61517           /**
61518            * Creates a compiled template function that can interpolate data properties
61519            * in "interpolate" delimiters, HTML-escape interpolated data properties in
61520            * "escape" delimiters, and execute JavaScript in "evaluate" delimiters.
61521            * Data properties may be accessed as free variables in the template. If a
61522            * setting object is provided it takes precedence over `_.templateSettings`
61523            * values.
61524            *
61525            * **Note:** In the development build `_.template` utilizes
61526            * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
61527            * for easier debugging.
61528            *
61529            * For more information on precompiling templates see [lodash's custom
61530            * builds documentation](https://lodash.com/custom-builds).
61531            *
61532            * For more information on Chrome extension sandboxes see [Chrome's
61533            * extensions
61534            * documentation](https://developer.chrome.com/extensions/sandboxingEval).
61535            *
61536            * @static
61537            * @memberOf _
61538            * @category String
61539            * @param {string}
61540            *            [string=''] The template string.
61541            * @param {Object}
61542            *            [options] The options object.
61543            * @param {RegExp}
61544            *            [options.escape] The HTML "escape" delimiter.
61545            * @param {RegExp}
61546            *            [options.evaluate] The "evaluate" delimiter.
61547            * @param {Object}
61548            *            [options.imports] An object to import into the template as
61549            *            free variables.
61550            * @param {RegExp}
61551            *            [options.interpolate] The "interpolate" delimiter.
61552            * @param {string}
61553            *            [options.sourceURL] The sourceURL of the template's compiled
61554            *            source.
61555            * @param {string}
61556            *            [options.variable] The data object variable name.
61557            * @param- {Object} [otherOptions] Enables the legacy `options` param
61558            *         signature.
61559            * @returns {Function} Returns the compiled template function.
61560            * @example
61561            *  // using the "interpolate" delimiter to create a compiled
61562            * template var compiled = _.template('hello <%= user %>!'); compiled({
61563            * 'user': 'fred' }); // => 'hello fred!'
61564            *  // using the HTML "escape" delimiter to escape data property values var
61565            * compiled = _.template('<b><%- value %></b>'); compiled({ 'value': '<script>'
61566            * }); // => '<b>&lt;script&gt;</b>'
61567            *  // using the "evaluate" delimiter to execute JavaScript and generate
61568            * HTML var compiled = _.template('<% _.forEach(users, function(user) { %>
61569            * <li><%- user %></li><% }); %>'); compiled({ 'users': ['fred',
61570            * 'barney'] }); // => '
61571            * <li>fred</li>
61572            * <li>barney</li>'
61573            *  // using the internal `print` function in "evaluate" delimiters var
61574            * compiled = _.template('<% print("hello " + user); %>!'); compiled({
61575            * 'user': 'barney' }); // => 'hello barney!'
61576            *  // using the ES delimiter as an alternative to the default "interpolate"
61577            * delimiter var compiled = _.template('hello ${ user }!'); compiled({
61578            * 'user': 'pebbles' }); // => 'hello pebbles!'
61579            *  // using custom template delimiters _.templateSettings.interpolate =
61580            * /{{([\s\S]+?)}}/g; var compiled = _.template('hello {{ user }}!');
61581            * compiled({ 'user': 'mustache' }); // => 'hello mustache!'
61582            *  // using backslashes to treat delimiters as plain text var compiled =
61583            * _.template('<%= "\\<%- value %\\>" %>'); compiled({ 'value': 'ignored'
61584            * }); // => '<%- value %>'
61585            *  // using the `imports` option to import `jQuery` as `jq` var text = '<%
61586            * jq.each(users, function(user) { %>
61587            * <li><%- user %></li><% }); %>'; var compiled = _.template(text, {
61588            * 'imports': { 'jq': jQuery } }); compiled({ 'users': ['fred', 'barney']
61589            * }); // => '
61590            * <li>fred</li>
61591            * <li>barney</li>'
61592            *  // using the `sourceURL` option to specify a custom sourceURL for the
61593            * template var compiled = _.template('hello <%= user %>!', { 'sourceURL':
61594            * '/basic/greeting.jst' }); compiled(data); // => find the source of
61595            * "greeting.jst" under the Sources tab or Resources panel of the web
61596            * inspector
61597            *  // using the `variable` option to ensure a with-statement isn't used in
61598            * the compiled template var compiled = _.template('hi <%= data.user %>!', {
61599            * 'variable': 'data' }); compiled.source; // => function(data) { // var
61600            * __t, __p = ''; // __p += 'hi ' + ((__t = ( data.user )) == null ? '' :
61601            * __t) + '!'; // return __p; // }
61602            *  // using the `source` property to inline compiled templates for
61603            * meaningful // line numbers in error messages and a stack trace
61604            * fs.writeFileSync(path.join(cwd, 'jst.js'), '\ var JST = {\ "main": ' +
61605            * _.template(mainText).source + '\ };\ ');
61606            */
61607           function template(string, options, otherOptions) {
61608             // Based on John Resig's `tmpl` implementation
61609             // (http://ejohn.org/blog/javascript-micro-templating/)
61610             // and Laura Doktorova's doT.js (https://github.com/olado/doT).
61611             var settings = lodash.templateSettings;
61612
61613             if (otherOptions && isIterateeCall(string, options, otherOptions)) {
61614               options = otherOptions = undefined;
61615             }
61616             string = baseToString(string);
61617             options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
61618
61619             var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
61620               importsKeys = keys(imports),
61621               importsValues = baseValues(imports, importsKeys);
61622
61623             var isEscaping,
61624               isEvaluating,
61625               index = 0,
61626               interpolate = options.interpolate || reNoMatch,
61627               source = "__p += '";
61628
61629             // Compile the regexp to match each delimiter.
61630             var reDelimiters = RegExp(
61631               (options.escape || reNoMatch).source + '|' +
61632               interpolate.source + '|' +
61633               (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
61634               (options.evaluate || reNoMatch).source + '|$', 'g');
61635
61636             // Use a sourceURL for easier debugging.
61637             var sourceURL = '//# sourceURL=' +
61638               ('sourceURL' in options ? options.sourceURL : ('lodash.templateSources[' + (++templateCounter) + ']')) + '\n';
61639
61640             string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
61641               interpolateValue || (interpolateValue = esTemplateValue);
61642
61643               // Escape characters that can't be included in string literals.
61644               source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
61645
61646               // Replace delimiters with snippets.
61647               if (escapeValue) {
61648                 isEscaping = true;
61649                 source += "' +\n__e(" + escapeValue + ") +\n'";
61650               }
61651               if (evaluateValue) {
61652                 isEvaluating = true;
61653                 source += "';\n" + evaluateValue + ";\n__p += '";
61654               }
61655               if (interpolateValue) {
61656                 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
61657               }
61658               index = offset + match.length;
61659
61660               // The JS engine embedded in Adobe products requires returning the
61661               // `match`
61662               // string in order to produce the correct `offset` value.
61663               return match;
61664             });
61665
61666             source += "';\n";
61667
61668             // If `variable` is not specified wrap a with-statement around the
61669             // generated
61670             // code to add the data object to the top of the scope chain.
61671             var variable = options.variable;
61672             if (!variable) {
61673               source = 'with (obj) {\n' + source + '\n}\n';
61674             }
61675             // Cleanup code by stripping empty strings.
61676             source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
61677               .replace(reEmptyStringMiddle, '$1')
61678               .replace(reEmptyStringTrailing, '$1;');
61679
61680             // Frame code as the function body.
61681             source = 'function(' + (variable || 'obj') + ') {\n' +
61682               (variable ? '' : 'obj || (obj = {});\n') +
61683               "var __t, __p = ''" +
61684               (isEscaping ? ', __e = _.escape' : '') +
61685               (isEvaluating ? ', __j = Array.prototype.join;\n' +
61686                 "function print() { __p += __j.call(arguments, '') }\n" : ';\n'
61687               ) +
61688               source +
61689               'return __p\n}';
61690
61691             var result = attempt(function() {
61692               return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
61693             });
61694
61695             // Provide the compiled function's source by its `toString` method or
61696             // the `source` property as a convenience for inlining compiled
61697             // templates.
61698             result.source = source;
61699             if (isError(result)) {
61700               throw result;
61701             }
61702             return result;
61703           }
61704
61705           /**
61706            * Removes leading and trailing whitespace or specified characters from
61707            * `string`.
61708            *
61709            * @static
61710            * @memberOf _
61711            * @category String
61712            * @param {string}
61713            *            [string=''] The string to trim.
61714            * @param {string}
61715            *            [chars=whitespace] The characters to trim.
61716            * @param- {Object} [guard] Enables use as a callback for functions like
61717            *         `_.map`.
61718            * @returns {string} Returns the trimmed string.
61719            * @example
61720            *
61721            * _.trim(' abc '); // => 'abc'
61722            *
61723            * _.trim('-_-abc-_-', '_-'); // => 'abc'
61724            *
61725            * _.map([' foo ', ' bar '], _.trim); // => ['foo', 'bar']
61726            */
61727           function trim(string, chars, guard) {
61728             var value = string;
61729             string = baseToString(string);
61730             if (!string) {
61731               return string;
61732             }
61733             if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61734               return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
61735             }
61736             chars = (chars + '');
61737             return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
61738           }
61739
61740           /**
61741            * Removes leading whitespace or specified characters from `string`.
61742            *
61743            * @static
61744            * @memberOf _
61745            * @category String
61746            * @param {string}
61747            *            [string=''] The string to trim.
61748            * @param {string}
61749            *            [chars=whitespace] The characters to trim.
61750            * @param- {Object} [guard] Enables use as a callback for functions like
61751            *         `_.map`.
61752            * @returns {string} Returns the trimmed string.
61753            * @example
61754            *
61755            * _.trimLeft(' abc '); // => 'abc '
61756            *
61757            * _.trimLeft('-_-abc-_-', '_-'); // => 'abc-_-'
61758            */
61759           function trimLeft(string, chars, guard) {
61760             var value = string;
61761             string = baseToString(string);
61762             if (!string) {
61763               return string;
61764             }
61765             if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61766               return string.slice(trimmedLeftIndex(string));
61767             }
61768             return string.slice(charsLeftIndex(string, (chars + '')));
61769           }
61770
61771           /**
61772            * Removes trailing whitespace or specified characters from `string`.
61773            *
61774            * @static
61775            * @memberOf _
61776            * @category String
61777            * @param {string}
61778            *            [string=''] The string to trim.
61779            * @param {string}
61780            *            [chars=whitespace] The characters to trim.
61781            * @param- {Object} [guard] Enables use as a callback for functions like
61782            *         `_.map`.
61783            * @returns {string} Returns the trimmed string.
61784            * @example
61785            *
61786            * _.trimRight(' abc '); // => ' abc'
61787            *
61788            * _.trimRight('-_-abc-_-', '_-'); // => '-_-abc'
61789            */
61790           function trimRight(string, chars, guard) {
61791             var value = string;
61792             string = baseToString(string);
61793             if (!string) {
61794               return string;
61795             }
61796             if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61797               return string.slice(0, trimmedRightIndex(string) + 1);
61798             }
61799             return string.slice(0, charsRightIndex(string, (chars + '')) + 1);
61800           }
61801
61802           /**
61803            * Truncates `string` if it's longer than the given maximum string length.
61804            * The last characters of the truncated string are replaced with the
61805            * omission string which defaults to "...".
61806            *
61807            * @static
61808            * @memberOf _
61809            * @category String
61810            * @param {string}
61811            *            [string=''] The string to truncate.
61812            * @param {Object|number}
61813            *            [options] The options object or maximum string length.
61814            * @param {number}
61815            *            [options.length=30] The maximum string length.
61816            * @param {string}
61817            *            [options.omission='...'] The string to indicate text is
61818            *            omitted.
61819            * @param {RegExp|string}
61820            *            [options.separator] The separator pattern to truncate to.
61821            * @param- {Object} [guard] Enables use as a callback for functions like
61822            *         `_.map`.
61823            * @returns {string} Returns the truncated string.
61824            * @example
61825            *
61826            * _.trunc('hi-diddly-ho there, neighborino'); // => 'hi-diddly-ho there,
61827            * neighbo...'
61828            *
61829            * _.trunc('hi-diddly-ho there, neighborino', 24); // => 'hi-diddly-ho
61830            * there, n...'
61831            *
61832            * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' '
61833            * }); // => 'hi-diddly-ho there,...'
61834            *
61835            * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator':
61836            * /,? +/ }); // => 'hi-diddly-ho there...'
61837            *
61838            * _.trunc('hi-diddly-ho there, neighborino', { 'omission': ' [...]' }); // =>
61839            * 'hi-diddly-ho there, neig [...]'
61840            */
61841           function trunc(string, options, guard) {
61842             if (guard && isIterateeCall(string, options, guard)) {
61843               options = undefined;
61844             }
61845             var length = DEFAULT_TRUNC_LENGTH,
61846               omission = DEFAULT_TRUNC_OMISSION;
61847
61848             if (options != null) {
61849               if (isObject(options)) {
61850                 var separator = 'separator' in options ? options.separator : separator;
61851                 length = 'length' in options ? (+options.length || 0) : length;
61852                 omission = 'omission' in options ? baseToString(options.omission) : omission;
61853               } else {
61854                 length = +options || 0;
61855               }
61856             }
61857             string = baseToString(string);
61858             if (length >= string.length) {
61859               return string;
61860             }
61861             var end = length - omission.length;
61862             if (end < 1) {
61863               return omission;
61864             }
61865             var result = string.slice(0, end);
61866             if (separator == null) {
61867               return result + omission;
61868             }
61869             if (isRegExp(separator)) {
61870               if (string.slice(end).search(separator)) {
61871                 var match,
61872                   newEnd,
61873                   substring = string.slice(0, end);
61874
61875                 if (!separator.global) {
61876                   separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
61877                 }
61878                 separator.lastIndex = 0;
61879                 while ((match = separator.exec(substring))) {
61880                   newEnd = match.index;
61881                 }
61882                 result = result.slice(0, newEnd == null ? end : newEnd);
61883               }
61884             } else if (string.indexOf(separator, end) != end) {
61885               var index = result.lastIndexOf(separator);
61886               if (index > -1) {
61887                 result = result.slice(0, index);
61888               }
61889             }
61890             return result + omission;
61891           }
61892
61893           /**
61894            * The inverse of `_.escape`; this method converts the HTML entities
61895            * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to
61896            * their corresponding characters.
61897            *
61898            * **Note:** No other HTML entities are unescaped. To unescape additional
61899            * HTML entities use a third-party library like [_he_](https://mths.be/he).
61900            *
61901            * @static
61902            * @memberOf _
61903            * @category String
61904            * @param {string}
61905            *            [string=''] The string to unescape.
61906            * @returns {string} Returns the unescaped string.
61907            * @example
61908            *
61909            * _.unescape('fred, barney, &amp; pebbles'); // => 'fred, barney, &
61910            * pebbles'
61911            */
61912           function unescape(string) {
61913             string = baseToString(string);
61914             return (string && reHasEscapedHtml.test(string)) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
61915           }
61916
61917           /**
61918            * Splits `string` into an array of its words.
61919            *
61920            * @static
61921            * @memberOf _
61922            * @category String
61923            * @param {string}
61924            *            [string=''] The string to inspect.
61925            * @param {RegExp|string}
61926            *            [pattern] The pattern to match words.
61927            * @param- {Object} [guard] Enables use as a callback for functions like
61928            *         `_.map`.
61929            * @returns {Array} Returns the words of `string`.
61930            * @example
61931            *
61932            * _.words('fred, barney, & pebbles'); // => ['fred', 'barney', 'pebbles']
61933            *
61934            * _.words('fred, barney, & pebbles', /[^, ]+/g); // => ['fred', 'barney',
61935            * '&', 'pebbles']
61936            */
61937           function words(string, pattern, guard) {
61938             if (guard && isIterateeCall(string, pattern, guard)) {
61939               pattern = undefined;
61940             }
61941             string = baseToString(string);
61942             return string.match(pattern || reWords) || [];
61943           }
61944
61945           /*------------------------------------------------------------------------*/
61946
61947           /**
61948            * Attempts to invoke `func`, returning either the result or the caught
61949            * error object. Any additional arguments are provided to `func` when it is
61950            * invoked.
61951            *
61952            * @static
61953            * @memberOf _
61954            * @category Utility
61955            * @param {Function}
61956            *            func The function to attempt.
61957            * @returns {*} Returns the `func` result or error object.
61958            * @example
61959            *  // avoid throwing errors for invalid selectors var elements =
61960            * _.attempt(function(selector) { return
61961            * document.querySelectorAll(selector); }, '>_>');
61962            *
61963            * if (_.isError(elements)) { elements = []; }
61964            */
61965           var attempt = restParam(function(func, args) {
61966             try {
61967               return func.apply(undefined, args);
61968             } catch (e) {
61969               return isError(e) ? e : new Error(e);
61970             }
61971           });
61972
61973           /**
61974            * Creates a function that invokes `func` with the `this` binding of
61975            * `thisArg` and arguments of the created function. If `func` is a property
61976            * name the created callback returns the property value for a given element.
61977            * If `func` is an object the created callback returns `true` for elements
61978            * that contain the equivalent object properties, otherwise it returns
61979            * `false`.
61980            *
61981            * @static
61982            * @memberOf _
61983            * @alias iteratee
61984            * @category Utility
61985            * @param {*}
61986            *            [func=_.identity] The value to convert to a callback.
61987            * @param {*}
61988            *            [thisArg] The `this` binding of `func`.
61989            * @param- {Object} [guard] Enables use as a callback for functions like
61990            *         `_.map`.
61991            * @returns {Function} Returns the callback.
61992            * @example
61993            *
61994            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
61995            * 40 } ];
61996            *  // wrap to create custom callback shorthands _.callback =
61997            * _.wrap(_.callback, function(callback, func, thisArg) { var match =
61998            * /^(.+?)__([gl]t)(.+)$/.exec(func); if (!match) { return callback(func,
61999            * thisArg); } return function(object) { return match[2] == 'gt' ?
62000            * object[match[1]] > match[3] : object[match[1]] < match[3]; }; });
62001            *
62002            * _.filter(users, 'age__gt36'); // => [{ 'user': 'fred', 'age': 40 }]
62003            */
62004           function callback(func, thisArg, guard) {
62005             if (guard && isIterateeCall(func, thisArg, guard)) {
62006               thisArg = undefined;
62007             }
62008             return isObjectLike(func) ? matches(func) : baseCallback(func, thisArg);
62009           }
62010
62011           /**
62012            * Creates a function that returns `value`.
62013            *
62014            * @static
62015            * @memberOf _
62016            * @category Utility
62017            * @param {*}
62018            *            value The value to return from the new function.
62019            * @returns {Function} Returns the new function.
62020            * @example
62021            *
62022            * var object = { 'user': 'fred' }; var getter = _.constant(object);
62023            *
62024            * getter() === object; // => true
62025            */
62026           function constant(value) {
62027             return function() {
62028               return value;
62029             };
62030           }
62031
62032           /**
62033            * This method returns the first argument provided to it.
62034            *
62035            * @static
62036            * @memberOf _
62037            * @category Utility
62038            * @param {*}
62039            *            value Any value.
62040            * @returns {*} Returns `value`.
62041            * @example
62042            *
62043            * var object = { 'user': 'fred' };
62044            *
62045            * _.identity(object) === object; // => true
62046            */
62047           function identity(value) {
62048             return value;
62049           }
62050
62051           /**
62052            * Creates a function that performs a deep comparison between a given object
62053            * and `source`, returning `true` if the given object has equivalent
62054            * property values, else `false`.
62055            *
62056            * **Note:** This method supports comparing arrays, booleans, `Date`
62057            * objects, numbers, `Object` objects, regexes, and strings. Objects are
62058            * compared by their own, not inherited, enumerable properties. For
62059            * comparing a single own or inherited property value see
62060            * `_.matchesProperty`.
62061            *
62062            * @static
62063            * @memberOf _
62064            * @category Utility
62065            * @param {Object}
62066            *            source The object of property values to match.
62067            * @returns {Function} Returns the new function.
62068            * @example
62069            *
62070            * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
62071            * 'fred', 'age': 40, 'active': false } ];
62072            *
62073            * _.filter(users, _.matches({ 'age': 40, 'active': false })); // => [{
62074            * 'user': 'fred', 'age': 40, 'active': false }]
62075            */
62076           function matches(source) {
62077             return baseMatches(baseClone(source, true));
62078           }
62079
62080           /**
62081            * Creates a function that compares the property value of `path` on a given
62082            * object to `value`.
62083            *
62084            * **Note:** This method supports comparing arrays, booleans, `Date`
62085            * objects, numbers, `Object` objects, regexes, and strings. Objects are
62086            * compared by their own, not inherited, enumerable properties.
62087            *
62088            * @static
62089            * @memberOf _
62090            * @category Utility
62091            * @param {Array|string}
62092            *            path The path of the property to get.
62093            * @param {*}
62094            *            srcValue The value to match.
62095            * @returns {Function} Returns the new function.
62096            * @example
62097            *
62098            * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
62099            *
62100            * _.find(users, _.matchesProperty('user', 'fred')); // => { 'user': 'fred' }
62101            */
62102           function matchesProperty(path, srcValue) {
62103             return baseMatchesProperty(path, baseClone(srcValue, true));
62104           }
62105
62106           /**
62107            * Creates a function that invokes the method at `path` on a given object.
62108            * Any additional arguments are provided to the invoked method.
62109            *
62110            * @static
62111            * @memberOf _
62112            * @category Utility
62113            * @param {Array|string}
62114            *            path The path of the method to invoke.
62115            * @param {...*}
62116            *            [args] The arguments to invoke the method with.
62117            * @returns {Function} Returns the new function.
62118            * @example
62119            *
62120            * var objects = [ { 'a': { 'b': { 'c': _.constant(2) } } }, { 'a': { 'b': {
62121            * 'c': _.constant(1) } } } ];
62122            *
62123            * _.map(objects, _.method('a.b.c')); // => [2, 1]
62124            *
62125            * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c'); // =>
62126            * [1, 2]
62127            */
62128           var method = restParam(function(path, args) {
62129             return function(object) {
62130               return invokePath(object, path, args);
62131             };
62132           });
62133
62134           /**
62135            * The opposite of `_.method`; this method creates a function that invokes
62136            * the method at a given path on `object`. Any additional arguments are
62137            * provided to the invoked method.
62138            *
62139            * @static
62140            * @memberOf _
62141            * @category Utility
62142            * @param {Object}
62143            *            object The object to query.
62144            * @param {...*}
62145            *            [args] The arguments to invoke the method with.
62146            * @returns {Function} Returns the new function.
62147            * @example
62148            *
62149            * var array = _.times(3, _.constant), object = { 'a': array, 'b': array,
62150            * 'c': array };
62151            *
62152            * _.map(['a[2]', 'c[0]'], _.methodOf(object)); // => [2, 0]
62153            *
62154            * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); // => [2, 0]
62155            */
62156           var methodOf = restParam(function(object, args) {
62157             return function(path) {
62158               return invokePath(object, path, args);
62159             };
62160           });
62161
62162           /**
62163            * Adds all own enumerable function properties of a source object to the
62164            * destination object. If `object` is a function then methods are added to
62165            * its prototype as well.
62166            *
62167            * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
62168            * avoid conflicts caused by modifying the original.
62169            *
62170            * @static
62171            * @memberOf _
62172            * @category Utility
62173            * @param {Function|Object}
62174            *            [object=lodash] The destination object.
62175            * @param {Object}
62176            *            source The object of functions to add.
62177            * @param {Object}
62178            *            [options] The options object.
62179            * @param {boolean}
62180            *            [options.chain=true] Specify whether the functions added are
62181            *            chainable.
62182            * @returns {Function|Object} Returns `object`.
62183            * @example
62184            *
62185            * function vowels(string) { return _.filter(string, function(v) { return
62186            * /[aeiou]/i.test(v); }); }
62187            *
62188            * _.mixin({ 'vowels': vowels }); _.vowels('fred'); // => ['e']
62189            *
62190            * _('fred').vowels().value(); // => ['e']
62191            *
62192            * _.mixin({ 'vowels': vowels }, { 'chain': false }); _('fred').vowels(); // =>
62193            * ['e']
62194            */
62195           function mixin(object, source, options) {
62196             if (options == null) {
62197               var isObj = isObject(source),
62198                 props = isObj ? keys(source) : undefined,
62199                 methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;
62200
62201               if (!(methodNames ? methodNames.length : isObj)) {
62202                 methodNames = false;
62203                 options = source;
62204                 source = object;
62205                 object = this;
62206               }
62207             }
62208             if (!methodNames) {
62209               methodNames = baseFunctions(source, keys(source));
62210             }
62211             var chain = true,
62212               index = -1,
62213               isFunc = isFunction(object),
62214               length = methodNames.length;
62215
62216             if (options === false) {
62217               chain = false;
62218             } else if (isObject(options) && 'chain' in options) {
62219               chain = options.chain;
62220             }
62221             while (++index < length) {
62222               var methodName = methodNames[index],
62223                 func = source[methodName];
62224
62225               object[methodName] = func;
62226               if (isFunc) {
62227                 object.prototype[methodName] = (function(func) {
62228                   return function() {
62229                     var chainAll = this.__chain__;
62230                     if (chain || chainAll) {
62231                       var result = object(this.__wrapped__),
62232                         actions = result.__actions__ = arrayCopy(this.__actions__);
62233
62234                       actions.push({
62235                         'func': func,
62236                         'args': arguments,
62237                         'thisArg': object
62238                       });
62239                       result.__chain__ = chainAll;
62240                       return result;
62241                     }
62242                     return func.apply(object, arrayPush([this.value()], arguments));
62243                   };
62244                 }(func));
62245               }
62246             }
62247             return object;
62248           }
62249
62250           /**
62251            * Reverts the `_` variable to its previous value and returns a reference to
62252            * the `lodash` function.
62253            *
62254            * @static
62255            * @memberOf _
62256            * @category Utility
62257            * @returns {Function} Returns the `lodash` function.
62258            * @example
62259            *
62260            * var lodash = _.noConflict();
62261            */
62262           function noConflict() {
62263             root._ = oldDash;
62264             return this;
62265           }
62266
62267           /**
62268            * A no-operation function that returns `undefined` regardless of the
62269            * arguments it receives.
62270            *
62271            * @static
62272            * @memberOf _
62273            * @category Utility
62274            * @example
62275            *
62276            * var object = { 'user': 'fred' };
62277            *
62278            * _.noop(object) === undefined; // => true
62279            */
62280           function noop() {
62281             // No operation performed.
62282           }
62283
62284           /**
62285            * Creates a function that returns the property value at `path` on a given
62286            * object.
62287            *
62288            * @static
62289            * @memberOf _
62290            * @category Utility
62291            * @param {Array|string}
62292            *            path The path of the property to get.
62293            * @returns {Function} Returns the new function.
62294            * @example
62295            *
62296            * var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ];
62297            *
62298            * _.map(objects, _.property('a.b.c')); // => [2, 1]
62299            *
62300            * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // =>
62301            * [1, 2]
62302            */
62303           function property(path) {
62304             return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
62305           }
62306
62307           /**
62308            * The opposite of `_.property`; this method creates a function that returns
62309            * the property value at a given path on `object`.
62310            *
62311            * @static
62312            * @memberOf _
62313            * @category Utility
62314            * @param {Object}
62315            *            object The object to query.
62316            * @returns {Function} Returns the new function.
62317            * @example
62318            *
62319            * var array = [0, 1, 2], object = { 'a': array, 'b': array, 'c': array };
62320            *
62321            * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); // => [2, 0]
62322            *
62323            * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); // => [2, 0]
62324            */
62325           function propertyOf(object) {
62326             return function(path) {
62327               return baseGet(object, toPath(path), path + '');
62328             };
62329           }
62330
62331           /**
62332            * Creates an array of numbers (positive and/or negative) progressing from
62333            * `start` up to, but not including, `end`. If `end` is not specified it is
62334            * set to `start` with `start` then set to `0`. If `end` is less than
62335            * `start` a zero-length range is created unless a negative `step` is
62336            * specified.
62337            *
62338            * @static
62339            * @memberOf _
62340            * @category Utility
62341            * @param {number}
62342            *            [start=0] The start of the range.
62343            * @param {number}
62344            *            end The end of the range.
62345            * @param {number}
62346            *            [step=1] The value to increment or decrement by.
62347            * @returns {Array} Returns the new array of numbers.
62348            * @example
62349            *
62350            * _.range(4); // => [0, 1, 2, 3]
62351            *
62352            * _.range(1, 5); // => [1, 2, 3, 4]
62353            *
62354            * _.range(0, 20, 5); // => [0, 5, 10, 15]
62355            *
62356            * _.range(0, -4, -1); // => [0, -1, -2, -3]
62357            *
62358            * _.range(1, 4, 0); // => [1, 1, 1]
62359            *
62360            * _.range(0); // => []
62361            */
62362           function range(start, end, step) {
62363             if (step && isIterateeCall(start, end, step)) {
62364               end = step = undefined;
62365             }
62366             start = +start || 0;
62367             step = step == null ? 1 : (+step || 0);
62368
62369             if (end == null) {
62370               end = start;
62371               start = 0;
62372             } else {
62373               end = +end || 0;
62374             }
62375             // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
62376             // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
62377             var index = -1,
62378               length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
62379               result = Array(length);
62380
62381             while (++index < length) {
62382               result[index] = start;
62383               start += step;
62384             }
62385             return result;
62386           }
62387
62388           /**
62389            * Invokes the iteratee function `n` times, returning an array of the
62390            * results of each invocation. The `iteratee` is bound to `thisArg` and
62391            * invoked with one argument; (index).
62392            *
62393            * @static
62394            * @memberOf _
62395            * @category Utility
62396            * @param {number}
62397            *            n The number of times to invoke `iteratee`.
62398            * @param {Function}
62399            *            [iteratee=_.identity] The function invoked per iteration.
62400            * @param {*}
62401            *            [thisArg] The `this` binding of `iteratee`.
62402            * @returns {Array} Returns the array of results.
62403            * @example
62404            *
62405            * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false)); // => [3,
62406            * 6, 4]
62407            *
62408            * _.times(3, function(n) { mage.castSpell(n); }); // => invokes
62409            * `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
62410            *
62411            * _.times(3, function(n) { this.cast(n); }, mage); // => also invokes
62412            * `mage.castSpell(n)` three times
62413            */
62414           function times(n, iteratee, thisArg) {
62415             n = nativeFloor(n);
62416
62417             // Exit early to avoid a JSC JIT bug in Safari 8
62418             // where `Array(0)` is treated as `Array(1)`.
62419             if (n < 1 || !nativeIsFinite(n)) {
62420               return [];
62421             }
62422             var index = -1,
62423               result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
62424
62425             iteratee = bindCallback(iteratee, thisArg, 1);
62426             while (++index < n) {
62427               if (index < MAX_ARRAY_LENGTH) {
62428                 result[index] = iteratee(index);
62429               } else {
62430                 iteratee(index);
62431               }
62432             }
62433             return result;
62434           }
62435
62436           /**
62437            * Generates a unique ID. If `prefix` is provided the ID is appended to it.
62438            *
62439            * @static
62440            * @memberOf _
62441            * @category Utility
62442            * @param {string}
62443            *            [prefix] The value to prefix the ID with.
62444            * @returns {string} Returns the unique ID.
62445            * @example
62446            *
62447            * _.uniqueId('contact_'); // => 'contact_104'
62448            *
62449            * _.uniqueId(); // => '105'
62450            */
62451           function uniqueId(prefix) {
62452             var id = ++idCounter;
62453             return baseToString(prefix) + id;
62454           }
62455
62456           /*------------------------------------------------------------------------*/
62457
62458           /**
62459            * Adds two numbers.
62460            *
62461            * @static
62462            * @memberOf _
62463            * @category Math
62464            * @param {number}
62465            *            augend The first number to add.
62466            * @param {number}
62467            *            addend The second number to add.
62468            * @returns {number} Returns the sum.
62469            * @example
62470            *
62471            * _.add(6, 4); // => 10
62472            */
62473           function add(augend, addend) {
62474             return (+augend || 0) + (+addend || 0);
62475           }
62476
62477           /**
62478            * Calculates `n` rounded up to `precision`.
62479            *
62480            * @static
62481            * @memberOf _
62482            * @category Math
62483            * @param {number}
62484            *            n The number to round up.
62485            * @param {number}
62486            *            [precision=0] The precision to round up to.
62487            * @returns {number} Returns the rounded up number.
62488            * @example
62489            *
62490            * _.ceil(4.006); // => 5
62491            *
62492            * _.ceil(6.004, 2); // => 6.01
62493            *
62494            * _.ceil(6040, -2); // => 6100
62495            */
62496           var ceil = createRound('ceil');
62497
62498           /**
62499            * Calculates `n` rounded down to `precision`.
62500            *
62501            * @static
62502            * @memberOf _
62503            * @category Math
62504            * @param {number}
62505            *            n The number to round down.
62506            * @param {number}
62507            *            [precision=0] The precision to round down to.
62508            * @returns {number} Returns the rounded down number.
62509            * @example
62510            *
62511            * _.floor(4.006); // => 4
62512            *
62513            * _.floor(0.046, 2); // => 0.04
62514            *
62515            * _.floor(4060, -2); // => 4000
62516            */
62517           var floor = createRound('floor');
62518
62519           /**
62520            * Gets the maximum value of `collection`. If `collection` is empty or
62521            * falsey `-Infinity` is returned. If an iteratee function is provided it is
62522            * invoked for each value in `collection` to generate the criterion by which
62523            * the value is ranked. The `iteratee` is bound to `thisArg` and invoked
62524            * with three arguments: (value, index, collection).
62525            *
62526            * If a property name is provided for `iteratee` the created `_.property`
62527            * style callback returns the property value of the given element.
62528            *
62529            * If a value is also provided for `thisArg` the created `_.matchesProperty`
62530            * style callback returns `true` for elements that have a matching property
62531            * value, else `false`.
62532            *
62533            * If an object is provided for `iteratee` the created `_.matches` style
62534            * callback returns `true` for elements that have the properties of the
62535            * given object, else `false`.
62536            *
62537            * @static
62538            * @memberOf _
62539            * @category Math
62540            * @param {Array|Object|string}
62541            *            collection The collection to iterate over.
62542            * @param {Function|Object|string}
62543            *            [iteratee] The function invoked per iteration.
62544            * @param {*}
62545            *            [thisArg] The `this` binding of `iteratee`.
62546            * @returns {*} Returns the maximum value.
62547            * @example
62548            *
62549            * _.max([4, 2, 8, 6]); // => 8
62550            *
62551            * _.max([]); // => -Infinity
62552            *
62553            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62554            * 40 } ];
62555            *
62556            * _.max(users, function(chr) { return chr.age; }); // => { 'user': 'fred',
62557            * 'age': 40 }
62558            *  // using the `_.property` callback shorthand _.max(users, 'age'); // => {
62559            * 'user': 'fred', 'age': 40 }
62560            */
62561           var max = createExtremum(gt, NEGATIVE_INFINITY);
62562
62563           /**
62564            * Gets the minimum value of `collection`. If `collection` is empty or
62565            * falsey `Infinity` is returned. If an iteratee function is provided it is
62566            * invoked for each value in `collection` to generate the criterion by which
62567            * the value is ranked. The `iteratee` is bound to `thisArg` and invoked
62568            * with three arguments: (value, index, collection).
62569            *
62570            * If a property name is provided for `iteratee` the created `_.property`
62571            * style callback returns the property value of the given element.
62572            *
62573            * If a value is also provided for `thisArg` the created `_.matchesProperty`
62574            * style callback returns `true` for elements that have a matching property
62575            * value, else `false`.
62576            *
62577            * If an object is provided for `iteratee` the created `_.matches` style
62578            * callback returns `true` for elements that have the properties of the
62579            * given object, else `false`.
62580            *
62581            * @static
62582            * @memberOf _
62583            * @category Math
62584            * @param {Array|Object|string}
62585            *            collection The collection to iterate over.
62586            * @param {Function|Object|string}
62587            *            [iteratee] The function invoked per iteration.
62588            * @param {*}
62589            *            [thisArg] The `this` binding of `iteratee`.
62590            * @returns {*} Returns the minimum value.
62591            * @example
62592            *
62593            * _.min([4, 2, 8, 6]); // => 2
62594            *
62595            * _.min([]); // => Infinity
62596            *
62597            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62598            * 40 } ];
62599            *
62600            * _.min(users, function(chr) { return chr.age; }); // => { 'user':
62601            * 'barney', 'age': 36 }
62602            *  // using the `_.property` callback shorthand _.min(users, 'age'); // => {
62603            * 'user': 'barney', 'age': 36 }
62604            */
62605           var min = createExtremum(lt, POSITIVE_INFINITY);
62606
62607           /**
62608            * Calculates `n` rounded to `precision`.
62609            *
62610            * @static
62611            * @memberOf _
62612            * @category Math
62613            * @param {number}
62614            *            n The number to round.
62615            * @param {number}
62616            *            [precision=0] The precision to round to.
62617            * @returns {number} Returns the rounded number.
62618            * @example
62619            *
62620            * _.round(4.006); // => 4
62621            *
62622            * _.round(4.006, 2); // => 4.01
62623            *
62624            * _.round(4060, -2); // => 4100
62625            */
62626           var round = createRound('round');
62627
62628           /**
62629            * Gets the sum of the values in `collection`.
62630            *
62631            * @static
62632            * @memberOf _
62633            * @category Math
62634            * @param {Array|Object|string}
62635            *            collection The collection to iterate over.
62636            * @param {Function|Object|string}
62637            *            [iteratee] The function invoked per iteration.
62638            * @param {*}
62639            *            [thisArg] The `this` binding of `iteratee`.
62640            * @returns {number} Returns the sum.
62641            * @example
62642            *
62643            * _.sum([4, 6]); // => 10
62644            *
62645            * _.sum({ 'a': 4, 'b': 6 }); // => 10
62646            *
62647            * var objects = [ { 'n': 4 }, { 'n': 6 } ];
62648            *
62649            * _.sum(objects, function(object) { return object.n; }); // => 10
62650            *  // using the `_.property` callback shorthand _.sum(objects, 'n'); // =>
62651            * 10
62652            */
62653           function sum(collection, iteratee, thisArg) {
62654             if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
62655               iteratee = undefined;
62656             }
62657             iteratee = getCallback(iteratee, thisArg, 3);
62658             return iteratee.length == 1 ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee) : baseSum(collection, iteratee);
62659           }
62660
62661           /*------------------------------------------------------------------------*/
62662
62663           // Ensure wrappers are instances of `baseLodash`.
62664           lodash.prototype = baseLodash.prototype;
62665
62666           LodashWrapper.prototype = baseCreate(baseLodash.prototype);
62667           LodashWrapper.prototype.constructor = LodashWrapper;
62668
62669           LazyWrapper.prototype = baseCreate(baseLodash.prototype);
62670           LazyWrapper.prototype.constructor = LazyWrapper;
62671
62672           // Add functions to the `Map` cache.
62673           MapCache.prototype['delete'] = mapDelete;
62674           MapCache.prototype.get = mapGet;
62675           MapCache.prototype.has = mapHas;
62676           MapCache.prototype.set = mapSet;
62677
62678           // Add functions to the `Set` cache.
62679           SetCache.prototype.push = cachePush;
62680
62681           // Assign cache to `_.memoize`.
62682           memoize.Cache = MapCache;
62683
62684           // Add functions that return wrapped values when chaining.
62685           lodash.after = after;
62686           lodash.ary = ary;
62687           lodash.assign = assign;
62688           lodash.at = at;
62689           lodash.before = before;
62690           lodash.bind = bind;
62691           lodash.bindAll = bindAll;
62692           lodash.bindKey = bindKey;
62693           lodash.callback = callback;
62694           lodash.chain = chain;
62695           lodash.chunk = chunk;
62696           lodash.compact = compact;
62697           lodash.constant = constant;
62698           lodash.countBy = countBy;
62699           lodash.create = create;
62700           lodash.curry = curry;
62701           lodash.curryRight = curryRight;
62702           lodash.debounce = debounce;
62703           lodash.defaults = defaults;
62704           lodash.defaultsDeep = defaultsDeep;
62705           lodash.defer = defer;
62706           lodash.delay = delay;
62707           lodash.difference = difference;
62708           lodash.drop = drop;
62709           lodash.dropRight = dropRight;
62710           lodash.dropRightWhile = dropRightWhile;
62711           lodash.dropWhile = dropWhile;
62712           lodash.fill = fill;
62713           lodash.filter = filter;
62714           lodash.flatten = flatten;
62715           lodash.flattenDeep = flattenDeep;
62716           lodash.flow = flow;
62717           lodash.flowRight = flowRight;
62718           lodash.forEach = forEach;
62719           lodash.forEachRight = forEachRight;
62720           lodash.forIn = forIn;
62721           lodash.forInRight = forInRight;
62722           lodash.forOwn = forOwn;
62723           lodash.forOwnRight = forOwnRight;
62724           lodash.functions = functions;
62725           lodash.groupBy = groupBy;
62726           lodash.indexBy = indexBy;
62727           lodash.initial = initial;
62728           lodash.intersection = intersection;
62729           lodash.invert = invert;
62730           lodash.invoke = invoke;
62731           lodash.keys = keys;
62732           lodash.keysIn = keysIn;
62733           lodash.map = map;
62734           lodash.mapKeys = mapKeys;
62735           lodash.mapValues = mapValues;
62736           lodash.matches = matches;
62737           lodash.matchesProperty = matchesProperty;
62738           lodash.memoize = memoize;
62739           lodash.merge = merge;
62740           lodash.method = method;
62741           lodash.methodOf = methodOf;
62742           lodash.mixin = mixin;
62743           lodash.modArgs = modArgs;
62744           lodash.negate = negate;
62745           lodash.omit = omit;
62746           lodash.once = once;
62747           lodash.pairs = pairs;
62748           lodash.partial = partial;
62749           lodash.partialRight = partialRight;
62750           lodash.partition = partition;
62751           lodash.pick = pick;
62752           lodash.pluck = pluck;
62753           lodash.property = property;
62754           lodash.propertyOf = propertyOf;
62755           lodash.pull = pull;
62756           lodash.pullAt = pullAt;
62757           lodash.range = range;
62758           lodash.rearg = rearg;
62759           lodash.reject = reject;
62760           lodash.remove = remove;
62761           lodash.rest = rest;
62762           lodash.restParam = restParam;
62763           lodash.set = set;
62764           lodash.shuffle = shuffle;
62765           lodash.slice = slice;
62766           lodash.sortBy = sortBy;
62767           lodash.sortByAll = sortByAll;
62768           lodash.sortByOrder = sortByOrder;
62769           lodash.spread = spread;
62770           lodash.take = take;
62771           lodash.takeRight = takeRight;
62772           lodash.takeRightWhile = takeRightWhile;
62773           lodash.takeWhile = takeWhile;
62774           lodash.tap = tap;
62775           lodash.throttle = throttle;
62776           lodash.thru = thru;
62777           lodash.times = times;
62778           lodash.toArray = toArray;
62779           lodash.toPlainObject = toPlainObject;
62780           lodash.transform = transform;
62781           lodash.union = union;
62782           lodash.uniq = uniq;
62783           lodash.unzip = unzip;
62784           lodash.unzipWith = unzipWith;
62785           lodash.values = values;
62786           lodash.valuesIn = valuesIn;
62787           lodash.where = where;
62788           lodash.without = without;
62789           lodash.wrap = wrap;
62790           lodash.xor = xor;
62791           lodash.zip = zip;
62792           lodash.zipObject = zipObject;
62793           lodash.zipWith = zipWith;
62794
62795           // Add aliases.
62796           lodash.backflow = flowRight;
62797           lodash.collect = map;
62798           lodash.compose = flowRight;
62799           lodash.each = forEach;
62800           lodash.eachRight = forEachRight;
62801           lodash.extend = assign;
62802           lodash.iteratee = callback;
62803           lodash.methods = functions;
62804           lodash.object = zipObject;
62805           lodash.select = filter;
62806           lodash.tail = rest;
62807           lodash.unique = uniq;
62808
62809           // Add functions to `lodash.prototype`.
62810           mixin(lodash, lodash);
62811
62812           /*------------------------------------------------------------------------*/
62813
62814           // Add functions that return unwrapped values when chaining.
62815           lodash.add = add;
62816           lodash.attempt = attempt;
62817           lodash.camelCase = camelCase;
62818           lodash.capitalize = capitalize;
62819           lodash.ceil = ceil;
62820           lodash.clone = clone;
62821           lodash.cloneDeep = cloneDeep;
62822           lodash.deburr = deburr;
62823           lodash.endsWith = endsWith;
62824           lodash.escape = escape;
62825           lodash.escapeRegExp = escapeRegExp;
62826           lodash.every = every;
62827           lodash.find = find;
62828           lodash.findIndex = findIndex;
62829           lodash.findKey = findKey;
62830           lodash.findLast = findLast;
62831           lodash.findLastIndex = findLastIndex;
62832           lodash.findLastKey = findLastKey;
62833           lodash.findWhere = findWhere;
62834           lodash.first = first;
62835           lodash.floor = floor;
62836           lodash.get = get;
62837           lodash.gt = gt;
62838           lodash.gte = gte;
62839           lodash.has = has;
62840           lodash.identity = identity;
62841           lodash.includes = includes;
62842           lodash.indexOf = indexOf;
62843           lodash.inRange = inRange;
62844           lodash.isArguments = isArguments;
62845           lodash.isArray = isArray;
62846           lodash.isBoolean = isBoolean;
62847           lodash.isDate = isDate;
62848           lodash.isElement = isElement;
62849           lodash.isEmpty = isEmpty;
62850           lodash.isEqual = isEqual;
62851           lodash.isError = isError;
62852           lodash.isFinite = isFinite;
62853           lodash.isFunction = isFunction;
62854           lodash.isMatch = isMatch;
62855           lodash.isNaN = isNaN;
62856           lodash.isNative = isNative;
62857           lodash.isNull = isNull;
62858           lodash.isNumber = isNumber;
62859           lodash.isObject = isObject;
62860           lodash.isPlainObject = isPlainObject;
62861           lodash.isRegExp = isRegExp;
62862           lodash.isString = isString;
62863           lodash.isTypedArray = isTypedArray;
62864           lodash.isUndefined = isUndefined;
62865           lodash.kebabCase = kebabCase;
62866           lodash.last = last;
62867           lodash.lastIndexOf = lastIndexOf;
62868           lodash.lt = lt;
62869           lodash.lte = lte;
62870           lodash.max = max;
62871           lodash.min = min;
62872           lodash.noConflict = noConflict;
62873           lodash.noop = noop;
62874           lodash.now = now;
62875           lodash.pad = pad;
62876           lodash.padLeft = padLeft;
62877           lodash.padRight = padRight;
62878           lodash.parseInt = parseInt;
62879           lodash.random = random;
62880           lodash.reduce = reduce;
62881           lodash.reduceRight = reduceRight;
62882           lodash.repeat = repeat;
62883           lodash.result = result;
62884           lodash.round = round;
62885           lodash.runInContext = runInContext;
62886           lodash.size = size;
62887           lodash.snakeCase = snakeCase;
62888           lodash.some = some;
62889           lodash.sortedIndex = sortedIndex;
62890           lodash.sortedLastIndex = sortedLastIndex;
62891           lodash.startCase = startCase;
62892           lodash.startsWith = startsWith;
62893           lodash.sum = sum;
62894           lodash.template = template;
62895           lodash.trim = trim;
62896           lodash.trimLeft = trimLeft;
62897           lodash.trimRight = trimRight;
62898           lodash.trunc = trunc;
62899           lodash.unescape = unescape;
62900           lodash.uniqueId = uniqueId;
62901           lodash.words = words;
62902
62903           // Add aliases.
62904           lodash.all = every;
62905           lodash.any = some;
62906           lodash.contains = includes;
62907           lodash.eq = isEqual;
62908           lodash.detect = find;
62909           lodash.foldl = reduce;
62910           lodash.foldr = reduceRight;
62911           lodash.head = first;
62912           lodash.include = includes;
62913           lodash.inject = reduce;
62914
62915           mixin(lodash, (function() {
62916             var source = {};
62917             baseForOwn(lodash, function(func, methodName) {
62918               if (!lodash.prototype[methodName]) {
62919                 source[methodName] = func;
62920               }
62921             });
62922             return source;
62923           }()), false);
62924
62925           /*------------------------------------------------------------------------*/
62926
62927           // Add functions capable of returning wrapped and unwrapped values when
62928           // chaining.
62929           lodash.sample = sample;
62930
62931           lodash.prototype.sample = function(n) {
62932             if (!this.__chain__ && n == null) {
62933               return sample(this.value());
62934             }
62935             return this.thru(function(value) {
62936               return sample(value, n);
62937             });
62938           };
62939
62940           /*------------------------------------------------------------------------*/
62941
62942           /**
62943            * The semantic version number.
62944            *
62945            * @static
62946            * @memberOf _
62947            * @type string
62948            */
62949           lodash.VERSION = VERSION;
62950
62951           // Assign default placeholders.
62952           arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
62953             lodash[methodName].placeholder = lodash;
62954           });
62955
62956           // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
62957           arrayEach(['drop', 'take'], function(methodName, index) {
62958             LazyWrapper.prototype[methodName] = function(n) {
62959               var filtered = this.__filtered__;
62960               if (filtered && !index) {
62961                 return new LazyWrapper(this);
62962               }
62963               n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);
62964
62965               var result = this.clone();
62966               if (filtered) {
62967                 result.__takeCount__ = nativeMin(result.__takeCount__, n);
62968               } else {
62969                 result.__views__.push({
62970                   'size': n,
62971                   'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
62972                 });
62973               }
62974               return result;
62975             };
62976
62977             LazyWrapper.prototype[methodName + 'Right'] = function(n) {
62978               return this.reverse()[methodName](n).reverse();
62979             };
62980           });
62981
62982           // Add `LazyWrapper` methods that accept an `iteratee` value.
62983           arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
62984             var type = index + 1,
62985               isFilter = type != LAZY_MAP_FLAG;
62986
62987             LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
62988               var result = this.clone();
62989               result.__iteratees__.push({
62990                 'iteratee': getCallback(iteratee, thisArg, 1),
62991                 'type': type
62992               });
62993               result.__filtered__ = result.__filtered__ || isFilter;
62994               return result;
62995             };
62996           });
62997
62998           // Add `LazyWrapper` methods for `_.first` and `_.last`.
62999           arrayEach(['first', 'last'], function(methodName, index) {
63000             var takeName = 'take' + (index ? 'Right' : '');
63001
63002             LazyWrapper.prototype[methodName] = function() {
63003               return this[takeName](1).value()[0];
63004             };
63005           });
63006
63007           // Add `LazyWrapper` methods for `_.initial` and `_.rest`.
63008           arrayEach(['initial', 'rest'], function(methodName, index) {
63009             var dropName = 'drop' + (index ? '' : 'Right');
63010
63011             LazyWrapper.prototype[methodName] = function() {
63012               return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
63013             };
63014           });
63015
63016           // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
63017           arrayEach(['pluck', 'where'], function(methodName, index) {
63018             var operationName = index ? 'filter' : 'map',
63019               createCallback = index ? baseMatches : property;
63020
63021             LazyWrapper.prototype[methodName] = function(value) {
63022               return this[operationName](createCallback(value));
63023             };
63024           });
63025
63026           LazyWrapper.prototype.compact = function() {
63027             return this.filter(identity);
63028           };
63029
63030           LazyWrapper.prototype.reject = function(predicate, thisArg) {
63031             predicate = getCallback(predicate, thisArg, 1);
63032             return this.filter(function(value) {
63033               return !predicate(value);
63034             });
63035           };
63036
63037           LazyWrapper.prototype.slice = function(start, end) {
63038             start = start == null ? 0 : (+start || 0);
63039
63040             var result = this;
63041             if (result.__filtered__ && (start > 0 || end < 0)) {
63042               return new LazyWrapper(result);
63043             }
63044             if (start < 0) {
63045               result = result.takeRight(-start);
63046             } else if (start) {
63047               result = result.drop(start);
63048             }
63049             if (end !== undefined) {
63050               end = (+end || 0);
63051               result = end < 0 ? result.dropRight(-end) : result.take(end - start);
63052             }
63053             return result;
63054           };
63055
63056           LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) {
63057             return this.reverse().takeWhile(predicate, thisArg).reverse();
63058           };
63059
63060           LazyWrapper.prototype.toArray = function() {
63061             return this.take(POSITIVE_INFINITY);
63062           };
63063
63064           // Add `LazyWrapper` methods to `lodash.prototype`.
63065           baseForOwn(LazyWrapper.prototype, function(func, methodName) {
63066             var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),
63067               retUnwrapped = /^(?:first|last)$/.test(methodName),
63068               lodashFunc = lodash[retUnwrapped ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName];
63069
63070             if (!lodashFunc) {
63071               return;
63072             }
63073             lodash.prototype[methodName] = function() {
63074               var args = retUnwrapped ? [1] : arguments,
63075                 chainAll = this.__chain__,
63076                 value = this.__wrapped__,
63077                 isHybrid = !!this.__actions__.length,
63078                 isLazy = value instanceof LazyWrapper,
63079                 iteratee = args[0],
63080                 useLazy = isLazy || isArray(value);
63081
63082               if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
63083                 // Avoid lazy use if the iteratee has a "length" value other than
63084                 // `1`.
63085                 isLazy = useLazy = false;
63086               }
63087               var interceptor = function(value) {
63088                 return (retUnwrapped && chainAll) ? lodashFunc(value, 1)[0] : lodashFunc.apply(undefined, arrayPush([value], args));
63089               };
63090
63091               var action = {
63092                   'func': thru,
63093                   'args': [interceptor],
63094                   'thisArg': undefined
63095                 },
63096                 onlyLazy = isLazy && !isHybrid;
63097
63098               if (retUnwrapped && !chainAll) {
63099                 if (onlyLazy) {
63100                   value = value.clone();
63101                   value.__actions__.push(action);
63102                   return func.call(value);
63103                 }
63104                 return lodashFunc.call(undefined, this.value())[0];
63105               }
63106               if (!retUnwrapped && useLazy) {
63107                 value = onlyLazy ? value : new LazyWrapper(this);
63108                 var result = func.apply(value, args);
63109                 result.__actions__.push(action);
63110                 return new LodashWrapper(result, chainAll);
63111               }
63112               return this.thru(interceptor);
63113             };
63114           });
63115
63116           // Add `Array` and `String` methods to `lodash.prototype`.
63117           arrayEach(['join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {
63118             var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],
63119               chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
63120               retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);
63121
63122             lodash.prototype[methodName] = function() {
63123               var args = arguments;
63124               if (retUnwrapped && !this.__chain__) {
63125                 return func.apply(this.value(), args);
63126               }
63127               return this[chainName](function(value) {
63128                 return func.apply(value, args);
63129               });
63130             };
63131           });
63132
63133           // Map minified function names to their real names.
63134           baseForOwn(LazyWrapper.prototype, function(func, methodName) {
63135             var lodashFunc = lodash[methodName];
63136             if (lodashFunc) {
63137               var key = lodashFunc.name,
63138                 names = realNames[key] || (realNames[key] = []);
63139
63140               names.push({
63141                 'name': methodName,
63142                 'func': lodashFunc
63143               });
63144             }
63145           });
63146
63147           realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{
63148             'name': 'wrapper',
63149             'func': undefined
63150           }];
63151
63152           // Add functions to the lazy wrapper.
63153           LazyWrapper.prototype.clone = lazyClone;
63154           LazyWrapper.prototype.reverse = lazyReverse;
63155           LazyWrapper.prototype.value = lazyValue;
63156
63157           // Add chaining functions to the `lodash` wrapper.
63158           lodash.prototype.chain = wrapperChain;
63159           lodash.prototype.commit = wrapperCommit;
63160           lodash.prototype.concat = wrapperConcat;
63161           lodash.prototype.plant = wrapperPlant;
63162           lodash.prototype.reverse = wrapperReverse;
63163           lodash.prototype.toString = wrapperToString;
63164           lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
63165
63166           // Add function aliases to the `lodash` wrapper.
63167           lodash.prototype.collect = lodash.prototype.map;
63168           lodash.prototype.head = lodash.prototype.first;
63169           lodash.prototype.select = lodash.prototype.filter;
63170           lodash.prototype.tail = lodash.prototype.rest;
63171
63172           return lodash;
63173         }
63174
63175         /*--------------------------------------------------------------------------*/
63176
63177         // Export lodash.
63178         var _ = runInContext();
63179
63180         // Some AMD build optimizers like r.js check for condition patterns like the
63181         // following:
63182         if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
63183           // Expose lodash to the global object when an AMD loader is present to avoid
63184           // errors in cases where lodash is loaded by a script tag and not intended
63185           // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for
63186           // more details.
63187           root._ = _;
63188
63189           // Define as an anonymous module so, through path mapping, it can be
63190           // referenced as the "underscore" module.
63191           define(function() {
63192             return _;
63193           });
63194         }
63195         // Check for `exports` after `define` in case a build optimizer adds an
63196         // `exports` object.
63197         else if (freeExports && freeModule) {
63198           // Export for Node.js or RingoJS.
63199           if (moduleExports) {
63200             (freeModule.exports = _)._ = _;
63201           }
63202           // Export for Rhino with CommonJS support.
63203           else {
63204             freeExports._ = _;
63205           }
63206         } else {
63207           // Export for a browser or Rhino.
63208           root._ = _;
63209         }
63210       }.call(this));
63211
63212     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
63213   }, {}],
63214   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js": [function(require, module, exports) {
63215     var baseCreate = require('./baseCreate'),
63216       baseLodash = require('./baseLodash');
63217
63218     /** Used as references for `-Infinity` and `Infinity`. */
63219     var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
63220
63221     /**
63222      * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
63223      *
63224      * @private
63225      * @param {*}
63226      *            value The value to wrap.
63227      */
63228     function LazyWrapper(value) {
63229       this.__wrapped__ = value;
63230       this.__actions__ = [];
63231       this.__dir__ = 1;
63232       this.__filtered__ = false;
63233       this.__iteratees__ = [];
63234       this.__takeCount__ = POSITIVE_INFINITY;
63235       this.__views__ = [];
63236     }
63237
63238     LazyWrapper.prototype = baseCreate(baseLodash.prototype);
63239     LazyWrapper.prototype.constructor = LazyWrapper;
63240
63241     module.exports = LazyWrapper;
63242
63243   }, {
63244     "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js",
63245     "./baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js"
63246   }],
63247   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js": [function(require, module, exports) {
63248     var baseCreate = require('./baseCreate'),
63249       baseLodash = require('./baseLodash');
63250
63251     /**
63252      * The base constructor for creating `lodash` wrapper objects.
63253      *
63254      * @private
63255      * @param {*}
63256      *            value The value to wrap.
63257      * @param {boolean}
63258      *            [chainAll] Enable chaining for all wrapper methods.
63259      * @param {Array}
63260      *            [actions=[]] Actions to peform to resolve the unwrapped value.
63261      */
63262     function LodashWrapper(value, chainAll, actions) {
63263       this.__wrapped__ = value;
63264       this.__actions__ = actions || [];
63265       this.__chain__ = !!chainAll;
63266     }
63267
63268     LodashWrapper.prototype = baseCreate(baseLodash.prototype);
63269     LodashWrapper.prototype.constructor = LodashWrapper;
63270
63271     module.exports = LodashWrapper;
63272
63273   }, {
63274     "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js",
63275     "./baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js"
63276   }],
63277   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\SetCache.js": [function(require, module, exports) {
63278     (function(global) {
63279       var cachePush = require('./cachePush'),
63280         getNative = require('./getNative');
63281
63282       /** Native method references. */
63283       var Set = getNative(global, 'Set');
63284
63285       /*
63286        * Native method references for those with the same name as other `lodash`
63287        * methods.
63288        */
63289       var nativeCreate = getNative(Object, 'create');
63290
63291       /**
63292        *
63293        * Creates a cache object to store unique values.
63294        *
63295        * @private
63296        * @param {Array}
63297        *            [values] The values to cache.
63298        */
63299       function SetCache(values) {
63300         var length = values ? values.length : 0;
63301
63302         this.data = {
63303           'hash': nativeCreate(null),
63304           'set': new Set
63305         };
63306         while (length--) {
63307           this.push(values[length]);
63308         }
63309       }
63310
63311       // Add functions to the `Set` cache.
63312       SetCache.prototype.push = cachePush;
63313
63314       module.exports = SetCache;
63315
63316     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
63317   }, {
63318     "./cachePush": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cachePush.js",
63319     "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
63320   }],
63321   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js": [function(require, module, exports) {
63322     /**
63323      * Copies the values of `source` to `array`.
63324      *
63325      * @private
63326      * @param {Array}
63327      *            source The array to copy values from.
63328      * @param {Array}
63329      *            [array=[]] The array to copy values to.
63330      * @returns {Array} Returns `array`.
63331      */
63332     function arrayCopy(source, array) {
63333       var index = -1,
63334         length = source.length;
63335
63336       array || (array = Array(length));
63337       while (++index < length) {
63338         array[index] = source[index];
63339       }
63340       return array;
63341     }
63342
63343     module.exports = arrayCopy;
63344
63345   }, {}],
63346   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js": [function(require, module, exports) {
63347     /**
63348      * A specialized version of `_.forEach` for arrays without support for callback
63349      * shorthands and `this` binding.
63350      *
63351      * @private
63352      * @param {Array}
63353      *            array The array to iterate over.
63354      * @param {Function}
63355      *            iteratee The function invoked per iteration.
63356      * @returns {Array} Returns `array`.
63357      */
63358     function arrayEach(array, iteratee) {
63359       var index = -1,
63360         length = array.length;
63361
63362       while (++index < length) {
63363         if (iteratee(array[index], index, array) === false) {
63364           break;
63365         }
63366       }
63367       return array;
63368     }
63369
63370     module.exports = arrayEach;
63371
63372   }, {}],
63373   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEvery.js": [function(require, module, exports) {
63374     /**
63375      * A specialized version of `_.every` for arrays without support for callback
63376      * shorthands and `this` binding.
63377      *
63378      * @private
63379      * @param {Array}
63380      *            array The array to iterate over.
63381      * @param {Function}
63382      *            predicate The function invoked per iteration.
63383      * @returns {boolean} Returns `true` if all elements pass the predicate check,
63384      *          else `false`.
63385      */
63386     function arrayEvery(array, predicate) {
63387       var index = -1,
63388         length = array.length;
63389
63390       while (++index < length) {
63391         if (!predicate(array[index], index, array)) {
63392           return false;
63393         }
63394       }
63395       return true;
63396     }
63397
63398     module.exports = arrayEvery;
63399
63400   }, {}],
63401   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayFilter.js": [function(require, module, exports) {
63402     /**
63403      * A specialized version of `_.filter` for arrays without support for callback
63404      * shorthands and `this` binding.
63405      *
63406      * @private
63407      * @param {Array}
63408      *            array The array to iterate over.
63409      * @param {Function}
63410      *            predicate The function invoked per iteration.
63411      * @returns {Array} Returns the new filtered array.
63412      */
63413     function arrayFilter(array, predicate) {
63414       var index = -1,
63415         length = array.length,
63416         resIndex = -1,
63417         result = [];
63418
63419       while (++index < length) {
63420         var value = array[index];
63421         if (predicate(value, index, array)) {
63422           result[++resIndex] = value;
63423         }
63424       }
63425       return result;
63426     }
63427
63428     module.exports = arrayFilter;
63429
63430   }, {}],
63431   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js": [function(require, module, exports) {
63432     /**
63433      * A specialized version of `_.map` for arrays without support for callback
63434      * shorthands and `this` binding.
63435      *
63436      * @private
63437      * @param {Array}
63438      *            array The array to iterate over.
63439      * @param {Function}
63440      *            iteratee The function invoked per iteration.
63441      * @returns {Array} Returns the new mapped array.
63442      */
63443     function arrayMap(array, iteratee) {
63444       var index = -1,
63445         length = array.length,
63446         result = Array(length);
63447
63448       while (++index < length) {
63449         result[index] = iteratee(array[index], index, array);
63450       }
63451       return result;
63452     }
63453
63454     module.exports = arrayMap;
63455
63456   }, {}],
63457   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayPush.js": [function(require, module, exports) {
63458     /**
63459      * Appends the elements of `values` to `array`.
63460      *
63461      * @private
63462      * @param {Array}
63463      *            array The array to modify.
63464      * @param {Array}
63465      *            values The values to append.
63466      * @returns {Array} Returns `array`.
63467      */
63468     function arrayPush(array, values) {
63469       var index = -1,
63470         length = values.length,
63471         offset = array.length;
63472
63473       while (++index < length) {
63474         array[offset + index] = values[index];
63475       }
63476       return array;
63477     }
63478
63479     module.exports = arrayPush;
63480
63481   }, {}],
63482   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayReduce.js": [function(require, module, exports) {
63483     /**
63484      * A specialized version of `_.reduce` for arrays without support for callback
63485      * shorthands and `this` binding.
63486      *
63487      * @private
63488      * @param {Array}
63489      *            array The array to iterate over.
63490      * @param {Function}
63491      *            iteratee The function invoked per iteration.
63492      * @param {*}
63493      *            [accumulator] The initial value.
63494      * @param {boolean}
63495      *            [initFromArray] Specify using the first element of `array` as the
63496      *            initial value.
63497      * @returns {*} Returns the accumulated value.
63498      */
63499     function arrayReduce(array, iteratee, accumulator, initFromArray) {
63500       var index = -1,
63501         length = array.length;
63502
63503       if (initFromArray && length) {
63504         accumulator = array[++index];
63505       }
63506       while (++index < length) {
63507         accumulator = iteratee(accumulator, array[index], index, array);
63508       }
63509       return accumulator;
63510     }
63511
63512     module.exports = arrayReduce;
63513
63514   }, {}],
63515   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js": [function(require, module, exports) {
63516     /**
63517      * A specialized version of `_.some` for arrays without support for callback
63518      * shorthands and `this` binding.
63519      *
63520      * @private
63521      * @param {Array}
63522      *            array The array to iterate over.
63523      * @param {Function}
63524      *            predicate The function invoked per iteration.
63525      * @returns {boolean} Returns `true` if any element passes the predicate check,
63526      *          else `false`.
63527      */
63528     function arraySome(array, predicate) {
63529       var index = -1,
63530         length = array.length;
63531
63532       while (++index < length) {
63533         if (predicate(array[index], index, array)) {
63534           return true;
63535         }
63536       }
63537       return false;
63538     }
63539
63540     module.exports = arraySome;
63541
63542   }, {}],
63543   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\assignWith.js": [function(require, module, exports) {
63544     var keys = require('../object/keys');
63545
63546     /**
63547      * A specialized version of `_.assign` for customizing assigned values without
63548      * support for argument juggling, multiple sources, and `this` binding
63549      * `customizer` functions.
63550      *
63551      * @private
63552      * @param {Object}
63553      *            object The destination object.
63554      * @param {Object}
63555      *            source The source object.
63556      * @param {Function}
63557      *            customizer The function to customize assigned values.
63558      * @returns {Object} Returns `object`.
63559      */
63560     function assignWith(object, source, customizer) {
63561       var index = -1,
63562         props = keys(source),
63563         length = props.length;
63564
63565       while (++index < length) {
63566         var key = props[index],
63567           value = object[key],
63568           result = customizer(value, source[key], key, object, source);
63569
63570         if ((result === result ? (result !== value) : (value === value)) ||
63571           (value === undefined && !(key in object))) {
63572           object[key] = result;
63573         }
63574       }
63575       return object;
63576     }
63577
63578     module.exports = assignWith;
63579
63580   }, {
63581     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
63582   }],
63583   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseAssign.js": [function(require, module, exports) {
63584     var baseCopy = require('./baseCopy'),
63585       keys = require('../object/keys');
63586
63587     /**
63588      * The base implementation of `_.assign` without support for argument juggling,
63589      * multiple sources, and `customizer` functions.
63590      *
63591      * @private
63592      * @param {Object}
63593      *            object The destination object.
63594      * @param {Object}
63595      *            source The source object.
63596      * @returns {Object} Returns `object`.
63597      */
63598     function baseAssign(object, source) {
63599       return source == null ? object : baseCopy(source, keys(source), object);
63600     }
63601
63602     module.exports = baseAssign;
63603
63604   }, {
63605     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
63606     "./baseCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js"
63607   }],
63608   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js": [function(require, module, exports) {
63609     var baseMatches = require('./baseMatches'),
63610       baseMatchesProperty = require('./baseMatchesProperty'),
63611       bindCallback = require('./bindCallback'),
63612       identity = require('../utility/identity'),
63613       property = require('../utility/property');
63614
63615     /**
63616      * The base implementation of `_.callback` which supports specifying the number
63617      * of arguments to provide to `func`.
63618      *
63619      * @private
63620      * @param {*}
63621      *            [func=_.identity] The value to convert to a callback.
63622      * @param {*}
63623      *            [thisArg] The `this` binding of `func`.
63624      * @param {number}
63625      *            [argCount] The number of arguments to provide to `func`.
63626      * @returns {Function} Returns the callback.
63627      */
63628     function baseCallback(func, thisArg, argCount) {
63629       var type = typeof func;
63630       if (type == 'function') {
63631         return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
63632       }
63633       if (func == null) {
63634         return identity;
63635       }
63636       if (type == 'object') {
63637         return baseMatches(func);
63638       }
63639       return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
63640     }
63641
63642     module.exports = baseCallback;
63643
63644   }, {
63645     "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js",
63646     "../utility/property": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\property.js",
63647     "./baseMatches": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatches.js",
63648     "./baseMatchesProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatchesProperty.js",
63649     "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js"
63650   }],
63651   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCompareAscending.js": [function(require, module, exports) {
63652     /**
63653      * The base implementation of `compareAscending` which compares values and sorts
63654      * them in ascending order without guaranteeing a stable sort.
63655      *
63656      * @private
63657      * @param {*}
63658      *            value The value to compare.
63659      * @param {*}
63660      *            other The other value to compare.
63661      * @returns {number} Returns the sort order indicator for `value`.
63662      */
63663     function baseCompareAscending(value, other) {
63664       if (value !== other) {
63665         var valIsNull = value === null,
63666           valIsUndef = value === undefined,
63667           valIsReflexive = value === value;
63668
63669         var othIsNull = other === null,
63670           othIsUndef = other === undefined,
63671           othIsReflexive = other === other;
63672
63673         if ((value > other && !othIsNull) || !valIsReflexive ||
63674           (valIsNull && !othIsUndef && othIsReflexive) ||
63675           (valIsUndef && othIsReflexive)) {
63676           return 1;
63677         }
63678         if ((value < other && !valIsNull) || !othIsReflexive ||
63679           (othIsNull && !valIsUndef && valIsReflexive) ||
63680           (othIsUndef && valIsReflexive)) {
63681           return -1;
63682         }
63683       }
63684       return 0;
63685     }
63686
63687     module.exports = baseCompareAscending;
63688
63689   }, {}],
63690   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js": [function(require, module, exports) {
63691     /**
63692      * Copies properties of `source` to `object`.
63693      *
63694      * @private
63695      * @param {Object}
63696      *            source The object to copy properties from.
63697      * @param {Array}
63698      *            props The property names to copy.
63699      * @param {Object}
63700      *            [object={}] The object to copy properties to.
63701      * @returns {Object} Returns `object`.
63702      */
63703     function baseCopy(source, props, object) {
63704       object || (object = {});
63705
63706       var index = -1,
63707         length = props.length;
63708
63709       while (++index < length) {
63710         var key = props[index];
63711         object[key] = source[key];
63712       }
63713       return object;
63714     }
63715
63716     module.exports = baseCopy;
63717
63718   }, {}],
63719   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js": [function(require, module, exports) {
63720     var isObject = require('../lang/isObject');
63721
63722     /**
63723      * The base implementation of `_.create` without support for assigning
63724      * properties to the created object.
63725      *
63726      * @private
63727      * @param {Object}
63728      *            prototype The object to inherit from.
63729      * @returns {Object} Returns the new object.
63730      */
63731     var baseCreate = (function() {
63732       function object() {}
63733       return function(prototype) {
63734         if (isObject(prototype)) {
63735           object.prototype = prototype;
63736           var result = new object;
63737           object.prototype = undefined;
63738         }
63739         return result || {};
63740       };
63741     }());
63742
63743     module.exports = baseCreate;
63744
63745   }, {
63746     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
63747   }],
63748   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDelay.js": [function(require, module, exports) {
63749     /** Used as the `TypeError` message for "Functions" methods. */
63750     var FUNC_ERROR_TEXT = 'Expected a function';
63751
63752     /**
63753      * The base implementation of `_.delay` and `_.defer` which accepts an index of
63754      * where to slice the arguments to provide to `func`.
63755      *
63756      * @private
63757      * @param {Function}
63758      *            func The function to delay.
63759      * @param {number}
63760      *            wait The number of milliseconds to delay invocation.
63761      * @param {Object}
63762      *            args The arguments provide to `func`.
63763      * @returns {number} Returns the timer id.
63764      */
63765     function baseDelay(func, wait, args) {
63766       if (typeof func != 'function') {
63767         throw new TypeError(FUNC_ERROR_TEXT);
63768       }
63769       return setTimeout(function() {
63770         func.apply(undefined, args);
63771       }, wait);
63772     }
63773
63774     module.exports = baseDelay;
63775
63776   }, {}],
63777   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDifference.js": [function(require, module, exports) {
63778     var baseIndexOf = require('./baseIndexOf'),
63779       cacheIndexOf = require('./cacheIndexOf'),
63780       createCache = require('./createCache');
63781
63782     /** Used as the size to enable large array optimizations. */
63783     var LARGE_ARRAY_SIZE = 200;
63784
63785     /**
63786      * The base implementation of `_.difference` which accepts a single array of
63787      * values to exclude.
63788      *
63789      * @private
63790      * @param {Array}
63791      *            array The array to inspect.
63792      * @param {Array}
63793      *            values The values to exclude.
63794      * @returns {Array} Returns the new array of filtered values.
63795      */
63796     function baseDifference(array, values) {
63797       var length = array ? array.length : 0,
63798         result = [];
63799
63800       if (!length) {
63801         return result;
63802       }
63803       var index = -1,
63804         indexOf = baseIndexOf,
63805         isCommon = true,
63806         cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
63807         valuesLength = values.length;
63808
63809       if (cache) {
63810         indexOf = cacheIndexOf;
63811         isCommon = false;
63812         values = cache;
63813       }
63814       outer:
63815         while (++index < length) {
63816           var value = array[index];
63817
63818           if (isCommon && value === value) {
63819             var valuesIndex = valuesLength;
63820             while (valuesIndex--) {
63821               if (values[valuesIndex] === value) {
63822                 continue outer;
63823               }
63824             }
63825             result.push(value);
63826           } else if (indexOf(values, value, 0) < 0) {
63827             result.push(value);
63828           }
63829         }
63830       return result;
63831     }
63832
63833     module.exports = baseDifference;
63834
63835   }, {
63836     "./baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
63837     "./cacheIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js",
63838     "./createCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js"
63839   }],
63840   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js": [function(require, module, exports) {
63841     var baseForOwn = require('./baseForOwn'),
63842       createBaseEach = require('./createBaseEach');
63843
63844     /**
63845      * The base implementation of `_.forEach` without support for callback
63846      * shorthands and `this` binding.
63847      *
63848      * @private
63849      * @param {Array|Object|string}
63850      *            collection The collection to iterate over.
63851      * @param {Function}
63852      *            iteratee The function invoked per iteration.
63853      * @returns {Array|Object|string} Returns `collection`.
63854      */
63855     var baseEach = createBaseEach(baseForOwn);
63856
63857     module.exports = baseEach;
63858
63859   }, {
63860     "./baseForOwn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForOwn.js",
63861     "./createBaseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseEach.js"
63862   }],
63863   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEvery.js": [function(require, module, exports) {
63864     var baseEach = require('./baseEach');
63865
63866     /**
63867      * The base implementation of `_.every` without support for callback shorthands
63868      * and `this` binding.
63869      *
63870      * @private
63871      * @param {Array|Object|string}
63872      *            collection The collection to iterate over.
63873      * @param {Function}
63874      *            predicate The function invoked per iteration.
63875      * @returns {boolean} Returns `true` if all elements pass the predicate check,
63876      *          else `false`
63877      */
63878     function baseEvery(collection, predicate) {
63879       var result = true;
63880       baseEach(collection, function(value, index, collection) {
63881         result = !!predicate(value, index, collection);
63882         return result;
63883       });
63884       return result;
63885     }
63886
63887     module.exports = baseEvery;
63888
63889   }, {
63890     "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
63891   }],
63892   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFilter.js": [function(require, module, exports) {
63893     var baseEach = require('./baseEach');
63894
63895     /**
63896      * The base implementation of `_.filter` without support for callback shorthands
63897      * and `this` binding.
63898      *
63899      * @private
63900      * @param {Array|Object|string}
63901      *            collection The collection to iterate over.
63902      * @param {Function}
63903      *            predicate The function invoked per iteration.
63904      * @returns {Array} Returns the new filtered array.
63905      */
63906     function baseFilter(collection, predicate) {
63907       var result = [];
63908       baseEach(collection, function(value, index, collection) {
63909         if (predicate(value, index, collection)) {
63910           result.push(value);
63911         }
63912       });
63913       return result;
63914     }
63915
63916     module.exports = baseFilter;
63917
63918   }, {
63919     "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
63920   }],
63921   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFind.js": [function(require, module, exports) {
63922     /**
63923      * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and
63924      * `_.findLastKey`, without support for callback shorthands and `this` binding,
63925      * which iterates over `collection` using the provided `eachFunc`.
63926      *
63927      * @private
63928      * @param {Array|Object|string}
63929      *            collection The collection to search.
63930      * @param {Function}
63931      *            predicate The function invoked per iteration.
63932      * @param {Function}
63933      *            eachFunc The function to iterate over `collection`.
63934      * @param {boolean}
63935      *            [retKey] Specify returning the key of the found element instead of
63936      *            the element itself.
63937      * @returns {*} Returns the found element or its key, else `undefined`.
63938      */
63939     function baseFind(collection, predicate, eachFunc, retKey) {
63940       var result;
63941       eachFunc(collection, function(value, key, collection) {
63942         if (predicate(value, key, collection)) {
63943           result = retKey ? key : value;
63944           return false;
63945         }
63946       });
63947       return result;
63948     }
63949
63950     module.exports = baseFind;
63951
63952   }, {}],
63953   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFindIndex.js": [function(require, module, exports) {
63954     /**
63955      * The base implementation of `_.findIndex` and `_.findLastIndex` without
63956      * support for callback shorthands and `this` binding.
63957      *
63958      * @private
63959      * @param {Array}
63960      *            array The array to search.
63961      * @param {Function}
63962      *            predicate The function invoked per iteration.
63963      * @param {boolean}
63964      *            [fromRight] Specify iterating from right to left.
63965      * @returns {number} Returns the index of the matched value, else `-1`.
63966      */
63967     function baseFindIndex(array, predicate, fromRight) {
63968       var length = array.length,
63969         index = fromRight ? length : -1;
63970
63971       while ((fromRight ? index-- : ++index < length)) {
63972         if (predicate(array[index], index, array)) {
63973           return index;
63974         }
63975       }
63976       return -1;
63977     }
63978
63979     module.exports = baseFindIndex;
63980
63981   }, {}],
63982   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js": [function(require, module, exports) {
63983     var arrayPush = require('./arrayPush'),
63984       isArguments = require('../lang/isArguments'),
63985       isArray = require('../lang/isArray'),
63986       isArrayLike = require('./isArrayLike'),
63987       isObjectLike = require('./isObjectLike');
63988
63989     /**
63990      * The base implementation of `_.flatten` with added support for restricting
63991      * flattening and specifying the start index.
63992      *
63993      * @private
63994      * @param {Array}
63995      *            array The array to flatten.
63996      * @param {boolean}
63997      *            [isDeep] Specify a deep flatten.
63998      * @param {boolean}
63999      *            [isStrict] Restrict flattening to arrays-like objects.
64000      * @param {Array}
64001      *            [result=[]] The initial result value.
64002      * @returns {Array} Returns the new flattened array.
64003      */
64004     function baseFlatten(array, isDeep, isStrict, result) {
64005       result || (result = []);
64006
64007       var index = -1,
64008         length = array.length;
64009
64010       while (++index < length) {
64011         var value = array[index];
64012         if (isObjectLike(value) && isArrayLike(value) &&
64013           (isStrict || isArray(value) || isArguments(value))) {
64014           if (isDeep) {
64015             // Recursively flatten arrays (susceptible to call stack limits).
64016             baseFlatten(value, isDeep, isStrict, result);
64017           } else {
64018             arrayPush(result, value);
64019           }
64020         } else if (!isStrict) {
64021           result[result.length] = value;
64022         }
64023       }
64024       return result;
64025     }
64026
64027     module.exports = baseFlatten;
64028
64029   }, {
64030     "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
64031     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64032     "./arrayPush": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayPush.js",
64033     "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
64034     "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64035   }],
64036   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js": [function(require, module, exports) {
64037     var createBaseFor = require('./createBaseFor');
64038
64039     /**
64040      * The base implementation of `baseForIn` and `baseForOwn` which iterates over
64041      * `object` properties returned by `keysFunc` invoking `iteratee` for each
64042      * property. Iteratee functions may exit iteration early by explicitly returning
64043      * `false`.
64044      *
64045      * @private
64046      * @param {Object}
64047      *            object The object to iterate over.
64048      * @param {Function}
64049      *            iteratee The function invoked per iteration.
64050      * @param {Function}
64051      *            keysFunc The function to get the keys of `object`.
64052      * @returns {Object} Returns `object`.
64053      */
64054     var baseFor = createBaseFor();
64055
64056     module.exports = baseFor;
64057
64058   }, {
64059     "./createBaseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseFor.js"
64060   }],
64061   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js": [function(require, module, exports) {
64062     var baseFor = require('./baseFor'),
64063       keysIn = require('../object/keysIn');
64064
64065     /**
64066      * The base implementation of `_.forIn` without support for callback shorthands
64067      * and `this` binding.
64068      *
64069      * @private
64070      * @param {Object}
64071      *            object The object to iterate over.
64072      * @param {Function}
64073      *            iteratee The function invoked per iteration.
64074      * @returns {Object} Returns `object`.
64075      */
64076     function baseForIn(object, iteratee) {
64077       return baseFor(object, iteratee, keysIn);
64078     }
64079
64080     module.exports = baseForIn;
64081
64082   }, {
64083     "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js",
64084     "./baseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js"
64085   }],
64086   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForOwn.js": [function(require, module, exports) {
64087     var baseFor = require('./baseFor'),
64088       keys = require('../object/keys');
64089
64090     /**
64091      * The base implementation of `_.forOwn` without support for callback shorthands
64092      * and `this` binding.
64093      *
64094      * @private
64095      * @param {Object}
64096      *            object The object to iterate over.
64097      * @param {Function}
64098      *            iteratee The function invoked per iteration.
64099      * @returns {Object} Returns `object`.
64100      */
64101     function baseForOwn(object, iteratee) {
64102       return baseFor(object, iteratee, keys);
64103     }
64104
64105     module.exports = baseForOwn;
64106
64107   }, {
64108     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
64109     "./baseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js"
64110   }],
64111   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js": [function(require, module, exports) {
64112     var toObject = require('./toObject');
64113
64114     /**
64115      * The base implementation of `get` without support for string paths and default
64116      * values.
64117      *
64118      * @private
64119      * @param {Object}
64120      *            object The object to query.
64121      * @param {Array}
64122      *            path The path of the property to get.
64123      * @param {string}
64124      *            [pathKey] The key representation of path.
64125      * @returns {*} Returns the resolved value.
64126      */
64127     function baseGet(object, path, pathKey) {
64128       if (object == null) {
64129         return;
64130       }
64131       if (pathKey !== undefined && pathKey in toObject(object)) {
64132         path = [pathKey];
64133       }
64134       var index = 0,
64135         length = path.length;
64136
64137       while (object != null && index < length) {
64138         object = object[path[index++]];
64139       }
64140       return (index && index == length) ? object : undefined;
64141     }
64142
64143     module.exports = baseGet;
64144
64145   }, {
64146     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64147   }],
64148   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js": [function(require, module, exports) {
64149     var indexOfNaN = require('./indexOfNaN');
64150
64151     /**
64152      * The base implementation of `_.indexOf` without support for binary searches.
64153      *
64154      * @private
64155      * @param {Array}
64156      *            array The array to search.
64157      * @param {*}
64158      *            value The value to search for.
64159      * @param {number}
64160      *            fromIndex The index to search from.
64161      * @returns {number} Returns the index of the matched value, else `-1`.
64162      */
64163     function baseIndexOf(array, value, fromIndex) {
64164       if (value !== value) {
64165         return indexOfNaN(array, fromIndex);
64166       }
64167       var index = fromIndex - 1,
64168         length = array.length;
64169
64170       while (++index < length) {
64171         if (array[index] === value) {
64172           return index;
64173         }
64174       }
64175       return -1;
64176     }
64177
64178     module.exports = baseIndexOf;
64179
64180   }, {
64181     "./indexOfNaN": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\indexOfNaN.js"
64182   }],
64183   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js": [function(require, module, exports) {
64184     var baseIsEqualDeep = require('./baseIsEqualDeep'),
64185       isObject = require('../lang/isObject'),
64186       isObjectLike = require('./isObjectLike');
64187
64188     /**
64189      * The base implementation of `_.isEqual` without support for `this` binding
64190      * `customizer` functions.
64191      *
64192      * @private
64193      * @param {*}
64194      *            value The value to compare.
64195      * @param {*}
64196      *            other The other value to compare.
64197      * @param {Function}
64198      *            [customizer] The function to customize comparing values.
64199      * @param {boolean}
64200      *            [isLoose] Specify performing partial comparisons.
64201      * @param {Array}
64202      *            [stackA] Tracks traversed `value` objects.
64203      * @param {Array}
64204      *            [stackB] Tracks traversed `other` objects.
64205      * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
64206      */
64207     function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
64208       if (value === other) {
64209         return true;
64210       }
64211       if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
64212         return value !== value && other !== other;
64213       }
64214       return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
64215     }
64216
64217     module.exports = baseIsEqual;
64218
64219   }, {
64220     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
64221     "./baseIsEqualDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqualDeep.js",
64222     "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64223   }],
64224   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqualDeep.js": [function(require, module, exports) {
64225     var equalArrays = require('./equalArrays'),
64226       equalByTag = require('./equalByTag'),
64227       equalObjects = require('./equalObjects'),
64228       isArray = require('../lang/isArray'),
64229       isTypedArray = require('../lang/isTypedArray');
64230
64231     /** `Object#toString` result references. */
64232     var argsTag = '[object Arguments]',
64233       arrayTag = '[object Array]',
64234       objectTag = '[object Object]';
64235
64236     /** Used for native method references. */
64237     var objectProto = Object.prototype;
64238
64239     /** Used to check objects for own properties. */
64240     var hasOwnProperty = objectProto.hasOwnProperty;
64241
64242     /**
64243      * Used to resolve the
64244      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
64245      * of values.
64246      */
64247     var objToString = objectProto.toString;
64248
64249     /**
64250      * A specialized version of `baseIsEqual` for arrays and objects which performs
64251      * deep comparisons and tracks traversed objects enabling objects with circular
64252      * references to be compared.
64253      *
64254      * @private
64255      * @param {Object}
64256      *            object The object to compare.
64257      * @param {Object}
64258      *            other The other object to compare.
64259      * @param {Function}
64260      *            equalFunc The function to determine equivalents of values.
64261      * @param {Function}
64262      *            [customizer] The function to customize comparing objects.
64263      * @param {boolean}
64264      *            [isLoose] Specify performing partial comparisons.
64265      * @param {Array}
64266      *            [stackA=[]] Tracks traversed `value` objects.
64267      * @param {Array}
64268      *            [stackB=[]] Tracks traversed `other` objects.
64269      * @returns {boolean} Returns `true` if the objects are equivalent, else
64270      *          `false`.
64271      */
64272     function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
64273       var objIsArr = isArray(object),
64274         othIsArr = isArray(other),
64275         objTag = arrayTag,
64276         othTag = arrayTag;
64277
64278       if (!objIsArr) {
64279         objTag = objToString.call(object);
64280         if (objTag == argsTag) {
64281           objTag = objectTag;
64282         } else if (objTag != objectTag) {
64283           objIsArr = isTypedArray(object);
64284         }
64285       }
64286       if (!othIsArr) {
64287         othTag = objToString.call(other);
64288         if (othTag == argsTag) {
64289           othTag = objectTag;
64290         } else if (othTag != objectTag) {
64291           othIsArr = isTypedArray(other);
64292         }
64293       }
64294       var objIsObj = objTag == objectTag,
64295         othIsObj = othTag == objectTag,
64296         isSameTag = objTag == othTag;
64297
64298       if (isSameTag && !(objIsArr || objIsObj)) {
64299         return equalByTag(object, other, objTag);
64300       }
64301       if (!isLoose) {
64302         var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
64303           othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
64304
64305         if (objIsWrapped || othIsWrapped) {
64306           return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
64307         }
64308       }
64309       if (!isSameTag) {
64310         return false;
64311       }
64312       // Assume cyclic values are equal.
64313       // For more information on detecting circular references see
64314       // https://es5.github.io/#JO.
64315       stackA || (stackA = []);
64316       stackB || (stackB = []);
64317
64318       var length = stackA.length;
64319       while (length--) {
64320         if (stackA[length] == object) {
64321           return stackB[length] == other;
64322         }
64323       }
64324       // Add `object` and `other` to the stack of traversed objects.
64325       stackA.push(object);
64326       stackB.push(other);
64327
64328       var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
64329
64330       stackA.pop();
64331       stackB.pop();
64332
64333       return result;
64334     }
64335
64336     module.exports = baseIsEqualDeep;
64337
64338   }, {
64339     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64340     "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64341     "./equalArrays": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalArrays.js",
64342     "./equalByTag": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalByTag.js",
64343     "./equalObjects": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalObjects.js"
64344   }],
64345   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsMatch.js": [function(require, module, exports) {
64346     var baseIsEqual = require('./baseIsEqual'),
64347       toObject = require('./toObject');
64348
64349     /**
64350      * The base implementation of `_.isMatch` without support for callback
64351      * shorthands and `this` binding.
64352      *
64353      * @private
64354      * @param {Object}
64355      *            object The object to inspect.
64356      * @param {Array}
64357      *            matchData The propery names, values, and compare flags to match.
64358      * @param {Function}
64359      *            [customizer] The function to customize comparing objects.
64360      * @returns {boolean} Returns `true` if `object` is a match, else `false`.
64361      */
64362     function baseIsMatch(object, matchData, customizer) {
64363       var index = matchData.length,
64364         length = index,
64365         noCustomizer = !customizer;
64366
64367       if (object == null) {
64368         return !length;
64369       }
64370       object = toObject(object);
64371       while (index--) {
64372         var data = matchData[index];
64373         if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) {
64374           return false;
64375         }
64376       }
64377       while (++index < length) {
64378         data = matchData[index];
64379         var key = data[0],
64380           objValue = object[key],
64381           srcValue = data[1];
64382
64383         if (noCustomizer && data[2]) {
64384           if (objValue === undefined && !(key in object)) {
64385             return false;
64386           }
64387         } else {
64388           var result = customizer ? customizer(objValue, srcValue, key) : undefined;
64389           if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
64390             return false;
64391           }
64392         }
64393       }
64394       return true;
64395     }
64396
64397     module.exports = baseIsMatch;
64398
64399   }, {
64400     "./baseIsEqual": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js",
64401     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64402   }],
64403   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js": [function(require, module, exports) {
64404     /**
64405      * The function whose prototype all chaining wrappers inherit from.
64406      *
64407      * @private
64408      */
64409     function baseLodash() {
64410       // No operation performed.
64411     }
64412
64413     module.exports = baseLodash;
64414
64415   }, {}],
64416   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js": [function(require, module, exports) {
64417     var baseEach = require('./baseEach'),
64418       isArrayLike = require('./isArrayLike');
64419
64420     /**
64421      * The base implementation of `_.map` without support for callback shorthands
64422      * and `this` binding.
64423      *
64424      * @private
64425      * @param {Array|Object|string}
64426      *            collection The collection to iterate over.
64427      * @param {Function}
64428      *            iteratee The function invoked per iteration.
64429      * @returns {Array} Returns the new mapped array.
64430      */
64431     function baseMap(collection, iteratee) {
64432       var index = -1,
64433         result = isArrayLike(collection) ? Array(collection.length) : [];
64434
64435       baseEach(collection, function(value, key, collection) {
64436         result[++index] = iteratee(value, key, collection);
64437       });
64438       return result;
64439     }
64440
64441     module.exports = baseMap;
64442
64443   }, {
64444     "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
64445     "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js"
64446   }],
64447   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatches.js": [function(require, module, exports) {
64448     var baseIsMatch = require('./baseIsMatch'),
64449       getMatchData = require('./getMatchData'),
64450       toObject = require('./toObject');
64451
64452     /**
64453      * The base implementation of `_.matches` which does not clone `source`.
64454      *
64455      * @private
64456      * @param {Object}
64457      *            source The object of property values to match.
64458      * @returns {Function} Returns the new function.
64459      */
64460     function baseMatches(source) {
64461       var matchData = getMatchData(source);
64462       if (matchData.length == 1 && matchData[0][2]) {
64463         var key = matchData[0][0],
64464           value = matchData[0][1];
64465
64466         return function(object) {
64467           if (object == null) {
64468             return false;
64469           }
64470           return object[key] === value && (value !== undefined || (key in toObject(object)));
64471         };
64472       }
64473       return function(object) {
64474         return baseIsMatch(object, matchData);
64475       };
64476     }
64477
64478     module.exports = baseMatches;
64479
64480   }, {
64481     "./baseIsMatch": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsMatch.js",
64482     "./getMatchData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getMatchData.js",
64483     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64484   }],
64485   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatchesProperty.js": [function(require, module, exports) {
64486     var baseGet = require('./baseGet'),
64487       baseIsEqual = require('./baseIsEqual'),
64488       baseSlice = require('./baseSlice'),
64489       isArray = require('../lang/isArray'),
64490       isKey = require('./isKey'),
64491       isStrictComparable = require('./isStrictComparable'),
64492       last = require('../array/last'),
64493       toObject = require('./toObject'),
64494       toPath = require('./toPath');
64495
64496     /**
64497      * The base implementation of `_.matchesProperty` which does not clone
64498      * `srcValue`.
64499      *
64500      * @private
64501      * @param {string}
64502      *            path The path of the property to get.
64503      * @param {*}
64504      *            srcValue The value to compare.
64505      * @returns {Function} Returns the new function.
64506      */
64507     function baseMatchesProperty(path, srcValue) {
64508       var isArr = isArray(path),
64509         isCommon = isKey(path) && isStrictComparable(srcValue),
64510         pathKey = (path + '');
64511
64512       path = toPath(path);
64513       return function(object) {
64514         if (object == null) {
64515           return false;
64516         }
64517         var key = pathKey;
64518         object = toObject(object);
64519         if ((isArr || !isCommon) && !(key in object)) {
64520           object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
64521           if (object == null) {
64522             return false;
64523           }
64524           key = last(path);
64525           object = toObject(object);
64526         }
64527         return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true);
64528       };
64529     }
64530
64531     module.exports = baseMatchesProperty;
64532
64533   }, {
64534     "../array/last": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\last.js",
64535     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64536     "./baseGet": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js",
64537     "./baseIsEqual": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js",
64538     "./baseSlice": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSlice.js",
64539     "./isKey": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js",
64540     "./isStrictComparable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js",
64541     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js",
64542     "./toPath": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js"
64543   }],
64544   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMerge.js": [function(require, module, exports) {
64545     var arrayEach = require('./arrayEach'),
64546       baseMergeDeep = require('./baseMergeDeep'),
64547       isArray = require('../lang/isArray'),
64548       isArrayLike = require('./isArrayLike'),
64549       isObject = require('../lang/isObject'),
64550       isObjectLike = require('./isObjectLike'),
64551       isTypedArray = require('../lang/isTypedArray'),
64552       keys = require('../object/keys');
64553
64554     /**
64555      * The base implementation of `_.merge` without support for argument juggling,
64556      * multiple sources, and `this` binding `customizer` functions.
64557      *
64558      * @private
64559      * @param {Object}
64560      *            object The destination object.
64561      * @param {Object}
64562      *            source The source object.
64563      * @param {Function}
64564      *            [customizer] The function to customize merged values.
64565      * @param {Array}
64566      *            [stackA=[]] Tracks traversed source objects.
64567      * @param {Array}
64568      *            [stackB=[]] Associates values with source counterparts.
64569      * @returns {Object} Returns `object`.
64570      */
64571     function baseMerge(object, source, customizer, stackA, stackB) {
64572       if (!isObject(object)) {
64573         return object;
64574       }
64575       var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
64576         props = isSrcArr ? undefined : keys(source);
64577
64578       arrayEach(props || source, function(srcValue, key) {
64579         if (props) {
64580           key = srcValue;
64581           srcValue = source[key];
64582         }
64583         if (isObjectLike(srcValue)) {
64584           stackA || (stackA = []);
64585           stackB || (stackB = []);
64586           baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
64587         } else {
64588           var value = object[key],
64589             result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
64590             isCommon = result === undefined;
64591
64592           if (isCommon) {
64593             result = srcValue;
64594           }
64595           if ((result !== undefined || (isSrcArr && !(key in object))) &&
64596             (isCommon || (result === result ? (result !== value) : (value === value)))) {
64597             object[key] = result;
64598           }
64599         }
64600       });
64601       return object;
64602     }
64603
64604     module.exports = baseMerge;
64605
64606   }, {
64607     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64608     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
64609     "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64610     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
64611     "./arrayEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js",
64612     "./baseMergeDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMergeDeep.js",
64613     "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
64614     "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64615   }],
64616   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMergeDeep.js": [function(require, module, exports) {
64617     var arrayCopy = require('./arrayCopy'),
64618       isArguments = require('../lang/isArguments'),
64619       isArray = require('../lang/isArray'),
64620       isArrayLike = require('./isArrayLike'),
64621       isPlainObject = require('../lang/isPlainObject'),
64622       isTypedArray = require('../lang/isTypedArray'),
64623       toPlainObject = require('../lang/toPlainObject');
64624
64625     /**
64626      * A specialized version of `baseMerge` for arrays and objects which performs
64627      * deep merges and tracks traversed objects enabling objects with circular
64628      * references to be merged.
64629      *
64630      * @private
64631      * @param {Object}
64632      *            object The destination object.
64633      * @param {Object}
64634      *            source The source object.
64635      * @param {string}
64636      *            key The key of the value to merge.
64637      * @param {Function}
64638      *            mergeFunc The function to merge values.
64639      * @param {Function}
64640      *            [customizer] The function to customize merged values.
64641      * @param {Array}
64642      *            [stackA=[]] Tracks traversed source objects.
64643      * @param {Array}
64644      *            [stackB=[]] Associates values with source counterparts.
64645      * @returns {boolean} Returns `true` if the objects are equivalent, else
64646      *          `false`.
64647      */
64648     function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
64649       var length = stackA.length,
64650         srcValue = source[key];
64651
64652       while (length--) {
64653         if (stackA[length] == srcValue) {
64654           object[key] = stackB[length];
64655           return;
64656         }
64657       }
64658       var value = object[key],
64659         result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
64660         isCommon = result === undefined;
64661
64662       if (isCommon) {
64663         result = srcValue;
64664         if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
64665           result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []);
64666         } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
64667           result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {});
64668         } else {
64669           isCommon = false;
64670         }
64671       }
64672       // Add the source value to the stack of traversed objects and associate
64673       // it with its merged value.
64674       stackA.push(srcValue);
64675       stackB.push(result);
64676
64677       if (isCommon) {
64678         // Recursively merge objects and arrays (susceptible to call stack limits).
64679         object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
64680       } else if (result === result ? (result !== value) : (value === value)) {
64681         object[key] = result;
64682       }
64683     }
64684
64685     module.exports = baseMergeDeep;
64686
64687   }, {
64688     "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
64689     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64690     "../lang/isPlainObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isPlainObject.js",
64691     "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64692     "../lang/toPlainObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\toPlainObject.js",
64693     "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
64694     "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js"
64695   }],
64696   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js": [function(require, module, exports) {
64697     /**
64698      * The base implementation of `_.property` without support for deep paths.
64699      *
64700      * @private
64701      * @param {string}
64702      *            key The key of the property to get.
64703      * @returns {Function} Returns the new function.
64704      */
64705     function baseProperty(key) {
64706       return function(object) {
64707         return object == null ? undefined : object[key];
64708       };
64709     }
64710
64711     module.exports = baseProperty;
64712
64713   }, {}],
64714   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\basePropertyDeep.js": [function(require, module, exports) {
64715     var baseGet = require('./baseGet'),
64716       toPath = require('./toPath');
64717
64718     /**
64719      * A specialized version of `baseProperty` which supports deep paths.
64720      *
64721      * @private
64722      * @param {Array|string}
64723      *            path The path of the property to get.
64724      * @returns {Function} Returns the new function.
64725      */
64726     function basePropertyDeep(path) {
64727       var pathKey = (path + '');
64728       path = toPath(path);
64729       return function(object) {
64730         return baseGet(object, path, pathKey);
64731       };
64732     }
64733
64734     module.exports = basePropertyDeep;
64735
64736   }, {
64737     "./baseGet": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js",
64738     "./toPath": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js"
64739   }],
64740   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseReduce.js": [function(require, module, exports) {
64741     /**
64742      * The base implementation of `_.reduce` and `_.reduceRight` without support for
64743      * callback shorthands and `this` binding, which iterates over `collection`
64744      * using the provided `eachFunc`.
64745      *
64746      * @private
64747      * @param {Array|Object|string}
64748      *            collection The collection to iterate over.
64749      * @param {Function}
64750      *            iteratee The function invoked per iteration.
64751      * @param {*}
64752      *            accumulator The initial value.
64753      * @param {boolean}
64754      *            initFromCollection Specify using the first or last element of
64755      *            `collection` as the initial value.
64756      * @param {Function}
64757      *            eachFunc The function to iterate over `collection`.
64758      * @returns {*} Returns the accumulated value.
64759      */
64760     function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
64761       eachFunc(collection, function(value, index, collection) {
64762         accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
64763       });
64764       return accumulator;
64765     }
64766
64767     module.exports = baseReduce;
64768
64769   }, {}],
64770   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js": [function(require, module, exports) {
64771     var identity = require('../utility/identity'),
64772       metaMap = require('./metaMap');
64773
64774     /**
64775      * The base implementation of `setData` without support for hot loop detection.
64776      *
64777      * @private
64778      * @param {Function}
64779      *            func The function to associate metadata with.
64780      * @param {*}
64781      *            data The metadata.
64782      * @returns {Function} Returns `func`.
64783      */
64784     var baseSetData = !metaMap ? identity : function(func, data) {
64785       metaMap.set(func, data);
64786       return func;
64787     };
64788
64789     module.exports = baseSetData;
64790
64791   }, {
64792     "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js",
64793     "./metaMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js"
64794   }],
64795   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSlice.js": [function(require, module, exports) {
64796     /**
64797      * The base implementation of `_.slice` without an iteratee call guard.
64798      *
64799      * @private
64800      * @param {Array}
64801      *            array The array to slice.
64802      * @param {number}
64803      *            [start=0] The start position.
64804      * @param {number}
64805      *            [end=array.length] The end position.
64806      * @returns {Array} Returns the slice of `array`.
64807      */
64808     function baseSlice(array, start, end) {
64809       var index = -1,
64810         length = array.length;
64811
64812       start = start == null ? 0 : (+start || 0);
64813       if (start < 0) {
64814         start = -start > length ? 0 : (length + start);
64815       }
64816       end = (end === undefined || end > length) ? length : (+end || 0);
64817       if (end < 0) {
64818         end += length;
64819       }
64820       length = start > end ? 0 : ((end - start) >>> 0);
64821       start >>>= 0;
64822
64823       var result = Array(length);
64824       while (++index < length) {
64825         result[index] = array[index + start];
64826       }
64827       return result;
64828     }
64829
64830     module.exports = baseSlice;
64831
64832   }, {}],
64833   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSome.js": [function(require, module, exports) {
64834     var baseEach = require('./baseEach');
64835
64836     /**
64837      * The base implementation of `_.some` without support for callback shorthands
64838      * and `this` binding.
64839      *
64840      * @private
64841      * @param {Array|Object|string}
64842      *            collection The collection to iterate over.
64843      * @param {Function}
64844      *            predicate The function invoked per iteration.
64845      * @returns {boolean} Returns `true` if any element passes the predicate check,
64846      *          else `false`.
64847      */
64848     function baseSome(collection, predicate) {
64849       var result;
64850
64851       baseEach(collection, function(value, index, collection) {
64852         result = predicate(value, index, collection);
64853         return !result;
64854       });
64855       return !!result;
64856     }
64857
64858     module.exports = baseSome;
64859
64860   }, {
64861     "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
64862   }],
64863   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSortBy.js": [function(require, module, exports) {
64864     /**
64865      * The base implementation of `_.sortBy` which uses `comparer` to define the
64866      * sort order of `array` and replaces criteria objects with their corresponding
64867      * values.
64868      *
64869      * @private
64870      * @param {Array}
64871      *            array The array to sort.
64872      * @param {Function}
64873      *            comparer The function to define sort order.
64874      * @returns {Array} Returns `array`.
64875      */
64876     function baseSortBy(array, comparer) {
64877       var length = array.length;
64878
64879       array.sort(comparer);
64880       while (length--) {
64881         array[length] = array[length].value;
64882       }
64883       return array;
64884     }
64885
64886     module.exports = baseSortBy;
64887
64888   }, {}],
64889   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseToString.js": [function(require, module, exports) {
64890     /**
64891      * Converts `value` to a string if it's not one. An empty string is returned for
64892      * `null` or `undefined` values.
64893      *
64894      * @private
64895      * @param {*}
64896      *            value The value to process.
64897      * @returns {string} Returns the string.
64898      */
64899     function baseToString(value) {
64900       return value == null ? '' : (value + '');
64901     }
64902
64903     module.exports = baseToString;
64904
64905   }, {}],
64906   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseUniq.js": [function(require, module, exports) {
64907     var baseIndexOf = require('./baseIndexOf'),
64908       cacheIndexOf = require('./cacheIndexOf'),
64909       createCache = require('./createCache');
64910
64911     /** Used as the size to enable large array optimizations. */
64912     var LARGE_ARRAY_SIZE = 200;
64913
64914     /**
64915      * The base implementation of `_.uniq` without support for callback shorthands
64916      * and `this` binding.
64917      *
64918      * @private
64919      * @param {Array}
64920      *            array The array to inspect.
64921      * @param {Function}
64922      *            [iteratee] The function invoked per iteration.
64923      * @returns {Array} Returns the new duplicate free array.
64924      */
64925     function baseUniq(array, iteratee) {
64926       var index = -1,
64927         indexOf = baseIndexOf,
64928         length = array.length,
64929         isCommon = true,
64930         isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
64931         seen = isLarge ? createCache() : null,
64932         result = [];
64933
64934       if (seen) {
64935         indexOf = cacheIndexOf;
64936         isCommon = false;
64937       } else {
64938         isLarge = false;
64939         seen = iteratee ? [] : result;
64940       }
64941       outer:
64942         while (++index < length) {
64943           var value = array[index],
64944             computed = iteratee ? iteratee(value, index, array) : value;
64945
64946           if (isCommon && value === value) {
64947             var seenIndex = seen.length;
64948             while (seenIndex--) {
64949               if (seen[seenIndex] === computed) {
64950                 continue outer;
64951               }
64952             }
64953             if (iteratee) {
64954               seen.push(computed);
64955             }
64956             result.push(value);
64957           } else if (indexOf(seen, computed, 0) < 0) {
64958             if (iteratee || isLarge) {
64959               seen.push(computed);
64960             }
64961             result.push(value);
64962           }
64963         }
64964       return result;
64965     }
64966
64967     module.exports = baseUniq;
64968
64969   }, {
64970     "./baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
64971     "./cacheIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js",
64972     "./createCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js"
64973   }],
64974   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseValues.js": [function(require, module, exports) {
64975     /**
64976      * The base implementation of `_.values` and `_.valuesIn` which creates an array
64977      * of `object` property values corresponding to the property names of `props`.
64978      *
64979      * @private
64980      * @param {Object}
64981      *            object The object to query.
64982      * @param {Array}
64983      *            props The property names to get values for.
64984      * @returns {Object} Returns the array of property values.
64985      */
64986     function baseValues(object, props) {
64987       var index = -1,
64988         length = props.length,
64989         result = Array(length);
64990
64991       while (++index < length) {
64992         result[index] = object[props[index]];
64993       }
64994       return result;
64995     }
64996
64997     module.exports = baseValues;
64998
64999   }, {}],
65000   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js": [function(require, module, exports) {
65001     var identity = require('../utility/identity');
65002
65003     /**
65004      * A specialized version of `baseCallback` which only supports `this` binding
65005      * and specifying the number of arguments to provide to `func`.
65006      *
65007      * @private
65008      * @param {Function}
65009      *            func The function to bind.
65010      * @param {*}
65011      *            thisArg The `this` binding of `func`.
65012      * @param {number}
65013      *            [argCount] The number of arguments to provide to `func`.
65014      * @returns {Function} Returns the callback.
65015      */
65016     function bindCallback(func, thisArg, argCount) {
65017       if (typeof func != 'function') {
65018         return identity;
65019       }
65020       if (thisArg === undefined) {
65021         return func;
65022       }
65023       switch (argCount) {
65024         case 1:
65025           return function(value) {
65026             return func.call(thisArg, value);
65027           };
65028         case 3:
65029           return function(value, index, collection) {
65030             return func.call(thisArg, value, index, collection);
65031           };
65032         case 4:
65033           return function(accumulator, value, index, collection) {
65034             return func.call(thisArg, accumulator, value, index, collection);
65035           };
65036         case 5:
65037           return function(value, other, key, object, source) {
65038             return func.call(thisArg, value, other, key, object, source);
65039           };
65040       }
65041       return function() {
65042         return func.apply(thisArg, arguments);
65043       };
65044     }
65045
65046     module.exports = bindCallback;
65047
65048   }, {
65049     "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js"
65050   }],
65051   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js": [function(require, module, exports) {
65052     var isObject = require('../lang/isObject');
65053
65054     /**
65055      * Checks if `value` is in `cache` mimicking the return signature of `_.indexOf`
65056      * by returning `0` if the value is found, else `-1`.
65057      *
65058      * @private
65059      * @param {Object}
65060      *            cache The cache to search.
65061      * @param {*}
65062      *            value The value to search for.
65063      * @returns {number} Returns `0` if `value` is found, else `-1`.
65064      */
65065     function cacheIndexOf(cache, value) {
65066       var data = cache.data,
65067         result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
65068
65069       return result ? 0 : -1;
65070     }
65071
65072     module.exports = cacheIndexOf;
65073
65074   }, {
65075     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
65076   }],
65077   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cachePush.js": [function(require, module, exports) {
65078     var isObject = require('../lang/isObject');
65079
65080     /**
65081      * Adds `value` to the cache.
65082      *
65083      * @private
65084      * @name push
65085      * @memberOf SetCache
65086      * @param {*}
65087      *            value The value to cache.
65088      */
65089     function cachePush(value) {
65090       var data = this.data;
65091       if (typeof value == 'string' || isObject(value)) {
65092         data.set.add(value);
65093       } else {
65094         data.hash[value] = true;
65095       }
65096     }
65097
65098     module.exports = cachePush;
65099
65100   }, {
65101     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
65102   }],
65103   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\compareAscending.js": [function(require, module, exports) {
65104     var baseCompareAscending = require('./baseCompareAscending');
65105
65106     /**
65107      * Used by `_.sortBy` to compare transformed elements of a collection and stable
65108      * sort them in ascending order.
65109      *
65110      * @private
65111      * @param {Object}
65112      *            object The object to compare.
65113      * @param {Object}
65114      *            other The other object to compare.
65115      * @returns {number} Returns the sort order indicator for `object`.
65116      */
65117     function compareAscending(object, other) {
65118       return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
65119     }
65120
65121     module.exports = compareAscending;
65122
65123   }, {
65124     "./baseCompareAscending": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCompareAscending.js"
65125   }],
65126   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js": [function(require, module, exports) {
65127     /*
65128      * Native method references for those with the same name as other `lodash`
65129      * methods.
65130      */
65131     var nativeMax = Math.max;
65132
65133     /**
65134      * Creates an array that is the composition of partially applied arguments,
65135      * placeholders, and provided arguments into a single array of arguments.
65136      *
65137      * @private
65138      * @param {Array|Object}
65139      *            args The provided arguments.
65140      * @param {Array}
65141      *            partials The arguments to prepend to those provided.
65142      * @param {Array}
65143      *            holders The `partials` placeholder indexes.
65144      * @returns {Array} Returns the new array of composed arguments.
65145      */
65146     function composeArgs(args, partials, holders) {
65147       var holdersLength = holders.length,
65148         argsIndex = -1,
65149         argsLength = nativeMax(args.length - holdersLength, 0),
65150         leftIndex = -1,
65151         leftLength = partials.length,
65152         result = Array(leftLength + argsLength);
65153
65154       while (++leftIndex < leftLength) {
65155         result[leftIndex] = partials[leftIndex];
65156       }
65157       while (++argsIndex < holdersLength) {
65158         result[holders[argsIndex]] = args[argsIndex];
65159       }
65160       while (argsLength--) {
65161         result[leftIndex++] = args[argsIndex++];
65162       }
65163       return result;
65164     }
65165
65166     module.exports = composeArgs;
65167
65168   }, {}],
65169   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js": [function(require, module, exports) {
65170     /*
65171      * Native method references for those with the same name as other `lodash`
65172      * methods.
65173      */
65174     var nativeMax = Math.max;
65175
65176     /**
65177      * This function is like `composeArgs` except that the arguments composition is
65178      * tailored for `_.partialRight`.
65179      *
65180      * @private
65181      * @param {Array|Object}
65182      *            args The provided arguments.
65183      * @param {Array}
65184      *            partials The arguments to append to those provided.
65185      * @param {Array}
65186      *            holders The `partials` placeholder indexes.
65187      * @returns {Array} Returns the new array of composed arguments.
65188      */
65189     function composeArgsRight(args, partials, holders) {
65190       var holdersIndex = -1,
65191         holdersLength = holders.length,
65192         argsIndex = -1,
65193         argsLength = nativeMax(args.length - holdersLength, 0),
65194         rightIndex = -1,
65195         rightLength = partials.length,
65196         result = Array(argsLength + rightLength);
65197
65198       while (++argsIndex < argsLength) {
65199         result[argsIndex] = args[argsIndex];
65200       }
65201       var offset = argsIndex;
65202       while (++rightIndex < rightLength) {
65203         result[offset + rightIndex] = partials[rightIndex];
65204       }
65205       while (++holdersIndex < holdersLength) {
65206         result[offset + holders[holdersIndex]] = args[argsIndex++];
65207       }
65208       return result;
65209     }
65210
65211     module.exports = composeArgsRight;
65212
65213   }, {}],
65214   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAggregator.js": [function(require, module, exports) {
65215     var baseCallback = require('./baseCallback'),
65216       baseEach = require('./baseEach'),
65217       isArray = require('../lang/isArray');
65218
65219     /**
65220      * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.
65221      *
65222      * @private
65223      * @param {Function}
65224      *            setter The function to set keys and values of the accumulator
65225      *            object.
65226      * @param {Function}
65227      *            [initializer] The function to initialize the accumulator object.
65228      * @returns {Function} Returns the new aggregator function.
65229      */
65230     function createAggregator(setter, initializer) {
65231       return function(collection, iteratee, thisArg) {
65232         var result = initializer ? initializer() : {};
65233         iteratee = baseCallback(iteratee, thisArg, 3);
65234
65235         if (isArray(collection)) {
65236           var index = -1,
65237             length = collection.length;
65238
65239           while (++index < length) {
65240             var value = collection[index];
65241             setter(result, value, iteratee(value, index, collection), collection);
65242           }
65243         } else {
65244           baseEach(collection, function(value, key, collection) {
65245             setter(result, value, iteratee(value, key, collection), collection);
65246           });
65247         }
65248         return result;
65249       };
65250     }
65251
65252     module.exports = createAggregator;
65253
65254   }, {
65255     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65256     "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65257     "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
65258   }],
65259   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js": [function(require, module, exports) {
65260     var bindCallback = require('./bindCallback'),
65261       isIterateeCall = require('./isIterateeCall'),
65262       restParam = require('../function/restParam');
65263
65264     /**
65265      * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
65266      *
65267      * @private
65268      * @param {Function}
65269      *            assigner The function to assign values.
65270      * @returns {Function} Returns the new assigner function.
65271      */
65272     function createAssigner(assigner) {
65273       return restParam(function(object, sources) {
65274         var index = -1,
65275           length = object == null ? 0 : sources.length,
65276           customizer = length > 2 ? sources[length - 2] : undefined,
65277           guard = length > 2 ? sources[2] : undefined,
65278           thisArg = length > 1 ? sources[length - 1] : undefined;
65279
65280         if (typeof customizer == 'function') {
65281           customizer = bindCallback(customizer, thisArg, 5);
65282           length -= 2;
65283         } else {
65284           customizer = typeof thisArg == 'function' ? thisArg : undefined;
65285           length -= (customizer ? 1 : 0);
65286         }
65287         if (guard && isIterateeCall(sources[0], sources[1], guard)) {
65288           customizer = length < 3 ? undefined : customizer;
65289           length = 1;
65290         }
65291         while (++index < length) {
65292           var source = sources[index];
65293           if (source) {
65294             assigner(object, source, customizer);
65295           }
65296         }
65297         return object;
65298       });
65299     }
65300
65301     module.exports = createAssigner;
65302
65303   }, {
65304     "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
65305     "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
65306     "./isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
65307   }],
65308   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseEach.js": [function(require, module, exports) {
65309     var getLength = require('./getLength'),
65310       isLength = require('./isLength'),
65311       toObject = require('./toObject');
65312
65313     /**
65314      * Creates a `baseEach` or `baseEachRight` function.
65315      *
65316      * @private
65317      * @param {Function}
65318      *            eachFunc The function to iterate over a collection.
65319      * @param {boolean}
65320      *            [fromRight] Specify iterating from right to left.
65321      * @returns {Function} Returns the new base function.
65322      */
65323     function createBaseEach(eachFunc, fromRight) {
65324       return function(collection, iteratee) {
65325         var length = collection ? getLength(collection) : 0;
65326         if (!isLength(length)) {
65327           return eachFunc(collection, iteratee);
65328         }
65329         var index = fromRight ? length : -1,
65330           iterable = toObject(collection);
65331
65332         while ((fromRight ? index-- : ++index < length)) {
65333           if (iteratee(iterable[index], index, iterable) === false) {
65334             break;
65335           }
65336         }
65337         return collection;
65338       };
65339     }
65340
65341     module.exports = createBaseEach;
65342
65343   }, {
65344     "./getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
65345     "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
65346     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
65347   }],
65348   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseFor.js": [function(require, module, exports) {
65349     var toObject = require('./toObject');
65350
65351     /**
65352      * Creates a base function for `_.forIn` or `_.forInRight`.
65353      *
65354      * @private
65355      * @param {boolean}
65356      *            [fromRight] Specify iterating from right to left.
65357      * @returns {Function} Returns the new base function.
65358      */
65359     function createBaseFor(fromRight) {
65360       return function(object, iteratee, keysFunc) {
65361         var iterable = toObject(object),
65362           props = keysFunc(object),
65363           length = props.length,
65364           index = fromRight ? length : -1;
65365
65366         while ((fromRight ? index-- : ++index < length)) {
65367           var key = props[index];
65368           if (iteratee(iterable[key], key, iterable) === false) {
65369             break;
65370           }
65371         }
65372         return object;
65373       };
65374     }
65375
65376     module.exports = createBaseFor;
65377
65378   }, {
65379     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
65380   }],
65381   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBindWrapper.js": [function(require, module, exports) {
65382     (function(global) {
65383       var createCtorWrapper = require('./createCtorWrapper');
65384
65385       /**
65386        * Creates a function that wraps `func` and invokes it with the `this` binding
65387        * of `thisArg`.
65388        *
65389        * @private
65390        * @param {Function}
65391        *            func The function to bind.
65392        * @param {*}
65393        *            [thisArg] The `this` binding of `func`.
65394        * @returns {Function} Returns the new bound function.
65395        */
65396       function createBindWrapper(func, thisArg) {
65397         var Ctor = createCtorWrapper(func);
65398
65399         function wrapper() {
65400           var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
65401           return fn.apply(thisArg, arguments);
65402         }
65403         return wrapper;
65404       }
65405
65406       module.exports = createBindWrapper;
65407
65408     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65409   }, {
65410     "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js"
65411   }],
65412   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js": [function(require, module, exports) {
65413     (function(global) {
65414       var SetCache = require('./SetCache'),
65415         getNative = require('./getNative');
65416
65417       /** Native method references. */
65418       var Set = getNative(global, 'Set');
65419
65420       /*
65421        * Native method references for those with the same name as other `lodash`
65422        * methods.
65423        */
65424       var nativeCreate = getNative(Object, 'create');
65425
65426       /**
65427        * Creates a `Set` cache object to optimize linear searches of large arrays.
65428        *
65429        * @private
65430        * @param {Array}
65431        *            [values] The values to cache.
65432        * @returns {null|Object} Returns the new cache object if `Set` is supported,
65433        *          else `null`.
65434        */
65435       function createCache(values) {
65436         return (nativeCreate && Set) ? new SetCache(values) : null;
65437       }
65438
65439       module.exports = createCache;
65440
65441     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65442   }, {
65443     "./SetCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\SetCache.js",
65444     "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
65445   }],
65446   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js": [function(require, module, exports) {
65447     var baseCreate = require('./baseCreate'),
65448       isObject = require('../lang/isObject');
65449
65450     /**
65451      * Creates a function that produces an instance of `Ctor` regardless of whether
65452      * it was invoked as part of a `new` expression or by `call` or `apply`.
65453      *
65454      * @private
65455      * @param {Function}
65456      *            Ctor The constructor to wrap.
65457      * @returns {Function} Returns the new wrapped function.
65458      */
65459     function createCtorWrapper(Ctor) {
65460       return function() {
65461         // Use a `switch` statement to work with class constructors.
65462         // See
65463         // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
65464         // for more details.
65465         var args = arguments;
65466         switch (args.length) {
65467           case 0:
65468             return new Ctor;
65469           case 1:
65470             return new Ctor(args[0]);
65471           case 2:
65472             return new Ctor(args[0], args[1]);
65473           case 3:
65474             return new Ctor(args[0], args[1], args[2]);
65475           case 4:
65476             return new Ctor(args[0], args[1], args[2], args[3]);
65477           case 5:
65478             return new Ctor(args[0], args[1], args[2], args[3], args[4]);
65479           case 6:
65480             return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
65481           case 7:
65482             return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
65483         }
65484         var thisBinding = baseCreate(Ctor.prototype),
65485           result = Ctor.apply(thisBinding, args);
65486
65487         // Mimic the constructor's `return` behavior.
65488         // See https://es5.github.io/#x13.2.2 for more details.
65489         return isObject(result) ? result : thisBinding;
65490       };
65491     }
65492
65493     module.exports = createCtorWrapper;
65494
65495   }, {
65496     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
65497     "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js"
65498   }],
65499   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createFind.js": [function(require, module, exports) {
65500     var baseCallback = require('./baseCallback'),
65501       baseFind = require('./baseFind'),
65502       baseFindIndex = require('./baseFindIndex'),
65503       isArray = require('../lang/isArray');
65504
65505     /**
65506      * Creates a `_.find` or `_.findLast` function.
65507      *
65508      * @private
65509      * @param {Function}
65510      *            eachFunc The function to iterate over a collection.
65511      * @param {boolean}
65512      *            [fromRight] Specify iterating from right to left.
65513      * @returns {Function} Returns the new find function.
65514      */
65515     function createFind(eachFunc, fromRight) {
65516       return function(collection, predicate, thisArg) {
65517         predicate = baseCallback(predicate, thisArg, 3);
65518         if (isArray(collection)) {
65519           var index = baseFindIndex(collection, predicate, fromRight);
65520           return index > -1 ? collection[index] : undefined;
65521         }
65522         return baseFind(collection, predicate, eachFunc);
65523       };
65524     }
65525
65526     module.exports = createFind;
65527
65528   }, {
65529     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65530     "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65531     "./baseFind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFind.js",
65532     "./baseFindIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFindIndex.js"
65533   }],
65534   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createForEach.js": [function(require, module, exports) {
65535     var bindCallback = require('./bindCallback'),
65536       isArray = require('../lang/isArray');
65537
65538     /**
65539      * Creates a function for `_.forEach` or `_.forEachRight`.
65540      *
65541      * @private
65542      * @param {Function}
65543      *            arrayFunc The function to iterate over an array.
65544      * @param {Function}
65545      *            eachFunc The function to iterate over a collection.
65546      * @returns {Function} Returns the new each function.
65547      */
65548     function createForEach(arrayFunc, eachFunc) {
65549       return function(collection, iteratee, thisArg) {
65550         return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
65551       };
65552     }
65553
65554     module.exports = createForEach;
65555
65556   }, {
65557     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65558     "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js"
65559   }],
65560   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createHybridWrapper.js": [function(require, module, exports) {
65561     (function(global) {
65562       var arrayCopy = require('./arrayCopy'),
65563         composeArgs = require('./composeArgs'),
65564         composeArgsRight = require('./composeArgsRight'),
65565         createCtorWrapper = require('./createCtorWrapper'),
65566         isLaziable = require('./isLaziable'),
65567         reorder = require('./reorder'),
65568         replaceHolders = require('./replaceHolders'),
65569         setData = require('./setData');
65570
65571       /** Used to compose bitmasks for wrapper metadata. */
65572       var BIND_FLAG = 1,
65573         BIND_KEY_FLAG = 2,
65574         CURRY_BOUND_FLAG = 4,
65575         CURRY_FLAG = 8,
65576         CURRY_RIGHT_FLAG = 16,
65577         PARTIAL_FLAG = 32,
65578         PARTIAL_RIGHT_FLAG = 64,
65579         ARY_FLAG = 128;
65580
65581       /*
65582        * Native method references for those with the same name as other `lodash`
65583        * methods.
65584        */
65585       var nativeMax = Math.max;
65586
65587       /**
65588        * Creates a function that wraps `func` and invokes it with optional `this`
65589        * binding of, partial application, and currying.
65590        *
65591        * @private
65592        * @param {Function|string}
65593        *            func The function or method name to reference.
65594        * @param {number}
65595        *            bitmask The bitmask of flags. See `createWrapper` for more
65596        *            details.
65597        * @param {*}
65598        *            [thisArg] The `this` binding of `func`.
65599        * @param {Array}
65600        *            [partials] The arguments to prepend to those provided to the new
65601        *            function.
65602        * @param {Array}
65603        *            [holders] The `partials` placeholder indexes.
65604        * @param {Array}
65605        *            [partialsRight] The arguments to append to those provided to the
65606        *            new function.
65607        * @param {Array}
65608        *            [holdersRight] The `partialsRight` placeholder indexes.
65609        * @param {Array}
65610        *            [argPos] The argument positions of the new function.
65611        * @param {number}
65612        *            [ary] The arity cap of `func`.
65613        * @param {number}
65614        *            [arity] The arity of `func`.
65615        * @returns {Function} Returns the new wrapped function.
65616        */
65617       function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
65618         var isAry = bitmask & ARY_FLAG,
65619           isBind = bitmask & BIND_FLAG,
65620           isBindKey = bitmask & BIND_KEY_FLAG,
65621           isCurry = bitmask & CURRY_FLAG,
65622           isCurryBound = bitmask & CURRY_BOUND_FLAG,
65623           isCurryRight = bitmask & CURRY_RIGHT_FLAG,
65624           Ctor = isBindKey ? undefined : createCtorWrapper(func);
65625
65626         function wrapper() {
65627           // Avoid `arguments` object use disqualifying optimizations by
65628           // converting it to an array before providing it to other functions.
65629           var length = arguments.length,
65630             index = length,
65631             args = Array(length);
65632
65633           while (index--) {
65634             args[index] = arguments[index];
65635           }
65636           if (partials) {
65637             args = composeArgs(args, partials, holders);
65638           }
65639           if (partialsRight) {
65640             args = composeArgsRight(args, partialsRight, holdersRight);
65641           }
65642           if (isCurry || isCurryRight) {
65643             var placeholder = wrapper.placeholder,
65644               argsHolders = replaceHolders(args, placeholder);
65645
65646             length -= argsHolders.length;
65647             if (length < arity) {
65648               var newArgPos = argPos ? arrayCopy(argPos) : undefined,
65649                 newArity = nativeMax(arity - length, 0),
65650                 newsHolders = isCurry ? argsHolders : undefined,
65651                 newHoldersRight = isCurry ? undefined : argsHolders,
65652                 newPartials = isCurry ? args : undefined,
65653                 newPartialsRight = isCurry ? undefined : args;
65654
65655               bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
65656               bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
65657
65658               if (!isCurryBound) {
65659                 bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
65660               }
65661               var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
65662                 result = createHybridWrapper.apply(undefined, newData);
65663
65664               if (isLaziable(func)) {
65665                 setData(result, newData);
65666               }
65667               result.placeholder = placeholder;
65668               return result;
65669             }
65670           }
65671           var thisBinding = isBind ? thisArg : this,
65672             fn = isBindKey ? thisBinding[func] : func;
65673
65674           if (argPos) {
65675             args = reorder(args, argPos);
65676           }
65677           if (isAry && ary < args.length) {
65678             args.length = ary;
65679           }
65680           if (this && this !== global && this instanceof wrapper) {
65681             fn = Ctor || createCtorWrapper(func);
65682           }
65683           return fn.apply(thisBinding, args);
65684         }
65685         return wrapper;
65686       }
65687
65688       module.exports = createHybridWrapper;
65689
65690     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65691   }, {
65692     "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
65693     "./composeArgs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js",
65694     "./composeArgsRight": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js",
65695     "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js",
65696     "./isLaziable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLaziable.js",
65697     "./reorder": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\reorder.js",
65698     "./replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js",
65699     "./setData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js"
65700   }],
65701   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createPartialWrapper.js": [function(require, module, exports) {
65702     (function(global) {
65703       var createCtorWrapper = require('./createCtorWrapper');
65704
65705       /** Used to compose bitmasks for wrapper metadata. */
65706       var BIND_FLAG = 1;
65707
65708       /**
65709        * Creates a function that wraps `func` and invokes it with the optional `this`
65710        * binding of `thisArg` and the `partials` prepended to those provided to the
65711        * wrapper.
65712        *
65713        * @private
65714        * @param {Function}
65715        *            func The function to partially apply arguments to.
65716        * @param {number}
65717        *            bitmask The bitmask of flags. See `createWrapper` for more
65718        *            details.
65719        * @param {*}
65720        *            thisArg The `this` binding of `func`.
65721        * @param {Array}
65722        *            partials The arguments to prepend to those provided to the new
65723        *            function.
65724        * @returns {Function} Returns the new bound function.
65725        */
65726       function createPartialWrapper(func, bitmask, thisArg, partials) {
65727         var isBind = bitmask & BIND_FLAG,
65728           Ctor = createCtorWrapper(func);
65729
65730         function wrapper() {
65731           // Avoid `arguments` object use disqualifying optimizations by
65732           // converting it to an array before providing it `func`.
65733           var argsIndex = -1,
65734             argsLength = arguments.length,
65735             leftIndex = -1,
65736             leftLength = partials.length,
65737             args = Array(leftLength + argsLength);
65738
65739           while (++leftIndex < leftLength) {
65740             args[leftIndex] = partials[leftIndex];
65741           }
65742           while (argsLength--) {
65743             args[leftIndex++] = arguments[++argsIndex];
65744           }
65745           var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
65746           return fn.apply(isBind ? thisArg : this, args);
65747         }
65748         return wrapper;
65749       }
65750
65751       module.exports = createPartialWrapper;
65752
65753     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65754   }, {
65755     "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js"
65756   }],
65757   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createReduce.js": [function(require, module, exports) {
65758     var baseCallback = require('./baseCallback'),
65759       baseReduce = require('./baseReduce'),
65760       isArray = require('../lang/isArray');
65761
65762     /**
65763      * Creates a function for `_.reduce` or `_.reduceRight`.
65764      *
65765      * @private
65766      * @param {Function}
65767      *            arrayFunc The function to iterate over an array.
65768      * @param {Function}
65769      *            eachFunc The function to iterate over a collection.
65770      * @returns {Function} Returns the new each function.
65771      */
65772     function createReduce(arrayFunc, eachFunc) {
65773       return function(collection, iteratee, accumulator, thisArg) {
65774         var initFromArray = arguments.length < 3;
65775         return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
65776       };
65777     }
65778
65779     module.exports = createReduce;
65780
65781   }, {
65782     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65783     "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65784     "./baseReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseReduce.js"
65785   }],
65786   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createWrapper.js": [function(require, module, exports) {
65787     var baseSetData = require('./baseSetData'),
65788       createBindWrapper = require('./createBindWrapper'),
65789       createHybridWrapper = require('./createHybridWrapper'),
65790       createPartialWrapper = require('./createPartialWrapper'),
65791       getData = require('./getData'),
65792       mergeData = require('./mergeData'),
65793       setData = require('./setData');
65794
65795     /** Used to compose bitmasks for wrapper metadata. */
65796     var BIND_FLAG = 1,
65797       BIND_KEY_FLAG = 2,
65798       PARTIAL_FLAG = 32,
65799       PARTIAL_RIGHT_FLAG = 64;
65800
65801     /** Used as the `TypeError` message for "Functions" methods. */
65802     var FUNC_ERROR_TEXT = 'Expected a function';
65803
65804     /*
65805      * Native method references for those with the same name as other `lodash`
65806      * methods.
65807      */
65808     var nativeMax = Math.max;
65809
65810     /**
65811      * Creates a function that either curries or invokes `func` with optional `this`
65812      * binding and partially applied arguments.
65813      *
65814      * @private
65815      * @param {Function|string}
65816      *            func The function or method name to reference.
65817      * @param {number}
65818      *            bitmask The bitmask of flags. The bitmask may be composed of the
65819      *            following flags: 1 - `_.bind` 2 - `_.bindKey` 4 - `_.curry` or
65820      *            `_.curryRight` of a bound function 8 - `_.curry` 16 -
65821      *            `_.curryRight` 32 - `_.partial` 64 - `_.partialRight` 128 -
65822      *            `_.rearg` 256 - `_.ary`
65823      * @param {*}
65824      *            [thisArg] The `this` binding of `func`.
65825      * @param {Array}
65826      *            [partials] The arguments to be partially applied.
65827      * @param {Array}
65828      *            [holders] The `partials` placeholder indexes.
65829      * @param {Array}
65830      *            [argPos] The argument positions of the new function.
65831      * @param {number}
65832      *            [ary] The arity cap of `func`.
65833      * @param {number}
65834      *            [arity] The arity of `func`.
65835      * @returns {Function} Returns the new wrapped function.
65836      */
65837     function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
65838       var isBindKey = bitmask & BIND_KEY_FLAG;
65839       if (!isBindKey && typeof func != 'function') {
65840         throw new TypeError(FUNC_ERROR_TEXT);
65841       }
65842       var length = partials ? partials.length : 0;
65843       if (!length) {
65844         bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
65845         partials = holders = undefined;
65846       }
65847       length -= (holders ? holders.length : 0);
65848       if (bitmask & PARTIAL_RIGHT_FLAG) {
65849         var partialsRight = partials,
65850           holdersRight = holders;
65851
65852         partials = holders = undefined;
65853       }
65854       var data = isBindKey ? undefined : getData(func),
65855         newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
65856
65857       if (data) {
65858         mergeData(newData, data);
65859         bitmask = newData[1];
65860         arity = newData[9];
65861       }
65862       newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0);
65863
65864       if (bitmask == BIND_FLAG) {
65865         var result = createBindWrapper(newData[0], newData[2]);
65866       } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
65867         result = createPartialWrapper.apply(undefined, newData);
65868       } else {
65869         result = createHybridWrapper.apply(undefined, newData);
65870       }
65871       var setter = data ? baseSetData : setData;
65872       return setter(result, newData);
65873     }
65874
65875     module.exports = createWrapper;
65876
65877   }, {
65878     "./baseSetData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js",
65879     "./createBindWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBindWrapper.js",
65880     "./createHybridWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createHybridWrapper.js",
65881     "./createPartialWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createPartialWrapper.js",
65882     "./getData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js",
65883     "./mergeData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\mergeData.js",
65884     "./setData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js"
65885   }],
65886   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalArrays.js": [function(require, module, exports) {
65887     var arraySome = require('./arraySome');
65888
65889     /**
65890      * A specialized version of `baseIsEqualDeep` for arrays with support for
65891      * partial deep comparisons.
65892      *
65893      * @private
65894      * @param {Array}
65895      *            array The array to compare.
65896      * @param {Array}
65897      *            other The other array to compare.
65898      * @param {Function}
65899      *            equalFunc The function to determine equivalents of values.
65900      * @param {Function}
65901      *            [customizer] The function to customize comparing arrays.
65902      * @param {boolean}
65903      *            [isLoose] Specify performing partial comparisons.
65904      * @param {Array}
65905      *            [stackA] Tracks traversed `value` objects.
65906      * @param {Array}
65907      *            [stackB] Tracks traversed `other` objects.
65908      * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
65909      */
65910     function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
65911       var index = -1,
65912         arrLength = array.length,
65913         othLength = other.length;
65914
65915       if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
65916         return false;
65917       }
65918       // Ignore non-index properties.
65919       while (++index < arrLength) {
65920         var arrValue = array[index],
65921           othValue = other[index],
65922           result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
65923
65924         if (result !== undefined) {
65925           if (result) {
65926             continue;
65927           }
65928           return false;
65929         }
65930         // Recursively compare arrays (susceptible to call stack limits).
65931         if (isLoose) {
65932           if (!arraySome(other, function(othValue) {
65933               return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
65934             })) {
65935             return false;
65936           }
65937         } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
65938           return false;
65939         }
65940       }
65941       return true;
65942     }
65943
65944     module.exports = equalArrays;
65945
65946   }, {
65947     "./arraySome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js"
65948   }],
65949   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalByTag.js": [function(require, module, exports) {
65950     /** `Object#toString` result references. */
65951     var boolTag = '[object Boolean]',
65952       dateTag = '[object Date]',
65953       errorTag = '[object Error]',
65954       numberTag = '[object Number]',
65955       regexpTag = '[object RegExp]',
65956       stringTag = '[object String]';
65957
65958     /**
65959      * A specialized version of `baseIsEqualDeep` for comparing objects of the same
65960      * `toStringTag`.
65961      *
65962      * **Note:** This function only supports comparing values with tags of
65963      * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
65964      *
65965      * @private
65966      * @param {Object}
65967      *            object The object to compare.
65968      * @param {Object}
65969      *            other The other object to compare.
65970      * @param {string}
65971      *            tag The `toStringTag` of the objects to compare.
65972      * @returns {boolean} Returns `true` if the objects are equivalent, else
65973      *          `false`.
65974      */
65975     function equalByTag(object, other, tag) {
65976       switch (tag) {
65977         case boolTag:
65978         case dateTag:
65979           // Coerce dates and booleans to numbers, dates to milliseconds and
65980           // booleans
65981           // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
65982           return +object == +other;
65983
65984         case errorTag:
65985           return object.name == other.name && object.message == other.message;
65986
65987         case numberTag:
65988           // Treat `NaN` vs. `NaN` as equal.
65989           return (object != +object) ? other != +other : object == +other;
65990
65991         case regexpTag:
65992         case stringTag:
65993           // Coerce regexes to strings and treat strings primitives and string
65994           // objects as equal. See https://es5.github.io/#x15.10.6.4 for more
65995           // details.
65996           return object == (other + '');
65997       }
65998       return false;
65999     }
66000
66001     module.exports = equalByTag;
66002
66003   }, {}],
66004   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalObjects.js": [function(require, module, exports) {
66005     var keys = require('../object/keys');
66006
66007     /** Used for native method references. */
66008     var objectProto = Object.prototype;
66009
66010     /** Used to check objects for own properties. */
66011     var hasOwnProperty = objectProto.hasOwnProperty;
66012
66013     /**
66014      * A specialized version of `baseIsEqualDeep` for objects with support for
66015      * partial deep comparisons.
66016      *
66017      * @private
66018      * @param {Object}
66019      *            object The object to compare.
66020      * @param {Object}
66021      *            other The other object to compare.
66022      * @param {Function}
66023      *            equalFunc The function to determine equivalents of values.
66024      * @param {Function}
66025      *            [customizer] The function to customize comparing values.
66026      * @param {boolean}
66027      *            [isLoose] Specify performing partial comparisons.
66028      * @param {Array}
66029      *            [stackA] Tracks traversed `value` objects.
66030      * @param {Array}
66031      *            [stackB] Tracks traversed `other` objects.
66032      * @returns {boolean} Returns `true` if the objects are equivalent, else
66033      *          `false`.
66034      */
66035     function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
66036       var objProps = keys(object),
66037         objLength = objProps.length,
66038         othProps = keys(other),
66039         othLength = othProps.length;
66040
66041       if (objLength != othLength && !isLoose) {
66042         return false;
66043       }
66044       var index = objLength;
66045       while (index--) {
66046         var key = objProps[index];
66047         if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
66048           return false;
66049         }
66050       }
66051       var skipCtor = isLoose;
66052       while (++index < objLength) {
66053         key = objProps[index];
66054         var objValue = object[key],
66055           othValue = other[key],
66056           result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
66057
66058         // Recursively compare objects (susceptible to call stack limits).
66059         if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
66060           return false;
66061         }
66062         skipCtor || (skipCtor = key == 'constructor');
66063       }
66064       if (!skipCtor) {
66065         var objCtor = object.constructor,
66066           othCtor = other.constructor;
66067
66068         // Non `Object` object instances with different constructors are not equal.
66069         if (objCtor != othCtor &&
66070           ('constructor' in object && 'constructor' in other) &&
66071           !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
66072             typeof othCtor == 'function' && othCtor instanceof othCtor)) {
66073           return false;
66074         }
66075       }
66076       return true;
66077     }
66078
66079     module.exports = equalObjects;
66080
66081   }, {
66082     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
66083   }],
66084   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js": [function(require, module, exports) {
66085     var metaMap = require('./metaMap'),
66086       noop = require('../utility/noop');
66087
66088     /**
66089      * Gets metadata for `func`.
66090      *
66091      * @private
66092      * @param {Function}
66093      *            func The function to query.
66094      * @returns {*} Returns the metadata for `func`.
66095      */
66096     var getData = !metaMap ? noop : function(func) {
66097       return metaMap.get(func);
66098     };
66099
66100     module.exports = getData;
66101
66102   }, {
66103     "../utility/noop": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\noop.js",
66104     "./metaMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js"
66105   }],
66106   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getFuncName.js": [function(require, module, exports) {
66107     var realNames = require('./realNames');
66108
66109     /**
66110      * Gets the name of `func`.
66111      *
66112      * @private
66113      * @param {Function}
66114      *            func The function to query.
66115      * @returns {string} Returns the function name.
66116      */
66117     function getFuncName(func) {
66118       var result = (func.name + ''),
66119         array = realNames[result],
66120         length = array ? array.length : 0;
66121
66122       while (length--) {
66123         var data = array[length],
66124           otherFunc = data.func;
66125         if (otherFunc == null || otherFunc == func) {
66126           return data.name;
66127         }
66128       }
66129       return result;
66130     }
66131
66132     module.exports = getFuncName;
66133
66134   }, {
66135     "./realNames": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\realNames.js"
66136   }],
66137   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js": [function(require, module, exports) {
66138     var baseProperty = require('./baseProperty');
66139
66140     /**
66141      * Gets the "length" property value of `object`.
66142      *
66143      * **Note:** This function is used to avoid a [JIT
66144      * bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects Safari on
66145      * at least iOS 8.1-8.3 ARM64.
66146      *
66147      * @private
66148      * @param {Object}
66149      *            object The object to query.
66150      * @returns {*} Returns the "length" value.
66151      */
66152     var getLength = baseProperty('length');
66153
66154     module.exports = getLength;
66155
66156   }, {
66157     "./baseProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js"
66158   }],
66159   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getMatchData.js": [function(require, module, exports) {
66160     var isStrictComparable = require('./isStrictComparable'),
66161       pairs = require('../object/pairs');
66162
66163     /**
66164      * Gets the propery names, values, and compare flags of `object`.
66165      *
66166      * @private
66167      * @param {Object}
66168      *            object The object to query.
66169      * @returns {Array} Returns the match data of `object`.
66170      */
66171     function getMatchData(object) {
66172       var result = pairs(object),
66173         length = result.length;
66174
66175       while (length--) {
66176         result[length][2] = isStrictComparable(result[length][1]);
66177       }
66178       return result;
66179     }
66180
66181     module.exports = getMatchData;
66182
66183   }, {
66184     "../object/pairs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pairs.js",
66185     "./isStrictComparable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js"
66186   }],
66187   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js": [function(require, module, exports) {
66188     var isNative = require('../lang/isNative');
66189
66190     /**
66191      * Gets the native function at `key` of `object`.
66192      *
66193      * @private
66194      * @param {Object}
66195      *            object The object to query.
66196      * @param {string}
66197      *            key The key of the method to get.
66198      * @returns {*} Returns the function if it's native, else `undefined`.
66199      */
66200     function getNative(object, key) {
66201       var value = object == null ? undefined : object[key];
66202       return isNative(value) ? value : undefined;
66203     }
66204
66205     module.exports = getNative;
66206
66207   }, {
66208     "../lang/isNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNative.js"
66209   }],
66210   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\indexOfNaN.js": [function(require, module, exports) {
66211     /**
66212      * Gets the index at which the first occurrence of `NaN` is found in `array`.
66213      *
66214      * @private
66215      * @param {Array}
66216      *            array The array to search.
66217      * @param {number}
66218      *            fromIndex The index to search from.
66219      * @param {boolean}
66220      *            [fromRight] Specify iterating from right to left.
66221      * @returns {number} Returns the index of the matched `NaN`, else `-1`.
66222      */
66223     function indexOfNaN(array, fromIndex, fromRight) {
66224       var length = array.length,
66225         index = fromIndex + (fromRight ? 0 : -1);
66226
66227       while ((fromRight ? index-- : ++index < length)) {
66228         var other = array[index];
66229         if (other !== other) {
66230           return index;
66231         }
66232       }
66233       return -1;
66234     }
66235
66236     module.exports = indexOfNaN;
66237
66238   }, {}],
66239   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js": [function(require, module, exports) {
66240     var getLength = require('./getLength'),
66241       isLength = require('./isLength');
66242
66243     /**
66244      * Checks if `value` is array-like.
66245      *
66246      * @private
66247      * @param {*}
66248      *            value The value to check.
66249      * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
66250      */
66251     function isArrayLike(value) {
66252       return value != null && isLength(getLength(value));
66253     }
66254
66255     module.exports = isArrayLike;
66256
66257   }, {
66258     "./getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
66259     "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js"
66260   }],
66261   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js": [function(require, module, exports) {
66262     /** Used to detect unsigned integer values. */
66263     var reIsUint = /^\d+$/;
66264
66265     /**
66266      * Used as the [maximum
66267      * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
66268      * of an array-like value.
66269      */
66270     var MAX_SAFE_INTEGER = 9007199254740991;
66271
66272     /**
66273      * Checks if `value` is a valid array-like index.
66274      *
66275      * @private
66276      * @param {*}
66277      *            value The value to check.
66278      * @param {number}
66279      *            [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
66280      * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
66281      */
66282     function isIndex(value, length) {
66283       value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
66284       length = length == null ? MAX_SAFE_INTEGER : length;
66285       return value > -1 && value % 1 == 0 && value < length;
66286     }
66287
66288     module.exports = isIndex;
66289
66290   }, {}],
66291   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js": [function(require, module, exports) {
66292     var isArrayLike = require('./isArrayLike'),
66293       isIndex = require('./isIndex'),
66294       isObject = require('../lang/isObject');
66295
66296     /**
66297      * Checks if the provided arguments are from an iteratee call.
66298      *
66299      * @private
66300      * @param {*}
66301      *            value The potential iteratee value argument.
66302      * @param {*}
66303      *            index The potential iteratee index or key argument.
66304      * @param {*}
66305      *            object The potential iteratee object argument.
66306      * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
66307      *          else `false`.
66308      */
66309     function isIterateeCall(value, index, object) {
66310       if (!isObject(object)) {
66311         return false;
66312       }
66313       var type = typeof index;
66314       if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) {
66315         var other = object[index];
66316         return value === value ? (value === other) : (other !== other);
66317       }
66318       return false;
66319     }
66320
66321     module.exports = isIterateeCall;
66322
66323   }, {
66324     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
66325     "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
66326     "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js"
66327   }],
66328   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js": [function(require, module, exports) {
66329     var isArray = require('../lang/isArray'),
66330       toObject = require('./toObject');
66331
66332     /** Used to match property names within property paths. */
66333     var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
66334       reIsPlainProp = /^\w*$/;
66335
66336     /**
66337      * Checks if `value` is a property name and not a property path.
66338      *
66339      * @private
66340      * @param {*}
66341      *            value The value to check.
66342      * @param {Object}
66343      *            [object] The object to query keys on.
66344      * @returns {boolean} Returns `true` if `value` is a property name, else
66345      *          `false`.
66346      */
66347     function isKey(value, object) {
66348       var type = typeof value;
66349       if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
66350         return true;
66351       }
66352       if (isArray(value)) {
66353         return false;
66354       }
66355       var result = !reIsDeepProp.test(value);
66356       return result || (object != null && value in toObject(object));
66357     }
66358
66359     module.exports = isKey;
66360
66361   }, {
66362     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66363     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
66364   }],
66365   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLaziable.js": [function(require, module, exports) {
66366     var LazyWrapper = require('./LazyWrapper'),
66367       getData = require('./getData'),
66368       getFuncName = require('./getFuncName'),
66369       lodash = require('../chain/lodash');
66370
66371     /**
66372      * Checks if `func` has a lazy counterpart.
66373      *
66374      * @private
66375      * @param {Function}
66376      *            func The function to check.
66377      * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else
66378      *          `false`.
66379      */
66380     function isLaziable(func) {
66381       var funcName = getFuncName(func),
66382         other = lodash[funcName];
66383
66384       if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
66385         return false;
66386       }
66387       if (func === other) {
66388         return true;
66389       }
66390       var data = getData(other);
66391       return !!data && func === data[0];
66392     }
66393
66394     module.exports = isLaziable;
66395
66396   }, {
66397     "../chain/lodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\chain\\lodash.js",
66398     "./LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
66399     "./getData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js",
66400     "./getFuncName": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getFuncName.js"
66401   }],
66402   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js": [function(require, module, exports) {
66403     /**
66404      * Used as the [maximum
66405      * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
66406      * of an array-like value.
66407      */
66408     var MAX_SAFE_INTEGER = 9007199254740991;
66409
66410     /**
66411      * Checks if `value` is a valid array-like length.
66412      *
66413      * **Note:** This function is based on
66414      * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
66415      *
66416      * @private
66417      * @param {*}
66418      *            value The value to check.
66419      * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
66420      */
66421     function isLength(value) {
66422       return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
66423     }
66424
66425     module.exports = isLength;
66426
66427   }, {}],
66428   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js": [function(require, module, exports) {
66429     /**
66430      * Checks if `value` is object-like.
66431      *
66432      * @private
66433      * @param {*}
66434      *            value The value to check.
66435      * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
66436      */
66437     function isObjectLike(value) {
66438       return !!value && typeof value == 'object';
66439     }
66440
66441     module.exports = isObjectLike;
66442
66443   }, {}],
66444   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js": [function(require, module, exports) {
66445     var isObject = require('../lang/isObject');
66446
66447     /**
66448      * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
66449      *
66450      * @private
66451      * @param {*}
66452      *            value The value to check.
66453      * @returns {boolean} Returns `true` if `value` if suitable for strict equality
66454      *          comparisons, else `false`.
66455      */
66456     function isStrictComparable(value) {
66457       return value === value && !isObject(value);
66458     }
66459
66460     module.exports = isStrictComparable;
66461
66462   }, {
66463     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
66464   }],
66465   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\mergeData.js": [function(require, module, exports) {
66466     var arrayCopy = require('./arrayCopy'),
66467       composeArgs = require('./composeArgs'),
66468       composeArgsRight = require('./composeArgsRight'),
66469       replaceHolders = require('./replaceHolders');
66470
66471     /** Used to compose bitmasks for wrapper metadata. */
66472     var BIND_FLAG = 1,
66473       CURRY_BOUND_FLAG = 4,
66474       CURRY_FLAG = 8,
66475       ARY_FLAG = 128,
66476       REARG_FLAG = 256;
66477
66478     /** Used as the internal argument placeholder. */
66479     var PLACEHOLDER = '__lodash_placeholder__';
66480
66481     /*
66482      * Native method references for those with the same name as other `lodash`
66483      * methods.
66484      */
66485     var nativeMin = Math.min;
66486
66487     /**
66488      * Merges the function metadata of `source` into `data`.
66489      *
66490      * Merging metadata reduces the number of wrappers required to invoke a
66491      * function. This is possible because methods like `_.bind`, `_.curry`, and
66492      * `_.partial` may be applied regardless of execution order. Methods like
66493      * `_.ary` and `_.rearg` augment function arguments, making the order in which
66494      * they are executed important, preventing the merging of metadata. However, we
66495      * make an exception for a safe common case where curried functions have `_.ary`
66496      * and or `_.rearg` applied.
66497      *
66498      * @private
66499      * @param {Array}
66500      *            data The destination metadata.
66501      * @param {Array}
66502      *            source The source metadata.
66503      * @returns {Array} Returns `data`.
66504      */
66505     function mergeData(data, source) {
66506       var bitmask = data[1],
66507         srcBitmask = source[1],
66508         newBitmask = bitmask | srcBitmask,
66509         isCommon = newBitmask < ARY_FLAG;
66510
66511       var isCombo =
66512         (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
66513         (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
66514         (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
66515
66516       // Exit early if metadata can't be merged.
66517       if (!(isCommon || isCombo)) {
66518         return data;
66519       }
66520       // Use source `thisArg` if available.
66521       if (srcBitmask & BIND_FLAG) {
66522         data[2] = source[2];
66523         // Set when currying a bound function.
66524         newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
66525       }
66526       // Compose partial arguments.
66527       var value = source[3];
66528       if (value) {
66529         var partials = data[3];
66530         data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
66531         data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
66532       }
66533       // Compose partial right arguments.
66534       value = source[5];
66535       if (value) {
66536         partials = data[5];
66537         data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
66538         data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
66539       }
66540       // Use source `argPos` if available.
66541       value = source[7];
66542       if (value) {
66543         data[7] = arrayCopy(value);
66544       }
66545       // Use source `ary` if it's smaller.
66546       if (srcBitmask & ARY_FLAG) {
66547         data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
66548       }
66549       // Use source `arity` if one is not provided.
66550       if (data[9] == null) {
66551         data[9] = source[9];
66552       }
66553       // Use source `func` and merge bitmasks.
66554       data[0] = source[0];
66555       data[1] = newBitmask;
66556
66557       return data;
66558     }
66559
66560     module.exports = mergeData;
66561
66562   }, {
66563     "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
66564     "./composeArgs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js",
66565     "./composeArgsRight": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js",
66566     "./replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js"
66567   }],
66568   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js": [function(require, module, exports) {
66569     (function(global) {
66570       var getNative = require('./getNative');
66571
66572       /** Native method references. */
66573       var WeakMap = getNative(global, 'WeakMap');
66574
66575       /** Used to store function metadata. */
66576       var metaMap = WeakMap && new WeakMap;
66577
66578       module.exports = metaMap;
66579
66580     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
66581   }, {
66582     "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
66583   }],
66584   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js": [function(require, module, exports) {
66585     var toObject = require('./toObject');
66586
66587     /**
66588      * A specialized version of `_.pick` which picks `object` properties specified
66589      * by `props`.
66590      *
66591      * @private
66592      * @param {Object}
66593      *            object The source object.
66594      * @param {string[]}
66595      *            props The property names to pick.
66596      * @returns {Object} Returns the new object.
66597      */
66598     function pickByArray(object, props) {
66599       object = toObject(object);
66600
66601       var index = -1,
66602         length = props.length,
66603         result = {};
66604
66605       while (++index < length) {
66606         var key = props[index];
66607         if (key in object) {
66608           result[key] = object[key];
66609         }
66610       }
66611       return result;
66612     }
66613
66614     module.exports = pickByArray;
66615
66616   }, {
66617     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
66618   }],
66619   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js": [function(require, module, exports) {
66620     var baseForIn = require('./baseForIn');
66621
66622     /**
66623      * A specialized version of `_.pick` which picks `object` properties `predicate`
66624      * returns truthy for.
66625      *
66626      * @private
66627      * @param {Object}
66628      *            object The source object.
66629      * @param {Function}
66630      *            predicate The function invoked per iteration.
66631      * @returns {Object} Returns the new object.
66632      */
66633     function pickByCallback(object, predicate) {
66634       var result = {};
66635       baseForIn(object, function(value, key, object) {
66636         if (predicate(value, key, object)) {
66637           result[key] = value;
66638         }
66639       });
66640       return result;
66641     }
66642
66643     module.exports = pickByCallback;
66644
66645   }, {
66646     "./baseForIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js"
66647   }],
66648   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\realNames.js": [function(require, module, exports) {
66649     /** Used to lookup unminified function names. */
66650     var realNames = {};
66651
66652     module.exports = realNames;
66653
66654   }, {}],
66655   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\reorder.js": [function(require, module, exports) {
66656     var arrayCopy = require('./arrayCopy'),
66657       isIndex = require('./isIndex');
66658
66659     /*
66660      * Native method references for those with the same name as other `lodash`
66661      * methods.
66662      */
66663     var nativeMin = Math.min;
66664
66665     /**
66666      * Reorder `array` according to the specified indexes where the element at the
66667      * first index is assigned as the first element, the element at the second index
66668      * is assigned as the second element, and so on.
66669      *
66670      * @private
66671      * @param {Array}
66672      *            array The array to reorder.
66673      * @param {Array}
66674      *            indexes The arranged array indexes.
66675      * @returns {Array} Returns `array`.
66676      */
66677     function reorder(array, indexes) {
66678       var arrLength = array.length,
66679         length = nativeMin(indexes.length, arrLength),
66680         oldArray = arrayCopy(array);
66681
66682       while (length--) {
66683         var index = indexes[length];
66684         array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
66685       }
66686       return array;
66687     }
66688
66689     module.exports = reorder;
66690
66691   }, {
66692     "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
66693     "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js"
66694   }],
66695   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js": [function(require, module, exports) {
66696     /** Used as the internal argument placeholder. */
66697     var PLACEHOLDER = '__lodash_placeholder__';
66698
66699     /**
66700      * Replaces all `placeholder` elements in `array` with an internal placeholder
66701      * and returns an array of their indexes.
66702      *
66703      * @private
66704      * @param {Array}
66705      *            array The array to modify.
66706      * @param {*}
66707      *            placeholder The placeholder to replace.
66708      * @returns {Array} Returns the new array of placeholder indexes.
66709      */
66710     function replaceHolders(array, placeholder) {
66711       var index = -1,
66712         length = array.length,
66713         resIndex = -1,
66714         result = [];
66715
66716       while (++index < length) {
66717         if (array[index] === placeholder) {
66718           array[index] = PLACEHOLDER;
66719           result[++resIndex] = index;
66720         }
66721       }
66722       return result;
66723     }
66724
66725     module.exports = replaceHolders;
66726
66727   }, {}],
66728   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js": [function(require, module, exports) {
66729     var baseSetData = require('./baseSetData'),
66730       now = require('../date/now');
66731
66732     /** Used to detect when a function becomes hot. */
66733     var HOT_COUNT = 150,
66734       HOT_SPAN = 16;
66735
66736     /**
66737      * Sets metadata for `func`.
66738      *
66739      * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
66740      * period of time, it will trip its breaker and transition to an identity
66741      * function to avoid garbage collection pauses in V8. See [V8 issue
66742      * 2070](https://code.google.com/p/v8/issues/detail?id=2070) for more details.
66743      *
66744      * @private
66745      * @param {Function}
66746      *            func The function to associate metadata with.
66747      * @param {*}
66748      *            data The metadata.
66749      * @returns {Function} Returns `func`.
66750      */
66751     var setData = (function() {
66752       var count = 0,
66753         lastCalled = 0;
66754
66755       return function(key, value) {
66756         var stamp = now(),
66757           remaining = HOT_SPAN - (stamp - lastCalled);
66758
66759         lastCalled = stamp;
66760         if (remaining > 0) {
66761           if (++count >= HOT_COUNT) {
66762             return key;
66763           }
66764         } else {
66765           count = 0;
66766         }
66767         return baseSetData(key, value);
66768       };
66769     }());
66770
66771     module.exports = setData;
66772
66773   }, {
66774     "../date/now": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js",
66775     "./baseSetData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js"
66776   }],
66777   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\shimKeys.js": [function(require, module, exports) {
66778     var isArguments = require('../lang/isArguments'),
66779       isArray = require('../lang/isArray'),
66780       isIndex = require('./isIndex'),
66781       isLength = require('./isLength'),
66782       keysIn = require('../object/keysIn');
66783
66784     /** Used for native method references. */
66785     var objectProto = Object.prototype;
66786
66787     /** Used to check objects for own properties. */
66788     var hasOwnProperty = objectProto.hasOwnProperty;
66789
66790     /**
66791      * A fallback implementation of `Object.keys` which creates an array of the own
66792      * enumerable property names of `object`.
66793      *
66794      * @private
66795      * @param {Object}
66796      *            object The object to query.
66797      * @returns {Array} Returns the array of property names.
66798      */
66799     function shimKeys(object) {
66800       var props = keysIn(object),
66801         propsLength = props.length,
66802         length = propsLength && object.length;
66803
66804       var allowIndexes = !!length && isLength(length) &&
66805         (isArray(object) || isArguments(object));
66806
66807       var index = -1,
66808         result = [];
66809
66810       while (++index < propsLength) {
66811         var key = props[index];
66812         if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
66813           result.push(key);
66814         }
66815       }
66816       return result;
66817     }
66818
66819     module.exports = shimKeys;
66820
66821   }, {
66822     "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
66823     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66824     "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js",
66825     "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js",
66826     "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js"
66827   }],
66828   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\sortedUniq.js": [function(require, module, exports) {
66829     /**
66830      * An implementation of `_.uniq` optimized for sorted arrays without support for
66831      * callback shorthands and `this` binding.
66832      *
66833      * @private
66834      * @param {Array}
66835      *            array The array to inspect.
66836      * @param {Function}
66837      *            [iteratee] The function invoked per iteration.
66838      * @returns {Array} Returns the new duplicate free array.
66839      */
66840     function sortedUniq(array, iteratee) {
66841       var seen,
66842         index = -1,
66843         length = array.length,
66844         resIndex = -1,
66845         result = [];
66846
66847       while (++index < length) {
66848         var value = array[index],
66849           computed = iteratee ? iteratee(value, index, array) : value;
66850
66851         if (!index || seen !== computed) {
66852           seen = computed;
66853           result[++resIndex] = value;
66854         }
66855       }
66856       return result;
66857     }
66858
66859     module.exports = sortedUniq;
66860
66861   }, {}],
66862   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js": [function(require, module, exports) {
66863     var isObject = require('../lang/isObject');
66864
66865     /**
66866      * Converts `value` to an object if it's not one.
66867      *
66868      * @private
66869      * @param {*}
66870      *            value The value to process.
66871      * @returns {Object} Returns the object.
66872      */
66873     function toObject(value) {
66874       return isObject(value) ? value : Object(value);
66875     }
66876
66877     module.exports = toObject;
66878
66879   }, {
66880     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
66881   }],
66882   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js": [function(require, module, exports) {
66883     var baseToString = require('./baseToString'),
66884       isArray = require('../lang/isArray');
66885
66886     /** Used to match property names within property paths. */
66887     var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
66888
66889     /** Used to match backslashes in property paths. */
66890     var reEscapeChar = /\\(\\)?/g;
66891
66892     /**
66893      * Converts `value` to property path array if it's not one.
66894      *
66895      * @private
66896      * @param {*}
66897      *            value The value to process.
66898      * @returns {Array} Returns the property path array.
66899      */
66900     function toPath(value) {
66901       if (isArray(value)) {
66902         return value;
66903       }
66904       var result = [];
66905       baseToString(value).replace(rePropName, function(match, number, quote, string) {
66906         result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
66907       });
66908       return result;
66909     }
66910
66911     module.exports = toPath;
66912
66913   }, {
66914     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66915     "./baseToString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseToString.js"
66916   }],
66917   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\wrapperClone.js": [function(require, module, exports) {
66918     var LazyWrapper = require('./LazyWrapper'),
66919       LodashWrapper = require('./LodashWrapper'),
66920       arrayCopy = require('./arrayCopy');
66921
66922     /**
66923      * Creates a clone of `wrapper`.
66924      *
66925      * @private
66926      * @param {Object}
66927      *            wrapper The wrapper to clone.
66928      * @returns {Object} Returns the cloned wrapper.
66929      */
66930     function wrapperClone(wrapper) {
66931       return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
66932     }
66933
66934     module.exports = wrapperClone;
66935
66936   }, {
66937     "./LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
66938     "./LodashWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js",
66939     "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js"
66940   }],
66941   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js": [function(require, module, exports) {
66942     var isArrayLike = require('../internal/isArrayLike'),
66943       isObjectLike = require('../internal/isObjectLike');
66944
66945     /** Used for native method references. */
66946     var objectProto = Object.prototype;
66947
66948     /** Used to check objects for own properties. */
66949     var hasOwnProperty = objectProto.hasOwnProperty;
66950
66951     /** Native method references. */
66952     var propertyIsEnumerable = objectProto.propertyIsEnumerable;
66953
66954     /**
66955      * Checks if `value` is classified as an `arguments` object.
66956      *
66957      * @static
66958      * @memberOf _
66959      * @category Lang
66960      * @param {*}
66961      *            value The value to check.
66962      * @returns {boolean} Returns `true` if `value` is correctly classified, else
66963      *          `false`.
66964      * @example
66965      *
66966      * _.isArguments(function() { return arguments; }()); // => true
66967      *
66968      * _.isArguments([1, 2, 3]); // => false
66969      */
66970     function isArguments(value) {
66971       return isObjectLike(value) && isArrayLike(value) &&
66972         hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
66973     }
66974
66975     module.exports = isArguments;
66976
66977   }, {
66978     "../internal/isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
66979     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
66980   }],
66981   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js": [function(require, module, exports) {
66982     var getNative = require('../internal/getNative'),
66983       isLength = require('../internal/isLength'),
66984       isObjectLike = require('../internal/isObjectLike');
66985
66986     /** `Object#toString` result references. */
66987     var arrayTag = '[object Array]';
66988
66989     /** Used for native method references. */
66990     var objectProto = Object.prototype;
66991
66992     /**
66993      * Used to resolve the
66994      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
66995      * of values.
66996      */
66997     var objToString = objectProto.toString;
66998
66999     /*
67000      * Native method references for those with the same name as other `lodash`
67001      * methods.
67002      */
67003     var nativeIsArray = getNative(Array, 'isArray');
67004
67005     /**
67006      * Checks if `value` is classified as an `Array` object.
67007      *
67008      * @static
67009      * @memberOf _
67010      * @category Lang
67011      * @param {*}
67012      *            value The value to check.
67013      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67014      *          `false`.
67015      * @example
67016      *
67017      * _.isArray([1, 2, 3]); // => true
67018      *
67019      * _.isArray(function() { return arguments; }()); // => false
67020      */
67021     var isArray = nativeIsArray || function(value) {
67022       return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
67023     };
67024
67025     module.exports = isArray;
67026
67027   }, {
67028     "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js",
67029     "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67030     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67031   }],
67032   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js": [function(require, module, exports) {
67033     var isObject = require('./isObject');
67034
67035     /** `Object#toString` result references. */
67036     var funcTag = '[object Function]';
67037
67038     /** Used for native method references. */
67039     var objectProto = Object.prototype;
67040
67041     /**
67042      * Used to resolve the
67043      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67044      * of values.
67045      */
67046     var objToString = objectProto.toString;
67047
67048     /**
67049      * Checks if `value` is classified as a `Function` object.
67050      *
67051      * @static
67052      * @memberOf _
67053      * @category Lang
67054      * @param {*}
67055      *            value The value to check.
67056      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67057      *          `false`.
67058      * @example
67059      *
67060      * _.isFunction(_); // => true
67061      *
67062      * _.isFunction(/abc/); // => false
67063      */
67064     function isFunction(value) {
67065       // The use of `Object#toString` avoids issues with the `typeof` operator
67066       // in older versions of Chrome and Safari which return 'function' for
67067       // regexes
67068       // and Safari 8 which returns 'object' for typed array constructors.
67069       return isObject(value) && objToString.call(value) == funcTag;
67070     }
67071
67072     module.exports = isFunction;
67073
67074   }, {
67075     "./isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67076   }],
67077   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNative.js": [function(require, module, exports) {
67078     var isFunction = require('./isFunction'),
67079       isObjectLike = require('../internal/isObjectLike');
67080
67081     /** Used to detect host constructors (Safari > 5). */
67082     var reIsHostCtor = /^\[object .+?Constructor\]$/;
67083
67084     /** Used for native method references. */
67085     var objectProto = Object.prototype;
67086
67087     /** Used to resolve the decompiled source of functions. */
67088     var fnToString = Function.prototype.toString;
67089
67090     /** Used to check objects for own properties. */
67091     var hasOwnProperty = objectProto.hasOwnProperty;
67092
67093     /** Used to detect if a method is native. */
67094     var reIsNative = RegExp('^' +
67095       fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
67096       .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
67097     );
67098
67099     /**
67100      * Checks if `value` is a native function.
67101      *
67102      * @static
67103      * @memberOf _
67104      * @category Lang
67105      * @param {*}
67106      *            value The value to check.
67107      * @returns {boolean} Returns `true` if `value` is a native function, else
67108      *          `false`.
67109      * @example
67110      *
67111      * _.isNative(Array.prototype.push); // => true
67112      *
67113      * _.isNative(_); // => false
67114      */
67115     function isNative(value) {
67116       if (value == null) {
67117         return false;
67118       }
67119       if (isFunction(value)) {
67120         return reIsNative.test(fnToString.call(value));
67121       }
67122       return isObjectLike(value) && reIsHostCtor.test(value);
67123     }
67124
67125     module.exports = isNative;
67126
67127   }, {
67128     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
67129     "./isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js"
67130   }],
67131   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js": [function(require, module, exports) {
67132     var isObjectLike = require('../internal/isObjectLike');
67133
67134     /** `Object#toString` result references. */
67135     var numberTag = '[object Number]';
67136
67137     /** Used for native method references. */
67138     var objectProto = Object.prototype;
67139
67140     /**
67141      * Used to resolve the
67142      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67143      * of values.
67144      */
67145     var objToString = objectProto.toString;
67146
67147     /**
67148      * Checks if `value` is classified as a `Number` primitive or object.
67149      *
67150      * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
67151      * as numbers, use the `_.isFinite` method.
67152      *
67153      * @static
67154      * @memberOf _
67155      * @category Lang
67156      * @param {*}
67157      *            value The value to check.
67158      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67159      *          `false`.
67160      * @example
67161      *
67162      * _.isNumber(8.4); // => true
67163      *
67164      * _.isNumber(NaN); // => true
67165      *
67166      * _.isNumber('8.4'); // => false
67167      */
67168     function isNumber(value) {
67169       return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
67170     }
67171
67172     module.exports = isNumber;
67173
67174   }, {
67175     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67176   }],
67177   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js": [function(require, module, exports) {
67178     /**
67179      * Checks if `value` is the [language type](https://es5.github.io/#x8) of
67180      * `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and
67181      * `new String('')`)
67182      *
67183      * @static
67184      * @memberOf _
67185      * @category Lang
67186      * @param {*}
67187      *            value The value to check.
67188      * @returns {boolean} Returns `true` if `value` is an object, else `false`.
67189      * @example
67190      *
67191      * _.isObject({}); // => true
67192      *
67193      * _.isObject([1, 2, 3]); // => true
67194      *
67195      * _.isObject(1); // => false
67196      */
67197     function isObject(value) {
67198       // Avoid a V8 JIT bug in Chrome 19-20.
67199       // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
67200       var type = typeof value;
67201       return !!value && (type == 'object' || type == 'function');
67202     }
67203
67204     module.exports = isObject;
67205
67206   }, {}],
67207   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isPlainObject.js": [function(require, module, exports) {
67208     var baseForIn = require('../internal/baseForIn'),
67209       isArguments = require('./isArguments'),
67210       isObjectLike = require('../internal/isObjectLike');
67211
67212     /** `Object#toString` result references. */
67213     var objectTag = '[object Object]';
67214
67215     /** Used for native method references. */
67216     var objectProto = Object.prototype;
67217
67218     /** Used to check objects for own properties. */
67219     var hasOwnProperty = objectProto.hasOwnProperty;
67220
67221     /**
67222      * Used to resolve the
67223      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67224      * of values.
67225      */
67226     var objToString = objectProto.toString;
67227
67228     /**
67229      * Checks if `value` is a plain object, that is, an object created by the
67230      * `Object` constructor or one with a `[[Prototype]]` of `null`.
67231      *
67232      * **Note:** This method assumes objects created by the `Object` constructor
67233      * have no inherited enumerable properties.
67234      *
67235      * @static
67236      * @memberOf _
67237      * @category Lang
67238      * @param {*}
67239      *            value The value to check.
67240      * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
67241      * @example
67242      *
67243      * function Foo() { this.a = 1; }
67244      *
67245      * _.isPlainObject(new Foo); // => false
67246      *
67247      * _.isPlainObject([1, 2, 3]); // => false
67248      *
67249      * _.isPlainObject({ 'x': 0, 'y': 0 }); // => true
67250      *
67251      * _.isPlainObject(Object.create(null)); // => true
67252      */
67253     function isPlainObject(value) {
67254       var Ctor;
67255
67256       // Exit early for non `Object` objects.
67257       if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
67258         (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
67259         return false;
67260       }
67261       // IE < 9 iterates inherited properties before own properties. If the first
67262       // iterated property is an object's own property then there are no inherited
67263       // enumerable properties.
67264       var result;
67265       // In most environments an object's own properties are iterated before
67266       // its inherited properties. If the last iterated property is an object's
67267       // own property then there are no inherited enumerable properties.
67268       baseForIn(value, function(subValue, key) {
67269         result = key;
67270       });
67271       return result === undefined || hasOwnProperty.call(value, result);
67272     }
67273
67274     module.exports = isPlainObject;
67275
67276   }, {
67277     "../internal/baseForIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js",
67278     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
67279     "./isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js"
67280   }],
67281   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js": [function(require, module, exports) {
67282     var isObjectLike = require('../internal/isObjectLike');
67283
67284     /** `Object#toString` result references. */
67285     var stringTag = '[object String]';
67286
67287     /** Used for native method references. */
67288     var objectProto = Object.prototype;
67289
67290     /**
67291      * Used to resolve the
67292      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67293      * of values.
67294      */
67295     var objToString = objectProto.toString;
67296
67297     /**
67298      * Checks if `value` is classified as a `String` primitive or object.
67299      *
67300      * @static
67301      * @memberOf _
67302      * @category Lang
67303      * @param {*}
67304      *            value The value to check.
67305      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67306      *          `false`.
67307      * @example
67308      *
67309      * _.isString('abc'); // => true
67310      *
67311      * _.isString(1); // => false
67312      */
67313     function isString(value) {
67314       return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
67315     }
67316
67317     module.exports = isString;
67318
67319   }, {
67320     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67321   }],
67322   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js": [function(require, module, exports) {
67323     var isLength = require('../internal/isLength'),
67324       isObjectLike = require('../internal/isObjectLike');
67325
67326     /** `Object#toString` result references. */
67327     var argsTag = '[object Arguments]',
67328       arrayTag = '[object Array]',
67329       boolTag = '[object Boolean]',
67330       dateTag = '[object Date]',
67331       errorTag = '[object Error]',
67332       funcTag = '[object Function]',
67333       mapTag = '[object Map]',
67334       numberTag = '[object Number]',
67335       objectTag = '[object Object]',
67336       regexpTag = '[object RegExp]',
67337       setTag = '[object Set]',
67338       stringTag = '[object String]',
67339       weakMapTag = '[object WeakMap]';
67340
67341     var arrayBufferTag = '[object ArrayBuffer]',
67342       float32Tag = '[object Float32Array]',
67343       float64Tag = '[object Float64Array]',
67344       int8Tag = '[object Int8Array]',
67345       int16Tag = '[object Int16Array]',
67346       int32Tag = '[object Int32Array]',
67347       uint8Tag = '[object Uint8Array]',
67348       uint8ClampedTag = '[object Uint8ClampedArray]',
67349       uint16Tag = '[object Uint16Array]',
67350       uint32Tag = '[object Uint32Array]';
67351
67352     /** Used to identify `toStringTag` values of typed arrays. */
67353     var typedArrayTags = {};
67354     typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
67355       typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
67356       typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
67357       typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
67358       typedArrayTags[uint32Tag] = true;
67359     typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
67360       typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
67361       typedArrayTags[dateTag] = typedArrayTags[errorTag] =
67362       typedArrayTags[funcTag] = typedArrayTags[mapTag] =
67363       typedArrayTags[numberTag] = typedArrayTags[objectTag] =
67364       typedArrayTags[regexpTag] = typedArrayTags[setTag] =
67365       typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
67366
67367     /** Used for native method references. */
67368     var objectProto = Object.prototype;
67369
67370     /**
67371      * Used to resolve the
67372      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67373      * of values.
67374      */
67375     var objToString = objectProto.toString;
67376
67377     /**
67378      * Checks if `value` is classified as a typed array.
67379      *
67380      * @static
67381      * @memberOf _
67382      * @category Lang
67383      * @param {*}
67384      *            value The value to check.
67385      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67386      *          `false`.
67387      * @example
67388      *
67389      * _.isTypedArray(new Uint8Array); // => true
67390      *
67391      * _.isTypedArray([]); // => false
67392      */
67393     function isTypedArray(value) {
67394       return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
67395     }
67396
67397     module.exports = isTypedArray;
67398
67399   }, {
67400     "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67401     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67402   }],
67403   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\toPlainObject.js": [function(require, module, exports) {
67404     var baseCopy = require('../internal/baseCopy'),
67405       keysIn = require('../object/keysIn');
67406
67407     /**
67408      * Converts `value` to a plain object flattening inherited enumerable properties
67409      * of `value` to own properties of the plain object.
67410      *
67411      * @static
67412      * @memberOf _
67413      * @category Lang
67414      * @param {*}
67415      *            value The value to convert.
67416      * @returns {Object} Returns the converted plain object.
67417      * @example
67418      *
67419      * function Foo() { this.b = 2; }
67420      *
67421      * Foo.prototype.c = 3;
67422      *
67423      * _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 }
67424      *
67425      * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2, 'c':
67426      * 3 }
67427      */
67428     function toPlainObject(value) {
67429       return baseCopy(value, keysIn(value));
67430     }
67431
67432     module.exports = toPlainObject;
67433
67434   }, {
67435     "../internal/baseCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js",
67436     "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js"
67437   }],
67438   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js": [function(require, module, exports) {
67439     var assignWith = require('../internal/assignWith'),
67440       baseAssign = require('../internal/baseAssign'),
67441       createAssigner = require('../internal/createAssigner');
67442
67443     /**
67444      * Assigns own enumerable properties of source object(s) to the destination
67445      * object. Subsequent sources overwrite property assignments of previous
67446      * sources. If `customizer` is provided it's invoked to produce the assigned
67447      * values. The `customizer` is bound to `thisArg` and invoked with five
67448      * arguments: (objectValue, sourceValue, key, object, source).
67449      *
67450      * **Note:** This method mutates `object` and is based on
67451      * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
67452      *
67453      * @static
67454      * @memberOf _
67455      * @alias extend
67456      * @category Object
67457      * @param {Object}
67458      *            object The destination object.
67459      * @param {...Object}
67460      *            [sources] The source objects.
67461      * @param {Function}
67462      *            [customizer] The function to customize assigned values.
67463      * @param {*}
67464      *            [thisArg] The `this` binding of `customizer`.
67465      * @returns {Object} Returns `object`.
67466      * @example
67467      *
67468      * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); // => {
67469      * 'user': 'fred', 'age': 40 }
67470      *  // using a customizer callback var defaults = _.partialRight(_.assign,
67471      * function(value, other) { return _.isUndefined(value) ? other : value; });
67472      *
67473      * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
67474      * 'user': 'barney', 'age': 36 }
67475      */
67476     var assign = createAssigner(function(object, source, customizer) {
67477       return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
67478     });
67479
67480     module.exports = assign;
67481
67482   }, {
67483     "../internal/assignWith": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\assignWith.js",
67484     "../internal/baseAssign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseAssign.js",
67485     "../internal/createAssigner": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js"
67486   }],
67487   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js": [function(require, module, exports) {
67488     var getNative = require('../internal/getNative'),
67489       isArrayLike = require('../internal/isArrayLike'),
67490       isObject = require('../lang/isObject'),
67491       shimKeys = require('../internal/shimKeys');
67492
67493     /*
67494      * Native method references for those with the same name as other `lodash`
67495      * methods.
67496      */
67497     var nativeKeys = getNative(Object, 'keys');
67498
67499     /**
67500      * Creates an array of the own enumerable property names of `object`.
67501      *
67502      * **Note:** Non-object values are coerced to objects. See the [ES
67503      * spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for more
67504      * details.
67505      *
67506      * @static
67507      * @memberOf _
67508      * @category Object
67509      * @param {Object}
67510      *            object The object to query.
67511      * @returns {Array} Returns the array of property names.
67512      * @example
67513      *
67514      * function Foo() { this.a = 1; this.b = 2; }
67515      *
67516      * Foo.prototype.c = 3;
67517      *
67518      * _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed)
67519      *
67520      * _.keys('hi'); // => ['0', '1']
67521      */
67522     var keys = !nativeKeys ? shimKeys : function(object) {
67523       var Ctor = object == null ? undefined : object.constructor;
67524       if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
67525         (typeof object != 'function' && isArrayLike(object))) {
67526         return shimKeys(object);
67527       }
67528       return isObject(object) ? nativeKeys(object) : [];
67529     };
67530
67531     module.exports = keys;
67532
67533   }, {
67534     "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js",
67535     "../internal/isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
67536     "../internal/shimKeys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\shimKeys.js",
67537     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67538   }],
67539   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js": [function(require, module, exports) {
67540     var isArguments = require('../lang/isArguments'),
67541       isArray = require('../lang/isArray'),
67542       isIndex = require('../internal/isIndex'),
67543       isLength = require('../internal/isLength'),
67544       isObject = require('../lang/isObject');
67545
67546     /** Used for native method references. */
67547     var objectProto = Object.prototype;
67548
67549     /** Used to check objects for own properties. */
67550     var hasOwnProperty = objectProto.hasOwnProperty;
67551
67552     /**
67553      * Creates an array of the own and inherited enumerable property names of
67554      * `object`.
67555      *
67556      * **Note:** Non-object values are coerced to objects.
67557      *
67558      * @static
67559      * @memberOf _
67560      * @category Object
67561      * @param {Object}
67562      *            object The object to query.
67563      * @returns {Array} Returns the array of property names.
67564      * @example
67565      *
67566      * function Foo() { this.a = 1; this.b = 2; }
67567      *
67568      * Foo.prototype.c = 3;
67569      *
67570      * _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not guaranteed)
67571      */
67572     function keysIn(object) {
67573       if (object == null) {
67574         return [];
67575       }
67576       if (!isObject(object)) {
67577         object = Object(object);
67578       }
67579       var length = object.length;
67580       length = (length && isLength(length) &&
67581         (isArray(object) || isArguments(object)) && length) || 0;
67582
67583       var Ctor = object.constructor,
67584         index = -1,
67585         isProto = typeof Ctor == 'function' && Ctor.prototype === object,
67586         result = Array(length),
67587         skipIndexes = length > 0;
67588
67589       while (++index < length) {
67590         result[index] = (index + '');
67591       }
67592       for (var key in object) {
67593         if (!(skipIndexes && isIndex(key, length)) &&
67594           !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
67595           result.push(key);
67596         }
67597       }
67598       return result;
67599     }
67600
67601     module.exports = keysIn;
67602
67603   }, {
67604     "../internal/isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js",
67605     "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67606     "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
67607     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
67608     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67609   }],
67610   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\merge.js": [function(require, module, exports) {
67611     var baseMerge = require('../internal/baseMerge'),
67612       createAssigner = require('../internal/createAssigner');
67613
67614     /**
67615      * Recursively merges own enumerable properties of the source object(s), that
67616      * don't resolve to `undefined` into the destination object. Subsequent sources
67617      * overwrite property assignments of previous sources. If `customizer` is
67618      * provided it's invoked to produce the merged values of the destination and
67619      * source properties. If `customizer` returns `undefined` merging is handled by
67620      * the method instead. The `customizer` is bound to `thisArg` and invoked with
67621      * five arguments: (objectValue, sourceValue, key, object, source).
67622      *
67623      * @static
67624      * @memberOf _
67625      * @category Object
67626      * @param {Object}
67627      *            object The destination object.
67628      * @param {...Object}
67629      *            [sources] The source objects.
67630      * @param {Function}
67631      *            [customizer] The function to customize assigned values.
67632      * @param {*}
67633      *            [thisArg] The `this` binding of `customizer`.
67634      * @returns {Object} Returns `object`.
67635      * @example
67636      *
67637      * var users = { 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] };
67638      *
67639      * var ages = { 'data': [{ 'age': 36 }, { 'age': 40 }] };
67640      *
67641      * _.merge(users, ages); // => { 'data': [{ 'user': 'barney', 'age': 36 }, {
67642      * 'user': 'fred', 'age': 40 }] }
67643      *  // using a customizer callback var object = { 'fruits': ['apple'],
67644      * 'vegetables': ['beet'] };
67645      *
67646      * var other = { 'fruits': ['banana'], 'vegetables': ['carrot'] };
67647      *
67648      * _.merge(object, other, function(a, b) { if (_.isArray(a)) { return
67649      * a.concat(b); } }); // => { 'fruits': ['apple', 'banana'], 'vegetables':
67650      * ['beet', 'carrot'] }
67651      */
67652     var merge = createAssigner(baseMerge);
67653
67654     module.exports = merge;
67655
67656   }, {
67657     "../internal/baseMerge": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMerge.js",
67658     "../internal/createAssigner": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js"
67659   }],
67660   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\omit.js": [function(require, module, exports) {
67661     var arrayMap = require('../internal/arrayMap'),
67662       baseDifference = require('../internal/baseDifference'),
67663       baseFlatten = require('../internal/baseFlatten'),
67664       bindCallback = require('../internal/bindCallback'),
67665       keysIn = require('./keysIn'),
67666       pickByArray = require('../internal/pickByArray'),
67667       pickByCallback = require('../internal/pickByCallback'),
67668       restParam = require('../function/restParam');
67669
67670     /**
67671      * The opposite of `_.pick`; this method creates an object composed of the own
67672      * and inherited enumerable properties of `object` that are not omitted.
67673      *
67674      * @static
67675      * @memberOf _
67676      * @category Object
67677      * @param {Object}
67678      *            object The source object.
67679      * @param {Function|...(string|string[])}
67680      *            [predicate] The function invoked per iteration or property names
67681      *            to omit, specified as individual property names or arrays of
67682      *            property names.
67683      * @param {*}
67684      *            [thisArg] The `this` binding of `predicate`.
67685      * @returns {Object} Returns the new object.
67686      * @example
67687      *
67688      * var object = { 'user': 'fred', 'age': 40 };
67689      *
67690      * _.omit(object, 'age'); // => { 'user': 'fred' }
67691      *
67692      * _.omit(object, _.isNumber); // => { 'user': 'fred' }
67693      */
67694     var omit = restParam(function(object, props) {
67695       if (object == null) {
67696         return {};
67697       }
67698       if (typeof props[0] != 'function') {
67699         var props = arrayMap(baseFlatten(props), String);
67700         return pickByArray(object, baseDifference(keysIn(object), props));
67701       }
67702       var predicate = bindCallback(props[0], props[1], 3);
67703       return pickByCallback(object, function(value, key, object) {
67704         return !predicate(value, key, object);
67705       });
67706     });
67707
67708     module.exports = omit;
67709
67710   }, {
67711     "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
67712     "../internal/arrayMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js",
67713     "../internal/baseDifference": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDifference.js",
67714     "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
67715     "../internal/bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
67716     "../internal/pickByArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js",
67717     "../internal/pickByCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js",
67718     "./keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js"
67719   }],
67720   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pairs.js": [function(require, module, exports) {
67721     var keys = require('./keys'),
67722       toObject = require('../internal/toObject');
67723
67724     /**
67725      * Creates a two dimensional array of the key-value pairs for `object`, e.g.
67726      * `[[key1, value1], [key2, value2]]`.
67727      *
67728      * @static
67729      * @memberOf _
67730      * @category Object
67731      * @param {Object}
67732      *            object The object to query.
67733      * @returns {Array} Returns the new array of key-value pairs.
67734      * @example
67735      *
67736      * _.pairs({ 'barney': 36, 'fred': 40 }); // => [['barney', 36], ['fred', 40]]
67737      * (iteration order is not guaranteed)
67738      */
67739     function pairs(object) {
67740       object = toObject(object);
67741
67742       var index = -1,
67743         props = keys(object),
67744         length = props.length,
67745         result = Array(length);
67746
67747       while (++index < length) {
67748         var key = props[index];
67749         result[index] = [key, object[key]];
67750       }
67751       return result;
67752     }
67753
67754     module.exports = pairs;
67755
67756   }, {
67757     "../internal/toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js",
67758     "./keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
67759   }],
67760   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js": [function(require, module, exports) {
67761     var baseFlatten = require('../internal/baseFlatten'),
67762       bindCallback = require('../internal/bindCallback'),
67763       pickByArray = require('../internal/pickByArray'),
67764       pickByCallback = require('../internal/pickByCallback'),
67765       restParam = require('../function/restParam');
67766
67767     /**
67768      * Creates an object composed of the picked `object` properties. Property names
67769      * may be specified as individual arguments or as arrays of property names. If
67770      * `predicate` is provided it's invoked for each property of `object` picking
67771      * the properties `predicate` returns truthy for. The predicate is bound to
67772      * `thisArg` and invoked with three arguments: (value, key, object).
67773      *
67774      * @static
67775      * @memberOf _
67776      * @category Object
67777      * @param {Object}
67778      *            object The source object.
67779      * @param {Function|...(string|string[])}
67780      *            [predicate] The function invoked per iteration or property names
67781      *            to pick, specified as individual property names or arrays of
67782      *            property names.
67783      * @param {*}
67784      *            [thisArg] The `this` binding of `predicate`.
67785      * @returns {Object} Returns the new object.
67786      * @example
67787      *
67788      * var object = { 'user': 'fred', 'age': 40 };
67789      *
67790      * _.pick(object, 'user'); // => { 'user': 'fred' }
67791      *
67792      * _.pick(object, _.isString); // => { 'user': 'fred' }
67793      */
67794     var pick = restParam(function(object, props) {
67795       if (object == null) {
67796         return {};
67797       }
67798       return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
67799     });
67800
67801     module.exports = pick;
67802
67803   }, {
67804     "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
67805     "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
67806     "../internal/bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
67807     "../internal/pickByArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js",
67808     "../internal/pickByCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js"
67809   }],
67810   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js": [function(require, module, exports) {
67811     var baseValues = require('../internal/baseValues'),
67812       keys = require('./keys');
67813
67814     /**
67815      * Creates an array of the own enumerable property values of `object`.
67816      *
67817      * **Note:** Non-object values are coerced to objects.
67818      *
67819      * @static
67820      * @memberOf _
67821      * @category Object
67822      * @param {Object}
67823      *            object The object to query.
67824      * @returns {Array} Returns the array of property values.
67825      * @example
67826      *
67827      * function Foo() { this.a = 1; this.b = 2; }
67828      *
67829      * Foo.prototype.c = 3;
67830      *
67831      * _.values(new Foo); // => [1, 2] (iteration order is not guaranteed)
67832      *
67833      * _.values('hi'); // => ['h', 'i']
67834      */
67835     function values(object) {
67836       return baseValues(object, keys(object));
67837     }
67838
67839     module.exports = values;
67840
67841   }, {
67842     "../internal/baseValues": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseValues.js",
67843     "./keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
67844   }],
67845   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js": [function(require, module, exports) {
67846     /**
67847      * This method returns the first argument provided to it.
67848      *
67849      * @static
67850      * @memberOf _
67851      * @category Utility
67852      * @param {*}
67853      *            value Any value.
67854      * @returns {*} Returns `value`.
67855      * @example
67856      *
67857      * var object = { 'user': 'fred' };
67858      *
67859      * _.identity(object) === object; // => true
67860      */
67861     function identity(value) {
67862       return value;
67863     }
67864
67865     module.exports = identity;
67866
67867   }, {}],
67868   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\noop.js": [function(require, module, exports) {
67869     /**
67870      * A no-operation function that returns `undefined` regardless of the arguments
67871      * it receives.
67872      *
67873      * @static
67874      * @memberOf _
67875      * @category Utility
67876      * @example
67877      *
67878      * var object = { 'user': 'fred' };
67879      *
67880      * _.noop(object) === undefined; // => true
67881      */
67882     function noop() {
67883       // No operation performed.
67884     }
67885
67886     module.exports = noop;
67887
67888   }, {}],
67889   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\property.js": [function(require, module, exports) {
67890     var baseProperty = require('../internal/baseProperty'),
67891       basePropertyDeep = require('../internal/basePropertyDeep'),
67892       isKey = require('../internal/isKey');
67893
67894     /**
67895      * Creates a function that returns the property value at `path` on a given
67896      * object.
67897      *
67898      * @static
67899      * @memberOf _
67900      * @category Utility
67901      * @param {Array|string}
67902      *            path The path of the property to get.
67903      * @returns {Function} Returns the new function.
67904      * @example
67905      *
67906      * var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ];
67907      *
67908      * _.map(objects, _.property('a.b.c')); // => [2, 1]
67909      *
67910      * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // => [1,
67911      * 2]
67912      */
67913     function property(path) {
67914       return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
67915     }
67916
67917     module.exports = property;
67918
67919   }, {
67920     "../internal/baseProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js",
67921     "../internal/basePropertyDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\basePropertyDeep.js",
67922     "../internal/isKey": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js"
67923   }]
67924 }, {}, ["\\bpmn-js-examples-master\\modeler\\app\\index.js"]);