Merge "Integrate docs template"
[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 {
8         cldsModelXml = modelXml;
9         console.log("cldsOpenDiagram: cldsModelXml=" + cldsModelXml);
10         $("#cldsopendiagrambtn").click();
11 }
12 function cldsGetDiagram()
13 {
14         console.log("cldsGetDiagram: starting...");
15         $("#cldsgetdiagrambtn").click();
16         console.log("cldsGetDiagram: modelXML=" + modelXML);
17         return modelXML;
18 }
19 function uploaddata(file)
20 {
21         uploadfile= file;
22         $("#uploadmodel").click();
23         
24 }
25 function visibility_model()
26 {       
27         $("#openmodel").click();
28         
29 }
30 (function e(t, n, r) {
31     function s(o, u) {
32         if (!n[o]) {
33             if (!t[o]) {
34                 var a = typeof require == "function" && require;
35                 if (!u && a) return a(o, !0);
36                 if (i) return i(o, !0);
37                 var f = new Error("Cannot find module '" + o + "'");
38                 throw f.code = "MODULE_NOT_FOUND", f
39             }
40             var l = n[o] = {
41                 exports: {}
42             };
43             t[o][0].call(l.exports, function(e) {
44                 var n = t[o][1][e];
45                 return s(n ? n : e)
46             }, l, l.exports, e, t, n, r)
47         }
48         return n[o].exports
49     }
50     var i = typeof require == "function" && require;
51     for (var o = 0; o < r.length; o++) s(r[o]);
52     return s;
53 })
54                 
55         ({
56     "\\bpmn-js-examples-master\\modeler\\app\\index.js":
57
58         [function(require, module, exports) {
59
60         'use strict';
61
62
63
64         var $ = require('jquery'),
65             BpmnModeler = require('bpmn-js/lib/Modeler');
66
67         var container = $('#js-drop-zone');
68
69         var canvas = $('#js-canvas');
70
71         var renderer = new BpmnModeler({
72             container: canvas
73         });
74         abootDiagram=renderer;
75
76         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>";
77         //
78         /*file_generate_test_case.addEventListener('click', function(e) {
79                 
80
81         });*/
82
83        
84
85         function createNewDiagram(newDiagramXML) {
86             openDiagram(newDiagramXML);
87             
88         }
89        
90         function openDiagram(xml) {
91             renderer.importXML(xml, function(err) {
92
93                 if (err) {
94                     container
95                         .removeClass('with-diagram')
96                         .addClass('with-error');
97
98                     container.find('.error pre').text(err.message);
99
100                     console.error(err);
101                 } else {
102                     container
103                         .removeClass('with-error')
104                         .addClass('with-diagram');
105                 }
106
107
108             });
109         }
110
111         function saveSVG(done) {
112             renderer.saveSVG(done);
113         }
114
115         function saveDiagram(done) {
116
117             renderer.saveXML({
118                 format: true
119             }, function(err, xml) {
120                 done(err, xml);
121             });
122         }
123        
124
125         function registerFileDrop(container, callback) {
126
127             function handleFileSelect(e) {
128                 e.stopPropagation();
129                 e.preventDefault();
130
131                 var files = e.dataTransfer.files;
132
133                 var file = files[0];
134
135                 var reader = new FileReader();
136
137                 reader.onload = function(e) {
138
139                     var xml = e.target.result;
140
141                     callback(xml);
142                 };
143
144                 reader.readAsText(file);
145             }
146
147             function handleDragOver(e) {
148                 e.stopPropagation();
149                 e.preventDefault();
150
151                 e.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
152             }
153             if(container.get(0)){
154               container.get(0).addEventListener('dragover', handleDragOver, false);
155               container.get(0).addEventListener('drop', handleFileSelect, false);  
156             }            
157         }
158
159
160         // //// file drag / drop ///////////////////////
161
162         // check file api availability
163         if (!window.FileList || !window.FileReader) {
164             window.alert(
165                 'Looks like you use an older browser that does not support drag and drop. ' +
166                 'Try using Chrome, Firefox or the Internet Explorer > 10.');
167         } else {
168             registerFileDrop(container, openDiagram);
169         }
170
171         // bootstrap diagram functions
172         function openNewWin(linkURL) {
173                 window.open(""+linkURL+"","_self"/*, "", "scrollbars, top="+winTop+", left="+winLeft+", height="+winHeight+", width="+winWidth+""*/);
174                 }
175
176         
177         $(document).on('ready', function(e) {
178
179             /* $('#js-create-diagram').click(function(e) {*/
180             e.stopPropagation();
181             e.preventDefault();
182
183             createNewDiagram(newDiagramXML);
184             
185             /*});*/
186             var fileInput = document.getElementById('fileInput');
187             var file_generate_test_case = document.getElementById('file_generate_test_case');
188            
189             var downloadLink = $('#js-download-diagram');
190             var downloadSvgLink = $('#js-download-svg');
191             var readLink = $('#file_generate_test_case');
192             $('.buttons a').click(function(e) {
193                 if (!$(this).is('.active')) {
194                     e.preventDefault();
195                     e.stopPropagation();
196                 }
197             });
198             $('#openmodel').click(function() {
199                 
200                 createNewDiagram(modelXML);
201                 
202             }
203                 );
204                 
205             $('#cldsgetdiagrambtn').click(function() {
206                                 console.log("cldsgetdiagrambtn: starting...");
207                                 exportArtifacts();
208                                 console.log("cldsgetdiagrambtn: modelXML=" + modelXML);
209               });
210             $('#cldsopendiagrambtn').click(function() {
211                                 console.log("cldsopendiagrambtn: cldsModelXml=" + cldsModelXml);
212                 createNewDiagram(cldsModelXml);
213                 exportArtifacts();
214               });
215             $('#uploadmodel').click(function() {
216                 var file = uploadfile;
217                 var textType = /text.*/;
218
219                 var reader = new FileReader();
220
221                 reader.onload = function(e) {
222                     newDiagramXML = reader.result;
223                     e.stopPropagation();
224                     e.preventDefault();
225                     createNewDiagram(newDiagramXML);
226                     
227                 }
228
229                 reader.readAsText(file);
230                 exportArtifacts();
231               });
232            if(fileInput){
233               fileInput.addEventListener('change', function(e) {
234                   var file = fileInput.files[0];
235                   var textType = /text.*/;
236
237
238                   var reader = new FileReader();
239
240                   reader.onload = function(e) {
241                       newDiagramXML = reader.result;
242                       e.stopPropagation();
243                       e.preventDefault();
244                       createNewDiagram(newDiagramXML);
245                       
246                   }
247
248                   reader.readAsText(file);
249                   exportArtifacts();
250               }); 
251            }
252            
253            function setEncoded(link, name, data) {
254                 var encodedData = encodeURIComponent(data);
255                
256                 var el=document.getElementById(selected_model);
257                var text = (el.innerText || el.textContent);
258                 
259                
260                 if (data) {
261                         //var linkURL='data:application/bpmn20-xml;charset=UTF-8,' + encodedData;
262                     link.addClass('active').attr({
263                         'href':'data:application/bpmn20-xml;charset=UTF-8,' + encodedData,/*openNewWin( linkURL )*//*'*/
264                         'download': text.trim()+'.utmxml',
265                         'target':'_blank'
266                     });
267                     
268                 } else {
269                     link.removeClass('active');
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:Collector': 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                          var text2 = getSemantic(element).name;
1477                          if(text2 == undefined )
1478                                 {
1479                                   text2 = 'Collector';
1480                                 }
1481                         
1482                          renderLabel(p, text2, {
1483                              box: element,
1484                              align: 'center-middle'
1485                          });
1486                          
1487                     } else {
1488                         // Collapsed pool draw text inline
1489                         var text2 = getSemantic(element).name;
1490                         renderLabel(p, text2, {
1491                             box: element,
1492                             align: 'center-middle'
1493                         });
1494                     }
1495
1496                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1497
1498                     if (participantMultiplicity) {
1499                         renderer('ParticipantMultiplicityMarker')(p, element);
1500                     }
1501
1502                     return lane;
1503
1504
1505                 },
1506                 'bpmn:VesCollector': function(p, element) {
1507                     var lane = renderer('bpmn:Lane')(p, element, {
1508                         fill: 'White'
1509                     });
1510
1511                     var expandedPool = DiUtil.isExpanded(element);
1512
1513                     if (expandedPool) {
1514                        drawLine(p, [{
1515                              x: element.width,
1516                              y: 80
1517                          }, {
1518                              x: element.width,
1519                              y: 20
1520                          }]);
1521
1522                          drawLine(p, [{
1523                              x: 20,
1524                              y: 0
1525                          }, {
1526                              x: 20,
1527                              y: element.height
1528                          }]);
1529
1530                         textUtil.createText(p, "V", { align: 'left-top', 'padding': {top:0,  left:5, right:element.width - 20, bottom:0} });
1531                         textUtil.createText(p, "E", { align: 'left-top', 'padding': {top:12, left:5, right:element.width - 20, bottom:0} });
1532                         textUtil.createText(p, "S", { align: 'left-top', 'padding': {top:24, left:5, right:element.width - 20, bottom:0} });
1533
1534                          var text2 = getSemantic(element).name;
1535                          if(text2 == undefined )
1536                           {
1537                             text2 = 'VesCollector';
1538                           }
1539
1540                         renderLabel(p, text2, {
1541                              box: element,
1542                              align: 'center-middle'
1543                          });
1544
1545                     } else {
1546                         // Collapsed pool draw text inline
1547                         var text2 = getSemantic(element).name;
1548                         renderLabel(p, text2, {
1549                             box: element,
1550                             align: 'center-middle'
1551                         });
1552                     }
1553
1554                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1555
1556                     if (participantMultiplicity) {
1557                         renderer('ParticipantMultiplicityMarker')(p, element);
1558                     }
1559
1560                     return lane;
1561                 },
1562
1563                 'bpmn:Holmes': function(p, element) {
1564                     var lane = renderer('bpmn:Lane')(p, element, {
1565                         fill: 'White'
1566                     });
1567
1568                     var expandedPool = DiUtil.isExpanded(element);
1569
1570                     var instanceName = getSemantic(element).name;
1571                     if (expandedPool) {
1572
1573                         if (instanceName == undefined) {
1574                             instanceName = 'Holmes';
1575                         }
1576
1577                         // add holmes 'icon'
1578                         var attrs = computeStyle({}, {
1579                             stroke: 'black',
1580                             strokeWidth: 1,
1581                             fill: 'white'
1582                         });
1583                         p.circle(15, 15, 10).attr(attrs)
1584                         textUtil.createText(p, "H", { align: 'left-top', 'padding': { top:6, left:11 } });
1585                     }
1586
1587                     renderLabel(p, instanceName, {
1588                         box: element,
1589                         align: 'center-middle'
1590                     });
1591
1592                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1593
1594                     if (participantMultiplicity) {
1595                         renderer('ParticipantMultiplicityMarker')(p, element);
1596                     }
1597
1598                     return lane;
1599                 },
1600
1601
1602          'bpmn:StringMatch': function(p, element) {
1603                     var lane = renderer('bpmn:Lane')(p, element, {
1604                         fill: 'White'
1605                     });
1606
1607                     var expandedPool = DiUtil.isExpanded(element);
1608
1609                     if (expandedPool) {
1610
1611                          drawLine(p, [{
1612                              x: 0,
1613                              y: 20
1614                          }, {
1615                              x: element.width,
1616                              y: 20
1617                          }]);
1618                          var text2 = getSemantic(element).name;
1619                          if(text2 == undefined )
1620                         {
1621                           text2 = 'StringMatch';
1622                         }
1623                          renderLabel(p, text2, {
1624                              box: element,
1625                              align: 'center-middle'
1626                          });
1627
1628                     } else {
1629                         // Collapsed pool draw text inline
1630                         var text2 = getSemantic(element).name;
1631                         renderLabel(p, text2, {
1632                             box: element,
1633                             align: 'center-middle'
1634                         });
1635                     }
1636
1637                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1638
1639                     if (participantMultiplicity) {
1640                         renderer('ParticipantMultiplicityMarker')(p, element);
1641                     }
1642
1643                     return lane;
1644
1645
1646                    },
1647
1648                 'bpmn:TCA': function(p, element) {
1649                     var lane = renderer('bpmn:Lane')(p, element, {
1650                         fill: 'White'
1651                     });
1652
1653                     var expandedPool = DiUtil.isExpanded(element);
1654
1655                     if (expandedPool) {
1656                          
1657
1658                          drawLine(p, [{
1659                                  x: 0,
1660                              y: element.height - 20
1661                          }, {
1662                              x: element.width,
1663                              y: element.height - 20
1664                          }]);
1665                          var text2 = getSemantic(element).name;
1666                          if(text2 == undefined )
1667                         {
1668                           text2 = 'TCA';
1669                         }
1670                          renderLabel(p, text2, {
1671                              box: element,
1672                              align: 'center-middle'
1673                          });
1674                          
1675                     } else {
1676                         // Collapsed pool draw text inline
1677                         var text2 = getSemantic(element).name;
1678                         renderLabel(p, text2, {
1679                             box: element,
1680                             align: 'center-middle'
1681                         });
1682                     }
1683
1684                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1685
1686                     if (participantMultiplicity) {
1687                         renderer('ParticipantMultiplicityMarker')(p, element);
1688                     }
1689
1690                     return lane;
1691
1692
1693                 },
1694                                 'bpmn:GOC': function(p, element) {
1695                     var lane = renderer('bpmn:Lane')(p, element, {
1696                         fill: 'White'
1697                     });
1698
1699                     var expandedPool = DiUtil.isExpanded(element);
1700
1701                     if (expandedPool) {
1702                          
1703                          
1704
1705                          drawLine(p, [{
1706                              x: element.width/2,
1707                              y: element.height
1708                          }, {
1709                              x: element.width,
1710                              y: element.height/2
1711                          }]);
1712                          var text2 = getSemantic(element).name;
1713                          if(text2 == undefined )
1714                         {
1715                           text2 = 'GOC';
1716                         }
1717                          renderLabel(p, text2, {
1718                              box: element,
1719                              align: 'center-middle'
1720                          });
1721                          
1722                     } else {
1723                         // Collapsed pool draw text inline
1724                         var text2 = getSemantic(element).name;
1725                         renderLabel(p, text2, {
1726                             box: element,
1727                             align: 'center-middle'
1728                         });
1729                     }
1730
1731                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1732
1733                     if (participantMultiplicity) {
1734                         renderer('ParticipantMultiplicityMarker')(p, element);
1735                     }
1736
1737                     return lane;
1738
1739
1740                 },
1741                                 'bpmn:Policy': function(p, element) {
1742                     var lane = renderer('bpmn:Lane')(p, element, {
1743                         fill: 'White'
1744                     });
1745
1746                     var expandedPool = DiUtil.isExpanded(element);
1747
1748                     if (expandedPool) {
1749                          
1750                          
1751
1752                          drawLine(p, [{
1753                              x: 0,
1754                              y: element.height/2
1755                          }, {
1756                              x: element.width/2,
1757                              y: 0
1758                          }]);
1759                          var text2 = getSemantic(element).name;
1760                          if(text2 == undefined )
1761                         {
1762                           text2 = 'Policy';
1763                         }
1764                          renderLabel(p, text2, {
1765                              box: element,
1766                              align: 'center-middle'
1767                          });
1768                          
1769                     } else {
1770                         // Collapsed pool draw text inline
1771                         var text2 = getSemantic(element).name;
1772                         renderLabel(p, text2, {
1773                             box: element,
1774                             align: 'center-middle'
1775                         });
1776                     }
1777
1778                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1779
1780                     if (participantMultiplicity) {
1781                         renderer('ParticipantMultiplicityMarker')(p, element);
1782                     }
1783
1784                     return lane;
1785
1786
1787                 },
1788                 'bpmn:MessageEventDefinition': function(p, element, isThrowing) {
1789                     var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
1790                         xScaleFactor: 0.9,
1791                         yScaleFactor: 0.9,
1792                         containerWidth: element.width,
1793                         containerHeight: element.height,
1794                         position: {
1795                             mx: 0.235,
1796                             my: 0.315
1797                         }
1798                     });
1799
1800                     var fill = isThrowing ? 'black' : 'white';
1801                     var stroke = isThrowing ? 'white' : 'black';
1802
1803                     var messagePath = drawPath(p, pathData, {
1804                         strokeWidth: 1,
1805                         fill: fill,
1806                         stroke: stroke
1807                     });
1808
1809                     return messagePath;
1810                 },
1811                 'bpmn:TimerEventDefinition': function(p, element) {
1812
1813                     var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {
1814                         strokeWidth: 2
1815                     });
1816
1817                     var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
1818                         xScaleFactor: 0.75,
1819                         yScaleFactor: 0.75,
1820                         containerWidth: element.width,
1821                         containerHeight: element.height,
1822                         position: {
1823                             mx: 0.5,
1824                             my: 0.5
1825                         }
1826                     });
1827
1828                     drawPath(p, pathData, {
1829                         strokeWidth: 2,
1830                         strokeLinecap: 'square'
1831                     });
1832
1833                     for (var i = 0; i < 12; i++) {
1834
1835                         var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
1836                             xScaleFactor: 0.75,
1837                             yScaleFactor: 0.75,
1838                             containerWidth: element.width,
1839                             containerHeight: element.height,
1840                             position: {
1841                                 mx: 0.5,
1842                                 my: 0.5
1843                             }
1844                         });
1845
1846                         var width = element.width / 2;
1847                         var height = element.height / 2;
1848
1849                         drawPath(p, linePathData, {
1850                             strokeWidth: 1,
1851                             strokeLinecap: 'square',
1852                             transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
1853                         });
1854                     }
1855
1856                     return circle;
1857                 },
1858                 'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {
1859                     var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
1860                         xScaleFactor: 1,
1861                         yScaleFactor: 1,
1862                         containerWidth: event.width,
1863                         containerHeight: event.height,
1864                         position: {
1865                             mx: 0.5,
1866                             my: 0.555
1867                         }
1868                     });
1869
1870                     var fill = isThrowing ? 'black' : 'none';
1871
1872                     return drawPath(p, pathData, {
1873                         strokeWidth: 1,
1874                         fill: fill
1875                     });
1876                 },
1877                 'bpmn:ConditionalEventDefinition': function(p, event) {
1878                     var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
1879                         xScaleFactor: 1,
1880                         yScaleFactor: 1,
1881                         containerWidth: event.width,
1882                         containerHeight: event.height,
1883                         position: {
1884                             mx: 0.5,
1885                             my: 0.222
1886                         }
1887                     });
1888
1889                     return drawPath(p, pathData, {
1890                         strokeWidth: 1
1891                     });
1892                 },
1893                 'bpmn:LinkEventDefinition': function(p, event, isThrowing) {
1894                     var pathData = pathMap.getScaledPath('EVENT_LINK', {
1895                         xScaleFactor: 1,
1896                         yScaleFactor: 1,
1897                         containerWidth: event.width,
1898                         containerHeight: event.height,
1899                         position: {
1900                             mx: 0.57,
1901                             my: 0.263
1902                         }
1903                     });
1904
1905                     var fill = isThrowing ? 'black' : 'none';
1906
1907                     return drawPath(p, pathData, {
1908                         strokeWidth: 1,
1909                         fill: fill
1910                     });
1911                 },
1912                 'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {
1913                     var pathData = pathMap.getScaledPath('EVENT_ERROR', {
1914                         xScaleFactor: 1.1,
1915                         yScaleFactor: 1.1,
1916                         containerWidth: event.width,
1917                         containerHeight: event.height,
1918                         position: {
1919                             mx: 0.2,
1920                             my: 0.722
1921                         }
1922                     });
1923
1924                     var fill = isThrowing ? 'black' : 'none';
1925
1926                     return drawPath(p, pathData, {
1927                         strokeWidth: 1,
1928                         fill: fill
1929                     });
1930                 },
1931                 'bpmn:CancelEventDefinition': function(p, event, isThrowing) {
1932                     var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
1933                         xScaleFactor: 1.0,
1934                         yScaleFactor: 1.0,
1935                         containerWidth: event.width,
1936                         containerHeight: event.height,
1937                         position: {
1938                             mx: 0.638,
1939                             my: -0.055
1940                         }
1941                     });
1942
1943                     var fill = isThrowing ? 'black' : 'none';
1944
1945                     return drawPath(p, pathData, {
1946                         strokeWidth: 1,
1947                         fill: fill
1948                     }).transform('rotate(45)');
1949                 },
1950                 'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {
1951                     var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
1952                         xScaleFactor: 1,
1953                         yScaleFactor: 1,
1954                         containerWidth: event.width,
1955                         containerHeight: event.height,
1956                         position: {
1957                             mx: 0.201,
1958                             my: 0.472
1959                         }
1960                     });
1961
1962                     var fill = isThrowing ? 'black' : 'none';
1963
1964                     return drawPath(p, pathData, {
1965                         strokeWidth: 1,
1966                         fill: fill
1967                     });
1968                 },
1969                 'bpmn:SignalEventDefinition': function(p, event, isThrowing) {
1970                     var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
1971                         xScaleFactor: 0.9,
1972                         yScaleFactor: 0.9,
1973                         containerWidth: event.width,
1974                         containerHeight: event.height,
1975                         position: {
1976                             mx: 0.5,
1977                             my: 0.2
1978                         }
1979                     });
1980
1981                     var fill = isThrowing ? 'black' : 'none';
1982
1983                     return drawPath(p, pathData, {
1984                         strokeWidth: 1,
1985                         fill: fill
1986                     });
1987                 },
1988                 'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {
1989                     var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
1990                         xScaleFactor: 1.1,
1991                         yScaleFactor: 1.1,
1992                         containerWidth: event.width,
1993                         containerHeight: event.height,
1994                         position: {
1995                             mx: 0.222,
1996                             my: 0.36
1997                         }
1998                     });
1999
2000                     var fill = isThrowing ? 'black' : 'none';
2001
2002                     return drawPath(p, pathData, {
2003                         strokeWidth: 1,
2004                         fill: fill
2005                     });
2006                 },
2007                 'bpmn:ParallelMultipleEventDefinition': function(p, event) {
2008                     var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
2009                         xScaleFactor: 1.2,
2010                         yScaleFactor: 1.2,
2011                         containerWidth: event.width,
2012                         containerHeight: event.height,
2013                         position: {
2014                             mx: 0.458,
2015                             my: 0.194
2016                         }
2017                     });
2018
2019                     return drawPath(p, pathData, {
2020                         strokeWidth: 1
2021                     });
2022                 },
2023                 'bpmn:EndEvent': function(p, element) {
2024                     var circle = renderer('bpmn:Event')(p, element, {
2025                         strokeWidth: 4
2026                     });
2027
2028                     renderEventContent(element, p, true);
2029
2030                     return circle;
2031                 },
2032                 'bpmn:TerminateEventDefinition': function(p, element) {
2033                     var circle = drawCircle(p, element.width, element.height, 8, {
2034                         strokeWidth: 4,
2035                         fill: 'black'
2036                     });
2037
2038                     return circle;
2039                 },
2040                 'bpmn:IntermediateEvent': function(p, element) {
2041                     var outer = renderer('bpmn:Event')(p, element, {
2042                         strokeWidth: 1
2043                     });
2044                     /* inner */
2045                     drawCircle(p, element.width, element.height, INNER_OUTER_DIST, {
2046                         strokeWidth: 1,
2047                         fill: 'none'
2048                     });
2049
2050                     renderEventContent(element, p);
2051
2052                     return outer;
2053                 },
2054                 'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
2055                 'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
2056
2057                 'bpmn:Activity': function(p, element, attrs) {
2058                     return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);
2059                 },
2060
2061                 'bpmn:Task': function(p, element, attrs) {
2062                     var rect = renderer('bpmn:Activity')(p, element, attrs);
2063                     renderEmbeddedLabel(p, element, 'center-middle');
2064                     attachTaskMarkers(p, element);
2065                     return rect;
2066                 },
2067                 'bpmn:ServiceTask': function(p, element) {
2068                     var task = renderer('bpmn:Task')(p, element);
2069
2070                     var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
2071                         abspos: {
2072                             x: 12,
2073                             y: 18
2074                         }
2075                     });
2076
2077                     /* service bg */
2078                     drawPath(p, pathDataBG, {
2079                         strokeWidth: 1,
2080                         fill: 'none'
2081                     });
2082
2083                     var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {
2084                         abspos: {
2085                             x: 17.2,
2086                             y: 18
2087                         }
2088                     });
2089
2090                     /* service fill */
2091                     drawPath(p, fillPathData, {
2092                         strokeWidth: 0,
2093                         stroke: 'none',
2094                         fill: 'white'
2095                     });
2096
2097                     var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
2098                         abspos: {
2099                             x: 17,
2100                             y: 22
2101                         }
2102                     });
2103
2104                     /* service */
2105                     drawPath(p, pathData, {
2106                         strokeWidth: 1,
2107                         fill: 'white'
2108                     });
2109
2110                     return task;
2111                 },
2112                 'bpmn:UserTask': function(p, element) {
2113                     var task = renderer('bpmn:Task')(p, element);
2114
2115                     var x = 15;
2116                     var y = 12;
2117
2118                     var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {
2119                         abspos: {
2120                             x: x,
2121                             y: y
2122                         }
2123                     });
2124
2125                     /* user path */
2126                     drawPath(p, pathData, {
2127                         strokeWidth: 0.5,
2128                         fill: 'none'
2129                     });
2130
2131                     var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
2132                         abspos: {
2133                             x: x,
2134                             y: y
2135                         }
2136                     });
2137
2138                     /* user2 path */
2139                     drawPath(p, pathData2, {
2140                         strokeWidth: 0.5,
2141                         fill: 'none'
2142                     });
2143
2144                     var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
2145                         abspos: {
2146                             x: x,
2147                             y: y
2148                         }
2149                     });
2150
2151                     /* user3 path */
2152                     drawPath(p, pathData3, {
2153                         strokeWidth: 0.5,
2154                         fill: 'black'
2155                     });
2156
2157                     return task;
2158                 },
2159                 'bpmn:ManualTask': function(p, element) {
2160                     var task = renderer('bpmn:Task')(p, element);
2161
2162                     var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
2163                         abspos: {
2164                             x: 17,
2165                             y: 15
2166                         }
2167                     });
2168
2169                     /* manual path */
2170                     drawPath(p, pathData, {
2171                         strokeWidth: 0.25,
2172                         fill: 'white',
2173                         stroke: 'black'
2174                     });
2175
2176                     return task;
2177                 },
2178                 'bpmn:SendTask': function(p, element) {
2179                     var task = renderer('bpmn:Task')(p, element);
2180
2181                     var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
2182                         xScaleFactor: 1,
2183                         yScaleFactor: 1,
2184                         containerWidth: 21,
2185                         containerHeight: 14,
2186                         position: {
2187                             mx: 0.285,
2188                             my: 0.357
2189                         }
2190                     });
2191
2192                     /* send path */
2193                     drawPath(p, pathData, {
2194                         strokeWidth: 1,
2195                         fill: 'black',
2196                         stroke: 'white'
2197                     });
2198
2199                     return task;
2200                 },
2201                 'bpmn:ReceiveTask': function(p, element) {
2202                     var semantic = getSemantic(element);
2203
2204                     var task = renderer('bpmn:Task')(p, element);
2205                     var pathData;
2206
2207                     if (semantic.instantiate) {
2208                         drawCircle(p, 28, 28, 20 * 0.22, {
2209                             strokeWidth: 1
2210                         });
2211
2212                         pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
2213                             abspos: {
2214                                 x: 7.77,
2215                                 y: 9.52
2216                             }
2217                         });
2218                     } else {
2219
2220                         pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
2221                             xScaleFactor: 0.9,
2222                             yScaleFactor: 0.9,
2223                             containerWidth: 21,
2224                             containerHeight: 14,
2225                             position: {
2226                                 mx: 0.3,
2227                                 my: 0.4
2228                             }
2229                         });
2230                     }
2231
2232                     /* receive path */
2233                     drawPath(p, pathData, {
2234                         strokeWidth: 1
2235                     });
2236
2237                     return task;
2238                 },
2239                 'bpmn:ScriptTask': function(p, element) {
2240                     var task = renderer('bpmn:Task')(p, element);
2241
2242                     var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
2243                         abspos: {
2244                             x: 15,
2245                             y: 20
2246                         }
2247                     });
2248
2249                     /* script path */
2250                     drawPath(p, pathData, {
2251                         strokeWidth: 1
2252                     });
2253
2254                     return task;
2255                 },
2256                 'bpmn:BusinessRuleTask': function(p, element) {
2257                     var task = renderer('bpmn:Task')(p, element);
2258
2259                     var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
2260                         abspos: {
2261                             x: 8,
2262                             y: 8
2263                         }
2264                     });
2265
2266                     var businessHeaderPath = drawPath(p, headerPathData);
2267                     businessHeaderPath.attr({
2268                         strokeWidth: 1,
2269                         fill: 'AAA'
2270                     });
2271
2272                     var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
2273                         abspos: {
2274                             x: 8,
2275                             y: 8
2276                         }
2277                     });
2278
2279                     var businessPath = drawPath(p, headerData);
2280                     businessPath.attr({
2281                         strokeWidth: 1
2282                     });
2283
2284                     return task;
2285                 },
2286                 'bpmn:SubProcess': function(p, element, attrs) {
2287                     var rect = renderer('bpmn:Activity')(p, element, attrs);
2288
2289                     var semantic = getSemantic(element);
2290
2291                     var expanded = DiUtil.isExpanded(semantic);
2292
2293                     var isEventSubProcess = !!semantic.triggeredByEvent;
2294                     if (isEventSubProcess) {
2295                         rect.attr({
2296                             strokeDasharray: '1,2'
2297                         });
2298                     }
2299
2300                     renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');
2301
2302                     if (expanded) {
2303                         attachTaskMarkers(p, element);
2304                     } else {
2305                         attachTaskMarkers(p, element, ['SubProcessMarker']);
2306                     }
2307
2308                     return rect;
2309                 },
2310                 'bpmn:AdHocSubProcess': function(p, element) {
2311                     return renderer('bpmn:SubProcess')(p, element);
2312                 },
2313                 'bpmn:Transaction': function(p, element) {
2314                     var outer = renderer('bpmn:SubProcess')(p, element);
2315
2316                     var innerAttrs = styles.style(['no-fill', 'no-events']);
2317
2318                     /* inner path */
2319                     drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);
2320
2321                     return outer;
2322                 },
2323                 'bpmn:CallActivity': function(p, element) {
2324                     return renderer('bpmn:Task')(p, element, {
2325                         strokeWidth: 5
2326                     });
2327                 },
2328                 'bpmn:Participant': function(p, element) {
2329
2330                     var lane = renderer('bpmn:Lane')(p, element, {
2331                         fill: 'White'
2332                     });
2333
2334                     var expandedPool = DiUtil.isExpanded(element);
2335
2336                     if (expandedPool) {
2337                         drawLine(p, [{
2338                             x: 30,
2339                             y: 0
2340                         }, {
2341                             x: 30,
2342                             y: element.height
2343                         }]);
2344                         var text = getSemantic(element).name;
2345                         renderLaneLabel(p, text, element);
2346                     } else {
2347                         // Collapsed pool draw text inline
2348                         var text2 = getSemantic(element).name;
2349                         renderLabel(p, text2, {
2350                             box: element,
2351                             align: 'center-middle'
2352                         });
2353                     }
2354
2355                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
2356
2357                     if (participantMultiplicity) {
2358                         renderer('ParticipantMultiplicityMarker')(p, element);
2359                     }
2360
2361                     return lane;
2362                 },
2363                 'bpmn:Lane': function(p, element, attrs) {
2364                     var rect = drawRect(p, element.width, element.height, 0, attrs || {
2365                         fill: 'none'
2366                     });
2367
2368                     var semantic = getSemantic(element);
2369
2370                     if (semantic.$type === 'bpmn:Lane') {
2371                         var text = semantic.name;
2372                         renderLaneLabel(p, text, element);
2373                     }
2374
2375                     return rect;
2376                 },
2377                 'bpmn:InclusiveGateway': function(p, element) {
2378                     var diamond = drawDiamond(p, element.width, element.height);
2379
2380                     /* circle path */
2381                     drawCircle(p, element.width, element.height, element.height * 0.24, {
2382                         strokeWidth: 2.5,
2383                         fill: 'none'
2384                     });
2385
2386                     return diamond;
2387                 },
2388                 'bpmn:ExclusiveGateway': function(p, element) {
2389                     var diamond = drawDiamond(p, element.width, element.height);
2390                     renderEmbeddedLabel(p, element, 'center-middle');
2391
2392                     var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
2393                         xScaleFactor: 0.4,
2394                         yScaleFactor: 0.4,
2395                         containerWidth: element.width,
2396                         containerHeight: element.height,
2397                         position: {
2398                             mx: 0.32,
2399                             my: 0.3
2400                         }
2401                     });
2402
2403                     if (!!(getDi(element).isMarkerVisible)) {
2404                         drawPath(p, pathData, {
2405                             strokeWidth: 1,
2406                             fill: 'black'
2407                         });
2408                     }
2409
2410                     return diamond;
2411                 },
2412                 'bpmn:ComplexGateway': function(p, element) {
2413                     var diamond = drawDiamond(p, element.width, element.height);
2414
2415                     var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
2416                         xScaleFactor: 0.5,
2417                         yScaleFactor: 0.5,
2418                         containerWidth: element.width,
2419                         containerHeight: element.height,
2420                         position: {
2421                             mx: 0.46,
2422                             my: 0.26
2423                         }
2424                     });
2425
2426                     /* complex path */
2427                     drawPath(p, pathData, {
2428                         strokeWidth: 1,
2429                         fill: 'black'
2430                     });
2431
2432                     return diamond;
2433                 },
2434                 'bpmn:ParallelGateway': function(p, element) {
2435                     var diamond = drawDiamond(p, element.width, element.height);
2436
2437                     var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
2438                         xScaleFactor: 0.6,
2439                         yScaleFactor: 0.6,
2440                         containerWidth: element.width,
2441                         containerHeight: element.height,
2442                         position: {
2443                             mx: 0.46,
2444                             my: 0.2
2445                         }
2446                     });
2447
2448                     /* parallel path */
2449                     drawPath(p, pathData, {
2450                         strokeWidth: 1,
2451                         fill: 'black'
2452                     });
2453
2454                     return diamond;
2455                 },
2456                 'bpmn:EventBasedGateway': function(p, element) {
2457
2458                     var semantic = getSemantic(element);
2459
2460                     var diamond = drawDiamond(p, element.width, element.height);
2461
2462                     /* outer circle path */
2463                     drawCircle(p, element.width, element.height, element.height * 0.20, {
2464                         strokeWidth: 1,
2465                         fill: 'none'
2466                     });
2467
2468                     var type = semantic.eventGatewayType;
2469                     var instantiate = !!semantic.instantiate;
2470
2471                     function drawEvent() {
2472
2473                         var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {
2474                             xScaleFactor: 0.18,
2475                             yScaleFactor: 0.18,
2476                             containerWidth: element.width,
2477                             containerHeight: element.height,
2478                             position: {
2479                                 mx: 0.36,
2480                                 my: 0.44
2481                             }
2482                         });
2483
2484                         /* event path */
2485                         drawPath(p, pathData, {
2486                             strokeWidth: 2,
2487                             fill: 'none'
2488                         });
2489                     }
2490
2491                     if (type === 'Parallel') {
2492
2493                         var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
2494                             xScaleFactor: 0.4,
2495                             yScaleFactor: 0.4,
2496                             containerWidth: element.width,
2497                             containerHeight: element.height,
2498                             position: {
2499                                 mx: 0.474,
2500                                 my: 0.296
2501                             }
2502                         });
2503
2504                         var parallelPath = drawPath(p, pathData);
2505                         parallelPath.attr({
2506                             strokeWidth: 1,
2507                             fill: 'none'
2508                         });
2509                     } else if (type === 'Exclusive') {
2510
2511                         if (!instantiate) {
2512                             var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);
2513                             innerCircle.attr({
2514                                 strokeWidth: 1,
2515                                 fill: 'none'
2516                             });
2517                         }
2518
2519                         drawEvent();
2520                     }
2521
2522
2523                     return diamond;
2524                 },
2525                 'bpmn:Gateway': function(p, element) {
2526                     var diamond = drawDiamond(p, element.width, element.height);
2527                     renderEmbeddedLabel(p, element, 'center-middle');
2528
2529                     return diamond;
2530                 },
2531                 'bpmn:SequenceFlow': function(p, element) {
2532                     var pathData = createPathFromConnection(element);
2533                     var path = drawPath(p, pathData, {
2534                         strokeLinejoin: 'round',
2535                         markerEnd: marker('sequenceflow-end')
2536                     });
2537
2538                     var sequenceFlow = getSemantic(element);
2539                     var source = element.source.businessObject;
2540
2541                     // conditional flow marker
2542                     if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {
2543                         path.attr({
2544                             markerStart: marker('conditional-flow-marker')
2545                         });
2546                     }
2547
2548                     // default marker
2549                     if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {
2550                         path.attr({
2551                             markerStart: marker('conditional-default-flow-marker')
2552                         });
2553                     }
2554
2555                     return path;
2556                 },
2557                 'bpmn:Association': function(p, element, attrs) {
2558
2559                     attrs = assign({
2560                         strokeDasharray: '1,6',
2561                         strokeLinecap: 'round',
2562                         strokeLinejoin: 'round'
2563                     }, attrs || {});
2564
2565                     // TODO(nre): style according to directed state
2566                     return drawLine(p, element.waypoints, attrs);
2567                 },
2568                 'bpmn:DataInputAssociation': function(p, element) {
2569                     return renderer('bpmn:Association')(p, element, {
2570                         markerEnd: marker('data-association-end')
2571                     });
2572                 },
2573                 'bpmn:DataOutputAssociation': function(p, element) {
2574                     return renderer('bpmn:Association')(p, element, {
2575                         markerEnd: marker('data-association-end')
2576                     });
2577                 },
2578                 'bpmn:MessageFlow': function(p, element) {
2579
2580                     var semantic = getSemantic(element),
2581                         di = getDi(element);
2582
2583                     var pathData = createPathFromConnection(element);
2584                     var path = drawPath(p, pathData, {
2585                         markerEnd: marker('messageflow-end'),
2586                         markerStart: marker('messageflow-start'),
2587                         strokeDasharray: '10, 12',
2588                         strokeLinecap: 'round',
2589                         strokeLinejoin: 'round',
2590                         strokeWidth: '1.5px'
2591                     });
2592
2593                     if (semantic.messageRef) {
2594                         var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
2595
2596                         var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
2597                             abspos: {
2598                                 x: midPoint.x,
2599                                 y: midPoint.y
2600                             }
2601                         });
2602
2603                         var messageAttrs = {
2604                             strokeWidth: 1
2605                         };
2606
2607                         if (di.messageVisibleKind === 'initiating') {
2608                             messageAttrs.fill = 'white';
2609                             messageAttrs.stroke = 'black';
2610                         } else {
2611                             messageAttrs.fill = '#888';
2612                             messageAttrs.stroke = 'white';
2613                         }
2614
2615                         drawPath(p, markerPathData, messageAttrs);
2616                     }
2617
2618                     return path;
2619                 },
2620                 'bpmn:DataObject': function(p, element) {
2621                     var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
2622                         xScaleFactor: 1,
2623                         yScaleFactor: 1,
2624                         containerWidth: element.width,
2625                         containerHeight: element.height,
2626                         position: {
2627                             mx: 0.474,
2628                             my: 0.296
2629                         }
2630                     });
2631
2632                     var elementObject = drawPath(p, pathData, {
2633                         fill: 'white'
2634                     });
2635
2636                     var semantic = getSemantic(element);
2637
2638                     if (isCollection(semantic)) {
2639                         renderDataItemCollection(p, element);
2640                     }
2641
2642                     return elementObject;
2643                 },
2644                 'bpmn:DataObjectReference': as('bpmn:DataObject'),
2645                 'bpmn:DataInput': function(p, element) {
2646
2647                     var arrowPathData = pathMap.getRawPath('DATA_ARROW');
2648
2649                     // page
2650                     var elementObject = renderer('bpmn:DataObject')(p, element);
2651
2652                     /* input arrow path */
2653                     drawPath(p, arrowPathData, {
2654                         strokeWidth: 1
2655                     });
2656
2657                     return elementObject;
2658                 },
2659                 'bpmn:DataOutput': function(p, element) {
2660                     var arrowPathData = pathMap.getRawPath('DATA_ARROW');
2661
2662                     // page
2663                     var elementObject = renderer('bpmn:DataObject')(p, element);
2664
2665                     /* output arrow path */
2666                     drawPath(p, arrowPathData, {
2667                         strokeWidth: 1,
2668                         fill: 'black'
2669                     });
2670
2671                     return elementObject;
2672                 },
2673                 'bpmn:DataStoreReference': function(p, element) {
2674                     var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {
2675                         xScaleFactor: 1,
2676                         yScaleFactor: 1,
2677                         containerWidth: element.width,
2678                         containerHeight: element.height,
2679                         position: {
2680                             mx: 0,
2681                             my: 0.133
2682                         }
2683                     });
2684
2685                     var elementStore = drawPath(p, DATA_STORE_PATH, {
2686                         strokeWidth: 2,
2687                         fill: 'white'
2688                     });
2689
2690                     return elementStore;
2691                 },
2692                 'bpmn:BoundaryEvent': function(p, element) {
2693
2694                     var semantic = getSemantic(element),
2695                         cancel = semantic.cancelActivity;
2696
2697                     var attrs = {
2698                         strokeLinecap: 'round',
2699                         strokeWidth: 1
2700                     };
2701
2702                     if (!cancel) {
2703                         attrs.strokeDasharray = '6';
2704                     }
2705
2706                     var outer = renderer('bpmn:Event')(p, element, attrs);
2707                     /* inner path */
2708                     drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);
2709
2710                     renderEventContent(element, p);
2711
2712                     return outer;
2713                 },
2714                 'bpmn:Group': function(p, element) {
2715                     return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {
2716                         strokeWidth: 1,
2717                         strokeDasharray: '8,3,1,3',
2718                         fill: 'none',
2719                         pointerEvents: 'none'
2720                     });
2721                 },
2722                 'label': function(p, element) {
2723                     return renderExternalLabel(p, element, '');
2724                 },
2725                 'bpmn:TextAnnotation': function(p, element) {
2726                     var style = {
2727                         'fill': 'none',
2728                         'stroke': 'none'
2729                     };
2730                     var textElement = drawRect(p, element.width, element.height, 0, 0, style);
2731                     var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
2732                         xScaleFactor: 1,
2733                         yScaleFactor: 1,
2734                         containerWidth: element.width,
2735                         containerHeight: element.height,
2736                         position: {
2737                             mx: 0.0,
2738                             my: 0.0
2739                         }
2740                     });
2741                     drawPath(p, textPathData);
2742
2743                     var text = getSemantic(element).text || '';
2744                     renderLabel(p, text, {
2745                         box: element,
2746                         align: 'left-middle',
2747                         padding: 5
2748                     });
2749
2750                     return textElement;
2751                 },
2752                 'ParticipantMultiplicityMarker': function(p, element) {
2753                     var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
2754                         xScaleFactor: 1,
2755                         yScaleFactor: 1,
2756                         containerWidth: element.width,
2757                         containerHeight: element.height,
2758                         position: {
2759                             mx: ((element.width / 2) / element.width),
2760                             my: (element.height - 15) / element.height
2761                         }
2762                     });
2763
2764                     drawPath(p, subProcessPath);
2765                 },
2766                 'SubProcessMarker': function(p, element) {
2767                     var markerRect = drawRect(p, 14, 14, 0, {
2768                         strokeWidth: 1
2769                     });
2770
2771                     // Process marker is placed in the middle of the box
2772                     // therefore fixed values can be used here
2773                     markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');
2774
2775                     var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
2776                         xScaleFactor: 1.5,
2777                         yScaleFactor: 1.5,
2778                         containerWidth: element.width,
2779                         containerHeight: element.height,
2780                         position: {
2781                             mx: (element.width / 2 - 7.5) / element.width,
2782                             my: (element.height - 20) / element.height
2783                         }
2784                     });
2785
2786                     drawPath(p, subProcessPath);
2787                 },
2788                 'ParallelMarker': function(p, element, position) {
2789                     var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
2790                         xScaleFactor: 1,
2791                         yScaleFactor: 1,
2792                         containerWidth: element.width,
2793                         containerHeight: element.height,
2794                         position: {
2795                             mx: ((element.width / 2 + position.parallel) / element.width),
2796                             my: (element.height - 20) / element.height
2797                         }
2798                     });
2799                     drawPath(p, subProcessPath);
2800                 },
2801                 'SequentialMarker': function(p, element, position) {
2802                     var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
2803                         xScaleFactor: 1,
2804                         yScaleFactor: 1,
2805                         containerWidth: element.width,
2806                         containerHeight: element.height,
2807                         position: {
2808                             mx: ((element.width / 2 + position.seq) / element.width),
2809                             my: (element.height - 19) / element.height
2810                         }
2811                     });
2812                     drawPath(p, sequentialPath);
2813                 },
2814                 'CompensationMarker': function(p, element, position) {
2815                     var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {
2816                         xScaleFactor: 1,
2817                         yScaleFactor: 1,
2818                         containerWidth: element.width,
2819                         containerHeight: element.height,
2820                         position: {
2821                             mx: ((element.width / 2 + position.compensation) / element.width),
2822                             my: (element.height - 13) / element.height
2823                         }
2824                     });
2825                     drawPath(p, compensationPath, {
2826                         strokeWidth: 1
2827                     });
2828                 },
2829                 'LoopMarker': function(p, element, position) {
2830                     var loopPath = pathMap.getScaledPath('MARKER_LOOP', {
2831                         xScaleFactor: 1,
2832                         yScaleFactor: 1,
2833                         containerWidth: element.width,
2834                         containerHeight: element.height,
2835                         position: {
2836                             mx: ((element.width / 2 + position.loop) / element.width),
2837                             my: (element.height - 7) / element.height
2838                         }
2839                     });
2840
2841                     drawPath(p, loopPath, {
2842                         strokeWidth: 1,
2843                         fill: 'none',
2844                         strokeLinecap: 'round',
2845                         strokeMiterlimit: 0.5
2846                     });
2847                 },
2848                 'AdhocMarker': function(p, element, position) {
2849                     var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {
2850                         xScaleFactor: 1,
2851                         yScaleFactor: 1,
2852                         containerWidth: element.width,
2853                         containerHeight: element.height,
2854                         position: {
2855                             mx: ((element.width / 2 + position.adhoc) / element.width),
2856                             my: (element.height - 15) / element.height
2857                         }
2858                     });
2859
2860                     drawPath(p, loopPath, {
2861                         strokeWidth: 1,
2862                         fill: 'black'
2863                     });
2864                 }
2865             };
2866
2867             function attachTaskMarkers(p, element, taskMarkers) {
2868                 var obj = getSemantic(element);
2869
2870                 var subprocess = includes(taskMarkers, 'SubProcessMarker');
2871                 var position;
2872
2873                 if (subprocess) {
2874                     position = {
2875                         seq: -21,
2876                         parallel: -22,
2877                         compensation: -42,
2878                         loop: -18,
2879                         adhoc: 10
2880                     };
2881                 } else {
2882                     position = {
2883                         seq: -3,
2884                         parallel: -6,
2885                         compensation: -27,
2886                         loop: 0,
2887                         adhoc: 10
2888                     };
2889                 }
2890
2891                 forEach(taskMarkers, function(marker) {
2892                     renderer(marker)(p, element, position);
2893                 });
2894
2895                 if (obj.$type === 'bpmn:AdHocSubProcess') {
2896                     renderer('AdhocMarker')(p, element, position);
2897                 }
2898                 if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {
2899                     renderer('LoopMarker')(p, element, position);
2900                     return;
2901                 }
2902                 if (obj.loopCharacteristics &&
2903                     obj.loopCharacteristics.isSequential !== undefined &&
2904                     !obj.loopCharacteristics.isSequential) {
2905                     renderer('ParallelMarker')(p, element, position);
2906                 }
2907                 if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {
2908                     renderer('SequentialMarker')(p, element, position);
2909                 }
2910                 if (!!obj.isForCompensation) {
2911                     renderer('CompensationMarker')(p, element, position);
2912                 }
2913             }
2914
2915             function drawShape(parent, element) {
2916                 var type = element.type;
2917                 var h = handlers[type];
2918
2919                 /* jshint -W040 */
2920                 if (!h) {
2921                     return DefaultRenderer.prototype.drawShape.apply(this, [parent, element]);
2922                 } else {
2923                     return h(parent, element);
2924                 }
2925             }
2926
2927             function drawConnection(parent, element) {
2928                 var type = element.type;
2929                 var h = handlers[type];
2930
2931                 /* jshint -W040 */
2932                 if (!h) {
2933                     return DefaultRenderer.prototype.drawConnection.apply(this, [parent, element]);
2934                 } else {
2935                     return h(parent, element);
2936                 }
2937             }
2938
2939             function renderDataItemCollection(p, element) {
2940
2941                 var yPosition = (element.height - 16) / element.height;
2942
2943                 var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
2944                     xScaleFactor: 1,
2945                     yScaleFactor: 1,
2946                     containerWidth: element.width,
2947                     containerHeight: element.height,
2948                     position: {
2949                         mx: 0.451,
2950                         my: yPosition
2951                     }
2952                 });
2953
2954                 /* collection path */
2955                 drawPath(p, pathData, {
2956                     strokeWidth: 2
2957                 });
2958             }
2959
2960             function isCollection(element, filter) {
2961                 return element.isCollection ||
2962                     (element.elementObjectRef && element.elementObjectRef.isCollection);
2963             }
2964
2965             function getDi(element) {
2966                 return element.businessObject.di;
2967             }
2968
2969             function getSemantic(element) {
2970                 return element.businessObject;
2971             }
2972
2973             /**
2974              * Checks if eventDefinition of the given element matches with semantic
2975              * type.
2976              * 
2977              * @return {boolean} true if element is of the given semantic type
2978              */
2979             function isTypedEvent(event, eventDefinitionType, filter) {
2980
2981                 function matches(definition, filter) {
2982                     return every(filter, function(val, key) {
2983
2984                         // we want a == conversion here, to be able to catch
2985                         // undefined == false and friends
2986                         /* jshint -W116 */
2987                         return definition[key] == val;
2988                     });
2989                 }
2990
2991                 return some(event.eventDefinitions, function(definition) {
2992                     return definition.$type === eventDefinitionType && matches(event, filter);
2993                 });
2994             }
2995
2996             function isThrowEvent(event) {
2997                 return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');
2998             }
2999
3000
3001             // ///// cropping path customizations /////////////////////////
3002
3003             function componentsToPath(elements) {
3004                 return elements.join(',').replace(/,?([A-z]),?/g, '$1');
3005             }
3006
3007             function getCirclePath(shape) {
3008
3009                 var cx = shape.x + shape.width / 2,
3010                     cy = shape.y + shape.height / 2,
3011                     radius = shape.width / 2;
3012
3013                 var circlePath = [
3014                     ['M', cx, cy],
3015                     ['m', 0, -radius],
3016                     ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
3017                     ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
3018                     ['z']
3019                 ];
3020
3021                 return componentsToPath(circlePath);
3022             }
3023
3024             function getRoundRectPath(shape) {
3025
3026                 var radius = TASK_BORDER_RADIUS,
3027                     x = shape.x,
3028                     y = shape.y,
3029                     width = shape.width,
3030                     height = shape.height;
3031
3032                 var roundRectPath = [
3033                     ['M', x + radius, y],
3034                     ['l', width - radius * 2, 0],
3035                     ['a', radius, radius, 0, 0, 1, radius, radius],
3036                     ['l', 0, height - radius * 2],
3037                     ['a', radius, radius, 0, 0, 1, -radius, radius],
3038                     ['l', radius * 2 - width, 0],
3039                     ['a', radius, radius, 0, 0, 1, -radius, -radius],
3040                     ['l', 0, radius * 2 - height],
3041                     ['a', radius, radius, 0, 0, 1, radius, -radius],
3042                     ['z']
3043                 ];
3044
3045                 return componentsToPath(roundRectPath);
3046             }
3047
3048             function getDiamondPath(shape) {
3049
3050                 var width = shape.width,
3051                     height = shape.height,
3052                     x = shape.x,
3053                     y = shape.y,
3054                     halfWidth = width / 2,
3055                     halfHeight = height / 2;
3056
3057                 var diamondPath = [
3058                     ['M', x + halfWidth, y],
3059                     ['l', halfWidth, halfHeight],
3060                     ['l', -halfWidth, halfHeight],
3061                     ['l', -halfWidth, -halfHeight],
3062                     ['z']
3063                 ];
3064
3065                 return componentsToPath(diamondPath);
3066             }
3067
3068             function getRectPath(shape) {
3069                 var x = shape.x,
3070                     y = shape.y,
3071                     width = shape.width,
3072                     height = shape.height;
3073
3074                 var rectPath = [
3075                     ['M', x, y],
3076                     ['l', width, 0],
3077                     ['l', 0, height],
3078                     ['l', -width, 0],
3079                     ['z']
3080                 ];
3081
3082                 return componentsToPath(rectPath);
3083             }
3084
3085             function getShapePath(element) {
3086                 var obj = getSemantic(element);
3087
3088                 if (obj.$instanceOf('bpmn:Event')) {
3089                     return getCirclePath(element);
3090                 }
3091
3092                 if (obj.$instanceOf('bpmn:Activity')) {
3093                     return getRoundRectPath(element);
3094                 }
3095
3096                 if (obj.$instanceOf('bpmn:Gateway')) {
3097                     return getDiamondPath(element);
3098                 }
3099
3100                 return getRectPath(element);
3101             }
3102
3103
3104             // hook onto canvas init event to initialize
3105             // connection start/end markers on svg
3106             events.on('canvas.init', function(event) {
3107                 initMarkers(event.svg);
3108             });
3109
3110             this.drawShape = drawShape;
3111             this.drawConnection = drawConnection;
3112
3113             this.getShapePath = getShapePath;
3114         }
3115
3116         inherits(BpmnRenderer, DefaultRenderer);
3117
3118
3119         BpmnRenderer.$inject = ['eventBus', 'styles', 'pathMap'];
3120
3121         module.exports = BpmnRenderer;
3122
3123     }, {
3124         "../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
3125         "diagram-js/lib/draw/Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
3126         "diagram-js/lib/util/Text": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Text.js",
3127         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
3128         "lodash/collection/every": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\every.js",
3129         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
3130         "lodash/collection/includes": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\includes.js",
3131         "lodash/collection/some": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\some.js",
3132         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
3133         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
3134         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
3135     }],
3136     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\PathMap.js": [function(require, module, exports) {
3137         'use strict';
3138
3139         var Snap = require('diagram-js/vendor/snapsvg');
3140
3141         /**
3142          * Map containing SVG paths needed by BpmnRenderer.
3143          */
3144
3145         function PathMap() {
3146
3147             /**
3148              * Contains a map of path elements
3149              * 
3150              * <h1>Path definition</h1>
3151              * A parameterized path is defined like this:
3152              * 
3153              * <pre>
3154              * 'GATEWAY_PARALLEL': {
3155              *   d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
3156              *           '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
3157              *   height: 17.5,
3158              *   width:  17.5,
3159              *   heightElements: [2.5, 7.5],
3160              *   widthElements: [2.5, 7.5]
3161              * }
3162              * </pre>
3163              * 
3164              * <p>
3165              * It's important to specify a correct <b>height and width</b> for the path
3166              * as the scaling is based on the ratio between the specified height and
3167              * width in this object and the height and width that is set as scale target
3168              * (Note x,y coordinates will be scaled with individual ratios).
3169              * </p>
3170              * <p>
3171              * The '<b>heightElements</b>' and '<b>widthElements</b>' array must
3172              * contain the values that will be scaled. The scaling is based on the
3173              * computed ratios. Coordinates on the y axis should be in the
3174              * <b>heightElement</b>'s array, they will be scaled using the computed
3175              * ratio coefficient. In the parameterized path the scaled values can be
3176              * accessed through the 'e' object in {} brackets.
3177              * <ul>
3178              * <li>The values for the y axis can be accessed in the path string using
3179              * {e.y0}, {e.y1}, ....</li>
3180              * <li>The values for the x axis can be accessed in the path string using
3181              * {e.x0}, {e.x1}, ....</li>
3182              * </ul>
3183              * The numbers x0, x1 respectively y0, y1, ... map to the corresponding
3184              * array index.
3185              * </p>
3186              */
3187             this.pathMap = {
3188                 'EVENT_MESSAGE': {
3189                     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}',
3190                     height: 36,
3191                     width: 36,
3192                     heightElements: [6, 14],
3193                     widthElements: [10.5, 21]
3194                 },
3195                 'EVENT_SIGNAL': {
3196                     d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
3197                     height: 36,
3198                     width: 36,
3199                     heightElements: [18],
3200                     widthElements: [10, 20]
3201                 },
3202                 'EVENT_ESCALATION': {
3203                     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} ' +
3204                         '{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',
3205                     height: 36,
3206                     width: 36,
3207                     heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],
3208                     widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]
3209                 },
3210                 'EVENT_CONDITIONAL': {
3211                     d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
3212                         'M {e.x2},{e.y3} l {e.x0},0 ' +
3213                         'M {e.x2},{e.y4} l {e.x0},0 ' +
3214                         'M {e.x2},{e.y5} l {e.x0},0 ' +
3215                         'M {e.x2},{e.y6} l {e.x0},0 ' +
3216                         'M {e.x2},{e.y7} l {e.x0},0 ' +
3217                         'M {e.x2},{e.y8} l {e.x0},0 ',
3218                     height: 36,
3219                     width: 36,
3220                     heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
3221                     widthElements: [10.5, 14.5, 12.5]
3222                 },
3223                 'EVENT_LINK': {
3224                     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',
3225                     height: 36,
3226                     width: 36,
3227                     heightElements: [4.4375, 6.75, 7.8125],
3228                     widthElements: [9.84375, 13.5]
3229                 },
3230                 'EVENT_ERROR': {
3231                     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',
3232                     height: 36,
3233                     width: 36,
3234                     heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
3235                     widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
3236                 },
3237                 'EVENT_CANCEL_45': {
3238                     d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
3239                         '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
3240                     height: 36,
3241                     width: 36,
3242                     heightElements: [4.75, 8.5],
3243                     widthElements: [4.75, 8.5]
3244                 },
3245                 'EVENT_COMPENSATION': {
3246                     d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',
3247                     height: 36,
3248                     width: 36,
3249                     heightElements: [5, 10],
3250                     widthElements: [10]
3251                 },
3252                 'EVENT_TIMER_WH': {
3253                     d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
3254                     height: 36,
3255                     width: 36,
3256                     heightElements: [10, 2],
3257                     widthElements: [3, 7]
3258                 },
3259                 'EVENT_TIMER_LINE': {
3260                     d: 'M {mx},{my} ' +
3261                         'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
3262                     height: 36,
3263                     width: 36,
3264                     heightElements: [10, 3],
3265                     widthElements: [0, 0]
3266                 },
3267                 'EVENT_MULTIPLE': {
3268                     d: 'm {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
3269                     height: 36,
3270                     width: 36,
3271                     heightElements: [6.28099, 12.56199],
3272                     widthElements: [3.1405, 9.42149, 12.56198]
3273                 },
3274                 'EVENT_PARALLEL_MULTIPLE': {
3275                     d: 'm {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
3276                         '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
3277                     height: 36,
3278                     width: 36,
3279                     heightElements: [2.56228, 7.68683],
3280                     widthElements: [2.56228, 7.68683]
3281                 },
3282                 'GATEWAY_EXCLUSIVE': {
3283                     d: 'm {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
3284                         '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +
3285                         '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
3286                     height: 17.5,
3287                     width: 17.5,
3288                     heightElements: [8.5, 6.5312, -6.5312, -8.5],
3289                     widthElements: [6.5, -6.5, 3, -3, 5, -5]
3290                 },
3291                 'GATEWAY_PARALLEL': {
3292                     d: 'm {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
3293                         '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
3294                     height: 30,
3295                     width: 30,
3296                     heightElements: [5, 12.5],
3297                     widthElements: [5, 12.5]
3298                 },
3299                 'GATEWAY_EVENT_BASED': {
3300                     d: 'm {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
3301                     height: 11,
3302                     width: 11,
3303                     heightElements: [-6, 6, 12, -12],
3304                     widthElements: [9, -3, -12]
3305                 },
3306                 'GATEWAY_COMPLEX': {
3307                     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} ' +
3308                         '{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} ' +
3309                         '{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} ' +
3310                         '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
3311                     height: 17.125,
3312                     width: 17.125,
3313                     heightElements: [4.875, 3.4375, 2.125, 3],
3314                     widthElements: [3.4375, 2.125, 4.875, 3]
3315                 },
3316                 'DATA_OBJECT_PATH': {
3317                     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',
3318                     height: 61,
3319                     width: 51,
3320                     heightElements: [10, 50, 60],
3321                     widthElements: [10, 40, 50, 60]
3322                 },
3323                 'DATA_OBJECT_COLLECTION_PATH': {
3324                     d: 'm {mx}, {my} ' +
3325                         'm  0 15  l 0 -15 ' +
3326                         'm  4 15  l 0 -15 ' +
3327                         'm  4 15  l 0 -15 ',
3328                     height: 61,
3329                     width: 51,
3330                     heightElements: [12],
3331                     widthElements: [1, 6, 12, 15]
3332                 },
3333                 'DATA_ARROW': {
3334                     d: 'm 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
3335                     height: 61,
3336                     width: 51,
3337                     heightElements: [],
3338                     widthElements: []
3339                 },
3340                 'DATA_STORE': {
3341                     d: 'm  {mx},{my} ' +
3342                         'l  0,{e.y2} ' +
3343                         'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +
3344                         'l  0,-{e.y2} ' +
3345                         'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
3346                         'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +
3347                         'm  -{e.x2},{e.y0}' +
3348                         'c  {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +
3349                         'm  -{e.x2},{e.y0}' +
3350                         'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0',
3351                     height: 61,
3352                     width: 61,
3353                     heightElements: [7, 10, 45],
3354                     widthElements: [2, 58, 60]
3355                 },
3356                 'TEXT_ANNOTATION': {
3357                     d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
3358                     height: 30,
3359                     width: 10,
3360                     heightElements: [30],
3361                     widthElements: [10]
3362                 },
3363                 'MARKER_SUB_PROCESS': {
3364                     d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
3365                     height: 10,
3366                     width: 10,
3367                     heightElements: [],
3368                     widthElements: []
3369                 },
3370                 'MARKER_PARALLEL': {
3371                     d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
3372                     height: 10,
3373                     width: 10,
3374                     heightElements: [],
3375                     widthElements: []
3376                 },
3377                 'MARKER_SEQUENTIAL': {
3378                     d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
3379                     height: 10,
3380                     width: 10,
3381                     heightElements: [],
3382                     widthElements: []
3383                 },
3384                 'MARKER_COMPENSATION': {
3385                     d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',
3386                     height: 10,
3387                     width: 21,
3388                     heightElements: [],
3389                     widthElements: []
3390                 },
3391                 'MARKER_LOOP': {
3392                     d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +
3393                         '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
3394                         '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +
3395                         'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
3396                     height: 13.9,
3397                     width: 13.7,
3398                     heightElements: [],
3399                     widthElements: []
3400                 },
3401                 'MARKER_ADHOC': {
3402                     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 ' +
3403                         '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
3404                         '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 ' +
3405                         '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
3406                         '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',
3407                     height: 4,
3408                     width: 15,
3409                     heightElements: [],
3410                     widthElements: []
3411                 },
3412                 'TASK_TYPE_SEND': {
3413                     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}',
3414                     height: 14,
3415                     width: 21,
3416                     heightElements: [6, 14],
3417                     widthElements: [10.5, 21]
3418                 },
3419                 'TASK_TYPE_SCRIPT': {
3420                     d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
3421                         'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
3422                         'm -7,-12 l 5,0 ' +
3423                         'm -4.5,3 l 4.5,0 ' +
3424                         'm -3,3 l 5,0' +
3425                         'm -4,3 l 5,0',
3426                     height: 15,
3427                     width: 12.6,
3428                     heightElements: [6, 14],
3429                     widthElements: [10.5, 21]
3430                 },
3431                 'TASK_TYPE_USER_1': {
3432                     d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
3433                         '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
3434                         '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
3435                         'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
3436                         'm -8,6 l 0,5.5 m 11,0 l 0,-5'
3437                 },
3438                 'TASK_TYPE_USER_2': {
3439                     d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
3440                         '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
3441                 },
3442                 'TASK_TYPE_USER_3': {
3443                     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 ' +
3444                         '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
3445                         '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
3446                 },
3447                 'TASK_TYPE_MANUAL': {
3448                     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 ' +
3449                         '-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 ' +
3450                         '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 ' +
3451                         '-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 ' +
3452                         '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 ' +
3453                         '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
3454                         '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +
3455                         '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
3456                         '-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 ' +
3457                         '-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 ' +
3458                         '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 ' +
3459                         '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
3460                 },
3461                 'TASK_TYPE_INSTANTIATING_SEND': {
3462                     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'
3463                 },
3464                 'TASK_TYPE_SERVICE': {
3465                     d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
3466                         '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
3467                         '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
3468                         'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
3469                         '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
3470                         '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
3471                         '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 ' +
3472                         '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
3473                         'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
3474                         'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
3475                         '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
3476                         'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
3477                         'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
3478                         '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
3479                         '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
3480                 },
3481                 'TASK_TYPE_SERVICE_FILL': {
3482                     d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
3483                         '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
3484                         '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
3485                 },
3486                 'TASK_TYPE_BUSINESS_RULE_HEADER': {
3487                     d: 'm {mx},{my} 0,4 20,0 0,-4 z'
3488                 },
3489                 'TASK_TYPE_BUSINESS_RULE_MAIN': {
3490                     d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
3491                         'm 0,8 l 20,0 ' +
3492                         'm -13,-4 l 0,8'
3493                 },
3494                 'MESSAGE_FLOW_MARKER': {
3495                     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'
3496                 }
3497             };
3498
3499             this.getRawPath = function getRawPath(pathId) {
3500                 return this.pathMap[pathId].d;
3501             };
3502
3503             /**
3504              * Scales the path to the given height and width.
3505              * <h1>Use case</h1>
3506              * <p>
3507              * Use case is to scale the content of elements (event, gateways) based on
3508              * the element bounding box's size.
3509              * </p>
3510              * <h1>Why not transform</h1>
3511              * <p>
3512              * Scaling a path with transform() will also scale the stroke and IE does
3513              * not support the option 'non-scaling-stroke' to prevent this. Also there
3514              * are use cases where only some parts of a path should be scaled.
3515              * </p>
3516              * 
3517              * @param {String}
3518              *            pathId The ID of the path.
3519              * @param {Object}
3520              *            param
3521              *            <p>
3522              *            Example param object scales the path to 60% size of the
3523              *            container (data.width, data.height).
3524              * 
3525              * <pre>
3526              * {
3527              *  xScaleFactor : 0.6,
3528              *  yScaleFactor : 0.6,
3529              *  containerWidth : data.width,
3530              *  containerHeight : data.height,
3531              *  position : {
3532              *          mx : 0.46,
3533              *          my : 0.2,
3534              *  }
3535              * }
3536              * </pre>
3537              * 
3538              * <ul>
3539              *            <li>targetpathwidth = xScaleFactor * containerWidth</li>
3540              *            <li>targetpathheight = yScaleFactor * containerHeight</li>
3541              *            <li>Position is used to set the starting coordinate of the
3542              *            path. M is computed:
3543              *            <ul>
3544              *            <li>position.x * containerWidth</li>
3545              *            <li>position.y * containerHeight</li>
3546              *            </ul>
3547              *            Center of the container
3548              * 
3549              * <pre>
3550              *  position: {
3551              *       mx: 0.5,
3552              *       my: 0.5,
3553              *     }
3554              * </pre>
3555              * 
3556              * Upper left corner of the container
3557              * 
3558              * <pre>
3559              *  position: {
3560              *       mx: 0.0,
3561              *       my: 0.0,
3562              *     }
3563              * </pre>
3564              * 
3565              * </li>
3566              *            </ul>
3567              *            </p>
3568              * 
3569              */
3570             this.getScaledPath = function getScaledPath(pathId, param) {
3571                 var rawPath = this.pathMap[pathId];
3572
3573                 // positioning
3574                 // compute the start point of the path
3575                 var mx, my;
3576
3577                 if (!!param.abspos) {
3578                     mx = param.abspos.x;
3579                     my = param.abspos.y;
3580                 } else {
3581                     mx = param.containerWidth * param.position.mx;
3582                     my = param.containerHeight * param.position.my;
3583                 }
3584
3585                 var coordinates = {}; // map for the scaled coordinates
3586                 if (param.position) {
3587
3588                     // path
3589                     var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;
3590                     var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;
3591
3592
3593                     // Apply height ratio
3594                     for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {
3595                         coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;
3596                     }
3597
3598                     // Apply width ratio
3599                     for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {
3600                         coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
3601                     }
3602                 }
3603
3604                 // Apply value to raw path
3605                 var path = Snap.format(
3606                     rawPath.d, {
3607                         mx: mx,
3608                         my: my,
3609                         e: coordinates
3610                     }
3611                 );
3612                 return path;
3613             };
3614         }
3615
3616         module.exports = PathMap;
3617
3618     }, {
3619         "diagram-js/vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js"
3620     }],
3621     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\index.js": [function(require, module, exports) {
3622         module.exports = {
3623             renderer: ['type', require('./BpmnRenderer')],
3624             pathMap: ['type', require('./PathMap')]
3625         };
3626     }, {
3627         "./BpmnRenderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\BpmnRenderer.js",
3628         "./PathMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\PathMap.js"
3629     }],
3630     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\ContextPadProvider.js": [function(require, module, exports) {
3631         'use strict';
3632
3633
3634         var assign = require('lodash/object/assign'),
3635             forEach = require('lodash/collection/forEach');
3636
3637
3638         /**
3639          * A provider for BPMN 2.0 elements context pad
3640          */
3641         function ContextPadProvider(contextPad, modeling, elementFactory,
3642             connect, create, bpmnReplace,
3643             canvas) {
3644
3645             contextPad.registerProvider(this);
3646
3647             this._contextPad = contextPad;
3648
3649             this._modeling = modeling;
3650
3651             this._elementFactory = elementFactory;
3652             this._connect = connect;
3653             this._create = create;
3654             this._bpmnReplace = bpmnReplace;
3655             this._canvas = canvas;
3656         }
3657
3658         ContextPadProvider.$inject = [
3659             'contextPad',
3660             'modeling',
3661             'elementFactory',
3662             'connect',
3663             'create',
3664             'bpmnReplace',
3665             'canvas'
3666         ];
3667
3668         ContextPadProvider.prototype.getContextPadEntries = function(element) {
3669
3670             var contextPad = this._contextPad,
3671                 modeling = this._modeling,
3672
3673                 elementFactory = this._elementFactory,
3674                 connect = this._connect,
3675                 create = this._create,
3676                 bpmnReplace = this._bpmnReplace,
3677                 canvas = this._canvas;
3678
3679             var actions = {};
3680
3681             if (element.type === 'label') {
3682                 return actions;
3683             }
3684
3685             var bpmnElement = element.businessObject;
3686
3687             function startConnect(event, element, autoActivate) {
3688                 connect.start(event, element, autoActivate);
3689             }
3690
3691             function removeElement(e) {
3692               console.log(e);
3693                 if (element.waypoints) {
3694                     modeling.removeConnection(element);
3695                 } else {
3696                     modeling.removeShape(element);
3697                   
3698                 }
3699                 if(element.id == selected_decison_element)
3700                         {
3701                         
3702                         invisiblepropertyExplorer();
3703                         }
3704             }
3705
3706             function getReplaceMenuPosition(element) {
3707
3708                 var Y_OFFSET = 5;
3709
3710                 var diagramContainer = canvas.getContainer(),
3711                     pad = contextPad.getPad(element).html;
3712
3713                 var diagramRect = diagramContainer.getBoundingClientRect(),
3714                     padRect = pad.getBoundingClientRect();
3715
3716                 var top = padRect.top - diagramRect.top;
3717                 var left = padRect.left - diagramRect.left;
3718
3719                 var pos = {
3720                     x: left,
3721                     y: top + padRect.height + Y_OFFSET
3722                 };
3723
3724                 return pos;
3725             }
3726
3727            
3728             var change_color = function(par1,par2)
3729             {
3730                 if(isImportSchema == true){
3731
3732                         return par2/*'define-schema'*/;
3733                 }
3734                 else
3735                         {
3736                         return  par1/*'define-modify-schema'*/;
3737                         }
3738             }
3739             function appendAction(type, className, options) {
3740
3741                 function appendListener(event, element) {
3742
3743                     var shape = elementFactory.createShape(assign({
3744                         type: type
3745                     }, options));
3746                     create.start(event, shape, element);
3747                 }
3748
3749                 var shortType = type.replace(/^bpmn\:/, '');
3750
3751                 return {
3752                     group: 'model',
3753                     className: className,
3754                     title: 'Append ' + shortType,
3755                     action: {
3756                         dragstart: appendListener,
3757                         click: appendListener
3758                     }
3759                 };
3760             }
3761
3762
3763             if (bpmnElement.$instanceOf('bpmn:Gateway') || bpmnElement.$instanceOf('bpmn:MultiBranchConnector')) {
3764                 assign(actions, {
3765                     'define-path': {
3766                         group: 'DefinePath',
3767                         className: 'define-path',
3768                         title: 'Define/View Path',
3769                         action: {
3770                             click: function(event) {
3771                                                  
3772                                 if(bpmnElement.name){
3773                                                   var bpmnElementID = bpmnElement.id;
3774                                                 selected_decison_element = bpmnElementID;
3775                                                   var bpmnElementName = bpmnElement.name;
3776                                                 selected_element_name = bpmnElementName;
3777                                                   var pathIdentifiers = [];
3778                                                   
3779                                                   if (bpmnElement.outgoing) {
3780
3781                                                           var check_outgoing_names = true; 
3782                                                   forEach(bpmnElement.outgoing, function(og) {
3783                                                           
3784                                                           if(og.name && og.name.length !=0)
3785                                                                 {
3786                                                                   
3787                                                                                 pathIdentifiers.push(og.name);
3788                                                                 
3789                                                                  }
3790                                                           else
3791                                                                   {
3792                                                                 
3793                                                                                 errorProperty(bpmnElement.name+" out going path name was not entered");
3794                                                                                 check_outgoing_names=false;
3795                                                                   }
3796                                                           
3797                                                   });
3798                                                   if(check_outgoing_names)
3799                                                   {
3800                                                           
3801                                                                                 pathDetails(bpmnElementID,bpmnElementName,pathIdentifiers);
3802                                                   }
3803                                                   
3804                                                   
3805                                                         
3806                                                   }
3807                                                   else
3808                                                   {
3809                                                                         errorProperty(bpmnElement.name+' should atleast one output path was required');
3810                                                   }
3811                                                 
3812                             }
3813                                 else
3814                                         {
3815                                         errorProperty('Enter Valid Decision Name');
3816                                         }
3817                             }
3818                         }
3819                     }
3820                 });
3821             }
3822
3823             
3824
3825             if (bpmnElement.$instanceOf('bpmn:InitiateProcess')) {
3826             }
3827
3828                         if (bpmnElement.$instanceOf('bpmn:StartEvent')) {
3829             }
3830                         if (bpmnElement.$instanceOf('bpmn:Collector')) {
3831                 assign(actions, {
3832                     'Properties': {
3833                         group: 'clds',
3834                         label: 'Edit Properties',
3835                         className: 'clds-edit-properties',
3836                         title: 'Properties',
3837                         action: {
3838                             click: function(event) {
3839                                 lastElementSelected=bpmnElement.id
3840                                 CollectorsWindow(bpmnElement);
3841                             }
3842                         }
3843                     }
3844                 });
3845                                 
3846             }
3847                         if (bpmnElement.$instanceOf('bpmn:StringMatch')) {
3848                 assign(actions, {
3849                     'Properties': {
3850                         group: 'clds',
3851                         label: 'Edit Properties',
3852                         className: 'clds-edit-properties',
3853                         title: 'Properties',
3854                         action: {
3855                             click: function(event) {
3856                                 lastElementSelected=bpmnElement.id
3857                                 StringMatchWindow(bpmnElement);
3858                             }
3859                         }
3860                     }
3861                 });
3862       }
3863                         if (bpmnElement.$instanceOf('bpmn:Holmes')) {
3864                 assign(actions, {
3865                     'Properties': {
3866                         group: 'clds',
3867                         label: 'Edit Properties',
3868                         className: 'clds-edit-properties',
3869                         title: 'Properties',
3870                         action: {
3871                             click: function(event) {
3872                                 lastElementSelected=bpmnElement.id
3873                                 HolmesWindow(bpmnElement);
3874                             }
3875                         }
3876                     }
3877                 });
3878       }
3879                         if (bpmnElement.$instanceOf('bpmn:TCA')) {
3880                 assign(actions, {
3881                     'Properties': {
3882                         group: 'clds',
3883                         label: 'Edit Properties',
3884                         className: 'clds-edit-properties',
3885                         title: 'Properties',
3886                         action: {
3887                             click: function(event) {
3888                               console.log(event);
3889                                 lastElementSelected=bpmnElement.id
3890                             }
3891                         }
3892                     }
3893                 });
3894             }
3895                         if (bpmnElement.$instanceOf('bpmn:GOC')) {
3896                 assign(actions, {
3897                     'Properties': {
3898                         group: 'clds',
3899                         label: 'Edit Properties',
3900                         className: 'clds-edit-properties',
3901                         title: 'Properties',
3902                         action: {
3903                             click: function(event) {
3904                                 lastElementSelected=bpmnElement.id
3905                                 GOCWindow();
3906                             }
3907                         }
3908                     }
3909                 });
3910             }
3911                         if (bpmnElement.$instanceOf('bpmn:Policy')) {
3912                 assign(actions, {
3913                     'Properties': {
3914                         group: 'clds',
3915                         label: 'Edit Properties',
3916                         className: 'clds-edit-properties',
3917                         title: 'Properties',
3918                         action: {
3919                             click: function(event) {
3920                                 lastElementSelected=bpmnElement.id
3921                                 PolicyWindow(bpmnElement);
3922                             }
3923                         }
3924                     }
3925                 });
3926             }
3927
3928             if (bpmnElement.$instanceOf('bpmn:FlowNode') ||
3929                 bpmnElement.$instanceOf('bpmn:InteractionNode')) {
3930
3931                 assign(actions, {
3932                     'append.text-annotation': appendAction('bpmn:TextAnnotation', 'icon-text-annotation'),
3933
3934                     'connect': {
3935                         group: 'connect',
3936                         className: 'icon-connection',
3937                         title: 'Connector',
3938                         action: {
3939                             click: startConnect,
3940                             dragstart: startConnect
3941                         }
3942                     }
3943                 });
3944             }
3945                         
3946                         // Delete Element Entry
3947             assign(actions, {
3948                 'delete': {
3949                     group: 'edits',
3950                     className: 'icon-trash',
3951                     title: 'Remove',
3952                     action: {
3953                         click: removeElement,
3954                         dragstart: removeElement
3955                     }
3956                 }
3957
3958
3959
3960             });
3961
3962             return actions;
3963         };
3964
3965         function isEventType(eventBo, type, definition) {
3966
3967             var isType = eventBo.$instanceOf(type);
3968             var isDefinition = false;
3969
3970             var definitions = eventBo.eventDefinitions || [];
3971             forEach(definitions, function(def) {
3972                 if (def.$type === definition) {
3973                     isDefinition = true;
3974                 }
3975             });
3976
3977             return isType && isDefinition;
3978         }
3979
3980
3981         module.exports = ContextPadProvider;
3982
3983     }, {
3984         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
3985         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
3986     }],
3987     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\index.js": [function(require, module, exports) {
3988         module.exports = {
3989             __depends__: [
3990                 require('diagram-js-direct-editing'),
3991                 require('diagram-js/lib/features/context-pad'),
3992                 require('diagram-js/lib/features/selection'),
3993                 require('diagram-js/lib/features/connect'),
3994                 require('diagram-js/lib/features/create'),
3995                 require('../replace')
3996             ],
3997             __init__: ['contextPadProvider'],
3998             contextPadProvider: ['type', require('./ContextPadProvider')]
3999         };
4000     }, {
4001         "../replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\index.js",
4002         "./ContextPadProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\ContextPadProvider.js",
4003         "diagram-js-direct-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js",
4004         "diagram-js/lib/features/connect": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\index.js",
4005         "diagram-js/lib/features/context-pad": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\index.js",
4006         "diagram-js/lib/features/create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js",
4007         "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js"
4008     }],
4009     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\BpmnKeyBindings.js": [function(require, module, exports) {
4010         'use strict';
4011
4012
4013         function BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) {
4014                 
4015             keyboard.addListener(function(key, modifiers) {
4016                 
4017                 if (keyboard.hasModifier(modifiers)) {
4018                     return;
4019                 }
4020
4021                 // S -> activate space tool
4022                 if (key === 83) {
4023                     spaceTool.activateSelection();
4024
4025                     return true;
4026                 }
4027
4028                 // L -> activate lasso tool
4029                 if (key === 108) {
4030                     lassoTool.activateSelection();
4031
4032                     return true;
4033                 }
4034
4035                 var currentSelection = selection.get();
4036
4037                 // E -> activate direct editing
4038                 if (key === 69) {
4039                     if (currentSelection.length) {
4040                         directEditing.activate(currentSelection[0]);
4041                     }
4042
4043                     return true;
4044                 }
4045             });
4046         }
4047
4048         BpmnKeyBindings.$inject = ['keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection'];
4049
4050         module.exports = BpmnKeyBindings;
4051     }, {}],
4052     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\index.js": [function(require, module, exports) {
4053         module.exports = {
4054             __depends__: [
4055                 require('diagram-js/lib/features/keyboard')
4056             ],
4057             __init__: ['bpmnKeyBindings'],
4058             bpmnKeyBindings: ['type', require('./BpmnKeyBindings')]
4059         };
4060     }, {
4061         "./BpmnKeyBindings": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\BpmnKeyBindings.js",
4062         "diagram-js/lib/features/keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\index.js"
4063     }],
4064     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelEditingProvider.js": [function(require, module, exports) {
4065         'use strict';
4066
4067         var UpdateLabelHandler = require('./cmd/UpdateLabelHandler');
4068
4069         var LabelUtil = require('./LabelUtil');
4070
4071         var is = require('../../util/ModelUtil').is,
4072             isExpanded = require('../../util/DiUtil').isExpanded;
4073
4074         var daOriginalLabel = '';
4075
4076         var MIN_BOUNDS = {
4077             width: 150,
4078             height: 50
4079         };
4080
4081
4082         function LabelEditingProvider(eventBus, canvas, directEditing, commandStack, injector) {
4083
4084             directEditing.registerProvider(this);
4085             commandStack.registerHandler('element.updateLabel', UpdateLabelHandler);
4086
4087             // listen to dblclick on non-root elements
4088             eventBus.on('element.dblclick', function(event) {
4089                 
4090                 directEditing.activate(event.element);
4091             });
4092             
4093
4094             // complete on followup canvas operation
4095             eventBus.on(['element.mousedown', 'drag.activate', 'canvas.viewbox.changed'], function(event) {
4096                 directEditing.complete();
4097             });
4098
4099             // cancel on command stack changes
4100             eventBus.on(['commandStack.changed'], function() {
4101                 directEditing.cancel();
4102             });
4103
4104
4105             // activate direct editing for activities and text annotations
4106
4107
4108             if ('ontouchstart' in document.documentElement) {
4109                 // we deactivate automatic label editing on mobile devices
4110                 // as it breaks the user interaction workflow
4111
4112                 // TODO(nre): we should temporarily focus the edited element here
4113                 // and release the focused viewport after the direct edit operation is
4114                 // finished
4115             } else {
4116                 eventBus.on('create.end', 500, function(e) {
4117
4118                     var element = e.shape,
4119                         canExecute = e.context.canExecute;
4120
4121                     if (!canExecute) {
4122                         return;
4123                     }
4124
4125                     if (is(element, 'bpmn:Task') || is(element, 'bpmn:TextAnnotation') ||
4126                         (is(element, 'bpmn:SubProcess') && !isExpanded(element))) {
4127
4128                         directEditing.activate(element);
4129                     }
4130                 });
4131             }
4132
4133             this._canvas = canvas;
4134             this._commandStack = commandStack;
4135         }
4136
4137         LabelEditingProvider.$inject = ['eventBus', 'canvas', 'directEditing', 'commandStack', 'injector'];
4138
4139         module.exports = LabelEditingProvider;
4140
4141
4142         LabelEditingProvider.prototype.activate = function(element) {
4143
4144             var text = LabelUtil.getLabel(element);
4145
4146             if (text === undefined) {
4147                 return;
4148             }
4149
4150             daOriginalLabel = text;
4151             
4152             var bbox = this.getEditingBBox(element);
4153
4154             // adjust for expanded pools AND lanes
4155             if ((is(element, 'bpmn:Participant') && isExpanded(element)) || is(element, 'bpmn:Lane')) {
4156
4157                 bbox.width = MIN_BOUNDS.width;
4158                 bbox.height = MIN_BOUNDS.height;
4159
4160                 bbox.x = bbox.x + 10 - bbox.width / 2;
4161                 bbox.y = bbox.mid.y - bbox.height / 2;
4162             }
4163
4164             // adjust for expanded sub processes
4165             if (is(element, 'bpmn:SubProcess') && isExpanded(element)) {
4166
4167                 bbox.height = MIN_BOUNDS.height;
4168
4169                 bbox.x = bbox.mid.x - bbox.width / 2;
4170                 bbox.y = bbox.y + 10 - bbox.height / 2;
4171             }
4172
4173             return {
4174                 bounds: bbox,
4175                 text: text
4176             };
4177         };
4178
4179
4180         LabelEditingProvider.prototype.getEditingBBox = function(element, maxBounds) {
4181
4182             var target = element.label || element;
4183
4184             var bbox = this._canvas.getAbsoluteBBox(target);
4185
4186             var mid = {
4187                 x: bbox.x + bbox.width / 2,
4188                 y: bbox.y + bbox.height / 2
4189             };
4190
4191             // external label
4192             if (target.labelTarget) {
4193                 bbox.width = Math.max(bbox.width, MIN_BOUNDS.width);
4194                 bbox.height = Math.max(bbox.height, MIN_BOUNDS.height);
4195
4196                 bbox.x = mid.x - bbox.width / 2;
4197             }
4198
4199             bbox.mid = mid;
4200
4201             return bbox;
4202         };
4203
4204
4205         LabelEditingProvider.prototype.update = function(element, newLabel) {
4206                 //update conditional node
4207                 if (is(element, 'bpmn:ExclusiveGateway') || is(element, 'bpmn:MultiBranchConnector')){
4208                         updateDecisionLabel(daOriginalLabel, newLabel);
4209                 }
4210                 
4211                 this._commandStack.execute('element.updateLabel', {
4212                 element: element,
4213                 newLabel: newLabel
4214             });
4215         };
4216     }, {
4217         "../../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
4218         "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
4219         "./LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js",
4220         "./cmd/UpdateLabelHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\cmd\\UpdateLabelHandler.js"
4221     }],
4222     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js": [function(require, module, exports) {
4223         'use strict';
4224
4225         function getLabelAttr(semantic) {
4226             if (semantic.$instanceOf('bpmn:FlowElement') ||
4227                 semantic.$instanceOf('bpmn:Participant') ||
4228                 semantic.$instanceOf('bpmn:Lane') ||
4229                 semantic.$instanceOf('bpmn:SequenceFlow') ||
4230                 semantic.$instanceOf('bpmn:MessageFlow')) {
4231                 return 'name';
4232             }
4233
4234             if (semantic.$instanceOf('bpmn:TextAnnotation')) {
4235                 return 'text';
4236             }
4237         }
4238
4239         module.exports.getLabel = function(element) {
4240             var semantic = element.businessObject,
4241                 attr = getLabelAttr(semantic);
4242
4243             if (attr) {
4244                 return semantic[attr] || '';
4245             }
4246         };
4247
4248
4249         module.exports.setLabel = function(element, text) {
4250             var semantic = element.businessObject,
4251                 attr = getLabelAttr(semantic);
4252
4253             if (attr) {
4254                 semantic[attr] = text;
4255             }
4256
4257             var label = element.label || element;
4258
4259             // show label
4260             label.hidden = false;
4261
4262             return label;
4263         };
4264     }, {}],
4265     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\cmd\\UpdateLabelHandler.js": [function(require, module, exports) {
4266         'use strict';
4267
4268         var LabelUtil = require('../LabelUtil');
4269
4270
4271         /**
4272          * A handler that updates the text of a BPMN element.
4273          * 
4274          * @param {EventBus}
4275          *            eventBus
4276          */
4277         function UpdateTextHandler(eventBus) {
4278
4279             function setText(element, text) {
4280                 var label = LabelUtil.setLabel(element, text);
4281
4282                 eventBus.fire('element.changed', {
4283                     element: label
4284                 });
4285             }
4286
4287             function execute(ctx) {
4288                 ctx.oldLabel = LabelUtil.getLabel(ctx.element);
4289                 return setText(ctx.element, ctx.newLabel);
4290             }
4291
4292             function revert(ctx) {
4293                 return setText(ctx.element, ctx.oldLabel);
4294             }
4295
4296
4297             function canExecute(ctx) {
4298                 return true;
4299             }
4300
4301             // API
4302
4303             this.execute = execute;
4304             this.revert = revert;
4305
4306             this.canExecute = canExecute;
4307         }
4308
4309
4310         UpdateTextHandler.$inject = ['eventBus'];
4311
4312         module.exports = UpdateTextHandler;
4313     }, {
4314         "../LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js"
4315     }],
4316     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js": [function(require, module, exports) {
4317         module.exports = {
4318             __depends__: [
4319                 require('diagram-js/lib/command'),
4320                 require('diagram-js/lib/features/change-support'),
4321                 require('diagram-js-direct-editing')
4322             ],
4323             __init__: ['labelEditingProvider'],
4324             labelEditingProvider: ['type', require('./LabelEditingProvider')]
4325         };
4326     }, {
4327         "./LabelEditingProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelEditingProvider.js",
4328         "diagram-js-direct-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js",
4329         "diagram-js/lib/command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
4330         "diagram-js/lib/features/change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js"
4331     }],
4332     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnFactory.js": [function(require, module, exports) {
4333         'use strict';
4334
4335         var map = require('lodash/collection/map'),
4336             assign = require('lodash/object/assign'),
4337             pick = require('lodash/object/pick');
4338
4339
4340         function BpmnFactory(moddle) {
4341             this._model = moddle;
4342         }
4343
4344         BpmnFactory.$inject = ['moddle'];
4345
4346
4347         BpmnFactory.prototype._needsId = function(element) {
4348             return element.$instanceOf('bpmn:RootElement') ||
4349                 element.$instanceOf('bpmn:FlowElement') ||
4350                 element.$instanceOf('bpmn:MessageFlow') ||
4351                 element.$instanceOf('bpmn:Artifact') ||
4352                 element.$instanceOf('bpmn:Participant') ||
4353                 element.$instanceOf('bpmn:Process') ||
4354                 element.$instanceOf('bpmn:Collaboration') ||
4355                 element.$instanceOf('bpmndi:BPMNShape') ||
4356                 element.$instanceOf('bpmndi:BPMNEdge') ||
4357                 element.$instanceOf('bpmndi:BPMNDiagram') ||
4358                 element.$instanceOf('bpmndi:BPMNPlane');
4359         };
4360
4361         BpmnFactory.prototype._ensureId = function(element) {
4362
4363             // generate semantic ids for elements
4364             // bpmn:SequenceFlow -> SequenceFlow_ID
4365             var prefix = (element.$type || '').replace(/^[^:]*:/g, '') + '_';
4366
4367             if (!element.id && this._needsId(element)) {
4368                 element.id = this._model.ids.nextPrefixed(prefix, element);
4369             }
4370         };
4371
4372
4373         BpmnFactory.prototype.create = function(type, attrs) {
4374             var element = this._model.create(type, attrs || {});
4375
4376             this._ensureId(element);
4377
4378             return element;
4379         };
4380
4381
4382         BpmnFactory.prototype.createDiLabel = function() {
4383             return this.create('bpmndi:BPMNLabel', {
4384                 bounds: this.createDiBounds()
4385             });
4386         };
4387
4388
4389         BpmnFactory.prototype.createDiShape = function(semantic, bounds, attrs) {
4390
4391             return this.create('bpmndi:BPMNShape', assign({
4392                 bpmnElement: semantic,
4393                 bounds: this.createDiBounds(bounds)
4394             }, attrs));
4395         };
4396
4397
4398         BpmnFactory.prototype.createDiBounds = function(bounds) {
4399             return this.create('dc:Bounds', bounds);
4400         };
4401
4402
4403         BpmnFactory.prototype.createDiWaypoints = function(waypoints) {
4404             return map(waypoints, function(pos) {
4405                 return this.createDiWaypoint(pos);
4406             }, this);
4407         };
4408
4409         BpmnFactory.prototype.createDiWaypoint = function(point) {
4410             return this.create('dc:Point', pick(point, ['x', 'y']));
4411         };
4412
4413
4414         BpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {
4415             return this.create('bpmndi:BPMNEdge', assign({
4416                 bpmnElement: semantic
4417             }, attrs));
4418         };
4419
4420         BpmnFactory.prototype.createDiPlane = function(semantic) {
4421             return this.create('bpmndi:BPMNPlane', {
4422                 bpmnElement: semantic
4423             });
4424         };
4425
4426         module.exports = BpmnFactory;
4427
4428     }, {
4429         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
4430         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
4431         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
4432     }],
4433     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnLayouter.js": [function(require, module, exports) {
4434         'use strict';
4435
4436         var inherits = require('inherits');
4437
4438         var assign = require('lodash/object/assign');
4439
4440         var BaseLayouter = require('diagram-js/lib/layout/BaseLayouter'),
4441             LayoutUtil = require('diagram-js/lib/layout/LayoutUtil'),
4442             ManhattanLayout = require('diagram-js/lib/layout/ManhattanLayout');
4443
4444         var is = require('../../util/ModelUtil').is;
4445
4446
4447         function BpmnLayouter() {}
4448
4449         inherits(BpmnLayouter, BaseLayouter);
4450
4451         module.exports = BpmnLayouter;
4452
4453
4454         function getAttachment(waypoints, idx, shape) {
4455             var point = waypoints && waypoints[idx];
4456
4457             return point ? (point.original || point) : LayoutUtil.getMidPoint(shape);
4458         }
4459
4460
4461         BpmnLayouter.prototype.layoutConnection = function(connection, hints) {
4462             var source = connection.source,
4463                 target = connection.target,
4464                 waypoints = connection.waypoints,
4465                 start,
4466                 end;
4467
4468             var layoutManhattan,
4469                 updatedWaypoints;
4470
4471             start = getAttachment(waypoints, 0, source);
4472             end = getAttachment(waypoints, waypoints && waypoints.length - 1, target);
4473
4474             // manhattan layout sequence / message flows
4475             if (is(connection, 'bpmn:MessageFlow')) {
4476                 layoutManhattan = {
4477                     preferStraight: true,
4478                     preferVertical: true
4479                 };
4480             }
4481
4482             if (is(connection, 'bpmn:SequenceFlow')) {
4483                 layoutManhattan = {};
4484             }
4485
4486             if (layoutManhattan) {
4487
4488                 layoutManhattan = assign(layoutManhattan, hints);
4489
4490                 updatedWaypoints =
4491                     ManhattanLayout.repairConnection(
4492                         source, target, start, end,
4493                         waypoints,
4494                         layoutManhattan);
4495             }
4496
4497             return updatedWaypoints || [start, end];
4498         };
4499     }, {
4500         "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
4501         "diagram-js/lib/layout/BaseLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js",
4502         "diagram-js/lib/layout/LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
4503         "diagram-js/lib/layout/ManhattanLayout": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\ManhattanLayout.js",
4504         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4505         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4506     }],
4507     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnUpdater.js": [function(require, module, exports) {
4508         'use strict';
4509
4510         var assign = require('lodash/object/assign'),
4511             forEach = require('lodash/collection/forEach'),
4512             inherits = require('inherits');
4513
4514         var Collections = require('diagram-js/lib/util/Collections'),
4515             Model = require('diagram-js/lib/model');
4516
4517         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
4518
4519
4520         /**
4521          * A handler responsible for updating the underlying BPMN 2.0 XML + DI once
4522          * changes on the diagram happen
4523          */
4524         function BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {
4525
4526             CommandInterceptor.call(this, eventBus);
4527
4528             this._bpmnFactory = bpmnFactory;
4529
4530             var self = this;
4531
4532
4533
4534             // //// connection cropping /////////////////////////
4535
4536             // crop connection ends during create/update
4537             function cropConnection(e) {
4538                 var context = e.context,
4539                     connection;
4540
4541                 if (!context.cropped) {
4542                     connection = context.connection;
4543                     connection.waypoints = connectionDocking.getCroppedWaypoints(connection);
4544                     context.cropped = true;
4545                 }
4546             }
4547
4548             this.executed([
4549                 'connection.layout',
4550                 'connection.create',
4551                 'connection.reconnectEnd',
4552                 'connection.reconnectStart'
4553             ], cropConnection);
4554
4555             this.reverted(['connection.layout'], function(e) {
4556                 delete e.context.cropped;
4557             });
4558
4559
4560
4561             // //// BPMN + DI update /////////////////////////
4562
4563
4564             // update parent
4565             function updateParent(e) {
4566                 self.updateParent(e.context.shape || e.context.connection);
4567             }
4568
4569             this.executed(['shape.move',
4570                 'shape.create',
4571                 'shape.delete',
4572                 'connection.create',
4573                 'connection.move',
4574                 'connection.delete'
4575             ], updateParent);
4576             this.reverted(['shape.move',
4577                 'shape.create',
4578                 'shape.delete',
4579                 'connection.create',
4580                 'connection.move',
4581                 'connection.delete'
4582             ], updateParent);
4583
4584             /*
4585              * ## Updating Parent
4586              * 
4587              * When morphing a Process into a Collaboration or vice-versa, make sure
4588              * that both the *semantic* and *di* parent of each element is updated.
4589              * 
4590              */
4591             function updateRoot(event) {
4592                 var context = event.context,
4593                     oldRoot = context.oldRoot,
4594                     children = oldRoot.children;
4595
4596                 forEach(children, function(child) {
4597                     self.updateParent(child);
4598                 });
4599             }
4600
4601             this.executed(['canvas.updateRoot'], updateRoot);
4602             this.reverted(['canvas.updateRoot'], updateRoot);
4603
4604
4605             // update bounds
4606             function updateBounds(e) {
4607                 self.updateBounds(e.context.shape);
4608             }
4609
4610             this.executed(['shape.move', 'shape.create', 'shape.resize'], updateBounds);
4611             this.reverted(['shape.move', 'shape.create', 'shape.resize'], updateBounds);
4612
4613
4614             // attach / detach connection
4615             function updateConnection(e) {
4616                 self.updateConnection(e.context.connection);
4617             }
4618
4619             this.executed([
4620                 'connection.create',
4621                 'connection.move',
4622                 'connection.delete',
4623                 'connection.reconnectEnd',
4624                 'connection.reconnectStart'
4625             ], updateConnection);
4626
4627             this.reverted([
4628                 'connection.create',
4629                 'connection.move',
4630                 'connection.delete',
4631                 'connection.reconnectEnd',
4632                 'connection.reconnectStart'
4633             ], updateConnection);
4634
4635
4636             // update waypoints
4637             function updateConnectionWaypoints(e) {
4638                 self.updateConnectionWaypoints(e.context.connection);
4639             }
4640
4641             this.executed([
4642                 'connection.layout',
4643                 'connection.move',
4644                 'connection.updateWaypoints',
4645                 'connection.reconnectEnd',
4646                 'connection.reconnectStart'
4647             ], updateConnectionWaypoints);
4648
4649             this.reverted([
4650                 'connection.layout',
4651                 'connection.move',
4652                 'connection.updateWaypoints',
4653                 'connection.reconnectEnd',
4654                 'connection.reconnectStart'
4655             ], updateConnectionWaypoints);
4656         }
4657
4658         inherits(BpmnUpdater, CommandInterceptor);
4659
4660         module.exports = BpmnUpdater;
4661
4662         BpmnUpdater.$inject = ['eventBus', 'bpmnFactory', 'connectionDocking'];
4663
4664
4665         // ///// implementation //////////////////////////////////
4666
4667
4668         BpmnUpdater.prototype.updateParent = function(element) {
4669
4670             // do not update BPMN 2.0 label parent
4671             if (element instanceof Model.Label) {
4672                 return;
4673             }
4674
4675             var parentShape = element.parent;
4676
4677             var businessObject = element.businessObject,
4678                 parentBusinessObject = parentShape && parentShape.businessObject,
4679                 parentDi = parentBusinessObject && parentBusinessObject.di;
4680
4681             this.updateSemanticParent(businessObject, parentBusinessObject);
4682
4683             this.updateDiParent(businessObject.di, parentDi);
4684         };
4685
4686
4687         BpmnUpdater.prototype.updateBounds = function(shape) {
4688
4689             var di = shape.businessObject.di;
4690
4691             var bounds = (shape instanceof Model.Label) ? this._getLabel(di).bounds : di.bounds;
4692
4693             assign(bounds, {
4694                 x: shape.x,
4695                 y: shape.y,
4696                 width: shape.width,
4697                 height: shape.height
4698             });
4699         };
4700
4701
4702         BpmnUpdater.prototype.updateDiParent = function(di, parentDi) {
4703
4704             if (parentDi && !parentDi.$instanceOf('bpmndi:BPMNPlane')) {
4705                 parentDi = parentDi.$parent;
4706             }
4707
4708             if (di.$parent === parentDi) {
4709                 return;
4710             }
4711
4712             var planeElements = (parentDi || di.$parent).get('planeElement');
4713
4714             if (parentDi) {
4715                 planeElements.push(di);
4716                 di.$parent = parentDi;
4717             } else {
4718                 Collections.remove(planeElements, di);
4719                 di.$parent = null;
4720             }
4721         };
4722
4723         function getDefinitions(element) {
4724             while (element && !element.$instanceOf('bpmn:Definitions')) {
4725                 element = element.$parent;
4726             }
4727
4728             return element;
4729         }
4730
4731         BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent) {
4732
4733             var containment;
4734
4735             if (businessObject.$parent === newParent) {
4736                 return;
4737             }
4738
4739             if (businessObject.$instanceOf('bpmn:FlowElement')) {
4740
4741                 if (newParent && newParent.$instanceOf('bpmn:Participant')) {
4742                     newParent = newParent.processRef;
4743                 }
4744
4745                 containment = 'flowElements';
4746
4747             } else
4748
4749             if (businessObject.$instanceOf('bpmn:Artifact')) {
4750
4751                 while (newParent &&
4752                     !newParent.$instanceOf('bpmn:Process') &&
4753                     !newParent.$instanceOf('bpmn:SubProcess') &&
4754                     !newParent.$instanceOf('bpmn:Collaboration')) {
4755
4756                     if (newParent.$instanceOf('bpmn:Participant')) {
4757                         newParent = newParent.processRef;
4758                         break;
4759                     } else {
4760                         newParent = newParent.$parent;
4761                     }
4762                 }
4763
4764                 containment = 'artifacts';
4765             } else
4766
4767             if (businessObject.$instanceOf('bpmn:MessageFlow')) {
4768                 containment = 'messageFlows';
4769
4770             } else
4771
4772             if (businessObject.$instanceOf('bpmn:Participant')) {
4773                 containment = 'participants';
4774
4775                 // make sure the participants process is properly attached / detached
4776                 // from the XML document
4777
4778                 var process = businessObject.processRef,
4779                     definitions;
4780
4781                 if (process) {
4782                     definitions = getDefinitions(businessObject.$parent || newParent);
4783
4784                     if (businessObject.$parent) {
4785                         Collections.remove(definitions.get('rootElements'), process);
4786                         process.$parent = null;
4787                     }
4788
4789                     if (newParent) {
4790                         Collections.add(definitions.get('rootElements'), process);
4791                         process.$parent = definitions;
4792                     }
4793                 }
4794             }
4795
4796             if (!containment) {
4797                 throw new Error('no parent for ', businessObject, newParent);
4798             }
4799
4800             var children;
4801
4802             if (businessObject.$parent) {
4803                 // remove from old parent
4804                 children = businessObject.$parent.get(containment);
4805                 Collections.remove(children, businessObject);
4806             }
4807
4808             if (!newParent) {
4809                 businessObject.$parent = null;
4810             } else {
4811                 // add to new parent
4812                 children = newParent.get(containment);
4813                 children.push(businessObject);
4814                 businessObject.$parent = newParent;
4815             }
4816         };
4817
4818
4819         BpmnUpdater.prototype.updateConnectionWaypoints = function(connection) {
4820
4821             connection.businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
4822         };
4823
4824
4825         BpmnUpdater.prototype.updateConnection = function(connection) {
4826
4827             var businessObject = connection.businessObject,
4828                 newSource = connection.source && connection.source.businessObject,
4829                 newTarget = connection.target && connection.target.businessObject;
4830
4831             var inverseSet = businessObject.$instanceOf('bpmn:SequenceFlow');
4832
4833             if (businessObject.sourceRef !== newSource) {
4834                 if (inverseSet) {
4835                     Collections.remove(businessObject.sourceRef && businessObject.sourceRef.get('outgoing'), businessObject);
4836
4837                     if (newSource) {
4838                         newSource.get('outgoing').push(businessObject);
4839                     }
4840                 }
4841
4842                 businessObject.sourceRef = newSource;
4843             }
4844             if (businessObject.targetRef !== newTarget) {
4845                 if (inverseSet) {
4846                     Collections.remove(businessObject.targetRef && businessObject.targetRef.get('incoming'), businessObject);
4847
4848                     if (newTarget) {
4849                         newTarget.get('incoming').push(businessObject);
4850                     }
4851                 }
4852
4853                 businessObject.targetRef = newTarget;
4854             }
4855
4856             businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
4857         };
4858
4859
4860         // ///// helpers /////////////////////////////////////////
4861
4862         BpmnUpdater.prototype._getLabel = function(di) {
4863             if (!di.label) {
4864                 di.label = this._bpmnFactory.createDiLabel();
4865             }
4866
4867             return di.label;
4868         };
4869     }, {
4870         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
4871         "diagram-js/lib/model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js",
4872         "diagram-js/lib/util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
4873         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4874         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
4875         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4876     }],
4877     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ElementFactory.js": [function(require, module, exports) {
4878         'use strict';
4879
4880         var assign = require('lodash/object/assign'),
4881             inherits = require('inherits');
4882
4883         var BaseElementFactory = require('diagram-js/lib/core/ElementFactory'),
4884             LabelUtil = require('../../util/LabelUtil');
4885
4886
4887         /**
4888          * A bpmn-aware factory for diagram-js shapes
4889          */
4890         function ElementFactory(bpmnFactory, moddle) {
4891             BaseElementFactory.call(this);
4892
4893             this._bpmnFactory = bpmnFactory;
4894             this._moddle = moddle;
4895         }
4896
4897         inherits(ElementFactory, BaseElementFactory);
4898
4899
4900         ElementFactory.$inject = ['bpmnFactory', 'moddle'];
4901
4902         module.exports = ElementFactory;
4903
4904         ElementFactory.prototype.baseCreate = BaseElementFactory.prototype.create;
4905
4906         ElementFactory.prototype.create = function(elementType, attrs) {
4907
4908             // no special magic for labels,
4909             // we assume their businessObjects have already been created
4910             // and wired via attrs
4911             if (elementType === 'label') {
4912                 return this.baseCreate(elementType, assign({
4913                     type: 'label'
4914                 }, LabelUtil.DEFAULT_LABEL_SIZE, attrs));
4915             }
4916
4917             attrs = attrs || {};
4918
4919             var businessObject = attrs.businessObject,
4920                 size;
4921
4922             if (!businessObject) {
4923                 if (!attrs.type) {
4924                     throw new Error('no shape type specified');
4925                 }
4926
4927                 businessObject = this._bpmnFactory.create(attrs.type);
4928             }
4929
4930             if (!businessObject.di) {
4931                 if (elementType === 'root') {
4932                     businessObject.di = this._bpmnFactory.createDiPlane(businessObject, [], {
4933                         id: businessObject.id + '_di'
4934                     });
4935                 } else
4936                 if (elementType === 'connection') {
4937                     businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {
4938                         id: businessObject.id + '_di'
4939                     });
4940                 } else {
4941                     businessObject.di = this._bpmnFactory.createDiShape(businessObject, {}, {
4942                         id: businessObject.id + '_di'
4943                     });
4944                 }
4945             }
4946
4947             if (!!attrs.isExpanded) {
4948                 businessObject.di.isExpanded = attrs.isExpanded;
4949             }
4950
4951             /*
4952              * if (businessObject.$instanceOf('bpmn:ExclusiveGateway')) {
4953              * businessObject.di.isMarkerVisible = true; }
4954              */
4955
4956             if (attrs._eventDefinitionType) {
4957                 var eventDefinitions = businessObject.get('eventDefinitions') || [],
4958                     newEventDefinition = this._moddle.create(attrs._eventDefinitionType);
4959
4960                 eventDefinitions.push(newEventDefinition);
4961                 businessObject.eventDefinitions = eventDefinitions;
4962             }
4963
4964             size = this._getDefaultSize(businessObject);
4965
4966             attrs = assign({
4967                 businessObject: businessObject,
4968                 id: businessObject.id
4969             }, size, attrs);
4970
4971             return this.baseCreate(elementType, attrs);
4972         };
4973
4974
4975         ElementFactory.prototype._getDefaultSize = function(semantic) {
4976
4977             if (semantic.$instanceOf('bpmn:SubProcess')) {
4978                 var isExpanded = semantic.di.isExpanded === true;
4979
4980                 if (isExpanded) {
4981                     return {
4982                         width: 350,
4983                         height: 200
4984                     };
4985                 } else {
4986                     return {
4987                         width: 100,
4988                         height: 80
4989                     };
4990                 }
4991             }
4992
4993             if (semantic.$instanceOf('bpmn:InitiateProcess')) {
4994                 return {
4995                     width: 120,
4996                     height: 80
4997                 };
4998             }
4999             if (semantic.$instanceOf('bpmn:Collector')) {
5000                 return {
5001                     width: 120,
5002                     height: 80
5003                 };
5004             }
5005         
5006                         if (semantic.$instanceOf('bpmn:StringMatch')) {
5007                 return {
5008                     width: 120,
5009                     height: 80
5010                 };
5011       }
5012                         if (semantic.$instanceOf('bpmn:VesCollector')) {
5013                 return {
5014                     width: 120,
5015                     height: 80
5016                 };
5017             }
5018                         if (semantic.$instanceOf('bpmn:Holmes')) {
5019                 return {
5020                     width: 120,
5021                     height: 80
5022                 };
5023             }
5024                         if (semantic.$instanceOf('bpmn:TCA')) {
5025                 return {
5026                     width: 120,
5027                     height: 80
5028                 };
5029             }
5030                         
5031                         if (semantic.$instanceOf('bpmn:Policy')) {
5032                 return {
5033                     width: 120,
5034                     height: 80
5035                 };
5036             }
5037                         
5038                         if (semantic.$instanceOf('bpmn:GOC')) {
5039                 return {
5040                     width: 120,
5041                     height: 80
5042                 };
5043             }
5044             if (semantic.$instanceOf('bpmn:ParentReturn')) {
5045                 return {
5046                     width: 100,
5047                     height: 80
5048                 };
5049             }
5050             if (semantic.$instanceOf('bpmn:SubProcessCall')) {
5051                 return {
5052                     width: 100,
5053                     height: 80
5054                 };
5055             }
5056
5057             if (semantic.$instanceOf('bpmn:ExclusiveGateway')) {
5058                 return {
5059                     width: 100,
5060                     height: 80
5061                 };
5062             }
5063
5064             if (semantic.$instanceOf('bpmn:Task')) {
5065                 return {
5066                     width: 100,
5067                     height: 80
5068                 };
5069             }
5070
5071             if (semantic.$instanceOf('bpmn:Gateway')) {
5072                 return {
5073                     width: 100,
5074                     height: 100
5075                 };
5076             }
5077
5078             if (semantic.$instanceOf('bpmn:Event')) {
5079                 return {
5080                     width: 36,
5081                     height: 36
5082                 };
5083             }
5084
5085             if (semantic.$instanceOf('bpmn:Participant')) {
5086                 return {
5087                     width: 100,
5088                     height: 80
5089                 };
5090             }
5091
5092             return {
5093                 width: 100,
5094                 height: 80
5095             };
5096         };
5097
5098
5099         ElementFactory.prototype.createParticipantShape = function(collapsed) {
5100             // alert("entering createParticipantShape");
5101             var participantShape = this.createShape({
5102                 type: 'bpmn:Participant'
5103             });
5104
5105             if (!collapsed) {
5106                 participantShape.businessObject.processRef = this._bpmnFactory.create('bpmn:Process');
5107             }
5108
5109             return participantShape;
5110         };
5111     }, {
5112         "../../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
5113         "diagram-js/lib/core/ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js",
5114         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
5115         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
5116     }],
5117     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\LabelSupport.js": [function(require, module, exports) {
5118         'use strict';
5119
5120         var assign = require('lodash/object/assign'),
5121             forEach = require('lodash/collection/forEach');
5122
5123         var LabelUtil = require('../../util/LabelUtil');
5124
5125         var hasExternalLabel = LabelUtil.hasExternalLabel,
5126             getExternalLabelMid = LabelUtil.getExternalLabelMid;
5127
5128
5129         function LabelSupport(eventBus, modeling, bpmnFactory) {
5130
5131             // create external labels on shape creation
5132
5133             eventBus.on([
5134                 'commandStack.shape.create.postExecute',
5135                 'commandStack.connection.create.postExecute'
5136             ], function(e) {
5137                 var context = e.context;
5138
5139                 var element = context.shape || context.connection,
5140                     businessObject = element.businessObject;
5141
5142                 var position;
5143
5144                 if (hasExternalLabel(businessObject)) {
5145                     position = getExternalLabelMid(element);
5146                     modeling.createLabel(element, position, {
5147                         id: businessObject.id + '_label',
5148                         businessObject: businessObject
5149                     });
5150                 }
5151             });
5152
5153
5154             //move label when connection/shape is being moved
5155             //if shape is being moved, get connection as element
5156             
5157             eventBus.on(['commandStack.connection.create.postExecute',
5158                          'commandStack.connection.move.postExecute',
5159                          //'commandStack.connection.delete.postExecute',
5160                          'commandStack.connection.reconnectEnd.postExecute',
5161                          'commandStack.connection.reconnectStart.postExecute',
5162                          'commandStack.connection.updateWaypoints.postExecute',
5163                          'shape.move.end'
5164                      ],function(e){
5165                                 
5166                                 var context = e.context;
5167                                 var element;
5168                                 
5169                                 if(context.allDraggedElements != null){
5170                                         if(context.allDraggedElements.length > 0){
5171                                                 element = context.allDraggedElements[1];
5172                                         }
5173                                 }else{
5174                                         element = context.connection;
5175                                 }
5176                                 
5177                                 if(element==null){
5178                                         return;
5179                                 }
5180                 
5181                                 var businessObject = element.businessObject;
5182                                 
5183                                 if(businessObject.$type != 'bpmn:SequenceFlow'){
5184                                         return;
5185                                 }
5186                                 
5187                                 var position;
5188                 
5189                                 if (hasExternalLabel(businessObject)) {
5190                                     position = getExternalLabelMid(element);
5191                                     modeling.removeShape(element.label);
5192                                     modeling.createLabel(element, position, {
5193                                         id: businessObject.id + '_label',
5194                                         businessObject: businessObject
5195                                     });
5196                                 }
5197                 
5198             });
5199             
5200             
5201             // indicate label is dragged during move
5202
5203             // we need to add labels to the list of selected
5204             // shapes before the visuals get drawn.
5205             //
5206             // Hence this awesome magic number.
5207             //
5208             eventBus.on('shape.move.start', function(e) {
5209
5210                 var context = e.context,
5211                     shapes = context.shapes;
5212
5213                 var labels = [];
5214
5215                 forEach(shapes, function(element) {
5216                     var label = element.label;
5217
5218                     if (label && !label.hidden && context.shapes.indexOf(label) === -1) {
5219                         labels.push(label);
5220                     }
5221                 });
5222
5223                 forEach(labels, function(label) {
5224                     shapes.push(label);
5225                 });
5226             });
5227
5228
5229             // move labels with shapes
5230
5231             eventBus.on([
5232                 'commandStack.shapes.move.postExecute'
5233             ], function(e) {
5234
5235                 var context = e.context,
5236                     closure = context.closure,
5237                     enclosedElements = closure.enclosedElements;
5238
5239                 // ensure we move all labels with their respective elements
5240                 // if they have not been moved already
5241
5242                 forEach(enclosedElements, function(e) {
5243                     if (e.label && !enclosedElements[e.label.id]) {
5244                         modeling.moveShape(e.label, context.delta, e.parent);
5245                     }
5246                 });
5247             });
5248
5249
5250             // update di information on label movement and creation
5251
5252             eventBus.on([
5253                 'commandStack.label.create.executed',
5254                 'commandStack.shape.moved.executed'
5255             ], function(e) {
5256
5257                 var element = e.context.shape,
5258                     businessObject = element.businessObject,
5259                     di = businessObject.di;
5260
5261                 // we want to trigger on real labels only
5262                 if (!element.labelTarget) {
5263                     return;
5264                 }
5265
5266                 if (!di.label) {
5267                     di.label = bpmnFactory.create('bpmndi:BPMNLabel', {
5268                         bounds: bpmnFactory.create('dc:Bounds')
5269                     });
5270                 }
5271
5272                 assign(di.label.bounds, {
5273                     x: element.x,
5274                     y: element.y,
5275                     width: element.width,
5276                     height: element.height
5277                 });
5278             });
5279         }
5280
5281         LabelSupport.$inject = ['eventBus', 'modeling', 'bpmnFactory'];
5282
5283         module.exports = LabelSupport;
5284
5285     }, {
5286         "../../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
5287         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
5288         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
5289     }],
5290     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\Modeling.js": [function(require, module, exports) {
5291         'use strict';
5292
5293         var inherits = require('inherits');
5294
5295         var BaseModeling = require('diagram-js/lib/features/modeling/Modeling');
5296
5297         var UpdatePropertiesHandler = require('./cmd/UpdatePropertiesHandler'),
5298             UpdateCanvasRootHandler = require('./cmd/UpdateCanvasRootHandler');
5299
5300
5301         /**
5302          * BPMN 2.0 modeling features activator
5303          * 
5304          * @param {EventBus}
5305          *            eventBus
5306          * @param {ElementFactory}
5307          *            elementFactory
5308          * @param {CommandStack}
5309          *            commandStack
5310          * @param {BpmnRules}
5311          *            bpmnRules
5312          */
5313         function Modeling(eventBus, elementFactory, commandStack, bpmnRules) {
5314             BaseModeling.call(this, eventBus, elementFactory, commandStack);
5315
5316             this._bpmnRules = bpmnRules;
5317         }
5318
5319         inherits(Modeling, BaseModeling);
5320
5321         Modeling.$inject = ['eventBus', 'elementFactory', 'commandStack', 'bpmnRules'];
5322
5323         module.exports = Modeling;
5324
5325
5326         Modeling.prototype.getHandlers = function() {
5327             var handlers = BaseModeling.prototype.getHandlers.call(this);
5328
5329             handlers['element.updateProperties'] = UpdatePropertiesHandler;
5330             handlers['canvas.updateRoot'] = UpdateCanvasRootHandler;
5331
5332             return handlers;
5333         };
5334
5335
5336         Modeling.prototype.updateLabel = function(element, newLabel) {
5337             this._commandStack.execute('element.updateLabel', {
5338                 element: element,
5339                 newLabel: newLabel
5340             });
5341         };
5342
5343
5344         var getSharedParent = require('./ModelingUtil').getSharedParent;
5345
5346         Modeling.prototype.connect = function(source, target, attrs) {
5347
5348             var bpmnRules = this._bpmnRules;
5349
5350             if (!attrs) {
5351                 if (bpmnRules.canConnectMessageFlow(source, target)) {
5352                     attrs = {
5353                         type: 'bpmn:MessageFlow'
5354                     };
5355                 } else
5356                 if (bpmnRules.canConnectSequenceFlow(source, target)) {
5357                     attrs = {
5358                         type: 'bpmn:SequenceFlow'
5359                     };
5360                 } else {
5361                     attrs = {
5362                         type: 'bpmn:Association'
5363                     };
5364                 }
5365             }
5366
5367             return this.createConnection(source, target, attrs, getSharedParent(source, target));
5368         };
5369
5370
5371         Modeling.prototype.updateProperties = function(element, properties) {
5372             this._commandStack.execute('element.updateProperties', {
5373                 element: element,
5374                 properties: properties
5375             });
5376         };
5377
5378
5379         /**
5380          * Transform the current diagram into a collaboration.
5381          * 
5382          * @return {djs.model.Root} the new root element
5383          */
5384         Modeling.prototype.makeCollaboration = function() {
5385
5386             var collaborationElement = this._create('root', {
5387                 type: 'bpmn:Collaboration'
5388             });
5389
5390             var context = {
5391                 newRoot: collaborationElement
5392             };
5393
5394             this._commandStack.execute('canvas.updateRoot', context);
5395
5396             return collaborationElement;
5397         };
5398
5399         /**
5400          * Transform the current diagram into a process.
5401          * 
5402          * @return {djs.model.Root} the new root element
5403          */
5404         Modeling.prototype.makeProcess = function() {
5405
5406             var processElement = this._create('root', {
5407                 type: 'bpmn:Process'
5408             });
5409
5410             var context = {
5411                 newRoot: processElement
5412             };
5413
5414             this._commandStack.execute('canvas.updateRoot', context);
5415         };
5416     }, {
5417         "./ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
5418         "./cmd/UpdateCanvasRootHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdateCanvasRootHandler.js",
5419         "./cmd/UpdatePropertiesHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdatePropertiesHandler.js",
5420         "diagram-js/lib/features/modeling/Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js",
5421         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5422     }],
5423     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js": [function(require, module, exports) {
5424         'use strict';
5425
5426         var find = require('lodash/collection/find');
5427
5428
5429         function getParents(element) {
5430
5431             var parents = [];
5432
5433             while (element) {
5434                 element = element.parent;
5435
5436                 if (element) {
5437                     parents.push(element);
5438                 }
5439             }
5440
5441             return parents;
5442         }
5443
5444         module.exports.getParents = getParents;
5445
5446
5447         function getSharedParent(a, b) {
5448
5449             var parentsA = getParents(a),
5450                 parentsB = getParents(b);
5451
5452             return find(parentsA, function(parent) {
5453                 return parentsB.indexOf(parent) !== -1;
5454             });
5455         }
5456
5457         module.exports.getSharedParent = getSharedParent;
5458     }, {
5459         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js"
5460     }],
5461     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\AppendBehavior.js": [function(require, module, exports) {
5462         'use strict';
5463
5464         var inherits = require('inherits');
5465
5466         var is = require('../../../util/ModelUtil').is;
5467
5468         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5469
5470
5471         function AppendBehavior(eventBus, elementFactory, bpmnRules) {
5472
5473             CommandInterceptor.call(this, eventBus);
5474
5475             // assign correct shape position unless already set
5476
5477             this.preExecute('shape.append', function(context) {
5478
5479                 var source = context.source,
5480                     shape = context.shape;
5481
5482                 if (!context.position) {
5483
5484                     if (is(shape, 'bpmn:TextAnnotation')) {
5485                         context.position = {
5486                             x: source.x + source.width / 2 + 75,
5487                             y: source.y - (50) - shape.height / 2
5488                         };
5489                     } else {
5490                         context.position = {
5491                             x: source.x + source.width + 80 + shape.width / 2,
5492                             y: source.y + source.height / 2
5493                         };
5494                     }
5495                 }
5496             }, true);
5497         }
5498
5499
5500         AppendBehavior.$inject = ['eventBus', 'elementFactory', 'bpmnRules'];
5501
5502         inherits(AppendBehavior, CommandInterceptor);
5503
5504         module.exports = AppendBehavior;
5505     }, {
5506         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5507         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5508         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5509     }],
5510     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\CreateBehavior.js": [function(require, module, exports) {
5511         'use strict';
5512
5513         var inherits = require('inherits');
5514
5515         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5516
5517         var is = require('../../../util/ModelUtil').is;
5518
5519         /**
5520          * BPMN specific create behavior
5521          */
5522         function CreateBehavior(eventBus, modeling) {
5523
5524             CommandInterceptor.call(this, eventBus);
5525
5526
5527             /**
5528              * morph process into collaboration before adding participant onto
5529              * collaboration
5530              */
5531
5532             this.preExecute('shape.create', function(context) {
5533
5534                 var parent = context.parent,
5535                     shape = context.shape,
5536                     position = context.position;
5537
5538                 if (is(parent, 'bpmn:Process') && is(shape, 'bpmn:Participant')) {
5539
5540                     // this is going to detach the process root
5541                     // and set the returned collaboration element
5542                     // as the new root element
5543                     var collaborationElement = modeling.makeCollaboration();
5544
5545                     // monkey patch the create context
5546                     // so that the participant is being dropped
5547                     // onto the new collaboration root instead
5548                     context.position = position;
5549                     context.parent = collaborationElement;
5550
5551                     context.processRoot = parent;
5552                 }
5553             }, true);
5554
5555             this.execute('shape.create', function(context) {
5556
5557                 var processRoot = context.processRoot,
5558                     shape = context.shape;
5559
5560                 if (processRoot) {
5561                     context.oldProcessRef = shape.businessObject.processRef;
5562
5563                     // assign the participant processRef
5564                     shape.businessObject.processRef = processRoot.businessObject;
5565                 }
5566             }, true);
5567
5568             this.revert('shape.create', function(context) {
5569                 var processRoot = context.processRoot,
5570                     shape = context.shape;
5571
5572                 if (processRoot) {
5573                     // assign the participant processRef
5574                     shape.businessObject.processRef = context.oldProcessRef;
5575                 }
5576             }, true);
5577
5578             this.postExecute('shape.create', function(context) {
5579                                 
5580                 var processRoot = context.processRoot,
5581                     shape = context.shape;
5582
5583                 if (processRoot) {
5584                     // process root is already detached at this point
5585                     var processChildren = processRoot.children.slice();
5586                     modeling.moveShapes(processChildren, {
5587                         x: 0,
5588                         y: 0
5589                     }, shape);
5590                 }
5591                                 //console.log(context.shape.id);
5592                                 //newElementProcessor(context.shape.id);
5593                                 //console.log(context)
5594             }, true);
5595                         
5596         }
5597
5598         CreateBehavior.$inject = ['eventBus', 'modeling'];
5599
5600         inherits(CreateBehavior, CommandInterceptor);
5601
5602         module.exports = CreateBehavior;
5603     }, {
5604         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5605         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5606         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5607     }],
5608     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\DropBehavior.js": [function(require, module, exports) {
5609         'use strict';
5610
5611         var forEach = require('lodash/collection/forEach'),
5612             inherits = require('inherits');
5613
5614         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5615
5616         var is = require('../../../util/ModelUtil').is,
5617             getSharedParent = require('../ModelingUtil').getSharedParent;
5618
5619
5620         function DropBehavior(eventBus, modeling, bpmnRules) {
5621
5622             CommandInterceptor.call(this, eventBus);
5623
5624             // remove sequence flows that should not be allowed
5625             // after a move operation
5626
5627             this.postExecute('shapes.move', function(context) {
5628
5629                 var closure = context.closure,
5630                     allConnections = closure.allConnections;
5631
5632                 forEach(allConnections, function(c) {
5633
5634                     var source = c.source,
5635                         target = c.target;
5636
5637                     var replacementType,
5638                         remove;
5639
5640                     /**
5641                      * Check if incoming or outgoing connections can stay or could be
5642                      * substituted with an appropriate replacement.
5643                      * 
5644                      * This holds true for SequenceFlow <> MessageFlow.
5645                      */
5646
5647                     if (is(c, 'bpmn:SequenceFlow')) {
5648                         if (!bpmnRules.canConnectSequenceFlow(source, target)) {
5649                             remove = true;
5650                         }
5651
5652                         if (bpmnRules.canConnectMessageFlow(source, target)) {
5653                             replacementType = 'bpmn:MessageFlow';
5654                         }
5655                     }
5656
5657                     // transform message flows into sequence flows, if possible
5658
5659                     if (is(c, 'bpmn:MessageFlow')) {
5660
5661                         if (!bpmnRules.canConnectMessageFlow(source, target)) {
5662                             remove = true;
5663                         }
5664
5665                         if (bpmnRules.canConnectSequenceFlow(source, target)) {
5666                             replacementType = 'bpmn:SequenceFlow';
5667                         }
5668                     }
5669
5670                     if (is(c, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) {
5671                         remove = true;
5672                     }
5673
5674
5675                     // remove invalid connection
5676                     if (remove) {
5677                         modeling.removeConnection(c);
5678                     }
5679
5680                     // replace SequenceFlow <> MessageFlow
5681
5682                     if (replacementType) {
5683                         modeling.createConnection(source, target, {
5684                             type: replacementType,
5685                             waypoints: c.waypoints.slice()
5686                         }, getSharedParent(source, target));
5687                     }
5688                 });
5689             }, true);
5690         }
5691
5692         inherits(DropBehavior, CommandInterceptor);
5693
5694         DropBehavior.$inject = ['eventBus', 'modeling', 'bpmnRules'];
5695
5696         module.exports = DropBehavior;
5697     }, {
5698         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5699         "../ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
5700         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5701         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
5702         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
5703     }],
5704     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\ModelingFeedback.js": [function(require, module, exports) {
5705         'use strict';
5706
5707         var is = require('../../../util/ModelUtil').is;
5708
5709
5710         function ModelingFeedback(eventBus, tooltips) {
5711
5712             function showError(position, message) {
5713                 tooltips.add({
5714                     position: {
5715                         x: position.x + 5,
5716                         y: position.y + 5
5717                     },
5718                     type: 'error',
5719                     timeout: 2000,
5720                     html: '<div>' + message + '</div>'
5721                 });
5722             }
5723
5724             eventBus.on(['shape.move.rejected', 'create.rejected'], function(event) {
5725
5726                 var context = event.context,
5727                     shape = context.shape,
5728                     target = context.target;
5729
5730                 if (is(target, 'bpmn:Collaboration') && is(shape, 'bpmn:FlowNode')) {
5731                     showError(event, 'flow elements must be children of pools/participants');
5732                 }
5733             });
5734
5735         }
5736
5737
5738         ModelingFeedback.$inject = ['eventBus', 'tooltips'];
5739
5740         module.exports = ModelingFeedback;
5741     }, {
5742         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js"
5743     }],
5744     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\RemoveBehavior.js": [function(require, module, exports) {
5745         'use strict';
5746
5747         var inherits = require('inherits');
5748
5749         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5750
5751         var is = require('../../../util/ModelUtil').is;
5752
5753
5754         /**
5755          * BPMN specific remove behavior
5756          */
5757         function RemoveBehavior(eventBus, modeling) {
5758
5759             CommandInterceptor.call(this, eventBus);
5760
5761
5762             /**
5763              * morph collaboration diagram into process diagram after the last
5764              * participant has been removed
5765              */
5766
5767             this.preExecute('shape.delete', function(context) {
5768                                 //delete elementMap[context.shape.id];
5769                                 //console.log(context.shape.id);
5770                 var shape = context.shape,
5771                     parent = shape.parent;
5772
5773                 // activate the behavior if the shape to be removed
5774                 // is a participant
5775                 if (is(shape, 'bpmn:Participant')) {
5776                     context.collaborationRoot = parent;
5777                 }
5778             }, true);
5779
5780             this.postExecute('shape.delete', function(context) {
5781
5782                 var collaborationRoot = context.collaborationRoot;
5783
5784                 if (collaborationRoot && !collaborationRoot.businessObject.participants.length) {
5785                     // replace empty collaboration with process diagram
5786                     modeling.makeProcess();
5787                 }
5788             }, true);
5789
5790         }
5791
5792         RemoveBehavior.$inject = ['eventBus', 'modeling'];
5793
5794         inherits(RemoveBehavior, CommandInterceptor);
5795
5796         module.exports = RemoveBehavior;
5797     }, {
5798         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5799         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5800         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5801     }],
5802     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\index.js": [function(require, module, exports) {
5803         module.exports = {
5804             __init__: [
5805                 'appendBehavior',
5806                 'createBehavior',
5807                 'dropBehavior',
5808                 'removeBehavior',
5809                 'modelingFeedback'
5810             ],
5811             appendBehavior: ['type', require('./AppendBehavior')],
5812             dropBehavior: ['type', require('./DropBehavior')],
5813             createBehavior: ['type', require('./CreateBehavior')],
5814             removeBehavior: ['type', require('./RemoveBehavior')],
5815             modelingFeedback: ['type', require('./ModelingFeedback')]
5816         };
5817     }, {
5818         "./AppendBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\AppendBehavior.js",
5819         "./CreateBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\CreateBehavior.js",
5820         "./DropBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\DropBehavior.js",
5821         "./ModelingFeedback": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\ModelingFeedback.js",
5822         "./RemoveBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\RemoveBehavior.js"
5823     }],
5824     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdateCanvasRootHandler.js": [function(require, module, exports) {
5825         'use strict';
5826
5827         var Collections = require('diagram-js/lib/util/Collections');
5828
5829
5830         function UpdateCanvasRootHandler(canvas, modeling) {
5831             this._canvas = canvas;
5832             this._modeling = modeling;
5833         }
5834
5835         UpdateCanvasRootHandler.$inject = ['canvas', 'modeling'];
5836
5837         module.exports = UpdateCanvasRootHandler;
5838
5839
5840         UpdateCanvasRootHandler.prototype.execute = function(context) {
5841
5842             var canvas = this._canvas;
5843
5844             var newRoot = context.newRoot,
5845                 newRootBusinessObject = newRoot.businessObject,
5846                 oldRoot = canvas.getRootElement(),
5847                 oldRootBusinessObject = oldRoot.businessObject,
5848                 bpmnDefinitions = oldRootBusinessObject.$parent,
5849                 diPlane = oldRootBusinessObject.di;
5850
5851             // (1) replace process old <> new root
5852             canvas.setRootElement(newRoot, true);
5853
5854             // (2) update root elements
5855             Collections.add(bpmnDefinitions.rootElements, newRootBusinessObject);
5856             newRootBusinessObject.$parent = bpmnDefinitions;
5857
5858             Collections.remove(bpmnDefinitions.rootElements, oldRootBusinessObject);
5859             oldRootBusinessObject.$parent = null;
5860
5861             // (3) wire di
5862             oldRootBusinessObject.di = null;
5863
5864             diPlane.bpmnElement = newRootBusinessObject;
5865             newRootBusinessObject.di = diPlane;
5866
5867             context.oldRoot = oldRoot;
5868         };
5869
5870
5871         UpdateCanvasRootHandler.prototype.revert = function(context) {
5872
5873             var canvas = this._canvas;
5874
5875             var newRoot = context.newRoot,
5876                 newRootBusinessObject = newRoot.businessObject,
5877                 oldRoot = context.oldRoot,
5878                 oldRootBusinessObject = oldRoot.businessObject,
5879                 bpmnDefinitions = newRootBusinessObject.$parent,
5880                 diPlane = newRootBusinessObject.di;
5881
5882             // (1) replace process old <> new root
5883             canvas.setRootElement(oldRoot, true);
5884
5885             // (2) update root elements
5886             Collections.remove(bpmnDefinitions.rootElements, newRootBusinessObject);
5887             newRootBusinessObject.$parent = null;
5888
5889             Collections.add(bpmnDefinitions.rootElements, oldRootBusinessObject);
5890             oldRootBusinessObject.$parent = bpmnDefinitions;
5891
5892             // (3) wire di
5893             newRootBusinessObject.di = null;
5894
5895             diPlane.bpmnElement = oldRootBusinessObject;
5896             oldRootBusinessObject.di = diPlane;
5897         };
5898     }, {
5899         "diagram-js/lib/util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
5900     }],
5901     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdatePropertiesHandler.js": [function(require, module, exports) {
5902         'use strict';
5903
5904         var assign = require('lodash/object/assign'),
5905             pick = require('lodash/object/pick'),
5906             keys = require('lodash/object/keys');
5907
5908         var DEFAULT_FLOW = 'default',
5909             NAME = 'name',
5910             ID = 'id';
5911
5912
5913         /**
5914          * A handler that implements a BPMN 2.0 property update.
5915          * 
5916          * This should be used to set simple properties on elements with an underlying
5917          * BPMN business object.
5918          * 
5919          * Use respective diagram-js provided handlers if you would like to perform
5920          * automated modeling.
5921          */
5922         function UpdatePropertiesHandler(elementRegistry) {
5923             this._elementRegistry = elementRegistry;
5924         }
5925
5926         UpdatePropertiesHandler.$inject = ['elementRegistry'];
5927
5928         module.exports = UpdatePropertiesHandler;
5929
5930
5931         // //// api /////////////////////////////////////////////
5932
5933         /**
5934          * Updates a BPMN element with a list of new properties
5935          * 
5936          * @param {Object}
5937          *            context
5938          * @param {djs.model.Base}
5939          *            context.element the element to update
5940          * @param {Object}
5941          *            context.properties a list of properties to set on the element's
5942          *            businessObject (the BPMN model element)
5943          * 
5944          * @return {Array<djs.mode.Base>} the updated element
5945          */
5946         UpdatePropertiesHandler.prototype.execute = function(context) {
5947
5948             var element = context.element,
5949                 changed = [element];
5950
5951             if (!element) {
5952                 throw new Error('element required');
5953             }
5954
5955             var elementRegistry = this._elementRegistry;
5956
5957             var businessObject = element.businessObject,
5958                 properties = context.properties,
5959                 oldProperties = context.oldProperties || pick(businessObject, keys(properties));
5960
5961             if (ID in properties) {
5962                 elementRegistry.updateId(element, properties[ID]);
5963             }
5964
5965             // correctly indicate visual changes on default flow updates
5966             if (DEFAULT_FLOW in properties) {
5967
5968                 if (properties[DEFAULT_FLOW]) {
5969                     changed.push(elementRegistry.get(properties[DEFAULT_FLOW].id));
5970                 }
5971
5972                 if (businessObject[DEFAULT_FLOW]) {
5973                     changed.push(elementRegistry.get(businessObject[DEFAULT_FLOW].id));
5974                 }
5975             }
5976
5977             if (NAME in properties && element.label) {
5978                 changed.push(element.label);
5979             }
5980
5981             // update properties
5982             assign(businessObject, properties);
5983
5984
5985             // store old values
5986             context.oldProperties = oldProperties;
5987             context.changed = changed;
5988
5989             // indicate changed on objects affected by the update
5990             return changed;
5991         };
5992
5993         /**
5994          * Reverts the update on a BPMN elements properties.
5995          * 
5996          * @param {Object}
5997          *            context
5998          * 
5999          * @return {djs.mode.Base} the updated element
6000          */
6001         UpdatePropertiesHandler.prototype.revert = function(context) {
6002
6003             var element = context.element,
6004                 oldProperties = context.oldProperties,
6005                 businessObject = element.businessObject,
6006                 elementRegistry = this._elementRegistry;
6007
6008             assign(businessObject, context.oldProperties);
6009
6010             if (ID in oldProperties) {
6011                 elementRegistry.updateId(element, oldProperties[ID]);
6012             }
6013
6014             return context.changed;
6015         };
6016     }, {
6017         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
6018         "lodash/object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
6019         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
6020     }],
6021     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\index.js": [function(require, module, exports) {
6022         module.exports = {
6023             __init__: ['modeling', 'bpmnUpdater', 'labelSupport'],
6024             __depends__: [
6025                 require('../label-editing'),
6026                 require('./rules'),
6027                 require('./behavior'),
6028                 require('diagram-js/lib/command'),
6029                 require('diagram-js/lib/features/tooltips'),
6030                 require('diagram-js/lib/features/change-support')
6031             ],
6032             bpmnFactory: ['type', require('./BpmnFactory')],
6033             bpmnUpdater: ['type', require('./BpmnUpdater')],
6034             elementFactory: ['type', require('./ElementFactory')],
6035             modeling: ['type', require('./Modeling')],
6036             labelSupport: ['type', require('./LabelSupport')],
6037             layouter: ['type', require('./BpmnLayouter')],
6038             connectionDocking: ['type', require('diagram-js/lib/layout/CroppingConnectionDocking')]
6039         };
6040
6041     }, {
6042         "../label-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js",
6043         "./BpmnFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnFactory.js",
6044         "./BpmnLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnLayouter.js",
6045         "./BpmnUpdater": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnUpdater.js",
6046         "./ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ElementFactory.js",
6047         "./LabelSupport": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\LabelSupport.js",
6048         "./Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\Modeling.js",
6049         "./behavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\index.js",
6050         "./rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\index.js",
6051         "diagram-js/lib/command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
6052         "diagram-js/lib/features/change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js",
6053         "diagram-js/lib/features/tooltips": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\index.js",
6054         "diagram-js/lib/layout/CroppingConnectionDocking": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\CroppingConnectionDocking.js"
6055     }],
6056     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\BpmnRules.js": [function(require, module, exports) {
6057         'use strict';
6058
6059         var groupBy = require('lodash/collection/groupBy'),
6060             size = require('lodash/collection/size'),
6061             find = require('lodash/collection/find'),
6062             inherits = require('inherits');
6063
6064         var getParents = require('../ModelingUtil').getParents,
6065             is = require('../../../util/ModelUtil').is,
6066             getBusinessObject = require('../../../util/ModelUtil').getBusinessObject,
6067             isExpanded = require('../../../util/DiUtil').isExpanded;
6068
6069
6070         var RuleProvider = require('diagram-js/lib/features/rules/RuleProvider');
6071
6072         /**
6073          * BPMN specific modeling rule
6074          */
6075         function BpmnRules(eventBus) {
6076             RuleProvider.call(this, eventBus);
6077         }
6078
6079         inherits(BpmnRules, RuleProvider);
6080
6081         BpmnRules.$inject = ['eventBus'];
6082
6083         module.exports = BpmnRules;
6084
6085         BpmnRules.prototype.init = function() {
6086
6087             this.addRule('connection.create', function(context) {
6088                 var source = context.source,
6089                     target = context.target;
6090
6091                 return canConnect(source, target);
6092             });
6093
6094             this.addRule('connection.reconnectStart', function(context) {
6095
6096                 var connection = context.connection,
6097                     source = context.hover || context.source,
6098                     target = connection.target;
6099
6100                 return canConnect(source, target, connection);
6101             });
6102
6103             this.addRule('connection.reconnectEnd', function(context) {
6104
6105                 var connection = context.connection,
6106                     source = connection.source,
6107                     target = context.hover || context.target;
6108
6109                 return canConnect(source, target, connection);
6110             });
6111
6112             this.addRule('connection.updateWaypoints', function(context) {
6113                 // OK! but visually ignore
6114                 return null;
6115             });
6116
6117             this.addRule('shape.resize', function(context) {
6118
6119                 var shape = context.shape,
6120                     newBounds = context.newBounds;
6121
6122                 return canResize(shape, newBounds);
6123             });
6124
6125             this.addRule('shapes.move', function(context) {
6126
6127                 var target = context.newParent,
6128                     shapes = context.shapes;
6129
6130                 return canMove(shapes, target);
6131             });
6132
6133             this.addRule(['shape.create', 'shape.append'], function(context) {
6134                 var target = context.parent,
6135                     shape = context.shape,
6136                     source = context.source;
6137
6138                 return canCreate(shape, target, source);
6139             });
6140
6141         };
6142
6143         BpmnRules.prototype.canConnectMessageFlow = canConnectMessageFlow;
6144
6145         BpmnRules.prototype.canConnectSequenceFlow = canConnectSequenceFlow;
6146
6147         BpmnRules.prototype.canConnectAssociation = canConnectAssociation;
6148
6149         BpmnRules.prototype.canMove = canMove;
6150
6151         BpmnRules.prototype.canDrop = canDrop;
6152
6153         BpmnRules.prototype.canCreate = canCreate;
6154
6155         BpmnRules.prototype.canConnect = canConnect;
6156
6157         BpmnRules.prototype.canResize = canResize;
6158
6159         /**
6160          * Utility functions for rule checking
6161          */
6162
6163         function nonExistantOrLabel(element) {
6164             return !element || isLabel(element);
6165         }
6166
6167         function isSame(a, b) {
6168             return a === b;
6169         }
6170
6171         function getOrganizationalParent(element) {
6172
6173             var bo = getBusinessObject(element);
6174
6175             while (bo && !is(bo, 'bpmn:Process')) {
6176                 if (is(bo, 'bpmn:Participant')) {
6177                     return bo.processRef || bo;
6178                 }
6179
6180                 bo = bo.$parent;
6181             }
6182
6183             return bo;
6184         }
6185
6186         function isSameOrganization(a, b) {
6187             var parentA = getOrganizationalParent(a),
6188                 parentB = getOrganizationalParent(b);
6189
6190             return parentA === parentB;
6191         }
6192
6193         function isMessageFlowSource(element) {
6194             return is(element, 'bpmn:InteractionNode') && (!is(element, 'bpmn:Event') || (
6195                 is(element, 'bpmn:ThrowEvent') &&
6196                 hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
6197             ));
6198         }
6199
6200         function isMessageFlowTarget(element) {
6201             return is(element, 'bpmn:InteractionNode') && (!is(element, 'bpmn:Event') || (
6202                 is(element, 'bpmn:CatchEvent') &&
6203                 hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
6204             ));
6205         }
6206
6207         function getScopeParent(element) {
6208
6209             var bo = getBusinessObject(element);
6210
6211             if (is(bo, 'bpmn:Participant')) {
6212                 return null;
6213             }
6214
6215             while (bo) {
6216                 bo = bo.$parent;
6217
6218                 if (is(bo, 'bpmn:FlowElementsContainer')) {
6219                     return bo;
6220                 }
6221             }
6222
6223             return bo;
6224         }
6225
6226         function isSameScope(a, b) {
6227             var scopeParentA = getScopeParent(a),
6228                 scopeParentB = getScopeParent(b);
6229
6230             return scopeParentA && (scopeParentA === scopeParentB);
6231         }
6232
6233         function hasEventDefinition(element, eventDefinition) {
6234             var bo = getBusinessObject(element);
6235
6236             return !!find(bo.eventDefinitions || [], function(definition) {
6237                 return is(definition, eventDefinition);
6238             });
6239         }
6240
6241         function hasEventDefinitionOrNone(element, eventDefinition) {
6242             var bo = getBusinessObject(element);
6243
6244             return (bo.eventDefinitions || []).every(function(definition) {
6245                 return is(definition, eventDefinition);
6246             });
6247         }
6248
6249         function isSequenceFlowSource(element) {
6250             return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:EndEvent') && !(
6251                 is(element, 'bpmn:IntermediateThrowEvent') &&
6252                 hasEventDefinition(element, 'bpmn:LinkEventDefinition')
6253             );
6254         }
6255
6256         function isSequenceFlowTarget(element) {
6257             return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:StartEvent') && !(
6258                 is(element, 'bpmn:IntermediateCatchEvent') &&
6259                 hasEventDefinition(element, 'bpmn:LinkEventDefinition')
6260             );
6261         }
6262
6263         function isEventBasedTarget(element) {
6264             return is(element, 'bpmn:ReceiveTask') || (
6265                 is(element, 'bpmn:IntermediateCatchEvent') && (
6266                     hasEventDefinition(element, 'bpmn:MessageEventDefinition') ||
6267                     hasEventDefinition(element, 'bpmn:TimerEventDefinition') ||
6268                     hasEventDefinition(element, 'bpmn:ConditionalEventDefinition') ||
6269                     hasEventDefinition(element, 'bpmn:SignalEventDefinition')
6270                 )
6271             );
6272         }
6273
6274         function isLabel(element) {
6275             return element.labelTarget;
6276         }
6277
6278         function isConnection(element) {
6279             return element.waypoints;
6280         }
6281
6282         function isParent(possibleParent, element) {
6283             var allParents = getParents(element);
6284             return allParents.indexOf(possibleParent) !== -1;
6285         }
6286
6287         function canConnect(source, target, connection) {
6288
6289             if (nonExistantOrLabel(source) || nonExistantOrLabel(target)) {
6290                 return null;
6291             }
6292
6293             // See https://github.com/bpmn-io/bpmn-js/issues/178
6294             // as a workround we disallow connections with same
6295             // target and source element.
6296             // This rule must be removed if a auto layout for this
6297             // connections is implemented.
6298             if (isSame(source, target)) {
6299                 return false;
6300             }
6301
6302             if (canConnectMessageFlow(source, target) ||
6303                 canConnectSequenceFlow(source, target)) {
6304
6305                 return true;
6306             }
6307
6308             if (is(connection, 'bpmn:Association')) {
6309                 return canConnectAssociation(source, target);
6310             }
6311
6312             return false;
6313         }
6314
6315         /**
6316          * Can an element be dropped into the target element
6317          * 
6318          * @return {Boolean}
6319          */
6320         function canDrop(element, target) {
6321
6322             // can move labels everywhere
6323             if (isLabel(element) && !isConnection(target)) {
6324                 return true;
6325             }
6326
6327             // allow to create new participants on
6328             // on existing collaboration and process diagrams
6329             if (is(element, 'bpmn:Participant')) {
6330                 return is(target, 'bpmn:Process') || is(target, 'bpmn:Collaboration');
6331             }
6332
6333             // drop flow elements onto flow element containers
6334             // and participants
6335             if (is(element, 'bpmn:FlowElement')) {
6336                 if (is(target, 'bpmn:FlowElementsContainer')) {
6337                     return isExpanded(target) !== false;
6338                 }
6339
6340                 return is(target, 'bpmn:Participant');
6341             }
6342
6343             if (is(element, 'bpmn:Artifact')) {
6344                 return is(target, 'bpmn:Collaboration') ||
6345                     is(target, 'bpmn:Participant') ||
6346                     is(target, 'bpmn:Process');
6347             }
6348
6349             if (is(element, 'bpmn:MessageFlow')) {
6350                 return is(target, 'bpmn:Collaboration');
6351             }
6352
6353             return false;
6354         }
6355
6356         function canMove(elements, target) {
6357
6358             // only move if they have the same parent
6359             var sameParent = size(groupBy(elements, function(s) {
6360                 return s.parent && s.parent.id;
6361             })) === 1;
6362
6363             if (!sameParent) {
6364                 return false;
6365             }
6366
6367             if (!target) {
6368                 return true;
6369             }
6370
6371             return elements.every(function(element) {
6372                 return canDrop(element, target);
6373             });
6374         }
6375
6376         function canCreate(shape, target, source) {
6377
6378             if (!target) {
6379                 return false;
6380             }
6381
6382             if (isLabel(target)) {
6383                 return null;
6384             }
6385
6386             if (isSame(source, target)) {
6387                 return false;
6388             }
6389
6390             // ensure we do not drop the element
6391             // into source
6392             if (source && isParent(source, target)) {
6393                 return false;
6394             }
6395
6396             return canDrop(shape, target);
6397         }
6398
6399         function canResize(shape, newBounds) {
6400             if (is(shape, 'bpmn:SubProcess')) {
6401                 return isExpanded(shape) && (!newBounds || (newBounds.width >= 100 && newBounds.height >= 80));
6402             }
6403
6404             if (is(shape, 'bpmn:Participant')) {
6405                 return !newBounds || (newBounds.width >= 100 && newBounds.height >= 80);
6406             }
6407
6408             if (is(shape, 'bpmn:TextAnnotation')) {
6409                 return true;
6410             }
6411             if (is(shape, 'bpmn:MultiBranchConnector')) {
6412                 return false;
6413             }
6414
6415             return true;
6416         }
6417
6418         function canConnectAssociation(source, target) {
6419
6420             // do not connect connections
6421             if (isConnection(source) || isConnection(target)) {
6422                 return false;
6423             }
6424
6425             // connect if different parent
6426             return !isParent(target, source) &&
6427                 !isParent(source, target);
6428         }
6429
6430         function canConnectMessageFlow(source, target) {
6431
6432             return isMessageFlowSource(source) &&
6433                 isMessageFlowTarget(target) &&
6434                 !isSameOrganization(source, target);
6435         }
6436
6437         function canConnectSequenceFlow(source, target) {
6438
6439             return isSequenceFlowSource(source) &&
6440                 isSequenceFlowTarget(target) &&
6441                 isSameScope(source, target) &&
6442                 !(is(source, 'bpmn:EventBasedGateway') && !isEventBasedTarget(target));
6443         }
6444     }, {
6445         "../../../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
6446         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
6447         "../ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
6448         "diagram-js/lib/features/rules/RuleProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\RuleProvider.js",
6449         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
6450         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
6451         "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
6452         "lodash/collection/size": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\size.js"
6453     }],
6454     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\index.js": [function(require, module, exports) {
6455         module.exports = {
6456             __depends__: [
6457                 require('diagram-js/lib/features/rules')
6458             ],
6459             __init__: ['bpmnRules'],
6460             bpmnRules: ['type', require('./BpmnRules')]
6461         };
6462
6463     }, {
6464         "./BpmnRules": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\BpmnRules.js",
6465         "diagram-js/lib/features/rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js"
6466     }],
6467     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\PaletteProvider.js": [function(require, module, exports) {
6468         'use strict';
6469
6470         var assign = require('lodash/object/assign');
6471
6472         /**
6473          * A palette provider for BPMN 2.0 elements.
6474          */
6475         function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) {
6476
6477             this._create = create;
6478             this._elementFactory = elementFactory;
6479             this._spaceTool = spaceTool;
6480             this._lassoTool = lassoTool;
6481
6482             palette.registerProvider(this);
6483         }
6484
6485         module.exports = PaletteProvider;
6486
6487         PaletteProvider.$inject = ['palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool'];
6488
6489
6490         PaletteProvider.prototype.getPaletteEntries = function(element) {
6491
6492             var actions = {},
6493                 create = this._create,
6494                 elementFactory = this._elementFactory,
6495                 spaceTool = this._spaceTool,
6496                 lassoTool = this._lassoTool;
6497
6498
6499             function createAction(type, group, className, title, options) {
6500                 function createListener(event) {
6501                     var shape = elementFactory.createShape(assign({
6502                         type: type
6503                     }, options));
6504
6505                     if (options) {
6506                         shape.businessObject.di.isExpanded = options.isExpanded;
6507                     }
6508
6509                     create.start(event, shape);
6510                 }
6511
6512                 var shortType = type.replace(/^bpmn\:/, '');
6513
6514                 return {
6515                     group: group,
6516                     className: className,
6517                     title: title || 'Create ' + shortType,
6518                     action: {
6519                         dragstart: createListener,
6520                         click: createListener
6521                     }
6522                 };
6523             }
6524
6525             function createParticipant(event, collapsed) {
6526                 create.start(event, elementFactory.createParticipantShape(collapsed));
6527             }
6528
6529             assign(actions, {
6530                 'create.start-event': createAction(
6531                     'bpmn:StartEvent', 'event', 'icon-start-event-none', "Start"
6532                 ),
6533                 'create.collector': createAction(
6534                         'bpmn:Collector', 'event', 'icon-collector-node', 'Collector'
6535                     ),
6536                                         'create.String-Match': createAction(
6537                         'bpmn:StringMatch', 'event', 'icon-stringmatch-node', 'String Match'
6538           ),
6539                                         'create.ves-collector': createAction(
6540                         'bpmn:VesCollector', 'event', 'icon-ves-collector-node', 'Ves Collector'
6541           ),
6542                                         'create.holmes': createAction(
6543                         'bpmn:Holmes', 'event', 'icon-holmes-node', 'Holmes'
6544           ),
6545
6546                 
6547                     'create.TCA': createAction(
6548                         'bpmn:TCA', 'event', 'icon-tca-node', 'TCA'
6549                     ),
6550                                         'create.Aand-AI': createAction(
6551                         'bpmn:Policy', 'event', 'icon-policy-node', 'Policy'
6552                     ),
6553                 'create.end-event': createAction(
6554                     'bpmn:EndEvent', 'event', 'icon-end-event-none', "End"
6555                 )
6556             });
6557
6558             return actions;
6559         };
6560
6561     }, {
6562         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
6563     }],
6564     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\index.js": [function(require, module, exports) {
6565         module.exports = {
6566             __depends__: [
6567                 require('diagram-js/lib/features/palette'),
6568                 require('diagram-js/lib/features/create')
6569             ],
6570             __init__: ['paletteProvider'],
6571             paletteProvider: ['type', require('./PaletteProvider')]
6572         };
6573
6574     }, {
6575         "./PaletteProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\PaletteProvider.js",
6576         "diagram-js/lib/features/create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js",
6577         "diagram-js/lib/features/palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\index.js"
6578     }],
6579     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\BpmnReplace.js": [function(require, module, exports) {
6580         'use strict';
6581
6582         var forEach = require('lodash/collection/forEach'),
6583             filter = require('lodash/collection/filter');
6584
6585         var REPLACE_OPTIONS = require('./ReplaceOptions');
6586
6587         var startEventReplace = REPLACE_OPTIONS.START_EVENT,
6588             intermediateEventReplace = REPLACE_OPTIONS.INTERMEDIATE_EVENT,
6589             endEventReplace = REPLACE_OPTIONS.END_EVENT,
6590             gatewayReplace = REPLACE_OPTIONS.GATEWAY,
6591             taskReplace = REPLACE_OPTIONS.TASK;
6592
6593
6594         /**
6595          * A replace menu provider that gives users the controls to choose and replace
6596          * BPMN elements with each other.
6597          * 
6598          * @param {BpmnFactory}
6599          *            bpmnFactory
6600          * @param {Moddle}
6601          *            moddle
6602          * @param {PopupMenu}
6603          *            popupMenu
6604          * @param {Replace}
6605          *            replace
6606          */
6607         function BpmnReplace(bpmnFactory, moddle, popupMenu, replace, selection) {
6608
6609             /**
6610              * Prepares a new business object for the replacement element and triggers
6611              * the replace operation.
6612              * 
6613              * @param {djs.model.Base}
6614              *            element
6615              * @param {Object}
6616              *            target
6617              * @return {djs.model.Base} the newly created element
6618              */
6619             function replaceElement(element, target) {
6620
6621                 var type = target.type,
6622                     oldBusinessObject = element.businessObject,
6623                     businessObject = bpmnFactory.create(type);
6624
6625                 var newElement = {
6626                     type: type,
6627                     businessObject: businessObject
6628                 };
6629
6630                 // initialize custom BPMN extensions
6631
6632                 if (target.eventDefinition) {
6633                     var eventDefinitions = businessObject.get('eventDefinitions'),
6634                         eventDefinition = moddle.create(target.eventDefinition);
6635
6636                     eventDefinitions.push(eventDefinition);
6637                 }
6638
6639                 if (target.instantiate !== undefined) {
6640                     businessObject.instantiate = target.instantiate;
6641                 }
6642
6643                 if (target.eventGatewayType !== undefined) {
6644                     businessObject.eventGatewayType = target.eventGatewayType;
6645                 }
6646
6647                 // copy size (for activities only)
6648                 if (oldBusinessObject.$instanceOf('bpmn:Activity')) {
6649
6650                     // TODO: need also to respect min/max Size
6651
6652                     newElement.width = element.width;
6653                     newElement.height = element.height;
6654                 }
6655
6656                 // TODO: copy other elligable properties from old business object
6657                 businessObject.name = oldBusinessObject.name;
6658
6659                 newElement = replace.replaceElement(element, newElement);
6660
6661                 selection.select(newElement);
6662
6663                 return newElement;
6664             }
6665
6666
6667             function getReplaceOptions(element) {
6668
6669                 var menuEntries = [];
6670                 var businessObject = element.businessObject;
6671
6672                 if (businessObject.$instanceOf('bpmn:StartEvent')) {
6673                     addEntries(startEventReplace, filterEvents);
6674                 } else
6675
6676                 if (businessObject.$instanceOf('bpmn:IntermediateCatchEvent') ||
6677                     businessObject.$instanceOf('bpmn:IntermediateThrowEvent')) {
6678
6679                     addEntries(intermediateEventReplace, filterEvents);
6680                 } else
6681
6682                 if (businessObject.$instanceOf('bpmn:EndEvent')) {
6683
6684                     addEntries(endEventReplace, filterEvents);
6685                 } else
6686
6687                 if (businessObject.$instanceOf('bpmn:Gateway')) {
6688
6689                     addEntries(gatewayReplace, function(entry) {
6690
6691                         return entry.target.type !== businessObject.$type;
6692                     });
6693                 } else
6694
6695                 if (businessObject.$instanceOf('bpmn:FlowNode')) {
6696                     addEntries(taskReplace, function(entry) {
6697                         return entry.target.type !== businessObject.$type;
6698                     });
6699                 }
6700
6701                 function filterEvents(entry) {
6702
6703                     var target = entry.target;
6704
6705                     var eventDefinition = businessObject.eventDefinitions && businessObject.eventDefinitions[0].$type;
6706                     var isEventDefinitionEqual = target.eventDefinition == eventDefinition;
6707                     var isEventTypeEqual = businessObject.$type == target.type;
6708
6709                     return ((!isEventDefinitionEqual && isEventTypeEqual) ||
6710                             !isEventTypeEqual) ||
6711                         !(isEventDefinitionEqual && isEventTypeEqual);
6712                 }
6713
6714                 function addEntries(entries, filterFun) {
6715                     // Filter selected type from the array
6716                     var filteredEntries = filter(entries, filterFun);
6717
6718                     // Add entries to replace menu
6719                     forEach(filteredEntries, function(definition) {
6720
6721                         var entry = addMenuEntry(definition);
6722                         menuEntries.push(entry);
6723                     });
6724                 }
6725
6726                 function addMenuEntry(definition) {
6727
6728                     return {
6729                         label: definition.label,
6730                         className: definition.className,
6731                         action: {
6732                             name: definition.actionName,
6733                             handler: function() {
6734                                 replaceElement(element, definition.target);
6735                             }
6736                         }
6737                     };
6738                 }
6739
6740                 return menuEntries;
6741             }
6742
6743
6744             // API
6745
6746             this.openChooser = function(position, element) {
6747                 var entries = this.getReplaceOptions(element);
6748
6749                 popupMenu.open('replace-menu', position, entries);
6750             };
6751
6752             this.getReplaceOptions = getReplaceOptions;
6753
6754             this.replaceElement = replaceElement;
6755         }
6756
6757         BpmnReplace.$inject = ['bpmnFactory', 'moddle', 'popupMenu', 'replace', 'selection'];
6758
6759         module.exports = BpmnReplace;
6760     }, {
6761         "./ReplaceOptions": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\ReplaceOptions.js",
6762         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
6763         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
6764     }],
6765     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\ReplaceOptions.js": [function(require, module, exports) {
6766         'use strict';
6767
6768         module.exports.START_EVENT = [{
6769             label: 'Start Event',
6770             actionName: 'replace-with-none-start',
6771             className: 'icon-start-event-none',
6772             target: {
6773                 type: 'bpmn:StartEvent'
6774             }
6775         }, {
6776             label: 'Intermediate Throw Event',
6777             actionName: 'replace-with-intermediate-throwing',
6778             className: 'icon-intermediate-event-none',
6779             target: {
6780                 type: 'bpmn:IntermediateThrowEvent'
6781             }
6782         }, {
6783             label: 'End Event',
6784             actionName: 'replace-with-message-end',
6785             className: 'icon-end-event-none',
6786             target: {
6787                 type: 'bpmn:EndEvent'
6788             }
6789         }, {
6790             label: 'Message Start Event',
6791             actionName: 'replace-with-message-start',
6792             className: 'icon-start-event-message',
6793             target: {
6794                 type: 'bpmn:StartEvent',
6795                 eventDefinition: 'bpmn:MessageEventDefinition'
6796             }
6797         }, {
6798             label: 'Timer Start Event',
6799             actionName: 'replace-with-timer-start',
6800             className: 'icon-start-event-timer',
6801             target: {
6802                 type: 'bpmn:StartEvent',
6803                 eventDefinition: 'bpmn:TimerEventDefinition'
6804             }
6805         }, {
6806             label: 'Conditional Start Event',
6807             actionName: 'replace-with-conditional-start',
6808             className: 'icon-start-event-condition',
6809             target: {
6810                 type: 'bpmn:StartEvent',
6811                 eventDefinition: 'bpmn:ConditionalEventDefinition'
6812             }
6813         }, {
6814             label: 'Signal Start Event',
6815             actionName: 'replace-with-signal-start',
6816             className: 'icon-start-event-signal',
6817             target: {
6818                 type: 'bpmn:StartEvent',
6819                 eventDefinition: 'bpmn:SignalEventDefinition'
6820             }
6821         }];
6822
6823         module.exports.INTERMEDIATE_EVENT = [{
6824             label: 'Start Event',
6825             actionName: 'replace-with-none-start',
6826             className: 'icon-start-event-none',
6827             target: {
6828                 type: 'bpmn:StartEvent'
6829             }
6830         }, {
6831             label: 'Intermediate Throw Event',
6832             actionName: 'replace-with-message-intermediate-throw',
6833             className: 'icon-intermediate-event-none',
6834             target: {
6835                 type: 'bpmn:IntermediateThrowEvent'
6836             }
6837         }, {
6838             label: 'End Event',
6839             actionName: 'replace-with-message-end',
6840             className: 'icon-end-event-none',
6841             target: {
6842                 type: 'bpmn:EndEvent'
6843             }
6844         }, {
6845             label: 'Message Intermediate Catch Event',
6846             actionName: 'replace-with-intermediate-catch',
6847             className: 'icon-intermediate-event-catch-message',
6848             target: {
6849                 type: 'bpmn:IntermediateCatchEvent',
6850                 eventDefinition: 'bpmn:MessageEventDefinition'
6851             }
6852         }, {
6853             label: 'Message Intermediate Throw Event',
6854             actionName: 'replace-with-intermediate-throw',
6855             className: 'icon-intermediate-event-throw-message',
6856             target: {
6857                 type: 'bpmn:IntermediateThrowEvent',
6858                 eventDefinition: 'bpmn:MessageEventDefinition'
6859             }
6860         }, {
6861             label: 'Timer Intermediate Catch Event',
6862             actionName: 'replace-with-timer-intermediate-catch',
6863             className: 'icon-intermediate-event-catch-timer',
6864             target: {
6865                 type: 'bpmn:IntermediateCatchEvent',
6866                 eventDefinition: 'bpmn:TimerEventDefinition'
6867             }
6868         }, {
6869             label: 'Escalation Intermediate Catch Event',
6870             actionName: 'replace-with-escalation-catch',
6871             className: 'icon-intermediate-event-catch-escalation',
6872             target: {
6873                 type: 'bpmn:IntermediateCatchEvent',
6874                 eventDefinition: 'bpmn:EscalationEventDefinition'
6875             }
6876         }, {
6877             label: 'Conditional Intermediate Catch Event',
6878             actionName: 'replace-with-conditional-intermediate-catch',
6879             className: 'icon-intermediate-event-catch-condition',
6880             target: {
6881                 type: 'bpmn:IntermediateCatchEvent',
6882                 eventDefinition: 'bpmn:ConditionalEventDefinition'
6883             }
6884         }, {
6885             label: 'Link Intermediate Catch Event',
6886             actionName: 'replace-with-link-intermediate-catch',
6887             className: 'icon-intermediate-event-catch-link',
6888             target: {
6889                 type: 'bpmn:IntermediateCatchEvent',
6890                 eventDefinition: 'bpmn:LinkEventDefinition'
6891             }
6892         }, {
6893             label: 'Link Intermediate Throw Event',
6894             actionName: 'replace-with-link-intermediate-throw',
6895             className: 'icon-intermediate-event-throw-link',
6896             target: {
6897                 type: 'bpmn:IntermediateThrowEvent',
6898                 eventDefinition: 'bpmn:LinkEventDefinition'
6899             }
6900         }, {
6901             label: 'Compensation Intermediate Throw Event',
6902             actionName: 'replace-with-compensation-intermediate-throw',
6903             className: 'icon-intermediate-event-throw-compensation',
6904             target: {
6905                 type: 'bpmn:IntermediateThrowEvent',
6906                 eventDefinition: 'bpmn:CompensateEventDefinition'
6907             }
6908         }, {
6909             label: 'Signal Throw Catch Event',
6910             actionName: 'replace-with-throw-intermediate-catch',
6911             className: 'icon-intermediate-event-catch-signal',
6912             target: {
6913                 type: 'bpmn:IntermediateCatchEvent',
6914                 eventDefinition: 'bpmn:SignalEventDefinition'
6915             }
6916         }, {
6917             label: 'Signal Intermediate Throw Event',
6918             actionName: 'replace-with-signal-intermediate-throw',
6919             className: 'icon-intermediate-event-throw-signal',
6920             target: {
6921                 type: 'bpmn:IntermediateThrowEvent',
6922                 eventDefinition: 'bpmn:SignalEventDefinition'
6923             }
6924         }];
6925
6926         module.exports.END_EVENT = [{
6927             label: 'Start Event',
6928             actionName: 'replace-with-none-start',
6929             className: 'icon-start-event-none',
6930             target: {
6931                 type: 'bpmn:StartEvent'
6932             }
6933         }, {
6934             label: 'Intermediate Throw Event',
6935             actionName: 'replace-with-message-intermediate-throw',
6936             className: 'icon-intermediate-event-none',
6937             target: {
6938                 type: 'bpmn:IntermediateThrowEvent'
6939             }
6940         }, {
6941             label: 'End Event',
6942             actionName: 'replace-with-none-end',
6943             className: 'icon-end-event-none',
6944             target: {
6945                 type: 'bpmn:EndEvent'
6946             }
6947         }, {
6948             label: 'Message End Event',
6949             actionName: 'replace-with-message-end',
6950             className: 'icon-end-event-message',
6951             target: {
6952                 type: 'bpmn:EndEvent',
6953                 eventDefinition: 'bpmn:MessageEventDefinition'
6954             }
6955         }, {
6956             label: 'Escalation End Event',
6957             actionName: 'replace-with-escalation-end',
6958             className: 'icon-end-event-escalation',
6959             target: {
6960                 type: 'bpmn:EndEvent',
6961                 eventDefinition: 'bpmn:EscalationEventDefinition'
6962             }
6963         }, {
6964             label: 'Error End Event',
6965             actionName: 'replace-with-error-end',
6966             className: 'icon-end-event-error',
6967             target: {
6968                 type: 'bpmn:EndEvent',
6969                 eventDefinition: 'bpmn:ErrorEventDefinition'
6970             }
6971         }, {
6972             label: 'Cancel End Event',
6973             actionName: 'replace-with-cancel-end',
6974             className: 'icon-end-event-cancel',
6975             target: {
6976                 type: 'bpmn:EndEvent',
6977                 eventDefinition: 'bpmn:CancelEventDefinition'
6978             }
6979         }, {
6980             label: 'Compensation End Event',
6981             actionName: 'replace-with-compensation-end',
6982             className: 'icon-end-event-compensation',
6983             target: {
6984                 type: 'bpmn:EndEvent',
6985                 eventDefinition: 'bpmn:CompensateEventDefinition'
6986             }
6987         }, {
6988             label: 'Signal End Event',
6989             actionName: 'replace-with-signal-end',
6990             className: 'icon-end-event-signal',
6991             target: {
6992                 type: 'bpmn:EndEvent',
6993                 eventDefinition: 'bpmn:SignalEventDefinition'
6994             }
6995         }, {
6996             label: 'Terminate End Event',
6997             actionName: 'replace-with-terminate-end',
6998             className: 'icon-end-event-terminate',
6999             target: {
7000                 type: 'bpmn:EndEvent',
7001                 eventDefinition: 'bpmn:TerminateEventDefinition'
7002             }
7003         }];
7004
7005         module.exports.GATEWAY = [{
7006                 label: 'Exclusive Gateway',
7007                 actionName: 'replace-with-exclusive-gateway',
7008                 className: 'icon-gateway-xor',
7009                 target: {
7010                     type: 'bpmn:ExclusiveGateway'
7011                 }
7012             }, {
7013                 label: 'Parallel Gateway',
7014                 actionName: 'replace-with-parallel-gateway',
7015                 className: 'icon-gateway-parallel',
7016                 target: {
7017                     type: 'bpmn:ParallelGateway'
7018                 }
7019             }, {
7020                 label: 'Inclusive Gateway',
7021                 actionName: 'replace-with-inclusive-gateway',
7022                 className: 'icon-gateway-or',
7023                 target: {
7024                     type: 'bpmn:InclusiveGateway'
7025                 }
7026             }, {
7027                 label: 'Complex Gateway',
7028                 actionName: 'replace-with-complex-gateway',
7029                 className: 'icon-gateway-complex',
7030                 target: {
7031                     type: 'bpmn:ComplexGateway'
7032                 }
7033             }, {
7034                 label: 'Event based Gateway',
7035                 actionName: 'replace-with-event-based-gateway',
7036                 className: 'icon-gateway-eventbased',
7037                 target: {
7038                     type: 'bpmn:EventBasedGateway',
7039                     instantiate: false,
7040                     eventGatewayType: 'Exclusive'
7041                 }
7042             }
7043             // Gateways deactivated until https://github.com/bpmn-io/bpmn-js/issues/194
7044             // {
7045             // label: 'Event based instantiating Gateway',
7046             // actionName: 'replace-with-exclusive-event-based-gateway',
7047             // className: 'icon-exclusive-event-based',
7048             // target: {
7049             // type: 'bpmn:EventBasedGateway'
7050             // },
7051             // options: {
7052             // businessObject: { instantiate: true, eventGatewayType: 'Exclusive' }
7053             // }
7054             // },
7055             // {
7056             // label: 'Parallel Event based instantiating Gateway',
7057             // actionName: 'replace-with-parallel-event-based-instantiate-gateway',
7058             // className: 'icon-parallel-event-based-instantiate-gateway',
7059             // target: {
7060             // type: 'bpmn:EventBasedGateway'
7061             // },
7062             // options: {
7063             // businessObject: { instantiate: true, eventGatewayType: 'Parallel' }
7064             // }
7065             // }
7066         ];
7067
7068
7069         module.exports.TASK = [{
7070             label: 'Task',
7071             actionName: 'replace-with-task',
7072             className: 'icon-task',
7073             target: {
7074                 type: 'bpmn:Task'
7075             }
7076         }, {
7077             label: 'Send Task',
7078             actionName: 'replace-with-send-task',
7079             className: 'icon-send',
7080             target: {
7081                 type: 'bpmn:SendTask'
7082             }
7083         }, {
7084             label: 'Receive Task',
7085             actionName: 'replace-with-receive-task',
7086             className: 'icon-receive',
7087             target: {
7088                 type: 'bpmn:ReceiveTask'
7089             }
7090         }, {
7091             label: 'User Task',
7092             actionName: 'replace-with-user-task',
7093             className: 'icon-user',
7094             target: {
7095                 type: 'bpmn:UserTask'
7096             }
7097         }, {
7098             label: 'Manual Task',
7099             actionName: 'replace-with-manual-task',
7100             className: 'icon-manual',
7101             target: {
7102                 type: 'bpmn:ManualTask'
7103             }
7104         }, {
7105             label: 'Business Rule Task',
7106             actionName: 'replace-with-rule-task',
7107             className: 'icon-business-rule',
7108             target: {
7109                 type: 'bpmn:BusinessRuleTask'
7110             }
7111         }, {
7112             label: 'Service Task',
7113             actionName: 'replace-with-service-task',
7114             className: 'icon-service',
7115             target: {
7116                 type: 'bpmn:ServiceTask'
7117             }
7118         }, {
7119             label: 'Script Task',
7120             actionName: 'replace-with-script-task',
7121             className: 'icon-script',
7122             target: {
7123                 type: 'bpmn:ScriptTask'
7124             }
7125         }];
7126     }, {}],
7127     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\index.js": [function(require, module, exports) {
7128         module.exports = {
7129             __depends__: [
7130                 require('diagram-js/lib/features/popup-menu'),
7131                 require('diagram-js/lib/features/replace'),
7132                 require('diagram-js/lib/features/selection')
7133             ],
7134             bpmnReplace: ['type', require('./BpmnReplace')]
7135         };
7136     }, {
7137         "./BpmnReplace": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\BpmnReplace.js",
7138         "diagram-js/lib/features/popup-menu": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\index.js",
7139         "diagram-js/lib/features/replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\index.js",
7140         "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js"
7141     }],
7142     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\BpmnSnapping.js": [function(require, module, exports) {
7143         'use strict';
7144
7145         var inherits = require('inherits');
7146
7147         var forEach = require('lodash/collection/forEach');
7148
7149         var getBoundingBox = require('diagram-js/lib/util/Elements').getBBox;
7150         var is = require('../modeling/ModelingUtil').is;
7151
7152         var Snapping = require('diagram-js/lib/features/snapping/Snapping'),
7153             SnapUtil = require('diagram-js/lib/features/snapping/SnapUtil');
7154
7155         var is = require('../../util/ModelUtil').is;
7156
7157         var mid = SnapUtil.mid,
7158             topLeft = SnapUtil.topLeft,
7159             bottomRight = SnapUtil.bottomRight;
7160
7161         var round = Math.round;
7162
7163
7164         /**
7165          * BPMN specific snapping functionality
7166          *  * snap on process elements if a pool is created inside a process diagram
7167          * 
7168          * @param {EventBus}
7169          *            eventBus
7170          * @param {Canvas}
7171          *            canvas
7172          */
7173         function BpmnSnapping(eventBus, canvas) {
7174
7175             // instantiate super
7176             Snapping.call(this, eventBus, canvas);
7177
7178
7179             /**
7180              * Drop participant on process <> process elements snapping
7181              */
7182
7183             function initParticipantSnapping(context, shape, elements) {
7184
7185                 if (!elements.length) {
7186                     return;
7187                 }
7188
7189                 var snapBox = getBoundingBox(elements.filter(function(e) {
7190                     return !e.labelTarget && !e.waypoints;
7191                 }));
7192
7193                 snapBox.x -= 50;
7194                 snapBox.y -= 20;
7195                 snapBox.width += 70;
7196                 snapBox.height += 40;
7197
7198                 // adjust shape height to include bounding box
7199                 shape.width = Math.max(shape.width, snapBox.width);
7200                 shape.height = Math.max(shape.height, snapBox.height);
7201
7202                 context.participantSnapBox = snapBox;
7203             }
7204
7205             function snapParticipant(snapBox, shape, event) {
7206
7207                 var shapeHalfWidth = shape.width / 2 - 30,
7208                     shapeHalfHeight = shape.height / 2;
7209
7210                 var currentTopLeft = {
7211                     x: event.x - shapeHalfWidth - 30,
7212                     y: event.y - shapeHalfHeight
7213                 };
7214
7215                 var currentBottomRight = {
7216                     x: event.x + shapeHalfWidth + 30,
7217                     y: event.y + shapeHalfHeight
7218                 };
7219
7220                 var snapTopLeft = snapBox,
7221                     snapBottomRight = bottomRight(snapBox);
7222
7223                 if (currentTopLeft.x >= snapTopLeft.x) {
7224                     event.x = snapTopLeft.x + 30 + shapeHalfWidth;
7225                     event.snapped = true;
7226                 } else
7227                 if (currentBottomRight.x <= snapBottomRight.x) {
7228                     event.x = snapBottomRight.x - 30 - shapeHalfWidth;
7229                     event.snapped = true;
7230                 }
7231
7232                 if (currentTopLeft.y >= snapTopLeft.y) {
7233                     event.y = snapTopLeft.y + shapeHalfHeight;
7234                     event.snapped = true;
7235                 } else
7236                 if (currentBottomRight.y <= snapBottomRight.y) {
7237                     event.y = snapBottomRight.y - shapeHalfHeight;
7238                     event.snapped = true;
7239                 }
7240             }
7241
7242             eventBus.on('create.start', function(event) {
7243
7244                 var context = event.context,
7245                     shape = context.shape,
7246                     rootElement = canvas.getRootElement();
7247
7248                 // snap participant around existing elements (if any)
7249                 if (is(shape, 'bpmn:Participant') && is(rootElement, 'bpmn:Process')) {
7250
7251                     initParticipantSnapping(context, shape, rootElement.children);
7252                 }
7253             });
7254
7255             eventBus.on(['create.move', 'create.end'], 1500, function(event) {
7256
7257                 var context = event.context,
7258                     shape = context.shape,
7259                     participantSnapBox = context.participantSnapBox;
7260
7261                 if (!event.snapped && participantSnapBox) {
7262                     snapParticipant(participantSnapBox, shape, event);
7263                 }
7264             });
7265
7266             eventBus.on('resize.start', 1500, function(event) {
7267                 var context = event.context,
7268                     shape = context.shape;
7269
7270                 if (is(shape, 'bpmn:SubProcess')) {
7271                     context.minDimensions = {
7272                         width: 140,
7273                         height: 120
7274                     };
7275                 }
7276
7277                 if (is(shape, 'bpmn:Participant')) {
7278                     context.minDimensions = {
7279                         width: 400,
7280                         height: 200
7281                     };
7282                 }
7283
7284                 if (is(shape, 'bpmn:TextAnnotation')) {
7285                     context.minDimensions = {
7286                         width: 50,
7287                         height: 50
7288                     };
7289                 }
7290             });
7291
7292         }
7293
7294         inherits(BpmnSnapping, Snapping);
7295
7296         BpmnSnapping.$inject = ['eventBus', 'canvas'];
7297
7298         module.exports = BpmnSnapping;
7299
7300
7301         BpmnSnapping.prototype.initSnap = function(event) {
7302
7303             var context = event.context,
7304                 shape = context.shape,
7305                 shapeMid,
7306                 shapeBounds,
7307                 shapeTopLeft,
7308                 shapeBottomRight,
7309                 snapContext;
7310
7311
7312             snapContext = Snapping.prototype.initSnap.call(this, event);
7313
7314             if (is(shape, 'bpmn:Participant')) {
7315                 // assign higher priority for outer snaps on participants
7316                 snapContext.setSnapLocations(['top-left', 'bottom-right', 'mid']);
7317             }
7318
7319
7320             if (shape) {
7321
7322                 shapeMid = mid(shape, event);
7323
7324                 shapeBounds = {
7325                     width: shape.width,
7326                     height: shape.height,
7327                     x: isNaN(shape.x) ? round(shapeMid.x - shape.width / 2) : shape.x,
7328                     y: isNaN(shape.y) ? round(shapeMid.y - shape.height / 2) : shape.y,
7329                 };
7330
7331                 shapeTopLeft = topLeft(shapeBounds);
7332                 shapeBottomRight = bottomRight(shapeBounds);
7333
7334                 snapContext.setSnapOrigin('top-left', {
7335                     x: shapeTopLeft.x - event.x,
7336                     y: shapeTopLeft.y - event.y
7337                 });
7338
7339                 snapContext.setSnapOrigin('bottom-right', {
7340                     x: shapeBottomRight.x - event.x,
7341                     y: shapeBottomRight.y - event.y
7342                 });
7343
7344
7345                 forEach(shape.outgoing, function(c) {
7346                     var docking = c.waypoints[0];
7347
7348                     docking = docking.original || docking;
7349
7350                     snapContext.setSnapOrigin(c.id + '-docking', {
7351                         x: docking.x - event.x,
7352                         y: docking.y - event.y
7353                     });
7354                 });
7355
7356                 forEach(shape.incoming, function(c) {
7357                     var docking = c.waypoints[c.waypoints.length - 1];
7358
7359                     docking = docking.original || docking;
7360
7361                     snapContext.setSnapOrigin(c.id + '-docking', {
7362                         x: docking.x - event.x,
7363                         y: docking.y - event.y
7364                     });
7365                 });
7366
7367             }
7368
7369             var source = context.source;
7370
7371             if (source) {
7372                 snapContext.addDefaultSnap('mid', mid(source));
7373             }
7374         };
7375
7376
7377         BpmnSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
7378
7379             var siblings = this.getSiblings(shape, target);
7380
7381
7382             forEach(siblings, function(s) {
7383                 snapPoints.add('mid', mid(s));
7384
7385                 if (is(s, 'bpmn:Participant')) {
7386                     snapPoints.add('top-left', topLeft(s));
7387                     snapPoints.add('bottom-right', bottomRight(s));
7388                 }
7389             });
7390
7391             forEach(shape.incoming, function(c) {
7392
7393                 if (siblings.indexOf(c.source) === -1) {
7394                     snapPoints.add('mid', mid(c.source));
7395
7396                     var docking = c.waypoints[0];
7397                     snapPoints.add(c.id + '-docking', docking.original || docking);
7398                 }
7399             });
7400
7401
7402             forEach(shape.outgoing, function(c) {
7403
7404                 if (siblings.indexOf(c.target) === -1) {
7405                     snapPoints.add('mid', mid(c.target));
7406
7407                     var docking = c.waypoints[c.waypoints.length - 1];
7408                     snapPoints.add(c.id + '-docking', docking.original || docking);
7409                 }
7410             });
7411
7412         };
7413     }, {
7414         "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
7415         "../modeling/ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
7416         "diagram-js/lib/features/snapping/SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
7417         "diagram-js/lib/features/snapping/Snapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\Snapping.js",
7418         "diagram-js/lib/util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
7419         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
7420         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
7421     }],
7422     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\index.js": [function(require, module, exports) {
7423         module.exports = {
7424             __init__: ['snapping'],
7425             snapping: ['type', require('./BpmnSnapping')]
7426         };
7427     }, {
7428         "./BpmnSnapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\BpmnSnapping.js"
7429     }],
7430     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnImporter.js": [function(require, module, exports) {
7431         'use strict';
7432
7433         var assign = require('lodash/object/assign'),
7434             map = require('lodash/collection/map');
7435
7436         var LabelUtil = require('../util/LabelUtil');
7437
7438         var hasExternalLabel = LabelUtil.hasExternalLabel,
7439             getExternalLabelBounds = LabelUtil.getExternalLabelBounds,
7440             isExpanded = require('../util/DiUtil').isExpanded,
7441             elementToString = require('./Util').elementToString;
7442
7443
7444         function elementData(semantic, attrs) {
7445             return assign({
7446                 id: semantic.id,
7447                 type: semantic.$type,
7448                 businessObject: semantic
7449             }, attrs);
7450         }
7451
7452         function collectWaypoints(waypoints) {
7453             return map(waypoints, function(p) {
7454                 return {
7455                     x: p.x,
7456                     y: p.y
7457                 };
7458             });
7459         }
7460
7461
7462         /**
7463          * An importer that adds bpmn elements to the canvas
7464          * 
7465          * @param {EventBus}
7466          *            eventBus
7467          * @param {Canvas}
7468          *            canvas
7469          * @param {ElementFactory}
7470          *            elementFactory
7471          * @param {ElementRegistry}
7472          *            elementRegistry
7473          */
7474         function BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {
7475             this._eventBus = eventBus;
7476             this._canvas = canvas;
7477
7478             this._elementFactory = elementFactory;
7479             this._elementRegistry = elementRegistry;
7480         }
7481
7482         BpmnImporter.$inject = ['eventBus', 'canvas', 'elementFactory', 'elementRegistry'];
7483
7484         module.exports = BpmnImporter;
7485
7486
7487         /**
7488          * Add bpmn element (semantic) to the canvas onto the specified parent shape.
7489          */
7490         BpmnImporter.prototype.add = function(semantic, parentElement) {
7491
7492             var di = semantic.di,
7493                 element;
7494
7495             // ROOT ELEMENT
7496             // handle the special case that we deal with a
7497             // invisible root element (process or collaboration)
7498             if (di.$instanceOf('bpmndi:BPMNPlane')) {
7499
7500                 // add a virtual element (not being drawn)
7501                 element = this._elementFactory.createRoot(elementData(semantic));
7502
7503                 this._canvas.setRootElement(element);
7504             }
7505
7506             // SHAPE
7507             else if (di.$instanceOf('bpmndi:BPMNShape')) {
7508
7509                 var collapsed = !isExpanded(semantic);
7510                 var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);
7511
7512                 var bounds = semantic.di.bounds;
7513
7514                 element = this._elementFactory.createShape(elementData(semantic, {
7515                     collapsed: collapsed,
7516                     hidden: hidden,
7517                     x: Math.round(bounds.x),
7518                     y: Math.round(bounds.y),
7519                     width: Math.round(bounds.width),
7520                     height: Math.round(bounds.height)
7521                 }));
7522
7523                 this._canvas.addShape(element, parentElement);
7524             }
7525
7526             // CONNECTION
7527             else if (di.$instanceOf('bpmndi:BPMNEdge')) {
7528
7529                 var source = this._getSource(semantic),
7530                     target = this._getTarget(semantic);
7531
7532                 element = this._elementFactory.createConnection(elementData(semantic, {
7533                     source: source,
7534                     target: target,
7535                     waypoints: collectWaypoints(semantic.di.waypoint)
7536                 }));
7537
7538                 this._canvas.addConnection(element, parentElement);
7539             } else {
7540                 throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));
7541             }
7542
7543             // (optional) LABEL
7544             if (hasExternalLabel(semantic)) {
7545                 this.addLabel(semantic, element);
7546             }
7547
7548
7549             this._eventBus.fire('bpmnElement.added', {
7550                 element: element
7551             });
7552
7553             return element;
7554         };
7555
7556
7557         /**
7558          * add label for an element
7559          */
7560         BpmnImporter.prototype.addLabel = function(semantic, element) {
7561             var bounds = getExternalLabelBounds(semantic, element);
7562
7563             var label = this._elementFactory.createLabel(elementData(semantic, {
7564                 id: semantic.id + '_label',
7565                 labelTarget: element,
7566                 type: 'label',
7567                 hidden: element.hidden,
7568                 x: Math.round(bounds.x),
7569                 y: Math.round(bounds.y),
7570                 width: Math.round(bounds.width),
7571                 height: Math.round(bounds.height)
7572             }));
7573
7574             return this._canvas.addShape(label, element.parent);
7575         };
7576
7577         /**
7578          * Return the drawn connection end based on the given side.
7579          * 
7580          * @throws {Error}
7581          *             if the end is not yet drawn
7582          */
7583         BpmnImporter.prototype._getEnd = function(semantic, side) {
7584
7585             var element,
7586                 refSemantic,
7587                 type = semantic.$type;
7588
7589             refSemantic = semantic[side + 'Ref'];
7590
7591             // handle mysterious isMany DataAssociation#sourceRef
7592             if (side === 'source' && type === 'bpmn:DataInputAssociation') {
7593                 refSemantic = refSemantic && refSemantic[0];
7594             }
7595
7596             // fix source / target for DataInputAssociation / DataOutputAssociation
7597             if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||
7598                 side === 'target' && type === 'bpmn:DataInputAssociation') {
7599
7600                 refSemantic = semantic.$parent;
7601             }
7602
7603             element = refSemantic && this._getElement(refSemantic);
7604
7605             if (element) {
7606                 return element;
7607             }
7608
7609             if (refSemantic) {
7610                 throw new Error(
7611                     'element ' + elementToString(refSemantic) + ' referenced by ' +
7612                     elementToString(semantic) + '#' + side + 'Ref not yet drawn');
7613             } else {
7614                 throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');
7615             }
7616         };
7617
7618         BpmnImporter.prototype._getSource = function(semantic) {
7619             return this._getEnd(semantic, 'source');
7620         };
7621
7622         BpmnImporter.prototype._getTarget = function(semantic) {
7623             return this._getEnd(semantic, 'target');
7624         };
7625
7626
7627         BpmnImporter.prototype._getElement = function(semantic) {
7628             return this._elementRegistry.get(semantic.id);
7629         };
7630
7631     }, {
7632         "../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
7633         "../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
7634         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js",
7635         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
7636         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
7637     }],
7638     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnTreeWalker.js": [function(require, module, exports) {
7639         'use strict';
7640
7641         var filter = require('lodash/collection/filter'),
7642             find = require('lodash/collection/find'),
7643             forEach = require('lodash/collection/forEach');
7644
7645         var Refs = require('object-refs');
7646
7647         var elementToString = require('./Util').elementToString;
7648
7649         var diRefs = new Refs({
7650             name: 'bpmnElement',
7651             enumerable: true
7652         }, {
7653             name: 'di'
7654         });
7655
7656         /**
7657          * Returns true if an element has the given meta-model type
7658          * 
7659          * @param {ModdleElement}
7660          *            element
7661          * @param {String}
7662          *            type
7663          * 
7664          * @return {Boolean}
7665          */
7666         function is(element, type) {
7667             return element.$instanceOf(type);
7668         }
7669
7670
7671         /**
7672          * Find a suitable display candidate for definitions where the DI does not
7673          * correctly specify one.
7674          */
7675         function findDisplayCandidate(definitions) {
7676             return find(definitions.rootElements, function(e) {
7677                 return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
7678             });
7679         }
7680
7681
7682         function BpmnTreeWalker(handler) {
7683
7684             // list of containers already walked
7685             var handledProcesses = [];
7686
7687             // list of elements to handle deferred to ensure
7688             // prerequisites are drawn
7689             var deferred = [];
7690
7691             // /// Helpers /////////////////////////////////
7692
7693             function contextual(fn, ctx) {
7694                 return function(e) {
7695                     fn(e, ctx);
7696                 };
7697             }
7698
7699             function visit(element, ctx) {
7700
7701                 var gfx = element.gfx;
7702
7703                 // avoid multiple rendering of elements
7704                 if (gfx) {
7705                     throw new Error('already rendered ' + elementToString(element));
7706                 }
7707
7708                 // call handler
7709                 return handler.element(element, ctx);
7710             }
7711
7712             function visitRoot(element, diagram) {
7713                 return handler.root(element, diagram);
7714             }
7715
7716             function visitIfDi(element, ctx) {
7717                 try {
7718                     return element.di && visit(element, ctx);
7719                 } catch (e) {
7720                     logError(e.message, {
7721                         element: element,
7722                         error: e
7723                     });
7724
7725                     console.error('failed to import ' + elementToString(element));
7726                     console.error(e);
7727                 }
7728             }
7729
7730             function logError(message, context) {
7731                 handler.error(message, context);
7732             }
7733
7734             // //// DI handling ////////////////////////////
7735
7736             function registerDi(di) {
7737                 var bpmnElement = di.bpmnElement;
7738
7739                 if (bpmnElement) {
7740                     if (bpmnElement.di) {
7741                         logError('multiple DI elements defined for ' + elementToString(bpmnElement), {
7742                             element: bpmnElement
7743                         });
7744                     } else {
7745                         diRefs.bind(bpmnElement, 'di');
7746                         bpmnElement.di = di;
7747                     }
7748                 } else {
7749                     logError('no bpmnElement referenced in ' + elementToString(di), {
7750                         element: di
7751                     });
7752                 }
7753             }
7754
7755             function handleDiagram(diagram) {
7756                 handlePlane(diagram.plane);
7757             }
7758
7759             function handlePlane(plane) {
7760                 registerDi(plane);
7761
7762                 forEach(plane.planeElement, handlePlaneElement);
7763             }
7764
7765             function handlePlaneElement(planeElement) {
7766                 registerDi(planeElement);
7767             }
7768
7769
7770             // //// Semantic handling //////////////////////
7771
7772             function handleDefinitions(definitions, diagram) {
7773                 // make sure we walk the correct bpmnElement
7774
7775                 var diagrams = definitions.diagrams;
7776
7777                 if (diagram && diagrams.indexOf(diagram) === -1) {
7778                     throw new Error('diagram not part of bpmn:Definitions');
7779                 }
7780
7781                 if (!diagram && diagrams && diagrams.length) {
7782                     diagram = diagrams[0];
7783                 }
7784
7785                 // no diagram -> nothing to import
7786                 if (!diagram) {
7787                     return;
7788                 }
7789
7790                 // load DI from selected diagram only
7791                 handleDiagram(diagram);
7792
7793
7794                 var plane = diagram.plane;
7795
7796                 if (!plane) {
7797                     throw new Error('no plane for ' + elementToString(diagram));
7798                 }
7799
7800
7801                 var rootElement = plane.bpmnElement;
7802
7803                 // ensure we default to a suitable display candidate (process or
7804                 // collaboration),
7805                 // even if non is specified in DI
7806                 if (!rootElement) {
7807                     rootElement = findDisplayCandidate(definitions);
7808
7809                     if (!rootElement) {
7810                         return logError('no process or collaboration present to display');
7811                     } else {
7812
7813                         logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));
7814
7815                         // correct DI on the fly
7816                         plane.bpmnElement = rootElement;
7817                         registerDi(plane);
7818                     }
7819                 }
7820
7821
7822                 var ctx = visitRoot(rootElement, plane);
7823
7824                 if (is(rootElement, 'bpmn:Process')) {
7825                     handleProcess(rootElement, ctx);
7826                 } else if (is(rootElement, 'bpmn:Collaboration')) {
7827                     handleCollaboration(rootElement, ctx);
7828
7829                     // force drawing of everything not yet drawn that is part of the target
7830                     // DI
7831                     handleUnhandledProcesses(definitions.rootElements, ctx);
7832                 } else {
7833                     throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));
7834                 }
7835
7836                 // handle all deferred elements
7837                 handleDeferred(deferred);
7838             }
7839
7840             function handleDeferred(deferred) {
7841                 forEach(deferred, function(d) {
7842                     d();
7843                 });
7844             }
7845
7846             function handleProcess(process, context) {
7847                 handleFlowElementsContainer(process, context);
7848                 handleIoSpecification(process.ioSpecification, context);
7849
7850                 handleArtifacts(process.artifacts, context);
7851
7852                 // log process handled
7853                 handledProcesses.push(process);
7854             }
7855
7856             function handleUnhandledProcesses(rootElements) {
7857
7858                 // walk through all processes that have not yet been drawn and draw them
7859                 // if they contain lanes with DI information.
7860                 // we do this to pass the free-floating lane test cases in the MIWG test
7861                 // suite
7862                 var processes = filter(rootElements, function(e) {
7863                     return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;
7864                 });
7865
7866                 processes.forEach(contextual(handleProcess));
7867             }
7868
7869             function handleMessageFlow(messageFlow, context) {
7870                 visitIfDi(messageFlow, context);
7871             }
7872
7873             function handleMessageFlows(messageFlows, context) {
7874                 forEach(messageFlows, contextual(handleMessageFlow, context));
7875             }
7876
7877             function handleDataAssociation(association, context) {
7878                 visitIfDi(association, context);
7879             }
7880
7881             function handleDataInput(dataInput, context) {
7882                 visitIfDi(dataInput, context);
7883             }
7884
7885             function handleDataOutput(dataOutput, context) {
7886                 visitIfDi(dataOutput, context);
7887             }
7888
7889             function handleArtifact(artifact, context) {
7890
7891                 // bpmn:TextAnnotation
7892                 // bpmn:Group
7893                 // bpmn:Association
7894
7895                 visitIfDi(artifact, context);
7896             }
7897
7898             function handleArtifacts(artifacts, context) {
7899
7900                 forEach(artifacts, function(e) {
7901                     if (is(e, 'bpmn:Association')) {
7902                         deferred.push(function() {
7903                             handleArtifact(e, context);
7904                         });
7905                     } else {
7906                         handleArtifact(e, context);
7907                     }
7908                 });
7909             }
7910
7911             function handleIoSpecification(ioSpecification, context) {
7912
7913                 if (!ioSpecification) {
7914                     return;
7915                 }
7916
7917                 forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));
7918                 forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
7919             }
7920
7921             function handleSubProcess(subProcess, context) {
7922                 handleFlowElementsContainer(subProcess, context);
7923                 handleArtifacts(subProcess.artifacts, context);
7924             }
7925
7926             function handleFlowNode(flowNode, context) {
7927                 var childCtx = visitIfDi(flowNode, context);
7928
7929                 if (is(flowNode, 'bpmn:SubProcess')) {
7930                     handleSubProcess(flowNode, childCtx || context);
7931                 }
7932             }
7933
7934             function handleSequenceFlow(sequenceFlow, context) {
7935                 visitIfDi(sequenceFlow, context);
7936             }
7937
7938             function handleDataElement(dataObject, context) {
7939                 visitIfDi(dataObject, context);
7940             }
7941
7942             function handleBoundaryEvent(dataObject, context) {
7943                 visitIfDi(dataObject, context);
7944             }
7945
7946             function handleLane(lane, context) {
7947                 var newContext = visitIfDi(lane, context);
7948
7949                 if (lane.childLaneSet) {
7950                     handleLaneSet(lane.childLaneSet, newContext || context);
7951                 } else {
7952                     var filterList = filter(lane.flowNodeRef, function(e) {
7953                         return e.$type !== 'bpmn:BoundaryEvent';
7954                     });
7955                     handleFlowElements(filterList, newContext || context);
7956                 }
7957             }
7958
7959             function handleLaneSet(laneSet, context) {
7960                 forEach(laneSet.lanes, contextual(handleLane, context));
7961             }
7962
7963             function handleLaneSets(laneSets, context) {
7964                 forEach(laneSets, contextual(handleLaneSet, context));
7965             }
7966
7967             function handleFlowElementsContainer(container, context) {
7968
7969                 if (container.laneSets) {
7970                     handleLaneSets(container.laneSets, context);
7971                     handleNonFlowNodes(container.flowElements);
7972                 } else {
7973                     handleFlowElements(container.flowElements, context);
7974                 }
7975             }
7976
7977             function handleNonFlowNodes(flowElements, context) {
7978                 forEach(flowElements, function(e) {
7979                     if (is(e, 'bpmn:SequenceFlow')) {
7980                         deferred.push(function() {
7981                             handleSequenceFlow(e, context);
7982                         });
7983                     } else if (is(e, 'bpmn:BoundaryEvent')) {
7984                         deferred.unshift(function() {
7985                             handleBoundaryEvent(e, context);
7986                         });
7987                     } else if (is(e, 'bpmn:DataObject')) {
7988                         // SKIP (assume correct referencing via DataObjectReference)
7989                     } else if (is(e, 'bpmn:DataStoreReference')) {
7990                         handleDataElement(e, context);
7991                     } else if (is(e, 'bpmn:DataObjectReference')) {
7992                         handleDataElement(e, context);
7993                     }
7994                 });
7995             }
7996
7997             function handleFlowElements(flowElements, context) {
7998                 forEach(flowElements, function(e) {
7999                     if (is(e, 'bpmn:SequenceFlow')) {
8000                         deferred.push(function() {
8001                             handleSequenceFlow(e, context);
8002                         });
8003                     } else if (is(e, 'bpmn:BoundaryEvent')) {
8004                         deferred.unshift(function() {
8005                             handleBoundaryEvent(e, context);
8006                         });
8007                     } else if (is(e, 'bpmn:FlowNode')) {
8008                         handleFlowNode(e, context);
8009
8010                         if (is(e, 'bpmn:Activity')) {
8011
8012                             handleIoSpecification(e.ioSpecification, context);
8013
8014                             // defer handling of associations
8015                             deferred.push(function() {
8016                                 forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));
8017                                 forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));
8018                             });
8019                         }
8020                     } else if (is(e, 'bpmn:DataObject')) {
8021                         // SKIP (assume correct referencing via DataObjectReference)
8022                     } else if (is(e, 'bpmn:DataStoreReference')) {
8023                         handleDataElement(e, context);
8024                     } else if (is(e, 'bpmn:DataObjectReference')) {
8025                         handleDataElement(e, context);
8026                     } else {
8027                         logError(
8028                             'unrecognized flowElement ' + elementToString(e) + ' in context ' +
8029                             (context ? elementToString(context.businessObject) : null), {
8030                                 element: e,
8031                                 context: context
8032                             });
8033                     }
8034                 });
8035             }
8036
8037             function handleParticipant(participant, context) {
8038                 var newCtx = visitIfDi(participant, context);
8039
8040                 var process = participant.processRef;
8041                 if (process) {
8042                     handleProcess(process, newCtx || context);
8043                 }
8044             }
8045
8046             function handleCollaboration(collaboration) {
8047
8048                 forEach(collaboration.participants, contextual(handleParticipant));
8049
8050                 handleArtifacts(collaboration.artifacts);
8051
8052                 // handle message flows latest in the process
8053                 deferred.push(function() {
8054                     handleMessageFlows(collaboration.messageFlows);
8055                 });
8056             }
8057
8058
8059             // /// API ////////////////////////////////
8060
8061             return {
8062                 handleDefinitions: handleDefinitions
8063             };
8064         }
8065
8066         module.exports = BpmnTreeWalker;
8067     }, {
8068         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js",
8069         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
8070         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
8071         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
8072         "object-refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js"
8073     }],
8074     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Importer.js": [function(require, module, exports) {
8075         'use strict';
8076
8077         var BpmnTreeWalker = require('./BpmnTreeWalker');
8078
8079
8080         /**
8081          * Import the definitions into a diagram.
8082          * 
8083          * Errors and warnings are reported through the specified callback.
8084          * 
8085          * @param {Diagram}
8086          *            diagram
8087          * @param {ModdleElement}
8088          *            definitions
8089          * @param {Function}
8090          *            done the callback, invoked with (err, [ warning ]) once the import
8091          *            is done
8092          */
8093         function importBpmnDiagram(diagram, definitions, done) {
8094
8095             var importer = diagram.get('bpmnImporter'),
8096                 eventBus = diagram.get('eventBus');
8097
8098             var error,
8099                 warnings = [];
8100
8101             function parse(definitions) {
8102
8103                 var visitor = {
8104
8105                     root: function(element) {
8106                         return importer.add(element);
8107                     },
8108
8109                     element: function(element, parentShape) {
8110                         return importer.add(element, parentShape);
8111                     },
8112
8113                     error: function(message, context) {
8114                         warnings.push({
8115                             message: message,
8116                             context: context
8117                         });
8118                     }
8119                 };
8120
8121                 var walker = new BpmnTreeWalker(visitor);
8122
8123                 // import
8124                 walker.handleDefinitions(definitions);
8125             }
8126
8127             eventBus.fire('import.start');
8128
8129             try {
8130                 parse(definitions);
8131             } catch (e) {
8132                 error = e;
8133             }
8134
8135             eventBus.fire(error ? 'import.error' : 'import.success', {
8136                 error: error,
8137                 warnings: warnings
8138             });
8139             done(error, warnings);
8140         }
8141
8142         module.exports.importBpmnDiagram = importBpmnDiagram;
8143     }, {
8144         "./BpmnTreeWalker": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnTreeWalker.js"
8145     }],
8146     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js": [function(require, module, exports) {
8147         'use strict';
8148
8149         module.exports.elementToString = function(e) {
8150             if (!e) {
8151                 return '<null>';
8152             }
8153
8154             return '<' + e.$type + (e.id ? ' id="' + e.id : '') + '" />';
8155         };
8156     }, {}],
8157     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\index.js": [function(require, module, exports) {
8158         module.exports = {
8159             bpmnImporter: ['type', require('./BpmnImporter')]
8160         };
8161     }, {
8162         "./BpmnImporter": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnImporter.js"
8163     }],
8164     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js": [function(require, module, exports) {
8165         'use strict';
8166
8167         var is = require('./ModelUtil').is,
8168             getBusinessObject = require('./ModelUtil').getBusinessObject;
8169
8170         module.exports.isExpanded = function(element) {
8171
8172             if (is(element, 'bpmn:CallActivity')) {
8173                 return false;
8174             }
8175
8176             if (is(element, 'bpmn:SubProcess')) {
8177                 return getBusinessObject(element).di.isExpanded;
8178             }
8179
8180             if (is(element, 'bpmn:Participant')) {
8181                 return !!getBusinessObject(element).processRef;
8182             }
8183
8184             return true;
8185         };
8186
8187     }, {
8188         "./ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js"
8189     }],
8190     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js": [function(require, module, exports) {
8191         'use strict';
8192
8193         var assign = require('lodash/object/assign');
8194
8195
8196         var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {
8197             width: 90,
8198             height: 20
8199         };
8200
8201
8202         /**
8203          * Returns true if the given semantic has an external label
8204          * 
8205          * @param {BpmnElement}
8206          *            semantic
8207          * @return {Boolean} true if has label
8208          */
8209         module.exports.hasExternalLabel = function(semantic) {
8210
8211             return semantic.$instanceOf('bpmn:Event') ||
8212                 // semantic.$instanceOf('bpmn:Gateway') ||
8213                 semantic.$instanceOf('bpmn:DataStoreReference') ||
8214                 semantic.$instanceOf('bpmn:DataObjectReference') ||
8215                 semantic.$instanceOf('bpmn:SequenceFlow') ||
8216                 semantic.$instanceOf('bpmn:MessageFlow');
8217         };
8218
8219
8220         /**
8221          * Get the middle of a number of waypoints
8222          * 
8223          * @param {Array
8224          *            <Point>} waypoints
8225          * @return {Point} the mid point
8226          */
8227         var getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {
8228
8229             var mid = waypoints.length / 2 - 1;
8230
8231             var first = waypoints[Math.floor(mid)];
8232             var second = waypoints[Math.ceil(mid + 0.01)];
8233
8234             return {
8235                 x: first.x + (second.x - first.x) / 2,
8236                 y: first.y + (second.y - first.y) / 2
8237             };
8238         };
8239
8240
8241         var getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {
8242
8243             if (element.waypoints) {
8244                 return getWaypointsMid(element.waypoints);
8245             } else {
8246                 return {
8247                     x: element.x + element.width / 2,
8248                     y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2
8249                 };
8250             }
8251         };
8252
8253         /**
8254          * Returns the bounds of an elements label, parsed from the elements DI or
8255          * generated from its bounds.
8256          * 
8257          * @param {BpmnElement}
8258          *            semantic
8259          * @param {djs.model.Base}
8260          *            element
8261          */
8262         module.exports.getExternalLabelBounds = function(semantic, element) {
8263
8264             var mid,
8265                 size,
8266                 bounds,
8267                 di = semantic.di,
8268                 label = di.label;
8269
8270             if (label && label.bounds) {
8271                 bounds = label.bounds;
8272
8273                 size = {
8274                     width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),
8275                     height: bounds.height
8276                 };
8277
8278                 mid = {
8279                     x: bounds.x + bounds.width / 2,
8280                     y: bounds.y + bounds.height / 2
8281                 };
8282             } else {
8283
8284                 mid = getExternalLabelMid(element);
8285
8286                 size = DEFAULT_LABEL_SIZE;
8287             }
8288
8289             return assign({
8290                 x: mid.x - size.width / 2,
8291                 y: mid.y - size.height / 2
8292             }, size);
8293         };
8294     }, {
8295         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
8296     }],
8297     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js": [function(require, module, exports) {
8298         'use strict';
8299
8300         /**
8301          * Is an element of the given BPMN type?
8302          * 
8303          * @param {djs.model.Base|ModdleElement}
8304          *            element
8305          * @param {String}
8306          *            type
8307          * 
8308          * @return {Boolean}
8309          */
8310         function is(element, type) {
8311             var bo = getBusinessObject(element);
8312
8313             return bo && bo.$instanceOf(type);
8314         }
8315
8316         module.exports.is = is;
8317
8318
8319         /**
8320          * Return the business object for a given element.
8321          * 
8322          * @param {djs.model.Base|ModdleElement}
8323          *            element
8324          * 
8325          * @return {ModdleElement}
8326          */
8327         function getBusinessObject(element) {
8328             return (element && element.businessObject) || element;
8329         }
8330
8331         module.exports.getBusinessObject = getBusinessObject;
8332
8333     }, {}],
8334     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\index.js": [function(require, module, exports) {
8335         module.exports = require('./lib/simple');
8336     }, {
8337         "./lib/simple": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\simple.js"
8338     }],
8339     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\bpmn-moddle.js": [function(require, module, exports) {
8340         'use strict';
8341
8342         var isString = require('lodash/lang/isString'),
8343             isFunction = require('lodash/lang/isFunction'),
8344             assign = require('lodash/object/assign');
8345
8346         var Moddle = require('moddle'),
8347             XmlReader = require('moddle-xml/lib/reader'),
8348             XmlWriter = require('moddle-xml/lib/writer');
8349
8350         /**
8351          * A sub class of {@link Moddle} with support for import and export of BPMN 2.0
8352          * xml files.
8353          * 
8354          * @class BpmnModdle
8355          * @extends Moddle
8356          * 
8357          * @param {Object|Array}
8358          *            packages to use for instantiating the model
8359          * @param {Object}
8360          *            [options] additional options to pass over
8361          */
8362         function BpmnModdle(packages, options) {
8363             Moddle.call(this, packages, options);
8364         }
8365
8366         BpmnModdle.prototype = Object.create(Moddle.prototype);
8367
8368         module.exports = BpmnModdle;
8369
8370
8371         /**
8372          * Instantiates a BPMN model tree from a given xml string.
8373          * 
8374          * @param {String}
8375          *            xmlStr
8376          * @param {String}
8377          *            [typeName='bpmn:Definitions'] name of the root element
8378          * @param {Object}
8379          *            [options] options to pass to the underlying reader
8380          * @param {Function}
8381          *            done callback that is invoked with (err, result, parseContext)
8382          *            once the import completes
8383          */
8384         BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {
8385
8386             if (!isString(typeName)) {
8387                 done = options;
8388                 options = typeName;
8389                 typeName = 'bpmn:Definitions';
8390             }
8391
8392             if (isFunction(options)) {
8393                 done = options;
8394                 options = {};
8395             }
8396
8397             var reader = new XmlReader(assign({
8398                 model: this,
8399                 lax: true
8400             }, options));
8401             var rootHandler = reader.handler(typeName);
8402
8403             reader.fromXML(xmlStr, rootHandler, done);
8404         };
8405
8406
8407         /**
8408          * Serializes a BPMN 2.0 object tree to XML.
8409          * 
8410          * @param {String}
8411          *            element the root element, typically an instance of
8412          *            `bpmn:Definitions`
8413          * @param {Object}
8414          *            [options] to pass to the underlying writer
8415          * @param {Function}
8416          *            done callback invoked with (err, xmlStr) once the import completes
8417          */
8418         
8419       
8420         
8421         
8422         BpmnModdle.prototype.toXML = function(element, options, done) {
8423
8424             if (isFunction(options)) {
8425                 done = options;
8426                 options = {};
8427             }
8428
8429             var writer = new XmlWriter(options);
8430             try {
8431                 var result = writer.toXML(element);
8432                 modelXML = result;
8433                 list_models[selected_model]=result;
8434                 done(null, result);
8435             } catch (e) {
8436                 done(e);
8437             }
8438         };
8439
8440     }, {
8441         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
8442         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
8443         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
8444         "moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js",
8445         "moddle-xml/lib/reader": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\reader.js",
8446         "moddle-xml/lib/writer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\writer.js"
8447     }],
8448     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\id-support.js": [function(require, module, exports) {
8449         'use strict';
8450
8451         var ID_PATTERN = /^(.*:)?id$/;
8452
8453         /**
8454          * Extends the bpmn instance with id support.
8455          * 
8456          * @example
8457          * 
8458          * var moddle, ids;
8459          * 
8460          * require('id-support').extend(moddle, ids);
8461          * 
8462          * moddle.ids.next(); // create a next id moddle.ids; // ids instance
8463          *  // claims id as used moddle.create('foo:Bar', { id: 'fooobar1' });
8464          * 
8465          * 
8466          * @param {Moddle}
8467          *            model
8468          * @param {Ids}
8469          *            ids
8470          * 
8471          * @return {Moddle} the extended moddle instance
8472          */
8473         module.exports.extend = function(model, ids) {
8474
8475             var set = model.properties.set;
8476
8477             // do not reinitialize setter
8478             // unless it is already initialized
8479             if (!model.ids) {
8480
8481                 model.properties.set = function(target, property, value) {
8482
8483                     // ensure we log used ids once they are assigned
8484                     // to model elements
8485                     if (ID_PATTERN.test(property)) {
8486
8487                         var assigned = model.ids.assigned(value);
8488                         if (assigned && assigned !== target) {
8489                             throw new Error('id <' + value + '> already used');
8490                         }
8491
8492                         model.ids.claim(value, target);
8493                     }
8494
8495                     set.call(this, target, property, value);
8496                 };
8497             }
8498
8499             model.ids = ids;
8500
8501             return model;
8502         };
8503     }, {}],
8504     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\simple.js": [function(require, module, exports) {
8505         'use strict';
8506
8507         var assign = require('lodash/object/assign');
8508
8509         var BpmnModdle = require('./bpmn-moddle');
8510
8511         var packages = {
8512             bpmn: require('../resources/bpmn/json/bpmn.json'),
8513             bpmndi: require('../resources/bpmn/json/bpmndi.json'),
8514             dc: require('../resources/bpmn/json/dc.json'),
8515             di: require('../resources/bpmn/json/di.json')
8516         };
8517
8518         module.exports = function(additionalPackages, options) {
8519             return new BpmnModdle(assign({}, packages, additionalPackages), options);
8520         };
8521     }, {
8522         "../resources/bpmn/json/bpmn.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmn.json",
8523         "../resources/bpmn/json/bpmndi.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmndi.json",
8524         "../resources/bpmn/json/dc.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\dc.json",
8525         "../resources/bpmn/json/di.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\di.json",
8526         "./bpmn-moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\bpmn-moddle.js",
8527         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
8528     }],
8529     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js": [function(require, module, exports) {
8530         'use strict';
8531
8532         function capitalize(string) {
8533             return string.charAt(0).toUpperCase() + string.slice(1);
8534         }
8535
8536         function lower(string) {
8537             return string.charAt(0).toLowerCase() + string.slice(1);
8538         }
8539
8540         function hasLowerCaseAlias(pkg) {
8541             return pkg.xml && pkg.xml.tagAlias === 'lowerCase';
8542         }
8543
8544
8545         module.exports.aliasToName = function(alias, pkg) {
8546             if (hasLowerCaseAlias(pkg)) {
8547                 return capitalize(alias);
8548             } else {
8549                 return alias;
8550             }
8551         };
8552
8553         module.exports.nameToAlias = function(name, pkg) {
8554             if (hasLowerCaseAlias(pkg)) {
8555                 return lower(name);
8556             } else {
8557                 return name;
8558             }
8559         };
8560
8561         module.exports.DEFAULT_NS_MAP = {
8562             'xsi': 'http://www.w3.org/2001/XMLSchema-instance'
8563         };
8564
8565         module.exports.XSI_TYPE = 'xsi:type';
8566     }, {}],
8567     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\reader.js": [function(require, module, exports) {
8568         'use strict';
8569
8570         var reduce = require('lodash/collection/reduce'),
8571             forEach = require('lodash/collection/forEach'),
8572             find = require('lodash/collection/find'),
8573             assign = require('lodash/object/assign'),
8574             defer = require('lodash/function/defer');
8575
8576         var Stack = require('tiny-stack'),
8577             SaxParser = require('sax').parser,
8578             Moddle = require('moddle'),
8579             parseNameNs = require('moddle/lib/ns').parseName,
8580             Types = require('moddle/lib/types'),
8581             coerceType = Types.coerceType,
8582             isSimpleType = Types.isSimple,
8583             common = require('./common'),
8584             XSI_TYPE = common.XSI_TYPE,
8585             XSI_URI = common.DEFAULT_NS_MAP.xsi,
8586             aliasToName = common.aliasToName;
8587
8588         function parseNodeAttributes(node) {
8589             var nodeAttrs = node.attributes;
8590
8591             return reduce(nodeAttrs, function(result, v, k) {
8592                 var name, ns;
8593
8594                 if (!v.local) {
8595                     name = v.prefix;
8596                 } else {
8597                     ns = parseNameNs(v.name, v.prefix);
8598                     name = ns.name;
8599                 }
8600
8601                 result[name] = v.value;
8602                 return result;
8603             }, {});
8604         }
8605
8606         function normalizeType(node, attr, model) {
8607             var nameNs = parseNameNs(attr.value);
8608
8609             var uri = node.ns[nameNs.prefix || ''],
8610                 localName = nameNs.localName,
8611                 pkg = uri && model.getPackage(uri),
8612                 typePrefix;
8613
8614             if (pkg) {
8615                 typePrefix = pkg.xml && pkg.xml.typePrefix;
8616
8617                 if (typePrefix && localName.indexOf(typePrefix) === 0) {
8618                     localName = localName.slice(typePrefix.length);
8619                 }
8620
8621                 attr.value = pkg.prefix + ':' + localName;
8622             }
8623         }
8624
8625         /**
8626          * Normalizes namespaces for a node given an optional default namespace and a
8627          * number of mappings from uris to default prefixes.
8628          * 
8629          * @param {XmlNode}
8630          *            node
8631          * @param {Model}
8632          *            model the model containing all registered namespaces
8633          * @param {Uri}
8634          *            defaultNsUri
8635          */
8636         function normalizeNamespaces(node, model, defaultNsUri) {
8637             var uri, prefix;
8638
8639             uri = node.uri || defaultNsUri;
8640
8641             if (uri) {
8642                 var pkg = model.getPackage(uri);
8643
8644                 if (pkg) {
8645                     prefix = pkg.prefix;
8646                 } else {
8647                     prefix = node.prefix;
8648                 }
8649
8650                 node.prefix = prefix;
8651                 node.uri = uri;
8652             }
8653
8654             forEach(node.attributes, function(attr) {
8655
8656                 // normalize xsi:type attributes because the
8657                 // assigned type may or may not be namespace prefixed
8658                 if (attr.uri === XSI_URI && attr.local === 'type') {
8659                     normalizeType(node, attr, model);
8660                 }
8661
8662                 normalizeNamespaces(attr, model, null);
8663             });
8664         }
8665
8666
8667         /**
8668          * A parse context.
8669          * 
8670          * @class
8671          * 
8672          * @param {Object}
8673          *            options
8674          * @param {ElementHandler}
8675          *            options.parseRoot the root handler for parsing a document
8676          * @param {boolean}
8677          *            [options.lax=false] whether or not to ignore invalid elements
8678          */
8679         function Context(options) {
8680
8681             /**
8682              * @property {ElementHandler} parseRoot
8683              */
8684
8685             /**
8686              * @property {Boolean} lax
8687              */
8688
8689             assign(this, options);
8690
8691             var elementsById = this.elementsById = {};
8692             var references = this.references = [];
8693             var warnings = this.warnings = [];
8694
8695             this.addReference = function(reference) {
8696                 references.push(reference);
8697             };
8698
8699             this.addElement = function(id, element) {
8700
8701                 if (!id || !element) {
8702                     throw new Error('[xml-reader] id or ctx must not be null');
8703                 }
8704
8705                 elementsById[id] = element;
8706             };
8707
8708             this.addWarning = function(w) {
8709                 warnings.push(w);
8710             };
8711         }
8712
8713         function BaseHandler() {}
8714
8715         BaseHandler.prototype.handleEnd = function() {};
8716         BaseHandler.prototype.handleText = function() {};
8717         BaseHandler.prototype.handleNode = function() {};
8718
8719
8720         /**
8721          * A simple pass through handler that does nothing except for ignoring all input
8722          * it receives.
8723          * 
8724          * This is used to ignore unknown elements and attributes.
8725          */
8726         function NoopHandler() {}
8727
8728         NoopHandler.prototype = new BaseHandler();
8729
8730         NoopHandler.prototype.handleNode = function() {
8731             return this;
8732         };
8733
8734         function BodyHandler() {}
8735
8736         BodyHandler.prototype = new BaseHandler();
8737
8738         BodyHandler.prototype.handleText = function(text) {
8739             this.body = (this.body || '') + text;
8740         };
8741
8742         function ReferenceHandler(property, context) {
8743             this.property = property;
8744             this.context = context;
8745         }
8746
8747         ReferenceHandler.prototype = new BodyHandler();
8748
8749         ReferenceHandler.prototype.handleNode = function(node) {
8750
8751             if (this.element) {
8752                 throw new Error('expected no sub nodes');
8753             } else {
8754                 this.element = this.createReference(node);
8755             }
8756
8757             return this;
8758         };
8759
8760         ReferenceHandler.prototype.handleEnd = function() {
8761             this.element.id = this.body;
8762         };
8763
8764         ReferenceHandler.prototype.createReference = function() {
8765             return {
8766                 property: this.property.ns.name,
8767                 id: ''
8768             };
8769         };
8770
8771         function ValueHandler(propertyDesc, element) {
8772             this.element = element;
8773             this.propertyDesc = propertyDesc;
8774         }
8775
8776         ValueHandler.prototype = new BodyHandler();
8777
8778         ValueHandler.prototype.handleEnd = function() {
8779
8780             var value = this.body,
8781                 element = this.element,
8782                 propertyDesc = this.propertyDesc;
8783
8784             value = coerceType(propertyDesc.type, value);
8785
8786             if (propertyDesc.isMany) {
8787                 element.get(propertyDesc.name).push(value);
8788             } else {
8789                 element.set(propertyDesc.name, value);
8790             }
8791         };
8792
8793
8794         function BaseElementHandler() {}
8795
8796         BaseElementHandler.prototype = Object.create(BodyHandler.prototype);
8797
8798         BaseElementHandler.prototype.handleNode = function(node) {
8799             var parser = this,
8800                 element = this.element,
8801                 id;
8802
8803             if (!element) {
8804                 element = this.element = this.createElement(node);
8805                 id = element.id;
8806
8807                 if (id) {
8808                     this.context.addElement(id, element);
8809                 }
8810             } else {
8811                 parser = this.handleChild(node);
8812             }
8813
8814             return parser;
8815         };
8816
8817         /**
8818          * @class XMLReader.ElementHandler
8819          * 
8820          */
8821         function ElementHandler(model, type, context) {
8822             this.model = model;
8823             this.type = model.getType(type);
8824             this.context = context;
8825         }
8826
8827         ElementHandler.prototype = new BaseElementHandler();
8828
8829         ElementHandler.prototype.addReference = function(reference) {
8830             this.context.addReference(reference);
8831         };
8832
8833         ElementHandler.prototype.handleEnd = function() {
8834
8835             var value = this.body,
8836                 element = this.element,
8837                 descriptor = element.$descriptor,
8838                 bodyProperty = descriptor.bodyProperty;
8839
8840             if (bodyProperty && value !== undefined) {
8841                 value = coerceType(bodyProperty.type, value);
8842                 element.set(bodyProperty.name, value);
8843             }
8844         };
8845
8846         /**
8847          * Create an instance of the model from the given node.
8848          * 
8849          * @param {Element}
8850          *            node the xml node
8851          */
8852         ElementHandler.prototype.createElement = function(node) {
8853             var attributes = parseNodeAttributes(node),
8854                 Type = this.type,
8855                 descriptor = Type.$descriptor,
8856                 context = this.context,
8857                 instance = new Type({});
8858
8859             forEach(attributes, function(value, name) {
8860
8861                 var prop = descriptor.propertiesByName[name];
8862
8863                 if (prop && prop.isReference) {
8864                     context.addReference({
8865                         element: instance,
8866                         property: prop.ns.name,
8867                         id: value
8868                     });
8869                 } else {
8870                     if (prop) {
8871                         value = coerceType(prop.type, value);
8872                     }
8873
8874                     instance.set(name, value);
8875                 }
8876             });
8877
8878             return instance;
8879         };
8880
8881         ElementHandler.prototype.getPropertyForNode = function(node) {
8882
8883             var nameNs = parseNameNs(node.local, node.prefix);
8884
8885             var type = this.type,
8886                 model = this.model,
8887                 descriptor = type.$descriptor;
8888
8889             var propertyName = nameNs.name,
8890                 property = descriptor.propertiesByName[propertyName],
8891                 elementTypeName,
8892                 elementType,
8893                 typeAnnotation;
8894
8895             // search for properties by name first
8896
8897             if (property) {
8898
8899                 if (property.serialize === XSI_TYPE) {
8900                     typeAnnotation = node.attributes[XSI_TYPE];
8901
8902                     // xsi type is optional, if it does not exists the
8903                     // default type is assumed
8904                     if (typeAnnotation) {
8905
8906                         elementTypeName = typeAnnotation.value;
8907
8908                         // TODO: extract real name from attribute
8909                         elementType = model.getType(elementTypeName);
8910
8911                         return assign({}, property, {
8912                             effectiveType: elementType.$descriptor.name
8913                         });
8914                     }
8915                 }
8916
8917                 // search for properties by name first
8918                 return property;
8919             }
8920
8921
8922             var pkg = model.getPackage(nameNs.prefix);
8923
8924             if (pkg) {
8925                 elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);
8926                 elementType = model.getType(elementTypeName);
8927
8928                 // search for collection members later
8929                 property = find(descriptor.properties, function(p) {
8930                     return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);
8931                 });
8932
8933                 if (property) {
8934                     return assign({}, property, {
8935                         effectiveType: elementType.$descriptor.name
8936                     });
8937                 }
8938             } else {
8939                 // parse unknown element (maybe extension)
8940                 property = find(descriptor.properties, function(p) {
8941                     return !p.isReference && !p.isAttribute && p.type === 'Element';
8942                 });
8943
8944                 if (property) {
8945                     return property;
8946                 }
8947             }
8948
8949             throw new Error('unrecognized element <' + nameNs.name + '>');
8950         };
8951
8952         ElementHandler.prototype.toString = function() {
8953             return 'ElementDescriptor[' + this.type.$descriptor.name + ']';
8954         };
8955
8956         ElementHandler.prototype.valueHandler = function(propertyDesc, element) {
8957             return new ValueHandler(propertyDesc, element);
8958         };
8959
8960         ElementHandler.prototype.referenceHandler = function(propertyDesc) {
8961             return new ReferenceHandler(propertyDesc, this.context);
8962         };
8963
8964         ElementHandler.prototype.handler = function(type) {
8965             if (type === 'Element') {
8966                 return new GenericElementHandler(this.model, type, this.context);
8967             } else {
8968                 return new ElementHandler(this.model, type, this.context);
8969             }
8970         };
8971
8972         /**
8973          * Handle the child element parsing
8974          * 
8975          * @param {Element}
8976          *            node the xml node
8977          */
8978         ElementHandler.prototype.handleChild = function(node) {
8979             var propertyDesc, type, element, childHandler;
8980
8981             propertyDesc = this.getPropertyForNode(node);
8982             element = this.element;
8983
8984             type = propertyDesc.effectiveType || propertyDesc.type;
8985
8986             if (isSimpleType(type)) {
8987                 return this.valueHandler(propertyDesc, element);
8988             }
8989
8990             if (propertyDesc.isReference) {
8991                 childHandler = this.referenceHandler(propertyDesc).handleNode(node);
8992             } else {
8993                 childHandler = this.handler(type).handleNode(node);
8994             }
8995
8996             var newElement = childHandler.element;
8997
8998             // child handles may decide to skip elements
8999             // by not returning anything
9000             if (newElement !== undefined) {
9001
9002                 if (propertyDesc.isMany) {
9003                     element.get(propertyDesc.name).push(newElement);
9004                 } else {
9005                     element.set(propertyDesc.name, newElement);
9006                 }
9007
9008                 if (propertyDesc.isReference) {
9009                     assign(newElement, {
9010                         element: element
9011                     });
9012
9013                     this.context.addReference(newElement);
9014                 } else {
9015                     // establish child -> parent relationship
9016                     newElement.$parent = element;
9017                 }
9018             }
9019
9020             return childHandler;
9021         };
9022
9023
9024         function GenericElementHandler(model, type, context) {
9025             this.model = model;
9026             this.context = context;
9027         }
9028
9029         GenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);
9030
9031         GenericElementHandler.prototype.createElement = function(node) {
9032
9033             var name = node.name,
9034                 prefix = node.prefix,
9035                 uri = node.ns[prefix],
9036                 attributes = node.attributes;
9037
9038             return this.model.createAny(name, uri, attributes);
9039         };
9040
9041         GenericElementHandler.prototype.handleChild = function(node) {
9042
9043             var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),
9044                 element = this.element;
9045
9046             var newElement = handler.element,
9047                 children;
9048
9049             if (newElement !== undefined) {
9050                 children = element.$children = element.$children || [];
9051                 children.push(newElement);
9052
9053                 // establish child -> parent relationship
9054                 newElement.$parent = element;
9055             }
9056
9057             return handler;
9058         };
9059
9060         GenericElementHandler.prototype.handleText = function(text) {
9061             this.body = this.body || '' + text;
9062         };
9063
9064         GenericElementHandler.prototype.handleEnd = function() {
9065             if (this.body) {
9066                 this.element.$body = this.body;
9067             }
9068         };
9069
9070         /**
9071          * A reader for a meta-model
9072          * 
9073          * @param {Object}
9074          *            options
9075          * @param {Model}
9076          *            options.model used to read xml files
9077          * @param {Boolean}
9078          *            options.lax whether to make parse errors warnings
9079          */
9080         function XMLReader(options) {
9081
9082             if (options instanceof Moddle) {
9083                 options = {
9084                     model: options
9085                 };
9086             }
9087
9088             assign(this, {
9089                 lax: false
9090             }, options);
9091         }
9092
9093
9094         XMLReader.prototype.fromXML = function(xml, rootHandler, done) {
9095
9096             var model = this.model,
9097                 lax = this.lax,
9098                 context = new Context({
9099                     parseRoot: rootHandler
9100                 });
9101
9102             var parser = new SaxParser(true, {
9103                     xmlns: true,
9104                     trim: true
9105                 }),
9106                 stack = new Stack();
9107
9108             rootHandler.context = context;
9109
9110             // push root handler
9111             stack.push(rootHandler);
9112
9113
9114             function resolveReferences() {
9115
9116                 var elementsById = context.elementsById;
9117                 var references = context.references;
9118
9119                 var i, r;
9120
9121                 for (i = 0; !!(r = references[i]); i++) {
9122                     var element = r.element;
9123                     var reference = elementsById[r.id];
9124                     var property = element.$descriptor.propertiesByName[r.property];
9125
9126                     if (!reference) {
9127                         context.addWarning({
9128                             message: 'unresolved reference <' + r.id + '>',
9129                             element: r.element,
9130                             property: r.property,
9131                             value: r.id
9132                         });
9133                     }
9134
9135                     if (property.isMany) {
9136                         var collection = element.get(property.name),
9137                             idx = collection.indexOf(r);
9138
9139                         if (!reference) {
9140                             // remove unresolvable reference
9141                             collection.splice(idx, 1);
9142                         } else {
9143                             // update reference
9144                             collection[idx] = reference;
9145                         }
9146                     } else {
9147                         element.set(property.name, reference);
9148                     }
9149                 }
9150             }
9151
9152             function handleClose(tagName) {
9153                 stack.pop().handleEnd();
9154             }
9155
9156             function handleOpen(node) {
9157                 var handler = stack.peek();
9158
9159                 normalizeNamespaces(node, model);
9160
9161                 try {
9162                     stack.push(handler.handleNode(node));
9163                 } catch (e) {
9164
9165                     var line = this.line,
9166                         column = this.column;
9167
9168                     var message =
9169                         'unparsable content <' + node.name + '> detected\n\t' +
9170                         'line: ' + line + '\n\t' +
9171                         'column: ' + column + '\n\t' +
9172                         'nested error: ' + e.message;
9173
9174                     if (lax) {
9175                         context.addWarning({
9176                             message: message,
9177                             error: e
9178                         });
9179
9180                         console.warn('could not parse node');
9181                         console.warn(e);
9182
9183                         stack.push(new NoopHandler());
9184                     } else {
9185                         console.error('could not parse document');
9186                         console.error(e);
9187
9188                         throw new Error(message);
9189                     }
9190                 }
9191             }
9192
9193             function handleText(text) {
9194                 stack.peek().handleText(text);
9195             }
9196
9197             parser.onopentag = handleOpen;
9198             parser.oncdata = parser.ontext = handleText;
9199             parser.onclosetag = handleClose;
9200             parser.onend = resolveReferences;
9201
9202             // deferred parse XML to make loading really ascnchronous
9203             // this ensures the execution environment (node or browser)
9204             // is kept responsive and that certain optimization strategies
9205             // can kick in
9206             defer(function() {
9207                 var error;
9208
9209                 try {
9210                     parser.write(xml).close();
9211                 } catch (e) {
9212                     error = e;
9213                 }
9214
9215                 done(error, error ? undefined : rootHandler.element, context);
9216             });
9217         };
9218
9219         XMLReader.prototype.handler = function(name) {
9220             return new ElementHandler(this.model, name);
9221         };
9222
9223         module.exports = XMLReader;
9224         module.exports.ElementHandler = ElementHandler;
9225     }, {
9226         "./common": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js",
9227         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
9228         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
9229         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
9230         "lodash/function/defer": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\defer.js",
9231         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
9232         "moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js",
9233         "moddle/lib/ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
9234         "moddle/lib/types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js",
9235         "sax": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\sax\\lib\\sax.js",
9236         "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"
9237     }],
9238     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\writer.js": [function(require, module, exports) {
9239         'use strict';
9240
9241         var map = require('lodash/collection/map'),
9242             forEach = require('lodash/collection/forEach'),
9243             isString = require('lodash/lang/isString'),
9244             filter = require('lodash/collection/filter'),
9245             assign = require('lodash/object/assign');
9246
9247         var Types = require('moddle/lib/types'),
9248             parseNameNs = require('moddle/lib/ns').parseName,
9249             common = require('./common'),
9250             nameToAlias = common.nameToAlias;
9251
9252         var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
9253             ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
9254             DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
9255             XSI_TYPE = common.XSI_TYPE;
9256
9257
9258         function nsName(ns) {
9259             if (isString(ns)) {
9260                 return ns;
9261             } else {
9262                 return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;
9263             }
9264         }
9265
9266         function getElementNs(ns, descriptor) {
9267             if (descriptor.isGeneric) {
9268                 return descriptor.name;
9269             } else {
9270                 return assign({
9271                     localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg)
9272                 }, ns);
9273             }
9274         }
9275
9276         function getPropertyNs(ns, descriptor) {
9277             return assign({
9278                 localName: descriptor.ns.localName
9279             }, ns);
9280         }
9281
9282         function getSerializableProperties(element) {
9283             var descriptor = element.$descriptor;
9284
9285             return filter(descriptor.properties, function(p) {
9286                 var name = p.name;
9287
9288                 // do not serialize defaults
9289                 if (!element.hasOwnProperty(name)) {
9290                     return false;
9291                 }
9292
9293                 var value = element[name];
9294
9295                 // do not serialize default equals
9296                 if (value === p.default) {
9297                     return false;
9298                 }
9299
9300                 return p.isMany ? value.length : true;
9301             });
9302         }
9303
9304         var ESCAPE_MAP = {
9305             '\n': '10',
9306             '\n\r': '10',
9307             '"': '34',
9308             '\'': '39',
9309             '<': '60',
9310             '>': '62',
9311             '&': '38'
9312         };
9313
9314         /**
9315          * Escape a string attribute to not contain any bad values (line breaks, '"',
9316          * ...)
9317          * 
9318          * @param {String}
9319          *            str the string to escape
9320          * @return {String} the escaped string
9321          */
9322         function escapeAttr(str) {
9323
9324             // ensure we are handling strings here
9325             str = isString(str) ? str : '' + str;
9326
9327             return str.replace(ESCAPE_CHARS, function(str) {
9328                 return '&#' + ESCAPE_MAP[str] + ';';
9329             });
9330         }
9331
9332         function filterAttributes(props) {
9333             return filter(props, function(p) {
9334                 return p.isAttr;
9335             });
9336         }
9337
9338         function filterContained(props) {
9339             return filter(props, function(p) {
9340                 return !p.isAttr;
9341             });
9342         }
9343
9344
9345         function ReferenceSerializer(parent, ns) {
9346             this.ns = ns;
9347         }
9348
9349         ReferenceSerializer.prototype.build = function(element) {
9350             this.element = element;
9351             return this;
9352         };
9353
9354         ReferenceSerializer.prototype.serializeTo = function(writer) {
9355             writer
9356                 .appendIndent()
9357                 .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')
9358                 .appendNewLine();
9359         };
9360
9361         function BodySerializer() {}
9362
9363         BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
9364             var escape = this.escape;
9365
9366             if (escape) {
9367                 writer.append('<![CDATA[');
9368             }
9369
9370             writer.append(this.value);
9371
9372             if (escape) {
9373                 writer.append(']]>');
9374             }
9375         };
9376
9377         BodySerializer.prototype.build = function(prop, value) {
9378             this.value = value;
9379
9380             if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {
9381                 this.escape = true;
9382             }
9383
9384             return this;
9385         };
9386
9387         function ValueSerializer(ns) {
9388             this.ns = ns;
9389         }
9390
9391         ValueSerializer.prototype = new BodySerializer();
9392
9393         ValueSerializer.prototype.serializeTo = function(writer) {
9394
9395             writer
9396                 .appendIndent()
9397                 .append('<' + nsName(this.ns) + '>');
9398
9399             this.serializeValue(writer);
9400
9401             writer
9402                 .append('</' + nsName(this.ns) + '>')
9403                 .appendNewLine();
9404         };
9405
9406         function ElementSerializer(parent, ns) {
9407             this.body = [];
9408             this.attrs = [];
9409
9410             this.parent = parent;
9411             this.ns = ns;
9412         }
9413
9414         ElementSerializer.prototype.build = function(element) {
9415             this.element = element;
9416
9417             var otherAttrs = this.parseNsAttributes(element);
9418
9419             if (!this.ns) {
9420                 this.ns = this.nsTagName(element.$descriptor);
9421             }
9422
9423             if (element.$descriptor.isGeneric) {
9424                 this.parseGeneric(element);
9425             } else {
9426                 var properties = getSerializableProperties(element);
9427
9428                 this.parseAttributes(filterAttributes(properties));
9429                 this.parseContainments(filterContained(properties));
9430
9431                 this.parseGenericAttributes(element, otherAttrs);
9432             }
9433
9434             return this;
9435         };
9436
9437         ElementSerializer.prototype.nsTagName = function(descriptor) {
9438             var effectiveNs = this.logNamespaceUsed(descriptor.ns);
9439             return getElementNs(effectiveNs, descriptor);
9440         };
9441
9442         ElementSerializer.prototype.nsPropertyTagName = function(descriptor) {
9443             var effectiveNs = this.logNamespaceUsed(descriptor.ns);
9444             return getPropertyNs(effectiveNs, descriptor);
9445         };
9446
9447         ElementSerializer.prototype.isLocalNs = function(ns) {
9448             return ns.uri === this.ns.uri;
9449         };
9450
9451         ElementSerializer.prototype.nsAttributeName = function(element) {
9452
9453             var ns;
9454
9455             if (isString(element)) {
9456                 ns = parseNameNs(element);
9457             } else
9458             if (element.ns) {
9459                 ns = element.ns;
9460             }
9461
9462             var effectiveNs = this.logNamespaceUsed(ns);
9463
9464             // strip prefix if same namespace like parent
9465             if (this.isLocalNs(effectiveNs)) {
9466                 return {
9467                     localName: ns.localName
9468                 };
9469             } else {
9470                 return assign({
9471                     localName: ns.localName
9472                 }, effectiveNs);
9473             }
9474         };
9475
9476         ElementSerializer.prototype.parseGeneric = function(element) {
9477
9478             var self = this,
9479                 body = this.body,
9480                 attrs = this.attrs;
9481
9482             forEach(element, function(val, key) {
9483
9484                 if (key === '$body') {
9485                     body.push(new BodySerializer().build({
9486                         type: 'String'
9487                     }, val));
9488                 } else
9489                 if (key === '$children') {
9490                     forEach(val, function(child) {
9491                         body.push(new ElementSerializer(self).build(child));
9492                     });
9493                 } else
9494                 if (key.indexOf('$') !== 0) {
9495                     attrs.push({
9496                         name: key,
9497                         value: escapeAttr(val)
9498                     });
9499                 }
9500             });
9501         };
9502
9503         /**
9504          * Parse namespaces and return a list of left over generic attributes
9505          * 
9506          * @param {Object}
9507          *            element
9508          * @return {Array<Object>}
9509          */
9510         ElementSerializer.prototype.parseNsAttributes = function(element) {
9511             var self = this;
9512
9513             var genericAttrs = element.$attrs;
9514
9515             var attributes = [];
9516
9517             // parse namespace attributes first
9518             // and log them. push non namespace attributes to a list
9519             // and process them later
9520             forEach(genericAttrs, function(value, name) {
9521                 var nameNs = parseNameNs(name);
9522
9523                 if (nameNs.prefix === 'xmlns') {
9524                     self.logNamespace({
9525                         prefix: nameNs.localName,
9526                         uri: value
9527                     });
9528                 } else
9529                 if (!nameNs.prefix && nameNs.localName === 'xmlns') {
9530                     self.logNamespace({
9531                         uri: value
9532                     });
9533                 } else {
9534                     attributes.push({
9535                         name: name,
9536                         value: value
9537                     });
9538                 }
9539             });
9540
9541             return attributes;
9542         };
9543
9544         ElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {
9545
9546             var self = this;
9547
9548             forEach(attributes, function(attr) {
9549
9550                 // do not serialize xsi:type attribute
9551                 // it is set manually based on the actual implementation type
9552                 if (attr.name === XSI_TYPE) {
9553                     return;
9554                 }
9555
9556                 try {
9557                     self.addAttribute(self.nsAttributeName(attr.name), attr.value);
9558                 } catch (e) {
9559                     console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);
9560                 }
9561             });
9562         };
9563
9564         ElementSerializer.prototype.parseContainments = function(properties) {
9565
9566             var self = this,
9567                 body = this.body,
9568                 element = this.element;
9569
9570             forEach(properties, function(p) {
9571                 var value = element.get(p.name),
9572                     isReference = p.isReference,
9573                     isMany = p.isMany;
9574
9575                 var ns = self.nsPropertyTagName(p);
9576
9577                 if (!isMany) {
9578                     value = [value];
9579                 }
9580
9581                 if (p.isBody) {
9582                     body.push(new BodySerializer().build(p, value[0]));
9583                 } else
9584                 if (Types.isSimple(p.type)) {
9585                     forEach(value, function(v) {
9586                         body.push(new ValueSerializer(ns).build(p, v));
9587                     });
9588                 } else
9589                 if (isReference) {
9590                     forEach(value, function(v) {
9591                         body.push(new ReferenceSerializer(self, ns).build(v));
9592                     });
9593                 } else {
9594                     // allow serialization via type
9595                     // rather than element name
9596                     var asType = p.serialize === XSI_TYPE;
9597
9598                     forEach(value, function(v) {
9599                         var serializer;
9600
9601                         if (asType) {
9602                             serializer = new TypeSerializer(self, ns);
9603                         } else {
9604                             serializer = new ElementSerializer(self);
9605                         }
9606
9607                         body.push(serializer.build(v));
9608                     });
9609                 }
9610             });
9611         };
9612
9613         ElementSerializer.prototype.getNamespaces = function() {
9614             if (!this.parent) {
9615                 if (!this.namespaces) {
9616                     this.namespaces = {
9617                         prefixMap: {},
9618                         uriMap: {},
9619                         used: {}
9620                     };
9621                 }
9622             } else {
9623                 this.namespaces = this.parent.getNamespaces();
9624             }
9625
9626             return this.namespaces;
9627         };
9628
9629         ElementSerializer.prototype.logNamespace = function(ns) {
9630             var namespaces = this.getNamespaces();
9631
9632             var existing = namespaces.uriMap[ns.uri];
9633
9634             if (!existing) {
9635                 namespaces.uriMap[ns.uri] = ns;
9636             }
9637
9638             namespaces.prefixMap[ns.prefix] = ns.uri;
9639
9640             return ns;
9641         };
9642
9643         ElementSerializer.prototype.logNamespaceUsed = function(ns) {
9644             var element = this.element,
9645                 model = element.$model,
9646                 namespaces = this.getNamespaces();
9647
9648             // ns may be
9649             //
9650             // * prefix only
9651             // * prefix:uri
9652
9653             var prefix = ns.prefix;
9654             var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||
9655                 namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);
9656
9657             if (!uri) {
9658                 throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');
9659             }
9660
9661             ns = namespaces.uriMap[uri];
9662
9663             if (!ns) {
9664                 ns = this.logNamespace({
9665                     prefix: prefix,
9666                     uri: uri
9667                 });
9668             }
9669
9670             if (!namespaces.used[ns.uri]) {
9671                 namespaces.used[ns.uri] = ns;
9672             }
9673
9674             return ns;
9675         };
9676
9677         ElementSerializer.prototype.parseAttributes = function(properties) {
9678             var self = this,
9679                 element = this.element;
9680
9681             forEach(properties, function(p) {
9682                 self.logNamespaceUsed(p.ns);
9683
9684                 var value = element.get(p.name);
9685
9686                 if (p.isReference) {
9687                     value = value.id;
9688                 }
9689
9690                 self.addAttribute(self.nsAttributeName(p), value);
9691             });
9692         };
9693
9694         ElementSerializer.prototype.addAttribute = function(name, value) {
9695             var attrs = this.attrs;
9696
9697             if (isString(value)) {
9698                 value = escapeAttr(value);
9699             }
9700
9701             attrs.push({
9702                 name: name,
9703                 value: value
9704             });
9705         };
9706
9707         ElementSerializer.prototype.serializeAttributes = function(writer) {
9708             var attrs = this.attrs,
9709                 root = !this.parent,
9710                 namespaces = this.namespaces;
9711
9712             function collectNsAttrs() {
9713                 return map(namespaces.used, function(ns) {
9714                     var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');
9715                     return {
9716                         name: name,
9717                         value: ns.uri
9718                     };
9719                 });
9720             }
9721
9722             if (root) {
9723                 attrs = collectNsAttrs().concat(attrs);
9724             }
9725
9726             forEach(attrs, function(a) {
9727                 writer
9728                     .append(' ')
9729                     .append(nsName(a.name)).append('="').append(a.value).append('"');
9730             });
9731         };
9732
9733         ElementSerializer.prototype.serializeTo = function(writer) {
9734             var hasBody = this.body.length,
9735                 indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);
9736
9737             writer
9738                 .appendIndent()
9739                 .append('<' + nsName(this.ns));
9740
9741             this.serializeAttributes(writer);
9742
9743             writer.append(hasBody ? '>' : ' />');
9744
9745             if (hasBody) {
9746
9747                 if (indent) {
9748                     writer
9749                         .appendNewLine()
9750                         .indent();
9751                 }
9752
9753                 forEach(this.body, function(b) {
9754                     b.serializeTo(writer);
9755                 });
9756
9757                 if (indent) {
9758                     writer
9759                         .unindent()
9760                         .appendIndent();
9761                 }
9762
9763                 writer.append('</' + nsName(this.ns) + '>');
9764             }
9765
9766             writer.appendNewLine();
9767         };
9768
9769         /**
9770          * A serializer for types that handles serialization of data types
9771          */
9772         function TypeSerializer(parent, ns) {
9773             ElementSerializer.call(this, parent, ns);
9774         }
9775
9776         TypeSerializer.prototype = new ElementSerializer();
9777
9778         TypeSerializer.prototype.build = function(element) {
9779             var descriptor = element.$descriptor;
9780
9781             this.element = element;
9782
9783             this.typeNs = this.nsTagName(descriptor);
9784
9785             // add xsi:type attribute to represent the elements
9786             // actual type
9787
9788             var typeNs = this.typeNs,
9789                 pkg = element.$model.getPackage(typeNs.uri),
9790                 typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';
9791
9792             this.addAttribute(this.nsAttributeName(XSI_TYPE), (typeNs.prefix ? typeNs.prefix + ':' : '') +
9793                 typePrefix + descriptor.ns.localName);
9794
9795             // do the usual stuff
9796             return ElementSerializer.prototype.build.call(this, element);
9797         };
9798
9799         TypeSerializer.prototype.isLocalNs = function(ns) {
9800             return ns.uri === this.typeNs.uri;
9801         };
9802
9803         function SavingWriter() {
9804             this.value = '';
9805
9806             this.write = function(str) {
9807                 this.value += str;
9808             };
9809         }
9810
9811         function FormatingWriter(out, format) {
9812
9813             var indent = [''];
9814
9815             this.append = function(str) {
9816                 out.write(str);
9817
9818                 return this;
9819             };
9820
9821             this.appendNewLine = function() {
9822                 if (format) {
9823                     out.write('\n');
9824                 }
9825
9826                 return this;
9827             };
9828
9829             this.appendIndent = function() {
9830                 if (format) {
9831                     out.write(indent.join('  '));
9832                 }
9833
9834                 return this;
9835             };
9836
9837             this.indent = function() {
9838                 indent.push('');
9839                 return this;
9840             };
9841
9842             this.unindent = function() {
9843                 indent.pop();
9844                 return this;
9845             };
9846         }
9847
9848         /**
9849          * A writer for meta-model backed document trees
9850          * 
9851          * @param {Object}
9852          *            options output options to pass into the writer
9853          */
9854         function XMLWriter(options) {
9855
9856             options = assign({
9857                 format: false,
9858                 preamble: true
9859             }, options || {});
9860
9861             function toXML(tree, writer) {
9862                 var internalWriter = writer || new SavingWriter();
9863                 var formatingWriter = new FormatingWriter(internalWriter, options.format);
9864
9865                 if (options.preamble) {
9866                     formatingWriter.append(XML_PREAMBLE);
9867                 }
9868
9869                 new ElementSerializer().build(tree).serializeTo(formatingWriter);
9870
9871                 if (!writer) {
9872                     return internalWriter.value;
9873                 }
9874             }
9875
9876             return {
9877                 toXML: toXML
9878             };
9879         }
9880
9881         module.exports = XMLWriter;
9882     }, {
9883         "./common": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js",
9884         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
9885         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
9886         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
9887         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
9888         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
9889         "moddle/lib/ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
9890         "moddle/lib/types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js"
9891     }],
9892     "\\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) {
9893         (function(Buffer) {
9894             // wrapper for non-node envs
9895             ;
9896             (function(sax) {
9897
9898                 sax.parser = function(strict, opt) {
9899                     return new SAXParser(strict, opt)
9900                 }
9901                 sax.SAXParser = SAXParser
9902                 sax.SAXStream = SAXStream
9903                 sax.createStream = createStream
9904
9905                 // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer
9906                 // overruns.
9907                 // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer
9908                 // lengths)),
9909                 // since that's the earliest that a buffer overrun could occur. This way, checks
9910                 // are
9911                 // as rare as required, but as often as necessary to ensure never crossing this
9912                 // bound.
9913                 // Furthermore, buffers are only tested at most once per write(), so passing a
9914                 // very
9915                 // large string into write() might have undesirable effects, but this is
9916                 // manageable by
9917                 // the caller, so it is assumed to be safe. Thus, a call to write() may, in the
9918                 // extreme
9919                 // edge case, result in creating at most one complete copy of the string passed
9920                 // in.
9921                 // Set to Infinity to have unlimited buffers.
9922                 sax.MAX_BUFFER_LENGTH = 64 * 1024
9923
9924                 var buffers = [
9925                     "comment", "sgmlDecl", "textNode", "tagName", "doctype",
9926                     "procInstName", "procInstBody", "entity", "attribName",
9927                     "attribValue", "cdata", "script"
9928                 ]
9929
9930                 sax.EVENTS = // for discoverability.
9931                     ["text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace"]
9932
9933                 function SAXParser(strict, opt) {
9934                     if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)
9935
9936                     var parser = this
9937                     clearBuffers(parser)
9938                     parser.q = parser.c = ""
9939                     parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
9940                     parser.opt = opt || {}
9941                     parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
9942                     parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"
9943                     parser.tags = []
9944                     parser.closed = parser.closedRoot = parser.sawRoot = false
9945                     parser.tag = parser.error = null
9946                     parser.strict = !!strict
9947                     parser.noscript = !!(strict || parser.opt.noscript)
9948                     parser.state = S.BEGIN
9949                     parser.ENTITIES = Object.create(sax.ENTITIES)
9950                     parser.attribList = []
9951
9952                     // namespaces form a prototype chain.
9953                     // it always points at the current tag,
9954                     // which protos to its parent tag.
9955                     if (parser.opt.xmlns) parser.ns = Object.create(rootNS)
9956
9957                     // mostly just for error reporting
9958                     parser.trackPosition = parser.opt.position !== false
9959                     if (parser.trackPosition) {
9960                         parser.position = parser.line = parser.column = 0
9961                     }
9962                     emit(parser, "onready")
9963                 }
9964
9965                 if (!Object.create) Object.create = function(o) {
9966                     function f() {
9967                         this.__proto__ = o
9968                     }
9969                     f.prototype = o
9970                     return new f
9971                 }
9972
9973                 if (!Object.getPrototypeOf) Object.getPrototypeOf = function(o) {
9974                     return o.__proto__
9975                 }
9976
9977                 if (!Object.keys) Object.keys = function(o) {
9978                     var a = []
9979                     for (var i in o)
9980                         if (o.hasOwnProperty(i)) a.push(i)
9981                     return a
9982                 }
9983
9984                 function checkBufferLength(parser) {
9985                     var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10),
9986                         maxActual = 0
9987                     for (var i = 0, l = buffers.length; i < l; i++) {
9988                         var len = parser[buffers[i]].length
9989                         if (len > maxAllowed) {
9990                             // Text/cdata nodes can get big, and since they're buffered,
9991                             // we can get here under normal conditions.
9992                             // Avoid issues by emitting the text node now,
9993                             // so at least it won't get any bigger.
9994                             switch (buffers[i]) {
9995                                 case "textNode":
9996                                     closeText(parser)
9997                                     break
9998
9999                                 case "cdata":
10000                                     emitNode(parser, "oncdata", parser.cdata)
10001                                     parser.cdata = ""
10002                                     break
10003
10004                                 case "script":
10005                                     emitNode(parser, "onscript", parser.script)
10006                                     parser.script = ""
10007                                     break
10008
10009                                 default:
10010                                     error(parser, "Max buffer length exceeded: " + buffers[i])
10011                             }
10012                         }
10013                         maxActual = Math.max(maxActual, len)
10014                     }
10015                     // schedule the next check for the earliest possible buffer overrun.
10016                     parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual) + parser.position
10017                 }
10018
10019                 function clearBuffers(parser) {
10020                     for (var i = 0, l = buffers.length; i < l; i++) {
10021                         parser[buffers[i]] = ""
10022                     }
10023                 }
10024
10025                 function flushBuffers(parser) {
10026                     closeText(parser)
10027                     if (parser.cdata !== "") {
10028                         emitNode(parser, "oncdata", parser.cdata)
10029                         parser.cdata = ""
10030                     }
10031                     if (parser.script !== "") {
10032                         emitNode(parser, "onscript", parser.script)
10033                         parser.script = ""
10034                     }
10035                 }
10036
10037                 SAXParser.prototype = {
10038                     end: function() {
10039                         end(this)
10040                     },
10041                     write: write,
10042                     resume: function() {
10043                         this.error = null;
10044                         return this
10045                     },
10046                     close: function() {
10047                         return this.write(null)
10048                     },
10049                     flush: function() {
10050                         flushBuffers(this)
10051                     }
10052                 }
10053
10054                 try {
10055                     var Stream = require("stream").Stream
10056                 } catch (ex) {
10057                     var Stream = function() {}
10058                 }
10059
10060
10061                 var streamWraps = sax.EVENTS.filter(function(ev) {
10062                     return ev !== "error" && ev !== "end"
10063                 })
10064
10065                 function createStream(strict, opt) {
10066                     return new SAXStream(strict, opt)
10067                 }
10068
10069                 function SAXStream(strict, opt) {
10070                     if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)
10071
10072                     Stream.apply(this)
10073
10074                     this._parser = new SAXParser(strict, opt)
10075                     this.writable = true
10076                     this.readable = true
10077
10078
10079                     var me = this
10080
10081                     this._parser.onend = function() {
10082                         me.emit("end")
10083                     }
10084
10085                     this._parser.onerror = function(er) {
10086                         me.emit("error", er)
10087
10088                         // if didn't throw, then means error was handled.
10089                         // go ahead and clear error, so we can write again.
10090                         me._parser.error = null
10091                     }
10092
10093                     this._decoder = null;
10094
10095                     streamWraps.forEach(function(ev) {
10096                         Object.defineProperty(me, "on" + ev, {
10097                             get: function() {
10098                                 return me._parser["on" + ev]
10099                             },
10100                             set: function(h) {
10101                                 if (!h) {
10102                                     me.removeAllListeners(ev)
10103                                     return me._parser["on" + ev] = h
10104                                 }
10105                                 me.on(ev, h)
10106                             },
10107                             enumerable: true,
10108                             configurable: false
10109                         })
10110                     })
10111                 }
10112
10113                 SAXStream.prototype = Object.create(Stream.prototype, {
10114                     constructor: {
10115                         value: SAXStream
10116                     }
10117                 })
10118
10119                 SAXStream.prototype.write = function(data) {
10120                     if (typeof Buffer === 'function' &&
10121                         typeof Buffer.isBuffer === 'function' &&
10122                         Buffer.isBuffer(data)) {
10123                         if (!this._decoder) {
10124                             var SD = require('string_decoder').StringDecoder
10125                             this._decoder = new SD('utf8')
10126                         }
10127                         data = this._decoder.write(data);
10128                     }
10129
10130                     this._parser.write(data.toString())
10131                     this.emit("data", data)
10132                     return true
10133                 }
10134
10135                 SAXStream.prototype.end = function(chunk) {
10136                     if (chunk && chunk.length) this.write(chunk)
10137                     this._parser.end()
10138                     return true
10139                 }
10140
10141                 SAXStream.prototype.on = function(ev, handler) {
10142                     var me = this
10143                     if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
10144                         me._parser["on" + ev] = function() {
10145                             var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
10146                             args.splice(0, 0, ev)
10147                             me.emit.apply(me, args)
10148                         }
10149                     }
10150
10151                     return Stream.prototype.on.call(me, ev, handler)
10152                 }
10153
10154
10155
10156                 // character classes and tokens
10157                 var whitespace = "\r\n\t "
10158                     // this really needs to be replaced with character classes.
10159                     // XML allows all manner of ridiculous numbers and digits.
10160                     ,
10161                     number = "0124356789",
10162                     letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
10163                     // (Letter | "_" | ":")
10164                     ,
10165                     quote = "'\"",
10166                     entity = number + letter + "#",
10167                     attribEnd = whitespace + ">",
10168                     CDATA = "[CDATA[",
10169                     DOCTYPE = "DOCTYPE",
10170                     XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace",
10171                     XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/",
10172                     rootNS = {
10173                         xml: XML_NAMESPACE,
10174                         xmlns: XMLNS_NAMESPACE
10175                     }
10176
10177                 // turn all the string character sets into character class objects.
10178                 whitespace = charClass(whitespace)
10179                 number = charClass(number)
10180                 letter = charClass(letter)
10181
10182                 // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
10183                 // This implementation works on strings, a single character at a time
10184                 // as such, it cannot ever support astral-plane characters (10000-EFFFF)
10185                 // without a significant breaking change to either this parser, or the
10186                 // JavaScript language. Implementation of an emoji-capable xml parser
10187                 // is left as an exercise for the reader.
10188                 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]/
10189
10190                 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-]/
10191
10192                 quote = charClass(quote)
10193                 entity = charClass(entity)
10194                 attribEnd = charClass(attribEnd)
10195
10196                 function charClass(str) {
10197                     return str.split("").reduce(function(s, c) {
10198                         s[c] = true
10199                         return s
10200                     }, {})
10201                 }
10202
10203                 function isRegExp(c) {
10204                     return Object.prototype.toString.call(c) === '[object RegExp]'
10205                 }
10206
10207                 function is(charclass, c) {
10208                     return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]
10209                 }
10210
10211                 function not(charclass, c) {
10212                     return !is(charclass, c)
10213                 }
10214
10215                 var S = 0
10216                 sax.STATE = {
10217                     BEGIN: S++,
10218                     TEXT: S++ // general stuff
10219                         ,
10220                     TEXT_ENTITY: S++ // &amp and such.
10221                         ,
10222                     OPEN_WAKA: S++ // <
10223                         ,
10224                     SGML_DECL: S++ // <!BLARG
10225                         ,
10226                     SGML_DECL_QUOTED: S++ // <!BLARG foo "bar
10227                         ,
10228                     DOCTYPE: S++ // <!DOCTYPE
10229                         ,
10230                     DOCTYPE_QUOTED: S++ // <!DOCTYPE "//blah
10231                         ,
10232                     DOCTYPE_DTD: S++ // <!DOCTYPE "//blah" [ ...
10233                         ,
10234                     DOCTYPE_DTD_QUOTED: S++ // <!DOCTYPE "//blah" [ "foo
10235                         ,
10236                     COMMENT_STARTING: S++ // <!-
10237                         ,
10238                     COMMENT: S++ // <!--
10239                         ,
10240                     COMMENT_ENDING: S++ // <!-- blah -
10241                         ,
10242                     COMMENT_ENDED: S++ // <!-- blah --
10243                         ,
10244                     CDATA: S++ // <![CDATA[ something
10245                         ,
10246                     CDATA_ENDING: S++ // ]
10247                         ,
10248                     CDATA_ENDING_2: S++ // ]]
10249                         ,
10250                     PROC_INST: S++ // <?hi
10251                         ,
10252                     PROC_INST_BODY: S++ // <?hi there
10253                         ,
10254                     PROC_INST_ENDING: S++ // <?hi "there" ?
10255                         ,
10256                     OPEN_TAG: S++ // <strong
10257                         ,
10258                     OPEN_TAG_SLASH: S++ // <strong /
10259                         ,
10260                     ATTRIB: S++ // <a
10261                         ,
10262                     ATTRIB_NAME: S++ // <a foo
10263                         ,
10264                     ATTRIB_NAME_SAW_WHITE: S++ // <a foo _
10265                         ,
10266                     ATTRIB_VALUE: S++ // <a foo=
10267                         ,
10268                     ATTRIB_VALUE_QUOTED: S++ // <a foo="bar
10269                         ,
10270                     ATTRIB_VALUE_CLOSED: S++ // <a foo="bar"
10271                         ,
10272                     ATTRIB_VALUE_UNQUOTED: S++ // <a foo=bar
10273                         ,
10274                     ATTRIB_VALUE_ENTITY_Q: S++ // <foo bar="&quot;"
10275                         ,
10276                     ATTRIB_VALUE_ENTITY_U: S++ // <foo bar=&quot;
10277                         ,
10278                     CLOSE_TAG: S++ // </a
10279                         ,
10280                     CLOSE_TAG_SAW_WHITE: S++ // </a >
10281                         ,
10282                     SCRIPT: S++ // <script> ...
10283                         ,
10284                     SCRIPT_ENDING: S++ // <script> ... <
10285                 }
10286
10287                 sax.ENTITIES = {
10288                     "amp": "&",
10289                     "gt": ">",
10290                     "lt": "<",
10291                     "quot": "\"",
10292                     "apos": "'",
10293                     "AElig": 198,
10294                     "Aacute": 193,
10295                     "Acirc": 194,
10296                     "Agrave": 192,
10297                     "Aring": 197,
10298                     "Atilde": 195,
10299                     "Auml": 196,
10300                     "Ccedil": 199,
10301                     "ETH": 208,
10302                     "Eacute": 201,
10303                     "Ecirc": 202,
10304                     "Egrave": 200,
10305                     "Euml": 203,
10306                     "Iacute": 205,
10307                     "Icirc": 206,
10308                     "Igrave": 204,
10309                     "Iuml": 207,
10310                     "Ntilde": 209,
10311                     "Oacute": 211,
10312                     "Ocirc": 212,
10313                     "Ograve": 210,
10314                     "Oslash": 216,
10315                     "Otilde": 213,
10316                     "Ouml": 214,
10317                     "THORN": 222,
10318                     "Uacute": 218,
10319                     "Ucirc": 219,
10320                     "Ugrave": 217,
10321                     "Uuml": 220,
10322                     "Yacute": 221,
10323                     "aacute": 225,
10324                     "acirc": 226,
10325                     "aelig": 230,
10326                     "agrave": 224,
10327                     "aring": 229,
10328                     "atilde": 227,
10329                     "auml": 228,
10330                     "ccedil": 231,
10331                     "eacute": 233,
10332                     "ecirc": 234,
10333                     "egrave": 232,
10334                     "eth": 240,
10335                     "euml": 235,
10336                     "iacute": 237,
10337                     "icirc": 238,
10338                     "igrave": 236,
10339                     "iuml": 239,
10340                     "ntilde": 241,
10341                     "oacute": 243,
10342                     "ocirc": 244,
10343                     "ograve": 242,
10344                     "oslash": 248,
10345                     "otilde": 245,
10346                     "ouml": 246,
10347                     "szlig": 223,
10348                     "thorn": 254,
10349                     "uacute": 250,
10350                     "ucirc": 251,
10351                     "ugrave": 249,
10352                     "uuml": 252,
10353                     "yacute": 253,
10354                     "yuml": 255,
10355                     "copy": 169,
10356                     "reg": 174,
10357                     "nbsp": 160,
10358                     "iexcl": 161,
10359                     "cent": 162,
10360                     "pound": 163,
10361                     "curren": 164,
10362                     "yen": 165,
10363                     "brvbar": 166,
10364                     "sect": 167,
10365                     "uml": 168,
10366                     "ordf": 170,
10367                     "laquo": 171,
10368                     "not": 172,
10369                     "shy": 173,
10370                     "macr": 175,
10371                     "deg": 176,
10372                     "plusmn": 177,
10373                     "sup1": 185,
10374                     "sup2": 178,
10375                     "sup3": 179,
10376                     "acute": 180,
10377                     "micro": 181,
10378                     "para": 182,
10379                     "middot": 183,
10380                     "cedil": 184,
10381                     "ordm": 186,
10382                     "raquo": 187,
10383                     "frac14": 188,
10384                     "frac12": 189,
10385                     "frac34": 190,
10386                     "iquest": 191,
10387                     "times": 215,
10388                     "divide": 247,
10389                     "OElig": 338,
10390                     "oelig": 339,
10391                     "Scaron": 352,
10392                     "scaron": 353,
10393                     "Yuml": 376,
10394                     "fnof": 402,
10395                     "circ": 710,
10396                     "tilde": 732,
10397                     "Alpha": 913,
10398                     "Beta": 914,
10399                     "Gamma": 915,
10400                     "Delta": 916,
10401                     "Epsilon": 917,
10402                     "Zeta": 918,
10403                     "Eta": 919,
10404                     "Theta": 920,
10405                     "Iota": 921,
10406                     "Kappa": 922,
10407                     "Lambda": 923,
10408                     "Mu": 924,
10409                     "Nu": 925,
10410                     "Xi": 926,
10411                     "Omicron": 927,
10412                     "Pi": 928,
10413                     "Rho": 929,
10414                     "Sigma": 931,
10415                     "Tau": 932,
10416                     "Upsilon": 933,
10417                     "Phi": 934,
10418                     "Chi": 935,
10419                     "Psi": 936,
10420                     "Omega": 937,
10421                     "alpha": 945,
10422                     "beta": 946,
10423                     "gamma": 947,
10424                     "delta": 948,
10425                     "epsilon": 949,
10426                     "zeta": 950,
10427                     "eta": 951,
10428                     "theta": 952,
10429                     "iota": 953,
10430                     "kappa": 954,
10431                     "lambda": 955,
10432                     "mu": 956,
10433                     "nu": 957,
10434                     "xi": 958,
10435                     "omicron": 959,
10436                     "pi": 960,
10437                     "rho": 961,
10438                     "sigmaf": 962,
10439                     "sigma": 963,
10440                     "tau": 964,
10441                     "upsilon": 965,
10442                     "phi": 966,
10443                     "chi": 967,
10444                     "psi": 968,
10445                     "omega": 969,
10446                     "thetasym": 977,
10447                     "upsih": 978,
10448                     "piv": 982,
10449                     "ensp": 8194,
10450                     "emsp": 8195,
10451                     "thinsp": 8201,
10452                     "zwnj": 8204,
10453                     "zwj": 8205,
10454                     "lrm": 8206,
10455                     "rlm": 8207,
10456                     "ndash": 8211,
10457                     "mdash": 8212,
10458                     "lsquo": 8216,
10459                     "rsquo": 8217,
10460                     "sbquo": 8218,
10461                     "ldquo": 8220,
10462                     "rdquo": 8221,
10463                     "bdquo": 8222,
10464                     "dagger": 8224,
10465                     "Dagger": 8225,
10466                     "bull": 8226,
10467                     "hellip": 8230,
10468                     "permil": 8240,
10469                     "prime": 8242,
10470                     "Prime": 8243,
10471                     "lsaquo": 8249,
10472                     "rsaquo": 8250,
10473                     "oline": 8254,
10474                     "frasl": 8260,
10475                     "euro": 8364,
10476                     "image": 8465,
10477                     "weierp": 8472,
10478                     "real": 8476,
10479                     "trade": 8482,
10480                     "alefsym": 8501,
10481                     "larr": 8592,
10482                     "uarr": 8593,
10483                     "rarr": 8594,
10484                     "darr": 8595,
10485                     "harr": 8596,
10486                     "crarr": 8629,
10487                     "lArr": 8656,
10488                     "uArr": 8657,
10489                     "rArr": 8658,
10490                     "dArr": 8659,
10491                     "hArr": 8660,
10492                     "forall": 8704,
10493                     "part": 8706,
10494                     "exist": 8707,
10495                     "empty": 8709,
10496                     "nabla": 8711,
10497                     "isin": 8712,
10498                     "notin": 8713,
10499                     "ni": 8715,
10500                     "prod": 8719,
10501                     "sum": 8721,
10502                     "minus": 8722,
10503                     "lowast": 8727,
10504                     "radic": 8730,
10505                     "prop": 8733,
10506                     "infin": 8734,
10507                     "ang": 8736,
10508                     "and": 8743,
10509                     "or": 8744,
10510                     "cap": 8745,
10511                     "cup": 8746,
10512                     "int": 8747,
10513                     "there4": 8756,
10514                     "sim": 8764,
10515                     "cong": 8773,
10516                     "asymp": 8776,
10517                     "ne": 8800,
10518                     "equiv": 8801,
10519                     "le": 8804,
10520                     "ge": 8805,
10521                     "sub": 8834,
10522                     "sup": 8835,
10523                     "nsub": 8836,
10524                     "sube": 8838,
10525                     "supe": 8839,
10526                     "oplus": 8853,
10527                     "otimes": 8855,
10528                     "perp": 8869,
10529                     "sdot": 8901,
10530                     "lceil": 8968,
10531                     "rceil": 8969,
10532                     "lfloor": 8970,
10533                     "rfloor": 8971,
10534                     "lang": 9001,
10535                     "rang": 9002,
10536                     "loz": 9674,
10537                     "spades": 9824,
10538                     "clubs": 9827,
10539                     "hearts": 9829,
10540                     "diams": 9830
10541                 }
10542
10543                 Object.keys(sax.ENTITIES).forEach(function(key) {
10544                     var e = sax.ENTITIES[key]
10545                     var s = typeof e === 'number' ? String.fromCharCode(e) : e
10546                     sax.ENTITIES[key] = s
10547                 })
10548
10549                 for (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S
10550
10551                 // shorthand
10552                 S = sax.STATE
10553
10554                 function emit(parser, event, data) {
10555                     parser[event] && parser[event](data)
10556                 }
10557
10558                 function emitNode(parser, nodeType, data) {
10559                     if (parser.textNode) closeText(parser)
10560                     emit(parser, nodeType, data)
10561                 }
10562
10563                 function closeText(parser) {
10564                     parser.textNode = textopts(parser.opt, parser.textNode)
10565                     if (parser.textNode) emit(parser, "ontext", parser.textNode)
10566                     parser.textNode = ""
10567                 }
10568
10569                 function textopts(opt, text) {
10570                     if (opt.trim) text = text.trim()
10571                     if (opt.normalize) text = text.replace(/\s+/g, " ")
10572                     return text
10573                 }
10574
10575                 function error(parser, er) {
10576                     closeText(parser)
10577                     if (parser.trackPosition) {
10578                         er += "\nLine: " + parser.line +
10579                             "\nColumn: " + parser.column +
10580                             "\nChar: " + parser.c
10581                     }
10582                     er = new Error(er)
10583                     parser.error = er
10584                     emit(parser, "onerror", er)
10585                     return parser
10586                 }
10587
10588                 function end(parser) {
10589                     if (!parser.closedRoot) strictFail(parser, "Unclosed root tag")
10590                     if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, "Unexpected end")
10591                     closeText(parser)
10592                     parser.c = ""
10593                     parser.closed = true
10594                     emit(parser, "onend")
10595                     SAXParser.call(parser, parser.strict, parser.opt)
10596                     return parser
10597                 }
10598
10599                 function strictFail(parser, message) {
10600                     if (typeof parser !== 'object' || !(parser instanceof SAXParser))
10601                         throw new Error('bad call to strictFail');
10602                     if (parser.strict) error(parser, message)
10603                 }
10604
10605                 function newTag(parser) {
10606                     if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
10607                     var parent = parser.tags[parser.tags.length - 1] || parser,
10608                         tag = parser.tag = {
10609                             name: parser.tagName,
10610                             attributes: {}
10611                         }
10612
10613                     // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
10614                     if (parser.opt.xmlns) tag.ns = parent.ns
10615                     parser.attribList.length = 0
10616                 }
10617
10618                 function qname(name, attribute) {
10619                     var i = name.indexOf(":"),
10620                         qualName = i < 0 ? ["", name] : name.split(":"),
10621                         prefix = qualName[0],
10622                         local = qualName[1]
10623
10624                     // <x "xmlns"="http://foo">
10625                     if (attribute && name === "xmlns") {
10626                         prefix = "xmlns"
10627                         local = ""
10628                     }
10629
10630                     return {
10631                         prefix: prefix,
10632                         local: local
10633                     }
10634                 }
10635
10636                 function attrib(parser) {
10637                     if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()
10638
10639                     if (parser.attribList.indexOf(parser.attribName) !== -1 ||
10640                         parser.tag.attributes.hasOwnProperty(parser.attribName)) {
10641                         return parser.attribName = parser.attribValue = ""
10642                     }
10643
10644                     if (parser.opt.xmlns) {
10645                         var qn = qname(parser.attribName, true),
10646                             prefix = qn.prefix,
10647                             local = qn.local
10648
10649                         if (prefix === "xmlns") {
10650                             // namespace binding attribute; push the binding into scope
10651                             if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
10652                                 strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\n" + "Actual: " + parser.attribValue)
10653                             } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
10654                                 strictFail(parser, "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n" + "Actual: " + parser.attribValue)
10655                             } else {
10656                                 var tag = parser.tag,
10657                                     parent = parser.tags[parser.tags.length - 1] || parser
10658                                 if (tag.ns === parent.ns) {
10659                                     tag.ns = Object.create(parent.ns)
10660                                 }
10661                                 tag.ns[local] = parser.attribValue
10662                             }
10663                         }
10664
10665                         // defer onattribute events until all attributes have been seen
10666                         // so any new bindings can take effect; preserve attribute order
10667                         // so deferred events can be emitted in document order
10668                         parser.attribList.push([parser.attribName, parser.attribValue])
10669                     } else {
10670                         // in non-xmlns mode, we can emit the event right away
10671                         parser.tag.attributes[parser.attribName] = parser.attribValue
10672                         emitNode(parser, "onattribute", {
10673                             name: parser.attribName,
10674                             value: parser.attribValue
10675                         })
10676                     }
10677
10678                     parser.attribName = parser.attribValue = ""
10679                 }
10680
10681                 function openTag(parser, selfClosing) {
10682                     if (parser.opt.xmlns) {
10683                         // emit namespace binding events
10684                         var tag = parser.tag
10685
10686                         // add namespace info to tag
10687                         var qn = qname(parser.tagName)
10688                         tag.prefix = qn.prefix
10689                         tag.local = qn.local
10690                         tag.uri = tag.ns[qn.prefix] || ""
10691
10692                         if (tag.prefix && !tag.uri) {
10693                             strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName))
10694                             tag.uri = qn.prefix
10695                         }
10696
10697                         var parent = parser.tags[parser.tags.length - 1] || parser
10698                         if (tag.ns && parent.ns !== tag.ns) {
10699                             Object.keys(tag.ns).forEach(function(p) {
10700                                 emitNode(parser, "onopennamespace", {
10701                                     prefix: p,
10702                                     uri: tag.ns[p]
10703                                 })
10704                             })
10705                         }
10706
10707                         // handle deferred onattribute events
10708                         // Note: do not apply default ns to attributes:
10709                         // http://www.w3.org/TR/REC-xml-names/#defaulting
10710                         for (var i = 0, l = parser.attribList.length; i < l; i++) {
10711                             var nv = parser.attribList[i]
10712                             var name = nv[0],
10713                                 value = nv[1],
10714                                 qualName = qname(name, true),
10715                                 prefix = qualName.prefix,
10716                                 local = qualName.local,
10717                                 uri = prefix == "" ? "" : (tag.ns[prefix] || ""),
10718                                 a = {
10719                                     name: name,
10720                                     value: value,
10721                                     prefix: prefix,
10722                                     local: local,
10723                                     uri: uri
10724                                 }
10725
10726                             // if there's any attributes with an undefined namespace,
10727                             // then fail on them now.
10728                             if (prefix && prefix != "xmlns" && !uri) {
10729                                 strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix))
10730                                 a.uri = prefix
10731                             }
10732                             parser.tag.attributes[name] = a
10733                             emitNode(parser, "onattribute", a)
10734                         }
10735                         parser.attribList.length = 0
10736                     }
10737
10738                     parser.tag.isSelfClosing = !!selfClosing
10739
10740                     // process the tag
10741                     parser.sawRoot = true
10742                     parser.tags.push(parser.tag)
10743                     emitNode(parser, "onopentag", parser.tag)
10744                     if (!selfClosing) {
10745                         // special case for <script> in non-strict mode.
10746                         if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
10747                             parser.state = S.SCRIPT
10748                         } else {
10749                             parser.state = S.TEXT
10750                         }
10751                         parser.tag = null
10752                         parser.tagName = ""
10753                     }
10754                     parser.attribName = parser.attribValue = ""
10755                     parser.attribList.length = 0
10756                 }
10757
10758                 function closeTag(parser) {
10759                     if (!parser.tagName) {
10760                         strictFail(parser, "Weird empty close tag.")
10761                         parser.textNode += "</>"
10762                         parser.state = S.TEXT
10763                         return
10764                     }
10765
10766                     if (parser.script) {
10767                         if (parser.tagName !== "script") {
10768                             parser.script += "</" + parser.tagName + ">"
10769                             parser.tagName = ""
10770                             parser.state = S.SCRIPT
10771                             return
10772                         }
10773                         emitNode(parser, "onscript", parser.script)
10774                         parser.script = ""
10775                     }
10776
10777                     // first make sure that the closing tag actually exists.
10778                     // <a><b></c></b></a> will close everything, otherwise.
10779                     var t = parser.tags.length
10780                     var tagName = parser.tagName
10781                     if (!parser.strict) tagName = tagName[parser.looseCase]()
10782                     var closeTo = tagName
10783                     while (t--) {
10784                         var close = parser.tags[t]
10785                         if (close.name !== closeTo) {
10786                             // fail the first time in strict mode
10787                             strictFail(parser, "Unexpected close tag")
10788                         } else break
10789                     }
10790
10791                     // didn't find it. we already failed for strict, so just abort.
10792                     if (t < 0) {
10793                         strictFail(parser, "Unmatched closing tag: " + parser.tagName)
10794                         parser.textNode += "</" + parser.tagName + ">"
10795                         parser.state = S.TEXT
10796                         return
10797                     }
10798                     parser.tagName = tagName
10799                     var s = parser.tags.length
10800                     while (s-- > t) {
10801                         var tag = parser.tag = parser.tags.pop()
10802                         parser.tagName = parser.tag.name
10803                         emitNode(parser, "onclosetag", parser.tagName)
10804
10805                         var x = {}
10806                         for (var i in tag.ns) x[i] = tag.ns[i]
10807
10808                         var parent = parser.tags[parser.tags.length - 1] || parser
10809                         if (parser.opt.xmlns && tag.ns !== parent.ns) {
10810                             // remove namespace bindings introduced by tag
10811                             Object.keys(tag.ns).forEach(function(p) {
10812                                 var n = tag.ns[p]
10813                                 emitNode(parser, "onclosenamespace", {
10814                                     prefix: p,
10815                                     uri: n
10816                                 })
10817                             })
10818                         }
10819                     }
10820                     if (t === 0) parser.closedRoot = true
10821                     parser.tagName = parser.attribValue = parser.attribName = ""
10822                     parser.attribList.length = 0
10823                     parser.state = S.TEXT
10824                 }
10825
10826                 function parseEntity(parser) {
10827                     var entity = parser.entity,
10828                         entityLC = entity.toLowerCase(),
10829                         num, numStr = ""
10830                     if (parser.ENTITIES[entity])
10831                         return parser.ENTITIES[entity]
10832                     if (parser.ENTITIES[entityLC])
10833                         return parser.ENTITIES[entityLC]
10834                     entity = entityLC
10835                     if (entity.charAt(0) === "#") {
10836                         if (entity.charAt(1) === "x") {
10837                             entity = entity.slice(2)
10838                             num = parseInt(entity, 16)
10839                             numStr = num.toString(16)
10840                         } else {
10841                             entity = entity.slice(1)
10842                             num = parseInt(entity, 10)
10843                             numStr = num.toString(10)
10844                         }
10845                     }
10846                     entity = entity.replace(/^0+/, "")
10847                     if (numStr.toLowerCase() !== entity) {
10848                         strictFail(parser, "Invalid character entity")
10849                         return "&" + parser.entity + ";"
10850                     }
10851
10852                     return String.fromCodePoint(num)
10853                 }
10854
10855                 function write(chunk) {
10856                     var parser = this
10857                     if (this.error) throw this.error
10858                     if (parser.closed) return error(parser,
10859                         "Cannot write after close. Assign an onready handler.")
10860                     if (chunk === null) return end(parser)
10861                     var i = 0,
10862                         c = ""
10863                     while (parser.c = c = chunk.charAt(i++)) {
10864                         if (parser.trackPosition) {
10865                             parser.position++
10866                                 if (c === "\n") {
10867                                     parser.line++
10868                                         parser.column = 0
10869                                 } else parser.column++
10870                         }
10871                         switch (parser.state) {
10872
10873                             case S.BEGIN:
10874                                 if (c === "<") {
10875                                     parser.state = S.OPEN_WAKA
10876                                     parser.startTagPosition = parser.position
10877                                 } else if (not(whitespace, c)) {
10878                                     // have to process this as a text node.
10879                                     // weird, but happens.
10880                                     strictFail(parser, "Non-whitespace before first tag.")
10881                                     parser.textNode = c
10882                                     parser.state = S.TEXT
10883                                 }
10884                                 continue
10885
10886                             case S.TEXT:
10887                                 if (parser.sawRoot && !parser.closedRoot) {
10888                                     var starti = i - 1
10889                                     while (c && c !== "<" && c !== "&") {
10890                                         c = chunk.charAt(i++)
10891                                         if (c && parser.trackPosition) {
10892                                             parser.position++
10893                                                 if (c === "\n") {
10894                                                     parser.line++
10895                                                         parser.column = 0
10896                                                 } else parser.column++
10897                                         }
10898                                     }
10899                                     parser.textNode += chunk.substring(starti, i - 1)
10900                                 }
10901                                 if (c === "<") {
10902                                     parser.state = S.OPEN_WAKA
10903                                     parser.startTagPosition = parser.position
10904                                 } else {
10905                                     if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))
10906                                         strictFail(parser, "Text data outside of root node.")
10907                                     if (c === "&") parser.state = S.TEXT_ENTITY
10908                                     else parser.textNode += c
10909                                 }
10910                                 continue
10911
10912                             case S.SCRIPT:
10913                                 // only non-strict
10914                                 if (c === "<") {
10915                                     parser.state = S.SCRIPT_ENDING
10916                                 } else parser.script += c
10917                                 continue
10918
10919                             case S.SCRIPT_ENDING:
10920                                 if (c === "/") {
10921                                     parser.state = S.CLOSE_TAG
10922                                 } else {
10923                                     parser.script += "<" + c
10924                                     parser.state = S.SCRIPT
10925                                 }
10926                                 continue
10927
10928                             case S.OPEN_WAKA:
10929                                 // either a /, ?, !, or text is coming next.
10930                                 if (c === "!") {
10931                                     parser.state = S.SGML_DECL
10932                                     parser.sgmlDecl = ""
10933                                 } else if (is(whitespace, c)) {
10934                                     // wait for it...
10935                                 } else if (is(nameStart, c)) {
10936                                     parser.state = S.OPEN_TAG
10937                                     parser.tagName = c
10938                                 } else if (c === "/") {
10939                                     parser.state = S.CLOSE_TAG
10940                                     parser.tagName = ""
10941                                 } else if (c === "?") {
10942                                     parser.state = S.PROC_INST
10943                                     parser.procInstName = parser.procInstBody = ""
10944                                 } else {
10945                                     strictFail(parser, "Unencoded <")
10946                                         // if there was some whitespace, then add that in.
10947                                     if (parser.startTagPosition + 1 < parser.position) {
10948                                         var pad = parser.position - parser.startTagPosition
10949                                         c = new Array(pad).join(" ") + c
10950                                     }
10951                                     parser.textNode += "<" + c
10952                                     parser.state = S.TEXT
10953                                 }
10954                                 continue
10955
10956                             case S.SGML_DECL:
10957                                 if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
10958                                     emitNode(parser, "onopencdata")
10959                                     parser.state = S.CDATA
10960                                     parser.sgmlDecl = ""
10961                                     parser.cdata = ""
10962                                 } else if (parser.sgmlDecl + c === "--") {
10963                                     parser.state = S.COMMENT
10964                                     parser.comment = ""
10965                                     parser.sgmlDecl = ""
10966                                 } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
10967                                     parser.state = S.DOCTYPE
10968                                     if (parser.doctype || parser.sawRoot) strictFail(parser,
10969                                         "Inappropriately located doctype declaration")
10970                                     parser.doctype = ""
10971                                     parser.sgmlDecl = ""
10972                                 } else if (c === ">") {
10973                                     emitNode(parser, "onsgmldeclaration", parser.sgmlDecl)
10974                                     parser.sgmlDecl = ""
10975                                     parser.state = S.TEXT
10976                                 } else if (is(quote, c)) {
10977                                     parser.state = S.SGML_DECL_QUOTED
10978                                     parser.sgmlDecl += c
10979                                 } else parser.sgmlDecl += c
10980                                 continue
10981
10982                             case S.SGML_DECL_QUOTED:
10983                                 if (c === parser.q) {
10984                                     parser.state = S.SGML_DECL
10985                                     parser.q = ""
10986                                 }
10987                                 parser.sgmlDecl += c
10988                                 continue
10989
10990                             case S.DOCTYPE:
10991                                 if (c === ">") {
10992                                     parser.state = S.TEXT
10993                                     emitNode(parser, "ondoctype", parser.doctype)
10994                                     parser.doctype = true // just remember that we saw it.
10995                                 } else {
10996                                     parser.doctype += c
10997                                     if (c === "[") parser.state = S.DOCTYPE_DTD
10998                                     else if (is(quote, c)) {
10999                                         parser.state = S.DOCTYPE_QUOTED
11000                                         parser.q = c
11001                                     }
11002                                 }
11003                                 continue
11004
11005                             case S.DOCTYPE_QUOTED:
11006                                 parser.doctype += c
11007                                 if (c === parser.q) {
11008                                     parser.q = ""
11009                                     parser.state = S.DOCTYPE
11010                                 }
11011                                 continue
11012
11013                             case S.DOCTYPE_DTD:
11014                                 parser.doctype += c
11015                                 if (c === "]") parser.state = S.DOCTYPE
11016                                 else if (is(quote, c)) {
11017                                     parser.state = S.DOCTYPE_DTD_QUOTED
11018                                     parser.q = c
11019                                 }
11020                                 continue
11021
11022                             case S.DOCTYPE_DTD_QUOTED:
11023                                 parser.doctype += c
11024                                 if (c === parser.q) {
11025                                     parser.state = S.DOCTYPE_DTD
11026                                     parser.q = ""
11027                                 }
11028                                 continue
11029
11030                             case S.COMMENT:
11031                                 if (c === "-") parser.state = S.COMMENT_ENDING
11032                                 else parser.comment += c
11033                                 continue
11034
11035                             case S.COMMENT_ENDING:
11036                                 if (c === "-") {
11037                                     parser.state = S.COMMENT_ENDED
11038                                     parser.comment = textopts(parser.opt, parser.comment)
11039                                     if (parser.comment) emitNode(parser, "oncomment", parser.comment)
11040                                     parser.comment = ""
11041                                 } else {
11042                                     parser.comment += "-" + c
11043                                     parser.state = S.COMMENT
11044                                 }
11045                                 continue
11046
11047                             case S.COMMENT_ENDED:
11048                                 if (c !== ">") {
11049                                     strictFail(parser, "Malformed comment")
11050                                         // allow <!-- blah -- bloo --> in non-strict mode,
11051                                         // which is a comment of " blah -- bloo "
11052                                     parser.comment += "--" + c
11053                                     parser.state = S.COMMENT
11054                                 } else parser.state = S.TEXT
11055                                 continue
11056
11057                             case S.CDATA:
11058                                 if (c === "]") parser.state = S.CDATA_ENDING
11059                                 else parser.cdata += c
11060                                 continue
11061
11062                             case S.CDATA_ENDING:
11063                                 if (c === "]") parser.state = S.CDATA_ENDING_2
11064                                 else {
11065                                     parser.cdata += "]" + c
11066                                     parser.state = S.CDATA
11067                                 }
11068                                 continue
11069
11070                             case S.CDATA_ENDING_2:
11071                                 if (c === ">") {
11072                                     if (parser.cdata) emitNode(parser, "oncdata", parser.cdata)
11073                                     emitNode(parser, "onclosecdata")
11074                                     parser.cdata = ""
11075                                     parser.state = S.TEXT
11076                                 } else if (c === "]") {
11077                                     parser.cdata += "]"
11078                                 } else {
11079                                     parser.cdata += "]]" + c
11080                                     parser.state = S.CDATA
11081                                 }
11082                                 continue
11083
11084                             case S.PROC_INST:
11085                                 if (c === "?") parser.state = S.PROC_INST_ENDING
11086                                 else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY
11087                                 else parser.procInstName += c
11088                                 continue
11089
11090                             case S.PROC_INST_BODY:
11091                                 if (!parser.procInstBody && is(whitespace, c)) continue
11092                                 else if (c === "?") parser.state = S.PROC_INST_ENDING
11093                                 else parser.procInstBody += c
11094                                 continue
11095
11096                             case S.PROC_INST_ENDING:
11097                                 if (c === ">") {
11098                                     emitNode(parser, "onprocessinginstruction", {
11099                                         name: parser.procInstName,
11100                                         body: parser.procInstBody
11101                                     })
11102                                     parser.procInstName = parser.procInstBody = ""
11103                                     parser.state = S.TEXT
11104                                 } else {
11105                                     parser.procInstBody += "?" + c
11106                                     parser.state = S.PROC_INST_BODY
11107                                 }
11108                                 continue
11109
11110                             case S.OPEN_TAG:
11111                                 if (is(nameBody, c)) parser.tagName += c
11112                                 else {
11113                                     newTag(parser)
11114                                     if (c === ">") openTag(parser)
11115                                     else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11116                                     else {
11117                                         if (not(whitespace, c)) strictFail(
11118                                             parser, "Invalid character in tag name")
11119                                         parser.state = S.ATTRIB
11120                                     }
11121                                 }
11122                                 continue
11123
11124                             case S.OPEN_TAG_SLASH:
11125                                 if (c === ">") {
11126                                     openTag(parser, true)
11127                                     closeTag(parser)
11128                                 } else {
11129                                     strictFail(parser, "Forward-slash in opening tag not followed by >")
11130                                     parser.state = S.ATTRIB
11131                                 }
11132                                 continue
11133
11134                             case S.ATTRIB:
11135                                 // haven't read the attribute name yet.
11136                                 if (is(whitespace, c)) continue
11137                                 else if (c === ">") openTag(parser)
11138                                 else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11139                                 else if (is(nameStart, c)) {
11140                                     parser.attribName = c
11141                                     parser.attribValue = ""
11142                                     parser.state = S.ATTRIB_NAME
11143                                 } else strictFail(parser, "Invalid attribute name")
11144                                 continue
11145
11146                             case S.ATTRIB_NAME:
11147                                 if (c === "=") parser.state = S.ATTRIB_VALUE
11148                                 else if (c === ">") {
11149                                     strictFail(parser, "Attribute without value")
11150                                     parser.attribValue = parser.attribName
11151                                     attrib(parser)
11152                                     openTag(parser)
11153                                 } else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE
11154                                 else if (is(nameBody, c)) parser.attribName += c
11155                                 else strictFail(parser, "Invalid attribute name")
11156                                 continue
11157
11158                             case S.ATTRIB_NAME_SAW_WHITE:
11159                                 if (c === "=") parser.state = S.ATTRIB_VALUE
11160                                 else if (is(whitespace, c)) continue
11161                                 else {
11162                                     strictFail(parser, "Attribute without value")
11163                                     parser.tag.attributes[parser.attribName] = ""
11164                                     parser.attribValue = ""
11165                                     emitNode(parser, "onattribute", {
11166                                         name: parser.attribName,
11167                                         value: ""
11168                                     })
11169                                     parser.attribName = ""
11170                                     if (c === ">") openTag(parser)
11171                                     else if (is(nameStart, c)) {
11172                                         parser.attribName = c
11173                                         parser.state = S.ATTRIB_NAME
11174                                     } else {
11175                                         strictFail(parser, "Invalid attribute name")
11176                                         parser.state = S.ATTRIB
11177                                     }
11178                                 }
11179                                 continue
11180
11181                             case S.ATTRIB_VALUE:
11182                                 if (is(whitespace, c)) continue
11183                                 else if (is(quote, c)) {
11184                                     parser.q = c
11185                                     parser.state = S.ATTRIB_VALUE_QUOTED
11186                                 } else {
11187                                     strictFail(parser, "Unquoted attribute value")
11188                                     parser.state = S.ATTRIB_VALUE_UNQUOTED
11189                                     parser.attribValue = c
11190                                 }
11191                                 continue
11192
11193                             case S.ATTRIB_VALUE_QUOTED:
11194                                 if (c !== parser.q) {
11195                                     if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q
11196                                     else parser.attribValue += c
11197                                     continue
11198                                 }
11199                                 attrib(parser)
11200                                 parser.q = ""
11201                                 parser.state = S.ATTRIB_VALUE_CLOSED
11202                                 continue
11203
11204                             case S.ATTRIB_VALUE_CLOSED:
11205                                 if (is(whitespace, c)) {
11206                                     parser.state = S.ATTRIB
11207                                 } else if (c === ">") openTag(parser)
11208                                 else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11209                                 else if (is(nameStart, c)) {
11210                                     strictFail(parser, "No whitespace between attributes")
11211                                     parser.attribName = c
11212                                     parser.attribValue = ""
11213                                     parser.state = S.ATTRIB_NAME
11214                                 } else strictFail(parser, "Invalid attribute name")
11215                                 continue
11216
11217                             case S.ATTRIB_VALUE_UNQUOTED:
11218                                 if (not(attribEnd, c)) {
11219                                     if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U
11220                                     else parser.attribValue += c
11221                                     continue
11222                                 }
11223                                 attrib(parser)
11224                                 if (c === ">") openTag(parser)
11225                                 else parser.state = S.ATTRIB
11226                                 continue
11227
11228                             case S.CLOSE_TAG:
11229                                 if (!parser.tagName) {
11230                                     if (is(whitespace, c)) continue
11231                                     else if (not(nameStart, c)) {
11232                                         if (parser.script) {
11233                                             parser.script += "</" + c
11234                                             parser.state = S.SCRIPT
11235                                         } else {
11236                                             strictFail(parser, "Invalid tagname in closing tag.")
11237                                         }
11238                                     } else parser.tagName = c
11239                                 } else if (c === ">") closeTag(parser)
11240                                 else if (is(nameBody, c)) parser.tagName += c
11241                                 else if (parser.script) {
11242                                     parser.script += "</" + parser.tagName
11243                                     parser.tagName = ""
11244                                     parser.state = S.SCRIPT
11245                                 } else {
11246                                     if (not(whitespace, c)) strictFail(parser,
11247                                         "Invalid tagname in closing tag")
11248                                     parser.state = S.CLOSE_TAG_SAW_WHITE
11249                                 }
11250                                 continue
11251
11252                             case S.CLOSE_TAG_SAW_WHITE:
11253                                 if (is(whitespace, c)) continue
11254                                 if (c === ">") closeTag(parser)
11255                                 else strictFail(parser, "Invalid characters in closing tag")
11256                                 continue
11257
11258                             case S.TEXT_ENTITY:
11259                             case S.ATTRIB_VALUE_ENTITY_Q:
11260                             case S.ATTRIB_VALUE_ENTITY_U:
11261                                 switch (parser.state) {
11262                                     case S.TEXT_ENTITY:
11263                                         var returnState = S.TEXT,
11264                                             buffer = "textNode"
11265                                         break
11266
11267                                     case S.ATTRIB_VALUE_ENTITY_Q:
11268                                         var returnState = S.ATTRIB_VALUE_QUOTED,
11269                                             buffer = "attribValue"
11270                                         break
11271
11272                                     case S.ATTRIB_VALUE_ENTITY_U:
11273                                         var returnState = S.ATTRIB_VALUE_UNQUOTED,
11274                                             buffer = "attribValue"
11275                                         break
11276                                 }
11277                                 if (c === ";") {
11278                                     parser[buffer] += parseEntity(parser)
11279                                     parser.entity = ""
11280                                     parser.state = returnState
11281                                 } else if (is(entity, c)) parser.entity += c
11282                                 else {
11283                                     strictFail(parser, "Invalid character entity")
11284                                     parser[buffer] += "&" + parser.entity + c
11285                                     parser.entity = ""
11286                                     parser.state = returnState
11287                                 }
11288                                 continue
11289
11290                             default:
11291                                 throw new Error(parser, "Unknown state: " + parser.state)
11292                         }
11293                     } // while
11294                     // cdata blocks can get very big under normal conditions. emit and move on.
11295                     // if (parser.state === S.CDATA && parser.cdata) {
11296                     // emitNode(parser, "oncdata", parser.cdata)
11297                     // parser.cdata = ""
11298                     // }
11299                     if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)
11300                     return parser
11301                 }
11302
11303                 /* ! http://mths.be/fromcodepoint v0.1.0 by @mathias */
11304                 if (!String.fromCodePoint) {
11305                     (function() {
11306                         var stringFromCharCode = String.fromCharCode;
11307                         var floor = Math.floor;
11308                         var fromCodePoint = function() {
11309                             var MAX_SIZE = 0x4000;
11310                             var codeUnits = [];
11311                             var highSurrogate;
11312                             var lowSurrogate;
11313                             var index = -1;
11314                             var length = arguments.length;
11315                             if (!length) {
11316                                 return '';
11317                             }
11318                             var result = '';
11319                             while (++index < length) {
11320                                 var codePoint = Number(arguments[index]);
11321                                 if (!isFinite(codePoint) || // `NaN`,
11322                                     // `+Infinity`,
11323                                     // or
11324                                     // `-Infinity`
11325                                     codePoint < 0 || // not a valid
11326                                     // Unicode code
11327                                     // point
11328                                     codePoint > 0x10FFFF || // not a valid
11329                                     // Unicode code
11330                                     // point
11331                                     floor(codePoint) != codePoint // not
11332                                     // an
11333                                     // integer
11334                                 ) {
11335                                     throw RangeError('Invalid code point: ' + codePoint);
11336                                 }
11337                                 if (codePoint <= 0xFFFF) { // BMP code point
11338                                     codeUnits.push(codePoint);
11339                                 } else { // Astral code point; split in
11340                                     // surrogate halves
11341                                     // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
11342                                     codePoint -= 0x10000;
11343                                     highSurrogate = (codePoint >> 10) + 0xD800;
11344                                     lowSurrogate = (codePoint % 0x400) + 0xDC00;
11345                                     codeUnits.push(highSurrogate, lowSurrogate);
11346                                 }
11347                                 if (index + 1 == length || codeUnits.length > MAX_SIZE) {
11348                                     result += stringFromCharCode.apply(null, codeUnits);
11349                                     codeUnits.length = 0;
11350                                 }
11351                             }
11352                             return result;
11353                         };
11354                         if (Object.defineProperty) {
11355                             Object.defineProperty(String, 'fromCodePoint', {
11356                                 'value': fromCodePoint,
11357                                 'configurable': true,
11358                                 'writable': true
11359                             });
11360                         } else {
11361                             String.fromCodePoint = fromCodePoint;
11362                         }
11363                     }());
11364                 }
11365
11366             })(typeof exports === "undefined" ? sax = {} : exports);
11367
11368         }).call(this, undefined)
11369     }, {
11370         "stream": false,
11371         "string_decoder": false
11372     }],
11373     "\\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) {
11374         /**
11375          * Tiny stack for browser or server
11376          * 
11377          * @author Jason Mulligan <jason.mulligan@avoidwork.com>
11378          * @copyright 2014 Jason Mulligan
11379          * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>
11380          * @link http://avoidwork.github.io/tiny-stack
11381          * @module tiny-stack
11382          * @version 0.1.0
11383          */
11384
11385         (function(global) {
11386
11387             "use strict";
11388
11389             /**
11390              * TinyStack
11391              * 
11392              * @constructor
11393              */
11394             function TinyStack() {
11395                 this.data = [null];
11396                 this.top = 0;
11397             }
11398
11399             /**
11400              * Clears the stack
11401              * 
11402              * @method clear
11403              * @memberOf TinyStack
11404              * @return {Object} {@link TinyStack}
11405              */
11406             TinyStack.prototype.clear = function clear() {
11407                 this.data = [null];
11408                 this.top = 0;
11409
11410                 return this;
11411             };
11412
11413             /**
11414              * Gets the size of the stack
11415              * 
11416              * @method length
11417              * @memberOf TinyStack
11418              * @return {Number} Size of stack
11419              */
11420             TinyStack.prototype.length = function length() {
11421                 return this.top;
11422             };
11423
11424             /**
11425              * Gets the item at the top of the stack
11426              * 
11427              * @method peek
11428              * @memberOf TinyStack
11429              * @return {Mixed} Item at the top of the stack
11430              */
11431             TinyStack.prototype.peek = function peek() {
11432                 return this.data[this.top];
11433             };
11434
11435             /**
11436              * Gets & removes the item at the top of the stack
11437              * 
11438              * @method pop
11439              * @memberOf TinyStack
11440              * @return {Mixed} Item at the top of the stack
11441              */
11442             TinyStack.prototype.pop = function pop() {
11443                 if (this.top > 0) {
11444                     this.top--;
11445
11446                     return this.data.pop();
11447                 } else {
11448                     return undefined;
11449                 }
11450             };
11451
11452             /**
11453              * Pushes an item onto the stack
11454              * 
11455              * @method push
11456              * @memberOf TinyStack
11457              * @return {Object} {@link TinyStack}
11458              */
11459             TinyStack.prototype.push = function push(arg) {
11460                 this.data[++this.top] = arg;
11461
11462                 return this;
11463             };
11464
11465             /**
11466              * TinyStack factory
11467              * 
11468              * @method factory
11469              * @return {Object} {@link TinyStack}
11470              */
11471             function factory() {
11472                 return new TinyStack();
11473             }
11474
11475             // Node, AMD & window supported
11476             if (typeof exports != "undefined") {
11477                 module.exports = factory;
11478             } else if (typeof define == "function") {
11479                 define(function() {
11480                     return factory;
11481                 });
11482             } else {
11483                 global.stack = factory;
11484             }
11485         })(this);
11486
11487     }, {}],
11488     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js": [function(require, module, exports) {
11489         module.exports = require('./lib/moddle');
11490     }, {
11491         "./lib/moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\moddle.js"
11492     }],
11493     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\base.js": [function(require, module, exports) {
11494         'use strict';
11495
11496         function Base() {}
11497
11498         Base.prototype.get = function(name) {
11499             return this.$model.properties.get(this, name);
11500         };
11501
11502         Base.prototype.set = function(name, value) {
11503             this.$model.properties.set(this, name, value);
11504         };
11505
11506
11507         module.exports = Base;
11508     }, {}],
11509     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\descriptor-builder.js": [function(require, module, exports) {
11510         'use strict';
11511
11512         var pick = require('lodash/object/pick'),
11513             assign = require('lodash/object/assign'),
11514             forEach = require('lodash/collection/forEach');
11515
11516         var parseNameNs = require('./ns').parseName;
11517
11518
11519         function DescriptorBuilder(nameNs) {
11520             this.ns = nameNs;
11521             this.name = nameNs.name;
11522             this.allTypes = [];
11523             this.properties = [];
11524             this.propertiesByName = {};
11525         }
11526
11527         module.exports = DescriptorBuilder;
11528
11529
11530         DescriptorBuilder.prototype.build = function() {
11531             return pick(this, ['ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty']);
11532         };
11533
11534         DescriptorBuilder.prototype.addProperty = function(p, idx) {
11535             this.addNamedProperty(p, true);
11536
11537             var properties = this.properties;
11538
11539             if (idx !== undefined) {
11540                 properties.splice(idx, 0, p);
11541             } else {
11542                 properties.push(p);
11543             }
11544         };
11545
11546
11547         DescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {
11548             var oldNameNs = oldProperty.ns;
11549
11550             var props = this.properties,
11551                 propertiesByName = this.propertiesByName,
11552                 rename = oldProperty.name !== newProperty.name;
11553
11554             if (oldProperty.isBody) {
11555
11556                 if (!newProperty.isBody) {
11557                     throw new Error(
11558                         'property <' + newProperty.ns.name + '> must be body property ' +
11559                         'to refine <' + oldProperty.ns.name + '>');
11560                 }
11561
11562                 // TODO: Check compatibility
11563                 this.setBodyProperty(newProperty, false);
11564             }
11565
11566             // replacing the named property is intentional
11567             // thus, validate only if this is a "rename" operation
11568             this.addNamedProperty(newProperty, rename);
11569
11570             // replace old property at index with new one
11571             var idx = props.indexOf(oldProperty);
11572             if (idx === -1) {
11573                 throw new Error('property <' + oldNameNs.name + '> not found in property list');
11574             }
11575
11576             props[idx] = newProperty;
11577
11578             // replace propertiesByName entry with new property
11579             propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;
11580         };
11581
11582
11583         DescriptorBuilder.prototype.redefineProperty = function(p) {
11584
11585             var nsPrefix = p.ns.prefix;
11586             var parts = p.redefines.split('#');
11587
11588             var name = parseNameNs(parts[0], nsPrefix);
11589             var attrName = parseNameNs(parts[1], name.prefix).name;
11590
11591             var redefinedProperty = this.propertiesByName[attrName];
11592             if (!redefinedProperty) {
11593                 throw new Error('refined property <' + attrName + '> not found');
11594             } else {
11595                 this.replaceProperty(redefinedProperty, p);
11596             }
11597
11598             delete p.redefines;
11599         };
11600
11601         DescriptorBuilder.prototype.addNamedProperty = function(p, validate) {
11602             var ns = p.ns,
11603                 propsByName = this.propertiesByName;
11604
11605             if (validate) {
11606                 this.assertNotDefined(p, ns.name);
11607                 this.assertNotDefined(p, ns.localName);
11608             }
11609
11610             propsByName[ns.name] = propsByName[ns.localName] = p;
11611         };
11612
11613         DescriptorBuilder.prototype.removeNamedProperty = function(p) {
11614             var ns = p.ns,
11615                 propsByName = this.propertiesByName;
11616
11617             delete propsByName[ns.name];
11618             delete propsByName[ns.localName];
11619         };
11620
11621         DescriptorBuilder.prototype.setBodyProperty = function(p, validate) {
11622
11623             if (validate && this.bodyProperty) {
11624                 throw new Error(
11625                     'body property defined multiple times ' +
11626                     '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');
11627             }
11628
11629             this.bodyProperty = p;
11630         };
11631
11632         DescriptorBuilder.prototype.addIdProperty = function(name) {
11633             var nameNs = parseNameNs(name, this.ns.prefix);
11634
11635             var p = {
11636                 name: nameNs.localName,
11637                 type: 'String',
11638                 isAttr: true,
11639                 ns: nameNs
11640             };
11641
11642             // ensure that id is always the first attribute (if present)
11643             this.addProperty(p, 0);
11644         };
11645
11646         DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
11647             var propertyName = p.name,
11648                 definedProperty = this.propertiesByName[propertyName];
11649
11650             if (definedProperty) {
11651                 throw new Error(
11652                     'property <' + propertyName + '> already defined; ' +
11653                     'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +
11654                     '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');
11655             }
11656         };
11657
11658         DescriptorBuilder.prototype.hasProperty = function(name) {
11659             return this.propertiesByName[name];
11660         };
11661
11662         DescriptorBuilder.prototype.addTrait = function(t) {
11663
11664             var allTypes = this.allTypes;
11665
11666             if (allTypes.indexOf(t) !== -1) {
11667                 return;
11668             }
11669
11670             forEach(t.properties, function(p) {
11671
11672                 // clone property to allow extensions
11673                 p = assign({}, p, {
11674                     name: p.ns.localName
11675                 });
11676
11677                 Object.defineProperty(p, 'definedBy', {
11678                     value: t
11679                 });
11680
11681                 // add redefine support
11682                 if (p.redefines) {
11683                     this.redefineProperty(p);
11684                 } else {
11685                     if (p.isBody) {
11686                         this.setBodyProperty(p);
11687                     }
11688                     this.addProperty(p);
11689                 }
11690             }, this);
11691
11692             allTypes.push(t);
11693         };
11694
11695     }, {
11696         "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
11697         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
11698         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
11699         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
11700     }],
11701     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\factory.js": [function(require, module, exports) {
11702         'use strict';
11703
11704         var forEach = require('lodash/collection/forEach');
11705
11706         var Base = require('./base');
11707
11708
11709         function Factory(model, properties) {
11710             this.model = model;
11711             this.properties = properties;
11712         }
11713
11714         module.exports = Factory;
11715
11716
11717         Factory.prototype.createType = function(descriptor) {
11718
11719             var model = this.model;
11720
11721             var props = this.properties,
11722                 prototype = Object.create(Base.prototype);
11723
11724             // initialize default values
11725             forEach(descriptor.properties, function(p) {
11726                 if (!p.isMany && p.default !== undefined) {
11727                     prototype[p.name] = p.default;
11728                 }
11729             });
11730
11731             props.defineModel(prototype, model);
11732             props.defineDescriptor(prototype, descriptor);
11733
11734             var name = descriptor.ns.name;
11735
11736             /**
11737              * The new type constructor
11738              */
11739             function ModdleElement(attrs) {
11740                 props.define(this, '$type', {
11741                     value: name,
11742                     enumerable: true
11743                 });
11744                 props.define(this, '$attrs', {
11745                     value: {}
11746                 });
11747                 props.define(this, '$parent', {
11748                     writable: true
11749                 });
11750
11751                 forEach(attrs, function(val, key) {
11752                     this.set(key, val);
11753                 }, this);
11754             }
11755
11756             ModdleElement.prototype = prototype;
11757
11758             ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;
11759
11760             // static links
11761             props.defineModel(ModdleElement, model);
11762             props.defineDescriptor(ModdleElement, descriptor);
11763
11764             return ModdleElement;
11765         };
11766     }, {
11767         "./base": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\base.js",
11768         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
11769     }],
11770     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\moddle.js": [function(require, module, exports) {
11771         'use strict';
11772
11773         var isString = require('lodash/lang/isString'),
11774             isObject = require('lodash/lang/isObject'),
11775             forEach = require('lodash/collection/forEach'),
11776             find = require('lodash/collection/find');
11777
11778
11779         var Factory = require('./factory'),
11780             Registry = require('./registry'),
11781             Properties = require('./properties');
11782
11783         var parseNameNs = require('./ns').parseName;
11784
11785
11786         // // Moddle implementation /////////////////////////////////////////////////
11787
11788         /**
11789          * @class Moddle
11790          * 
11791          * A model that can be used to create elements of a specific type.
11792          * 
11793          * @example
11794          * 
11795          * var Moddle = require('moddle');
11796          * 
11797          * var pkg = { name: 'mypackage', prefix: 'my', types: [ { name: 'Root' } ] };
11798          * 
11799          * var moddle = new Moddle([pkg]);
11800          * 
11801          * @param {Array
11802          *            <Package>} packages the packages to contain
11803          * @param {Object}
11804          *            options additional options to pass to the model
11805          */
11806         function Moddle(packages, options) {
11807
11808             options = options || {};
11809
11810             this.properties = new Properties(this);
11811
11812             this.factory = new Factory(this, this.properties);
11813             this.registry = new Registry(packages, this.properties, options);
11814
11815             this.typeCache = {};
11816         }
11817
11818         module.exports = Moddle;
11819
11820
11821         /**
11822          * Create an instance of the specified type.
11823          * 
11824          * @method Moddle#create
11825          * 
11826          * @example
11827          * 
11828          * var foo = moddle.create('my:Foo'); var bar = moddle.create('my:Bar', { id:
11829          * 'BAR_1' });
11830          * 
11831          * @param {String|Object}
11832          *            descriptor the type descriptor or name know to the model
11833          * @param {Object}
11834          *            attrs a number of attributes to initialize the model instance with
11835          * @return {Object} model instance
11836          */
11837         Moddle.prototype.create = function(descriptor, attrs) {
11838             var Type = this.getType(descriptor);
11839
11840             if (!Type) {
11841                 throw new Error('unknown type <' + descriptor + '>');
11842             }
11843
11844             return new Type(attrs);
11845         };
11846
11847
11848         /**
11849          * Returns the type representing a given descriptor
11850          * 
11851          * @method Moddle#getType
11852          * 
11853          * @example
11854          * 
11855          * var Foo = moddle.getType('my:Foo'); var foo = new Foo({ 'id' : 'FOO_1' });
11856          * 
11857          * @param {String|Object}
11858          *            descriptor the type descriptor or name know to the model
11859          * @return {Object} the type representing the descriptor
11860          */
11861         Moddle.prototype.getType = function(descriptor) {
11862
11863             var cache = this.typeCache;
11864
11865             var name = isString(descriptor) ? descriptor : descriptor.ns.name;
11866
11867             var type = cache[name];
11868
11869             if (!type) {
11870                 descriptor = this.registry.getEffectiveDescriptor(name);
11871                 type = cache[name] = this.factory.createType(descriptor);
11872             }
11873
11874             return type;
11875         };
11876
11877
11878         /**
11879          * Creates an any-element type to be used within model instances.
11880          * 
11881          * This can be used to create custom elements that lie outside the meta-model.
11882          * The created element contains all the meta-data required to serialize it as
11883          * part of meta-model elements.
11884          * 
11885          * @method Moddle#createAny
11886          * 
11887          * @example
11888          * 
11889          * var foo = moddle.createAny('vendor:Foo', 'http://vendor', { value: 'bar' });
11890          * 
11891          * var container = moddle.create('my:Container', 'http://my', { any: [ foo ] });
11892          *  // go ahead and serialize the stuff
11893          * 
11894          * 
11895          * @param {String}
11896          *            name the name of the element
11897          * @param {String}
11898          *            nsUri the namespace uri of the element
11899          * @param {Object}
11900          *            [properties] a map of properties to initialize the instance with
11901          * @return {Object} the any type instance
11902          */
11903         Moddle.prototype.createAny = function(name, nsUri, properties) {
11904
11905             var nameNs = parseNameNs(name);
11906
11907             var element = {
11908                 $type: name
11909             };
11910
11911             var descriptor = {
11912                 name: name,
11913                 isGeneric: true,
11914                 ns: {
11915                     prefix: nameNs.prefix,
11916                     localName: nameNs.localName,
11917                     uri: nsUri
11918                 }
11919             };
11920
11921             this.properties.defineDescriptor(element, descriptor);
11922             this.properties.defineModel(element, this);
11923             this.properties.define(element, '$parent', {
11924                 enumerable: false,
11925                 writable: true
11926             });
11927
11928             forEach(properties, function(a, key) {
11929                 if (isObject(a) && a.value !== undefined) {
11930                     element[a.name] = a.value;
11931                 } else {
11932                     element[key] = a;
11933                 }
11934             });
11935
11936             return element;
11937         };
11938
11939         /**
11940          * Returns a registered package by uri or prefix
11941          * 
11942          * @return {Object} the package
11943          */
11944         Moddle.prototype.getPackage = function(uriOrPrefix) {
11945             return this.registry.getPackage(uriOrPrefix);
11946         };
11947
11948         /**
11949          * Returns a snapshot of all known packages
11950          * 
11951          * @return {Object} the package
11952          */
11953         Moddle.prototype.getPackages = function() {
11954             return this.registry.getPackages();
11955         };
11956
11957         /**
11958          * Returns the descriptor for an element
11959          */
11960         Moddle.prototype.getElementDescriptor = function(element) {
11961             return element.$descriptor;
11962         };
11963
11964         /**
11965          * Returns true if the given descriptor or instance represents the given type.
11966          * 
11967          * May be applied to this, if element is omitted.
11968          */
11969         Moddle.prototype.hasType = function(element, type) {
11970             if (type === undefined) {
11971                 type = element;
11972                 element = this;
11973             }
11974
11975             var descriptor = element.$model.getElementDescriptor(element);
11976
11977             return !!find(descriptor.allTypes, function(t) {
11978                 return t.name === type;
11979             });
11980         };
11981
11982
11983         /**
11984          * Returns the descriptor of an elements named property
11985          */
11986         Moddle.prototype.getPropertyDescriptor = function(element, property) {
11987             return this.getElementDescriptor(element).propertiesByName[property];
11988         };
11989
11990     }, {
11991         "./factory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\factory.js",
11992         "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
11993         "./properties": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\properties.js",
11994         "./registry": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\registry.js",
11995         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
11996         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
11997         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
11998         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js"
11999     }],
12000     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js": [function(require, module, exports) {
12001         'use strict';
12002
12003         /**
12004          * Parses a namespaced attribute name of the form (ns:)localName to an object,
12005          * given a default prefix to assume in case no explicit namespace is given.
12006          * 
12007          * @param {String}
12008          *            name
12009          * @param {String}
12010          *            [defaultPrefix] the default prefix to take, if none is present.
12011          * 
12012          * @return {Object} the parsed name
12013          */
12014         module.exports.parseName = function(name, defaultPrefix) {
12015             var parts = name.split(/:/),
12016                 localName, prefix;
12017
12018             // no prefix (i.e. only local name)
12019             if (parts.length === 1) {
12020                 localName = name;
12021                 prefix = defaultPrefix;
12022             } else
12023             // prefix + local name
12024             if (parts.length === 2) {
12025                 localName = parts[1];
12026                 prefix = parts[0];
12027             } else {
12028                 throw new Error('expected <prefix:localName> or <localName>, got ' + name);
12029             }
12030
12031             name = (prefix ? prefix + ':' : '') + localName;
12032
12033             return {
12034                 name: name,
12035                 prefix: prefix,
12036                 localName: localName
12037             };
12038         };
12039     }, {}],
12040     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\properties.js": [function(require, module, exports) {
12041         'use strict';
12042
12043
12044         /**
12045          * A utility that gets and sets properties of model elements.
12046          * 
12047          * @param {Model}
12048          *            model
12049          */
12050         function Properties(model) {
12051             this.model = model;
12052         }
12053
12054         module.exports = Properties;
12055
12056
12057         /**
12058          * Sets a named property on the target element
12059          * 
12060          * @param {Object}
12061          *            target
12062          * @param {String}
12063          *            name
12064          * @param {Object}
12065          *            value
12066          */
12067         Properties.prototype.set = function(target, name, value) {
12068
12069             var property = this.model.getPropertyDescriptor(target, name);
12070
12071             if (!property) {
12072                 target.$attrs[name] = value;
12073             } else {
12074                 Object.defineProperty(target, property.name, {
12075                     enumerable: !property.isReference,
12076                     writable: true,
12077                     value: value
12078                 });
12079             }
12080         };
12081
12082         /**
12083          * Returns the named property of the given element
12084          * 
12085          * @param {Object}
12086          *            target
12087          * @param {String}
12088          *            name
12089          * 
12090          * @return {Object}
12091          */
12092         Properties.prototype.get = function(target, name) {
12093
12094             var property = this.model.getPropertyDescriptor(target, name);
12095
12096             if (!property) {
12097                 return target.$attrs[name];
12098             }
12099
12100             var propertyName = property.name;
12101
12102             // check if access to collection property and lazily initialize it
12103             if (!target[propertyName] && property.isMany) {
12104                 Object.defineProperty(target, propertyName, {
12105                     enumerable: !property.isReference,
12106                     writable: true,
12107                     value: []
12108                 });
12109             }
12110
12111             return target[propertyName];
12112         };
12113
12114
12115         /**
12116          * Define a property on the target element
12117          * 
12118          * @param {Object}
12119          *            target
12120          * @param {String}
12121          *            name
12122          * @param {Object}
12123          *            options
12124          */
12125         Properties.prototype.define = function(target, name, options) {
12126             Object.defineProperty(target, name, options);
12127         };
12128
12129
12130         /**
12131          * Define the descriptor for an element
12132          */
12133         Properties.prototype.defineDescriptor = function(target, descriptor) {
12134             this.define(target, '$descriptor', {
12135                 value: descriptor
12136             });
12137         };
12138
12139         /**
12140          * Define the model for an element
12141          */
12142         Properties.prototype.defineModel = function(target, model) {
12143             this.define(target, '$model', {
12144                 value: model
12145             });
12146         };
12147     }, {}],
12148     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\registry.js": [function(require, module, exports) {
12149         'use strict';
12150
12151         var assign = require('lodash/object/assign'),
12152             forEach = require('lodash/collection/forEach');
12153
12154         var Types = require('./types'),
12155             DescriptorBuilder = require('./descriptor-builder');
12156
12157         var parseNameNs = require('./ns').parseName,
12158             isBuiltInType = Types.isBuiltIn;
12159
12160
12161         function Registry(packages, properties, options) {
12162
12163             this.options = assign({
12164                 generateId: 'id'
12165             }, options || {});
12166
12167             this.packageMap = {};
12168             this.typeMap = {};
12169
12170             this.packages = [];
12171
12172             this.properties = properties;
12173
12174             forEach(packages, this.registerPackage, this);
12175         }
12176
12177         module.exports = Registry;
12178
12179
12180         Registry.prototype.getPackage = function(uriOrPrefix) {
12181             return this.packageMap[uriOrPrefix];
12182         };
12183
12184         Registry.prototype.getPackages = function() {
12185             return this.packages;
12186         };
12187
12188
12189         Registry.prototype.registerPackage = function(pkg) {
12190             // alert("pkg :: " + pkg);
12191             // copy package
12192             pkg = assign({}, pkg);
12193
12194             // register types
12195             forEach(pkg.types, function(descriptor) {
12196                 this.registerType(descriptor, pkg);
12197             }, this);
12198
12199             this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;
12200             this.packages.push(pkg);
12201         };
12202
12203
12204         /**
12205          * Register a type from a specific package with us
12206          */
12207         Registry.prototype.registerType = function(type, pkg) {
12208
12209             type = assign({}, type, {
12210                 superClass: (type.superClass || []).slice(),
12211                 extends: (type.extends || []).slice(),
12212                 properties: (type.properties || []).slice()
12213             });
12214
12215             var ns = parseNameNs(type.name, pkg.prefix),
12216                 name = ns.name,
12217                 propertiesByName = {};
12218
12219             // parse properties
12220             forEach(type.properties, function(p) {
12221
12222                 // namespace property names
12223                 var propertyNs = parseNameNs(p.name, ns.prefix),
12224                     propertyName = propertyNs.name;
12225
12226                 // namespace property types
12227                 if (!isBuiltInType(p.type)) {
12228                     p.type = parseNameNs(p.type, propertyNs.prefix).name;
12229                 }
12230
12231                 assign(p, {
12232                     ns: propertyNs,
12233                     name: propertyName
12234                 });
12235
12236                 propertiesByName[propertyName] = p;
12237             });
12238
12239             // update ns + name
12240             assign(type, {
12241                 ns: ns,
12242                 name: name,
12243                 propertiesByName: propertiesByName
12244             });
12245
12246             forEach(type.extends, function(extendsName) {
12247                 var extended = this.typeMap[extendsName];
12248
12249                 extended.traits = extended.traits || [];
12250                 extended.traits.push(name);
12251             }, this);
12252
12253             // link to package
12254             this.definePackage(type, pkg);
12255
12256             // register
12257             this.typeMap[name] = type;
12258         };
12259
12260
12261         /**
12262          * Traverse the type hierarchy from bottom to top.
12263          */
12264         Registry.prototype.mapTypes = function(nsName, iterator) {
12265
12266             // alert("nsName :: " + nsName.name);
12267             var type = isBuiltInType(nsName.name) ? {
12268                 name: nsName.name
12269             } : this.typeMap[nsName.name];
12270             // alert("Type :: " + type);
12271
12272             var self = this;
12273
12274             /**
12275              * Traverse the selected super type or trait
12276              * 
12277              * @param {String}
12278              *            cls
12279              */
12280             function traverseSuper(cls) {
12281                 var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);
12282                 self.mapTypes(parentNs, iterator);
12283             }
12284
12285             if (!type) {
12286                 throw new Error('unknown type <' + nsName.name + '>');
12287             }
12288
12289             forEach(type.superClass, traverseSuper);
12290
12291             iterator(type);
12292
12293             forEach(type.traits, traverseSuper);
12294         };
12295
12296
12297         /**
12298          * Returns the effective descriptor for a type.
12299          * 
12300          * @param {String}
12301          *            type the namespaced name (ns:localName) of the type
12302          * 
12303          * @return {Descriptor} the resulting effective descriptor
12304          */
12305         Registry.prototype.getEffectiveDescriptor = function(name) {
12306
12307             var nsName = parseNameNs(name);
12308
12309             var builder = new DescriptorBuilder(nsName);
12310
12311             this.mapTypes(nsName, function(type) {
12312                 builder.addTrait(type);
12313             });
12314
12315             // check we have an id assigned
12316             var id = this.options.generateId;
12317             if (id && !builder.hasProperty(id)) {
12318                 builder.addIdProperty(id);
12319             }
12320
12321             var descriptor = builder.build();
12322
12323             // define package link
12324             this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);
12325
12326             return descriptor;
12327         };
12328
12329
12330         Registry.prototype.definePackage = function(target, pkg) {
12331             this.properties.define(target, '$pkg', {
12332                 value: pkg
12333             });
12334         };
12335     }, {
12336         "./descriptor-builder": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\descriptor-builder.js",
12337         "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
12338         "./types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js",
12339         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
12340         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
12341     }],
12342     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js": [function(require, module, exports) {
12343         'use strict';
12344
12345         /**
12346          * Built-in moddle types
12347          */
12348         var BUILTINS = {
12349             String: true,
12350             Boolean: true,
12351             Integer: true,
12352             Real: true,
12353             Element: true
12354         };
12355
12356         /**
12357          * Converters for built in types from string representations
12358          */
12359         var TYPE_CONVERTERS = {
12360             String: function(s) {
12361                 return s;
12362             },
12363             Boolean: function(s) {
12364                 return s === 'true';
12365             },
12366             Integer: function(s) {
12367                 return parseInt(s, 10);
12368             },
12369             Real: function(s) {
12370                 return parseFloat(s, 10);
12371             }
12372         };
12373
12374         /**
12375          * Convert a type to its real representation
12376          */
12377         module.exports.coerceType = function(type, value) {
12378
12379             var converter = TYPE_CONVERTERS[type];
12380
12381             if (converter) {
12382                 return converter(value);
12383             } else {
12384                 return value;
12385             }
12386         };
12387
12388         /**
12389          * Return whether the given type is built-in
12390          */
12391         module.exports.isBuiltIn = function(type) {
12392             return !!BUILTINS[type];
12393         };
12394
12395         /**
12396          * Return whether the given type is simple
12397          */
12398         module.exports.isSimple = function(type) {
12399             return !!TYPE_CONVERTERS[type];
12400         };
12401     }, {}],
12402     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmn.json": [function(require, module, exports) {
12403         module.exports = {
12404             "name": "BPMN20",
12405             "uri": "http://www.omg.org/spec/BPMN/20100524/MODEL",
12406             "associations": [],
12407             "types": [{
12408                 "name": "Interface",
12409                 "superClass": [
12410                     "RootElement"
12411                 ],
12412                 "properties": [{
12413                     "name": "name",
12414                     "isAttr": true,
12415                     "type": "String"
12416                 }, {
12417                     "name": "operations",
12418                     "type": "Operation",
12419                     "isMany": true
12420                 }, {
12421                     "name": "implementationRef",
12422                     "type": "String",
12423                     "isAttr": true
12424                 }]
12425             }, {
12426                 "name": "Operation",
12427                 "superClass": [
12428                     "BaseElement"
12429                 ],
12430                 "properties": [{
12431                     "name": "name",
12432                     "isAttr": true,
12433                     "type": "String"
12434                 }, {
12435                     "name": "inMessageRef",
12436                     "type": "Message",
12437                     "isAttr": true,
12438                     "isReference": true
12439                 }, {
12440                     "name": "outMessageRef",
12441                     "type": "Message",
12442                     "isAttr": true,
12443                     "isReference": true
12444                 }, {
12445                     "name": "errorRefs",
12446                     "type": "Error",
12447                     "isMany": true,
12448                     "isReference": true
12449                 }, {
12450                     "name": "implementationRef",
12451                     "type": "String",
12452                     "isAttr": true
12453                 }]
12454             }, {
12455                 "name": "EndPoint",
12456                 "superClass": [
12457                     "RootElement"
12458                 ]
12459             }, {
12460                 "name": "Auditing",
12461                 "superClass": [
12462                     "BaseElement"
12463                 ]
12464             }, {
12465                 "name": "GlobalTask",
12466                 "superClass": [
12467                     "CallableElement"
12468                 ],
12469                 "properties": [{
12470                     "name": "resources",
12471                     "type": "ResourceRole",
12472                     "isMany": true
12473                 }]
12474             }, {
12475                 "name": "Monitoring",
12476                 "superClass": [
12477                     "BaseElement"
12478                 ]
12479             }, {
12480                 "name": "Performer",
12481                 "superClass": [
12482                     "ResourceRole"
12483                 ]
12484             }, {
12485                 "name": "Process",
12486                 "superClass": [
12487                     "FlowElementsContainer",
12488                     "CallableElement"
12489                 ],
12490                 "properties": [{
12491                     "name": "processType",
12492                     "type": "ProcessType",
12493                     "isAttr": true
12494                 }, {
12495                     "name": "isClosed",
12496                     "isAttr": true,
12497                     "type": "Boolean"
12498                 }, {
12499                     "name": "auditing",
12500                     "type": "Auditing"
12501                 }, {
12502                     "name": "monitoring",
12503                     "type": "Monitoring"
12504                 }, {
12505                     "name": "properties",
12506                     "type": "Property",
12507                     "isMany": true
12508                 }, {
12509                     "name": "supports",
12510                     "type": "Process",
12511                     "isMany": true,
12512                     "isReference": true
12513                 }, {
12514                     "name": "definitionalCollaborationRef",
12515                     "type": "Collaboration",
12516                     "isAttr": true,
12517                     "isReference": true
12518                 }, {
12519                     "name": "isExecutable",
12520                     "isAttr": true,
12521                     "type": "Boolean"
12522                 }, {
12523                     "name": "resources",
12524                     "type": "ResourceRole",
12525                     "isMany": true
12526                 }, {
12527                     "name": "artifacts",
12528                     "type": "Artifact",
12529                     "isMany": true
12530                 }, {
12531                     "name": "correlationSubscriptions",
12532                     "type": "CorrelationSubscription",
12533                     "isMany": true
12534                 }]
12535             }, {
12536                 "name": "LaneSet",
12537                 "superClass": [
12538                     "BaseElement"
12539                 ],
12540                 "properties": [{
12541                     "name": "lanes",
12542                     "type": "Lane",
12543                     "isMany": true
12544                 }, {
12545                     "name": "name",
12546                     "isAttr": true,
12547                     "type": "String"
12548                 }]
12549             }, {
12550                 "name": "Lane",
12551                 "superClass": [
12552                     "BaseElement"
12553                 ],
12554                 "properties": [{
12555                     "name": "name",
12556                     "isAttr": true,
12557                     "type": "String"
12558                 }, {
12559                     "name": "childLaneSet",
12560                     "type": "LaneSet",
12561                     "serialize": "xsi:type"
12562                 }, {
12563                     "name": "partitionElementRef",
12564                     "type": "BaseElement",
12565                     "isAttr": true,
12566                     "isReference": true
12567                 }, {
12568                     "name": "flowNodeRef",
12569                     "type": "FlowNode",
12570                     "isMany": true,
12571                     "isReference": true
12572                 }, {
12573                     "name": "partitionElement",
12574                     "type": "BaseElement"
12575                 }]
12576             }, {
12577                 "name": "GlobalManualTask",
12578                 "superClass": [
12579                     "GlobalTask"
12580                 ]
12581             }, {
12582                 "name": "ManualTask",
12583                 "superClass": [
12584                     "Task"
12585                 ]
12586             }, {
12587                 "name": "UserTask",
12588                 "superClass": [
12589                     "Task"
12590                 ],
12591                 "properties": [{
12592                     "name": "renderings",
12593                     "type": "Rendering",
12594                     "isMany": true
12595                 }, {
12596                     "name": "implementation",
12597                     "isAttr": true,
12598                     "type": "String"
12599                 }]
12600             }, {
12601                 "name": "Rendering",
12602                 "superClass": [
12603                     "BaseElement"
12604                 ]
12605             }, {
12606                 "name": "HumanPerformer",
12607                 "superClass": [
12608                     "Performer"
12609                 ]
12610             }, {
12611                 "name": "PotentialOwner",
12612                 "superClass": [
12613                     "HumanPerformer"
12614                 ]
12615             }, {
12616                 "name": "GlobalUserTask",
12617                 "superClass": [
12618                     "GlobalTask"
12619                 ],
12620                 "properties": [{
12621                     "name": "implementation",
12622                     "isAttr": true,
12623                     "type": "String"
12624                 }, {
12625                     "name": "renderings",
12626                     "type": "Rendering",
12627                     "isMany": true
12628                 }]
12629             }, {
12630                 "name": "Gateway",
12631                 "isAbstract": true,
12632                 "superClass": [
12633                     "FlowNode"
12634                 ],
12635                 "properties": [{
12636                     "name": "gatewayDirection",
12637                     "type": "GatewayDirection",
12638                     "default": "Unspecified",
12639                     "isAttr": true
12640                 }]
12641             }, {
12642                 "name": "EventBasedGateway",
12643                 "superClass": [
12644                     "Gateway"
12645                 ],
12646                 "properties": [{
12647                     "name": "instantiate",
12648                     "default": false,
12649                     "isAttr": true,
12650                     "type": "Boolean"
12651                 }, {
12652                     "name": "eventGatewayType",
12653                     "type": "EventBasedGatewayType",
12654                     "isAttr": true,
12655                     "default": "Exclusive"
12656                 }]
12657             }, {
12658                 "name": "ComplexGateway",
12659                 "superClass": [
12660                     "Gateway"
12661                 ],
12662                 "properties": [{
12663                     "name": "activationCondition",
12664                     "type": "Expression",
12665                     "serialize": "xsi:type"
12666                 }, {
12667                     "name": "default",
12668                     "type": "SequenceFlow",
12669                     "isAttr": true,
12670                     "isReference": true
12671                 }]
12672             }, {
12673                 "name": "ExclusiveGateway",
12674                 "superClass": [
12675                     "Gateway"
12676                 ],
12677                 "properties": [{
12678                     "name": "default",
12679                     "type": "SequenceFlow",
12680                     "isAttr": true,
12681                     "isReference": true
12682                 }]
12683             }, {
12684                 "name": "InclusiveGateway",
12685                 "superClass": [
12686                     "Gateway"
12687                 ],
12688                 "properties": [{
12689                     "name": "default",
12690                     "type": "SequenceFlow",
12691                     "isAttr": true,
12692                     "isReference": true
12693                 }]
12694             }, {
12695                 "name": "ParallelGateway",
12696                 "superClass": [
12697                     "Gateway"
12698                 ]
12699             }, {
12700                 "name": "RootElement",
12701                 "isAbstract": true,
12702                 "superClass": [
12703                     "BaseElement"
12704                 ]
12705             }, {
12706                 "name": "Relationship",
12707                 "superClass": [
12708                     "BaseElement"
12709                 ],
12710                 "properties": [{
12711                     "name": "type",
12712                     "isAttr": true,
12713                     "type": "String"
12714                 }, {
12715                     "name": "direction",
12716                     "type": "RelationshipDirection",
12717                     "isAttr": true
12718                 }, {
12719                     "name": "source",
12720                     "isMany": true,
12721                     "isReference": true,
12722                     "type": "Element"
12723                 }, {
12724                     "name": "target",
12725                     "isMany": true,
12726                     "isReference": true,
12727                     "type": "Element"
12728                 }]
12729             }, {
12730                 "name": "BaseElement",
12731                 "isAbstract": true,
12732                 "properties": [{
12733                     "name": "id",
12734                     "isAttr": true,
12735                     "type": "String"
12736                 }, {
12737                     "name": "documentation",
12738                     "type": "Documentation",
12739                     "isMany": true
12740                 }, {
12741                     "name": "extensionDefinitions",
12742                     "type": "ExtensionDefinition",
12743                     "isMany": true,
12744                     "isReference": true
12745                 }, {
12746                     "name": "extensionElements",
12747                     "type": "ExtensionElements"
12748                 }]
12749             }, {
12750                 "name": "Extension",
12751                 "properties": [{
12752                     "name": "mustUnderstand",
12753                     "default": false,
12754                     "isAttr": true,
12755                     "type": "Boolean"
12756                 }, {
12757                     "name": "definition",
12758                     "type": "ExtensionDefinition"
12759                 }]
12760             }, {
12761                 "name": "ExtensionDefinition",
12762                 "properties": [{
12763                     "name": "name",
12764                     "isAttr": true,
12765                     "type": "String"
12766                 }, {
12767                     "name": "extensionAttributeDefinitions",
12768                     "type": "ExtensionAttributeDefinition",
12769                     "isMany": true
12770                 }]
12771             }, {
12772                 "name": "ExtensionAttributeDefinition",
12773                 "properties": [{
12774                     "name": "name",
12775                     "isAttr": true,
12776                     "type": "String"
12777                 }, {
12778                     "name": "type",
12779                     "isAttr": true,
12780                     "type": "String"
12781                 }, {
12782                     "name": "isReference",
12783                     "default": false,
12784                     "isAttr": true,
12785                     "type": "Boolean"
12786                 }, {
12787                     "name": "extensionDefinition",
12788                     "type": "ExtensionDefinition",
12789                     "isAttr": true,
12790                     "isReference": true
12791                 }]
12792             }, {
12793                 "name": "ExtensionElements",
12794                 "properties": [{
12795                     "name": "valueRef",
12796                     "isAttr": true,
12797                     "isReference": true,
12798                     "type": "Element"
12799                 }, {
12800                     "name": "values",
12801                     "type": "Element",
12802                     "isMany": true
12803                 }, {
12804                     "name": "extensionAttributeDefinition",
12805                     "type": "ExtensionAttributeDefinition",
12806                     "isAttr": true,
12807                     "isReference": true
12808                 }]
12809             }, {
12810                 "name": "Documentation",
12811                 "superClass": [
12812                     "BaseElement"
12813                 ],
12814                 "properties": [{
12815                     "name": "text",
12816                     "type": "String",
12817                     "isBody": true
12818                 }, {
12819                     "name": "textFormat",
12820                     "default": "text/plain",
12821                     "isAttr": true,
12822                     "type": "String"
12823                 }]
12824             }, {
12825                 "name": "Event",
12826                 "isAbstract": true,
12827                 "superClass": [
12828                     "FlowNode",
12829                     "InteractionNode"
12830                 ],
12831                 "properties": [{
12832                     "name": "properties",
12833                     "type": "Property",
12834                     "isMany": true
12835                 }]
12836             }, {
12837                 "name": "IntermediateCatchEvent",
12838                 "superClass": [
12839                     "CatchEvent"
12840                 ]
12841             }, {
12842                 "name": "IntermediateThrowEvent",
12843                 "superClass": [
12844                     "ThrowEvent"
12845                 ]
12846             }, {
12847                 "name": "EndEvent",
12848                 "superClass": [
12849                     "ThrowEvent"
12850                 ]
12851             }, {
12852                 "name": "StartEvent",
12853                 "superClass": [
12854                     "CatchEvent"
12855                 ],
12856                 "properties": [{
12857                     "name": "isInterrupting",
12858                     "default": true,
12859                     "isAttr": true,
12860                     "type": "Boolean"
12861                 }]
12862             }, {
12863                 "name": "MultiBranchConnector",
12864                 "superClass": [
12865                     "CatchEvent"
12866                 ],
12867                 "properties": [{
12868                     "name": "isInterrupting",
12869                     "default": true,
12870                     "isAttr": true,
12871                     "type": "Boolean"
12872                 }]
12873             }, {
12874                 "name": "ParentReturn",
12875                 "superClass": [
12876                     "Activity",
12877                     "InteractionNode"
12878                 ]
12879             }, {
12880                 "name": "SubProcessCall",
12881                 "superClass": [
12882                     "Activity",
12883                     "InteractionNode"
12884                 ]
12885             }, {
12886                 "name": "ThrowEvent",
12887                 "isAbstract": true,
12888                 "superClass": [
12889                     "Event"
12890                 ],
12891                 "properties": [{
12892                     "name": "inputSet",
12893                     "type": "InputSet"
12894                 }, {
12895                     "name": "eventDefinitionRefs",
12896                     "type": "EventDefinition",
12897                     "isMany": true,
12898                     "isReference": true
12899                 }, {
12900                     "name": "dataInputAssociation",
12901                     "type": "DataInputAssociation",
12902                     "isMany": true
12903                 }, {
12904                     "name": "dataInputs",
12905                     "type": "DataInput",
12906                     "isMany": true
12907                 }, {
12908                     "name": "eventDefinitions",
12909                     "type": "EventDefinition",
12910                     "isMany": true
12911                 }]
12912             }, {
12913                 "name": "CatchEvent",
12914                 "isAbstract": true,
12915                 "superClass": [
12916                     "Event"
12917                 ],
12918                 "properties": [{
12919                     "name": "parallelMultiple",
12920                     "isAttr": true,
12921                     "type": "Boolean",
12922                     "default": false
12923                 }, {
12924                     "name": "outputSet",
12925                     "type": "OutputSet"
12926                 }, {
12927                     "name": "eventDefinitionRefs",
12928                     "type": "EventDefinition",
12929                     "isMany": true,
12930                     "isReference": true
12931                 }, {
12932                     "name": "dataOutputAssociation",
12933                     "type": "DataOutputAssociation",
12934                     "isMany": true
12935                 }, {
12936                     "name": "dataOutputs",
12937                     "type": "DataOutput",
12938                     "isMany": true
12939                 }, {
12940                     "name": "eventDefinitions",
12941                     "type": "EventDefinition",
12942                     "isMany": true
12943                 }]
12944             }, {
12945                 "name": "BoundaryEvent",
12946                 "superClass": [
12947                     "CatchEvent"
12948                 ],
12949                 "properties": [{
12950                     "name": "cancelActivity",
12951                     "default": true,
12952                     "isAttr": true,
12953                     "type": "Boolean"
12954                 }, {
12955                     "name": "attachedToRef",
12956                     "type": "Activity",
12957                     "isAttr": true,
12958                     "isReference": true
12959                 }]
12960             }, {
12961                 "name": "EventDefinition",
12962                 "isAbstract": true,
12963                 "superClass": [
12964                     "RootElement"
12965                 ]
12966             }, {
12967                 "name": "CancelEventDefinition",
12968                 "superClass": [
12969                     "EventDefinition"
12970                 ]
12971             }, {
12972                 "name": "ErrorEventDefinition",
12973                 "superClass": [
12974                     "EventDefinition"
12975                 ],
12976                 "properties": [{
12977                     "name": "errorRef",
12978                     "type": "Error",
12979                     "isAttr": true,
12980                     "isReference": true
12981                 }]
12982             }, {
12983                 "name": "TerminateEventDefinition",
12984                 "superClass": [
12985                     "EventDefinition"
12986                 ]
12987             }, {
12988                 "name": "EscalationEventDefinition",
12989                 "superClass": [
12990                     "EventDefinition"
12991                 ],
12992                 "properties": [{
12993                     "name": "escalationRef",
12994                     "type": "Escalation",
12995                     "isAttr": true,
12996                     "isReference": true
12997                 }]
12998             }, {
12999                 "name": "Escalation",
13000                 "properties": [{
13001                     "name": "structureRef",
13002                     "type": "ItemDefinition",
13003                     "isAttr": true,
13004                     "isReference": true
13005                 }, {
13006                     "name": "name",
13007                     "isAttr": true,
13008                     "type": "String"
13009                 }, {
13010                     "name": "escalationCode",
13011                     "isAttr": true,
13012                     "type": "String"
13013                 }],
13014                 "superClass": [
13015                     "RootElement"
13016                 ]
13017             }, {
13018                 "name": "CompensateEventDefinition",
13019                 "superClass": [
13020                     "EventDefinition"
13021                 ],
13022                 "properties": [{
13023                     "name": "waitForCompletion",
13024                     "isAttr": true,
13025                     "type": "Boolean"
13026                 }, {
13027                     "name": "activityRef",
13028                     "type": "Activity",
13029                     "isAttr": true,
13030                     "isReference": true
13031                 }]
13032             }, {
13033                 "name": "TimerEventDefinition",
13034                 "superClass": [
13035                     "EventDefinition"
13036                 ],
13037                 "properties": [{
13038                     "name": "timeDate",
13039                     "type": "Expression",
13040                     "serialize": "xsi:type"
13041                 }, {
13042                     "name": "timeCycle",
13043                     "type": "Expression",
13044                     "serialize": "xsi:type"
13045                 }, {
13046                     "name": "timeDuration",
13047                     "type": "Expression",
13048                     "serialize": "xsi:type"
13049                 }]
13050             }, {
13051                 "name": "LinkEventDefinition",
13052                 "superClass": [
13053                     "EventDefinition"
13054                 ],
13055                 "properties": [{
13056                     "name": "name",
13057                     "isAttr": true,
13058                     "type": "String"
13059                 }, {
13060                     "name": "target",
13061                     "type": "LinkEventDefinition",
13062                     "isAttr": true,
13063                     "isReference": true
13064                 }, {
13065                     "name": "source",
13066                     "type": "LinkEventDefinition",
13067                     "isMany": true,
13068                     "isReference": true
13069                 }]
13070             }, {
13071                 "name": "MessageEventDefinition",
13072                 "superClass": [
13073                     "EventDefinition"
13074                 ],
13075                 "properties": [{
13076                     "name": "messageRef",
13077                     "type": "Message",
13078                     "isAttr": true,
13079                     "isReference": true
13080                 }, {
13081                     "name": "operationRef",
13082                     "type": "Operation",
13083                     "isAttr": true,
13084                     "isReference": true
13085                 }]
13086             }, {
13087                 "name": "ConditionalEventDefinition",
13088                 "superClass": [
13089                     "EventDefinition"
13090                 ],
13091                 "properties": [{
13092                     "name": "condition",
13093                     "type": "Expression",
13094                     "serialize": "xsi:type"
13095                 }]
13096             }, {
13097                 "name": "SignalEventDefinition",
13098                 "superClass": [
13099                     "EventDefinition"
13100                 ],
13101                 "properties": [{
13102                     "name": "signalRef",
13103                     "type": "Signal",
13104                     "isAttr": true,
13105                     "isReference": true
13106                 }]
13107             }, {
13108                 "name": "Signal",
13109                 "superClass": [
13110                     "RootElement"
13111                 ],
13112                 "properties": [{
13113                     "name": "structureRef",
13114                     "type": "ItemDefinition",
13115                     "isAttr": true,
13116                     "isReference": true
13117                 }, {
13118                     "name": "name",
13119                     "isAttr": true,
13120                     "type": "String"
13121                 }]
13122             }, {
13123                 "name": "ImplicitThrowEvent",
13124                 "superClass": [
13125                     "ThrowEvent"
13126                 ]
13127             }, {
13128                 "name": "DataState",
13129                 "superClass": [
13130                     "BaseElement"
13131                 ],
13132                 "properties": [{
13133                     "name": "name",
13134                     "isAttr": true,
13135                     "type": "String"
13136                 }]
13137             }, {
13138                 "name": "ItemAwareElement",
13139                 "superClass": [
13140                     "BaseElement"
13141                 ],
13142                 "properties": [{
13143                     "name": "itemSubjectRef",
13144                     "type": "ItemDefinition",
13145                     "isAttr": true,
13146                     "isReference": true
13147                 }, {
13148                     "name": "dataState",
13149                     "type": "DataState"
13150                 }]
13151             }, {
13152                 "name": "DataAssociation",
13153                 "superClass": [
13154                     "BaseElement"
13155                 ],
13156                 "properties": [{
13157                     "name": "transformation",
13158                     "type": "FormalExpression"
13159                 }, {
13160                     "name": "assignment",
13161                     "type": "Assignment",
13162                     "isMany": true
13163                 }, {
13164                     "name": "sourceRef",
13165                     "type": "ItemAwareElement",
13166                     "isMany": true,
13167                     "isReference": true
13168                 }, {
13169                     "name": "targetRef",
13170                     "type": "ItemAwareElement",
13171                     "isReference": true
13172                 }]
13173             }, {
13174                 "name": "DataInput",
13175                 "superClass": [
13176                     "ItemAwareElement"
13177                 ],
13178                 "properties": [{
13179                     "name": "name",
13180                     "isAttr": true,
13181                     "type": "String"
13182                 }, {
13183                     "name": "isCollection",
13184                     "default": false,
13185                     "isAttr": true,
13186                     "type": "Boolean"
13187                 }, {
13188                     "name": "inputSetRefs",
13189                     "type": "InputSet",
13190                     "isVirtual": true,
13191                     "isMany": true,
13192                     "isReference": true
13193                 }, {
13194                     "name": "inputSetWithOptional",
13195                     "type": "InputSet",
13196                     "isVirtual": true,
13197                     "isMany": true,
13198                     "isReference": true
13199                 }, {
13200                     "name": "inputSetWithWhileExecuting",
13201                     "type": "InputSet",
13202                     "isVirtual": true,
13203                     "isMany": true,
13204                     "isReference": true
13205                 }]
13206             }, {
13207                 "name": "DataOutput",
13208                 "superClass": [
13209                     "ItemAwareElement"
13210                 ],
13211                 "properties": [{
13212                     "name": "name",
13213                     "isAttr": true,
13214                     "type": "String"
13215                 }, {
13216                     "name": "isCollection",
13217                     "default": false,
13218                     "isAttr": true,
13219                     "type": "Boolean"
13220                 }, {
13221                     "name": "outputSetRefs",
13222                     "type": "OutputSet",
13223                     "isVirtual": true,
13224                     "isMany": true,
13225                     "isReference": true
13226                 }, {
13227                     "name": "outputSetWithOptional",
13228                     "type": "OutputSet",
13229                     "isVirtual": true,
13230                     "isMany": true,
13231                     "isReference": true
13232                 }, {
13233                     "name": "outputSetWithWhileExecuting",
13234                     "type": "OutputSet",
13235                     "isVirtual": true,
13236                     "isMany": true,
13237                     "isReference": true
13238                 }]
13239             }, {
13240                 "name": "InputSet",
13241                 "superClass": [
13242                     "BaseElement"
13243                 ],
13244                 "properties": [{
13245                     "name": "name",
13246                     "isAttr": true,
13247                     "type": "String"
13248                 }, {
13249                     "name": "dataInputRefs",
13250                     "type": "DataInput",
13251                     "isMany": true,
13252                     "isReference": true
13253                 }, {
13254                     "name": "optionalInputRefs",
13255                     "type": "DataInput",
13256                     "isMany": true,
13257                     "isReference": true
13258                 }, {
13259                     "name": "whileExecutingInputRefs",
13260                     "type": "DataInput",
13261                     "isMany": true,
13262                     "isReference": true
13263                 }, {
13264                     "name": "outputSetRefs",
13265                     "type": "OutputSet",
13266                     "isMany": true,
13267                     "isReference": true
13268                 }]
13269             }, {
13270                 "name": "OutputSet",
13271                 "superClass": [
13272                     "BaseElement"
13273                 ],
13274                 "properties": [{
13275                     "name": "dataOutputRefs",
13276                     "type": "DataOutput",
13277                     "isMany": true,
13278                     "isReference": true
13279                 }, {
13280                     "name": "name",
13281                     "isAttr": true,
13282                     "type": "String"
13283                 }, {
13284                     "name": "inputSetRefs",
13285                     "type": "InputSet",
13286                     "isMany": true,
13287                     "isReference": true
13288                 }, {
13289                     "name": "optionalOutputRefs",
13290                     "type": "DataOutput",
13291                     "isMany": true,
13292                     "isReference": true
13293                 }, {
13294                     "name": "whileExecutingOutputRefs",
13295                     "type": "DataOutput",
13296                     "isMany": true,
13297                     "isReference": true
13298                 }]
13299             }, {
13300                 "name": "Property",
13301                 "superClass": [
13302                     "ItemAwareElement"
13303                 ],
13304                 "properties": [{
13305                     "name": "name",
13306                     "isAttr": true,
13307                     "type": "String"
13308                 }]
13309             }, {
13310                 "name": "DataInputAssociation",
13311                 "superClass": [
13312                     "DataAssociation"
13313                 ]
13314             }, {
13315                 "name": "DataOutputAssociation",
13316                 "superClass": [
13317                     "DataAssociation"
13318                 ]
13319             }, {
13320                 "name": "InputOutputSpecification",
13321                 "superClass": [
13322                     "BaseElement"
13323                 ],
13324                 "properties": [{
13325                     "name": "inputSets",
13326                     "type": "InputSet",
13327                     "isMany": true
13328                 }, {
13329                     "name": "outputSets",
13330                     "type": "OutputSet",
13331                     "isMany": true
13332                 }, {
13333                     "name": "dataInputs",
13334                     "type": "DataInput",
13335                     "isMany": true
13336                 }, {
13337                     "name": "dataOutputs",
13338                     "type": "DataOutput",
13339                     "isMany": true
13340                 }]
13341             }, {
13342                 "name": "DataObject",
13343                 "superClass": [
13344                     "FlowElement",
13345                     "ItemAwareElement"
13346                 ],
13347                 "properties": [{
13348                     "name": "isCollection",
13349                     "default": false,
13350                     "isAttr": true,
13351                     "type": "Boolean"
13352                 }]
13353             }, {
13354                 "name": "InputOutputBinding",
13355                 "properties": [{
13356                     "name": "inputDataRef",
13357                     "type": "InputSet",
13358                     "isAttr": true,
13359                     "isReference": true
13360                 }, {
13361                     "name": "outputDataRef",
13362                     "type": "OutputSet",
13363                     "isAttr": true,
13364                     "isReference": true
13365                 }, {
13366                     "name": "operationRef",
13367                     "type": "Operation",
13368                     "isAttr": true,
13369                     "isReference": true
13370                 }]
13371             }, {
13372                 "name": "Assignment",
13373                 "superClass": [
13374                     "BaseElement"
13375                 ],
13376                 "properties": [{
13377                     "name": "from",
13378                     "type": "Expression",
13379                     "serialize": "xsi:type"
13380                 }, {
13381                     "name": "to",
13382                     "type": "Expression",
13383                     "serialize": "xsi:type"
13384                 }]
13385             }, {
13386                 "name": "DataStore",
13387                 "superClass": [
13388                     "RootElement",
13389                     "ItemAwareElement"
13390                 ],
13391                 "properties": [{
13392                     "name": "name",
13393                     "isAttr": true,
13394                     "type": "String"
13395                 }, {
13396                     "name": "capacity",
13397                     "isAttr": true,
13398                     "type": "Integer"
13399                 }, {
13400                     "name": "isUnlimited",
13401                     "default": true,
13402                     "isAttr": true,
13403                     "type": "Boolean"
13404                 }]
13405             }, {
13406                 "name": "DataStoreReference",
13407                 "superClass": [
13408                     "ItemAwareElement",
13409                     "FlowElement"
13410                 ],
13411                 "properties": [{
13412                     "name": "dataStoreRef",
13413                     "type": "DataStore",
13414                     "isAttr": true,
13415                     "isReference": true
13416                 }]
13417             }, {
13418                 "name": "DataObjectReference",
13419                 "superClass": [
13420                     "ItemAwareElement",
13421                     "FlowElement"
13422                 ],
13423                 "properties": [{
13424                     "name": "dataObjectRef",
13425                     "type": "DataObject",
13426                     "isAttr": true,
13427                     "isReference": true
13428                 }]
13429             }, {
13430                 "name": "ConversationLink",
13431                 "superClass": [
13432                     "BaseElement"
13433                 ],
13434                 "properties": [{
13435                     "name": "sourceRef",
13436                     "type": "InteractionNode",
13437                     "isAttr": true,
13438                     "isReference": true
13439                 }, {
13440                     "name": "targetRef",
13441                     "type": "InteractionNode",
13442                     "isAttr": true,
13443                     "isReference": true
13444                 }, {
13445                     "name": "name",
13446                     "isAttr": true,
13447                     "type": "String"
13448                 }]
13449             }, {
13450                 "name": "ConversationAssociation",
13451                 "superClass": [
13452                     "BaseElement"
13453                 ],
13454                 "properties": [{
13455                     "name": "innerConversationNodeRef",
13456                     "type": "ConversationNode",
13457                     "isAttr": true,
13458                     "isReference": true
13459                 }, {
13460                     "name": "outerConversationNodeRef",
13461                     "type": "ConversationNode",
13462                     "isAttr": true,
13463                     "isReference": true
13464                 }]
13465             }, {
13466                 "name": "CallConversation",
13467                 "superClass": [
13468                     "ConversationNode"
13469                 ],
13470                 "properties": [{
13471                     "name": "calledCollaborationRef",
13472                     "type": "Collaboration",
13473                     "isAttr": true,
13474                     "isReference": true
13475                 }, {
13476                     "name": "participantAssociations",
13477                     "type": "ParticipantAssociation",
13478                     "isMany": true
13479                 }]
13480             }, {
13481                 "name": "Conversation",
13482                 "superClass": [
13483                     "ConversationNode"
13484                 ]
13485             }, {
13486                 "name": "SubConversation",
13487                 "superClass": [
13488                     "ConversationNode"
13489                 ],
13490                 "properties": [{
13491                     "name": "conversationNodes",
13492                     "type": "ConversationNode",
13493                     "isMany": true
13494                 }]
13495             }, {
13496                 "name": "ConversationNode",
13497                 "isAbstract": true,
13498                 "superClass": [
13499                     "InteractionNode",
13500                     "BaseElement"
13501                 ],
13502                 "properties": [{
13503                     "name": "name",
13504                     "isAttr": true,
13505                     "type": "String"
13506                 }, {
13507                     "name": "participantRefs",
13508                     "type": "Participant",
13509                     "isMany": true,
13510                     "isReference": true
13511                 }, {
13512                     "name": "messageFlowRefs",
13513                     "type": "MessageFlow",
13514                     "isMany": true,
13515                     "isReference": true
13516                 }, {
13517                     "name": "correlationKeys",
13518                     "type": "CorrelationKey",
13519                     "isMany": true
13520                 }]
13521             }, {
13522                 "name": "GlobalConversation",
13523                 "superClass": [
13524                     "Collaboration"
13525                 ]
13526             }, {
13527                 "name": "PartnerEntity",
13528                 "superClass": [
13529                     "RootElement"
13530                 ],
13531                 "properties": [{
13532                     "name": "name",
13533                     "isAttr": true,
13534                     "type": "String"
13535                 }, {
13536                     "name": "participantRef",
13537                     "type": "Participant",
13538                     "isMany": true,
13539                     "isReference": true
13540                 }]
13541             }, {
13542                 "name": "PartnerRole",
13543                 "superClass": [
13544                     "RootElement"
13545                 ],
13546                 "properties": [{
13547                     "name": "name",
13548                     "isAttr": true,
13549                     "type": "String"
13550                 }, {
13551                     "name": "participantRef",
13552                     "type": "Participant",
13553                     "isMany": true,
13554                     "isReference": true
13555                 }]
13556             }, {
13557                 "name": "CorrelationProperty",
13558                 "superClass": [
13559                     "RootElement"
13560                 ],
13561                 "properties": [{
13562                     "name": "correlationPropertyRetrievalExpression",
13563                     "type": "CorrelationPropertyRetrievalExpression",
13564                     "isMany": true
13565                 }, {
13566                     "name": "name",
13567                     "isAttr": true,
13568                     "type": "String"
13569                 }, {
13570                     "name": "type",
13571                     "type": "ItemDefinition",
13572                     "isAttr": true,
13573                     "isReference": true
13574                 }]
13575             }, {
13576                 "name": "Error",
13577                 "superClass": [
13578                     "RootElement"
13579                 ],
13580                 "properties": [{
13581                     "name": "structureRef",
13582                     "type": "ItemDefinition",
13583                     "isAttr": true,
13584                     "isReference": true
13585                 }, {
13586                     "name": "name",
13587                     "isAttr": true,
13588                     "type": "String"
13589                 }, {
13590                     "name": "errorCode",
13591                     "isAttr": true,
13592                     "type": "String"
13593                 }]
13594             }, {
13595                 "name": "CorrelationKey",
13596                 "superClass": [
13597                     "BaseElement"
13598                 ],
13599                 "properties": [{
13600                     "name": "correlationPropertyRef",
13601                     "type": "CorrelationProperty",
13602                     "isMany": true,
13603                     "isReference": true
13604                 }, {
13605                     "name": "name",
13606                     "isAttr": true,
13607                     "type": "String"
13608                 }]
13609             }, {
13610                 "name": "Expression",
13611                 "superClass": [
13612                     "BaseElement"
13613                 ],
13614                 "isAbstract": true
13615             }, {
13616                 "name": "FormalExpression",
13617                 "superClass": [
13618                     "Expression"
13619                 ],
13620                 "properties": [{
13621                     "name": "language",
13622                     "isAttr": true,
13623                     "type": "String"
13624                 }, {
13625                     "name": "body",
13626                     "type": "String",
13627                     "isBody": true
13628                 }, {
13629                     "name": "evaluatesToTypeRef",
13630                     "type": "ItemDefinition",
13631                     "isAttr": true,
13632                     "isReference": true
13633                 }]
13634             }, {
13635                 "name": "Message",
13636                 "superClass": [
13637                     "RootElement"
13638                 ],
13639                 "properties": [{
13640                     "name": "name",
13641                     "isAttr": true,
13642                     "type": "String"
13643                 }, {
13644                     "name": "itemRef",
13645                     "type": "ItemDefinition",
13646                     "isAttr": true,
13647                     "isReference": true
13648                 }]
13649             }, {
13650                 "name": "ItemDefinition",
13651                 "superClass": [
13652                     "RootElement"
13653                 ],
13654                 "properties": [{
13655                     "name": "itemKind",
13656                     "type": "ItemKind",
13657                     "isAttr": true
13658                 }, {
13659                     "name": "structureRef",
13660                     "type": "String",
13661                     "isAttr": true
13662                 }, {
13663                     "name": "isCollection",
13664                     "default": false,
13665                     "isAttr": true,
13666                     "type": "Boolean"
13667                 }, {
13668                     "name": "import",
13669                     "type": "Import",
13670                     "isAttr": true,
13671                     "isReference": true
13672                 }]
13673             }, {
13674                 "name": "FlowElement",
13675                 "isAbstract": true,
13676                 "superClass": [
13677                     "BaseElement"
13678                 ],
13679                 "properties": [{
13680                     "name": "name",
13681                     "isAttr": true,
13682                     "type": "String"
13683                 }, {
13684                     "name": "auditing",
13685                     "type": "Auditing"
13686                 }, {
13687                     "name": "monitoring",
13688                     "type": "Monitoring"
13689                 }, {
13690                     "name": "categoryValueRef",
13691                     "type": "CategoryValue",
13692                     "isMany": true,
13693                     "isReference": true
13694                 }]
13695             }, {
13696                 "name": "SequenceFlow",
13697                 "superClass": [
13698                     "FlowElement"
13699                 ],
13700                 "properties": [{
13701                     "name": "isImmediate",
13702                     "isAttr": true,
13703                     "type": "Boolean"
13704                 }, {
13705                     "name": "conditionExpression",
13706                     "type": "Expression",
13707                     "serialize": "xsi:type"
13708                 }, {
13709                     "name": "sourceRef",
13710                     "type": "FlowNode",
13711                     "isAttr": true,
13712                     "isReference": true
13713                 }, {
13714                     "name": "targetRef",
13715                     "type": "FlowNode",
13716                     "isAttr": true,
13717                     "isReference": true
13718                 }]
13719             }, {
13720                 "name": "FlowElementsContainer",
13721                 "isAbstract": true,
13722                 "superClass": [
13723                     "BaseElement"
13724                 ],
13725                 "properties": [{
13726                     "name": "laneSets",
13727                     "type": "LaneSet",
13728                     "isMany": true
13729                 }, {
13730                     "name": "flowElements",
13731                     "type": "FlowElement",
13732                     "isMany": true
13733                 }]
13734             }, {
13735                 "name": "CallableElement",
13736                 "isAbstract": true,
13737                 "superClass": [
13738                     "RootElement"
13739                 ],
13740                 "properties": [{
13741                     "name": "name",
13742                     "isAttr": true,
13743                     "type": "String"
13744                 }, {
13745                     "name": "ioSpecification",
13746                     "type": "InputOutputSpecification"
13747                 }, {
13748                     "name": "supportedInterfaceRefs",
13749                     "type": "Interface",
13750                     "isMany": true,
13751                     "isReference": true
13752                 }, {
13753                     "name": "ioBinding",
13754                     "type": "InputOutputBinding",
13755                     "isMany": true
13756                 }]
13757             }, {
13758                 "name": "FlowNode",
13759                 "isAbstract": true,
13760                 "superClass": [
13761                     "FlowElement"
13762                 ],
13763                 "properties": [{
13764                     "name": "incoming",
13765                     "type": "SequenceFlow",
13766                     "isMany": true,
13767                     "isReference": true
13768                 }, {
13769                     "name": "outgoing",
13770                     "type": "SequenceFlow",
13771                     "isMany": true,
13772                     "isReference": true
13773                 }, {
13774                     "name": "lanes",
13775                     "type": "Lane",
13776                     "isVirtual": true,
13777                     "isMany": true,
13778                     "isReference": true
13779                 }]
13780             }, {
13781                 "name": "CorrelationPropertyRetrievalExpression",
13782                 "superClass": [
13783                     "BaseElement"
13784                 ],
13785                 "properties": [{
13786                     "name": "messagePath",
13787                     "type": "FormalExpression"
13788                 }, {
13789                     "name": "messageRef",
13790                     "type": "Message",
13791                     "isAttr": true,
13792                     "isReference": true
13793                 }]
13794             }, {
13795                 "name": "CorrelationPropertyBinding",
13796                 "superClass": [
13797                     "BaseElement"
13798                 ],
13799                 "properties": [{
13800                     "name": "dataPath",
13801                     "type": "FormalExpression"
13802                 }, {
13803                     "name": "correlationPropertyRef",
13804                     "type": "CorrelationProperty",
13805                     "isAttr": true,
13806                     "isReference": true
13807                 }]
13808             }, {
13809                 "name": "Resource",
13810                 "superClass": [
13811                     "RootElement"
13812                 ],
13813                 "properties": [{
13814                     "name": "name",
13815                     "isAttr": true,
13816                     "type": "String"
13817                 }, {
13818                     "name": "resourceParameters",
13819                     "type": "ResourceParameter",
13820                     "isMany": true
13821                 }]
13822             }, {
13823                 "name": "ResourceParameter",
13824                 "superClass": [
13825                     "BaseElement"
13826                 ],
13827                 "properties": [{
13828                     "name": "name",
13829                     "isAttr": true,
13830                     "type": "String"
13831                 }, {
13832                     "name": "isRequired",
13833                     "isAttr": true,
13834                     "type": "Boolean"
13835                 }, {
13836                     "name": "type",
13837                     "type": "ItemDefinition",
13838                     "isAttr": true,
13839                     "isReference": true
13840                 }]
13841             }, {
13842                 "name": "CorrelationSubscription",
13843                 "superClass": [
13844                     "BaseElement"
13845                 ],
13846                 "properties": [{
13847                     "name": "correlationKeyRef",
13848                     "type": "CorrelationKey",
13849                     "isAttr": true,
13850                     "isReference": true
13851                 }, {
13852                     "name": "correlationPropertyBinding",
13853                     "type": "CorrelationPropertyBinding",
13854                     "isMany": true
13855                 }]
13856             }, {
13857                 "name": "MessageFlow",
13858                 "superClass": [
13859                     "BaseElement"
13860                 ],
13861                 "properties": [{
13862                     "name": "name",
13863                     "isAttr": true,
13864                     "type": "String"
13865                 }, {
13866                     "name": "sourceRef",
13867                     "type": "InteractionNode",
13868                     "isAttr": true,
13869                     "isReference": true
13870                 }, {
13871                     "name": "targetRef",
13872                     "type": "InteractionNode",
13873                     "isAttr": true,
13874                     "isReference": true
13875                 }, {
13876                     "name": "messageRef",
13877                     "type": "Message",
13878                     "isAttr": true,
13879                     "isReference": true
13880                 }]
13881             }, {
13882                 "name": "MessageFlowAssociation",
13883                 "superClass": [
13884                     "BaseElement"
13885                 ],
13886                 "properties": [{
13887                     "name": "innerMessageFlowRef",
13888                     "type": "MessageFlow",
13889                     "isAttr": true,
13890                     "isReference": true
13891                 }, {
13892                     "name": "outerMessageFlowRef",
13893                     "type": "MessageFlow",
13894                     "isAttr": true,
13895                     "isReference": true
13896                 }]
13897             }, {
13898                 "name": "InteractionNode",
13899                 "isAbstract": true,
13900                 "properties": [{
13901                     "name": "incomingConversationLinks",
13902                     "type": "ConversationLink",
13903                     "isVirtual": true,
13904                     "isMany": true,
13905                     "isReference": true
13906                 }, {
13907                     "name": "outgoingConversationLinks",
13908                     "type": "ConversationLink",
13909                     "isVirtual": true,
13910                     "isMany": true,
13911                     "isReference": true
13912                 }]
13913             }, {
13914                 "name": "Participant",
13915                 "superClass": [
13916                     "InteractionNode",
13917                     "BaseElement"
13918                 ],
13919                 "properties": [{
13920                     "name": "name",
13921                     "isAttr": true,
13922                     "type": "String"
13923                 }, {
13924                     "name": "interfaceRefs",
13925                     "type": "Interface",
13926                     "isMany": true,
13927                     "isReference": true
13928                 }, {
13929                     "name": "participantMultiplicity",
13930                     "type": "ParticipantMultiplicity"
13931                 }, {
13932                     "name": "endPointRefs",
13933                     "type": "EndPoint",
13934                     "isMany": true,
13935                     "isReference": true
13936                 }, {
13937                     "name": "processRef",
13938                     "type": "Process",
13939                     "isAttr": true,
13940                     "isReference": true
13941                 }]
13942             }, {
13943                 "name": "ParticipantAssociation",
13944                 "superClass": [
13945                     "BaseElement"
13946                 ],
13947                 "properties": [{
13948                     "name": "innerParticipantRef",
13949                     "type": "Participant",
13950                     "isAttr": true,
13951                     "isReference": true
13952                 }, {
13953                     "name": "outerParticipantRef",
13954                     "type": "Participant",
13955                     "isAttr": true,
13956                     "isReference": true
13957                 }]
13958             }, {
13959                 "name": "ParticipantMultiplicity",
13960                 "properties": [{
13961                     "name": "minimum",
13962                     "default": 0,
13963                     "isAttr": true,
13964                     "type": "Integer"
13965                 }, {
13966                     "name": "maximum",
13967                     "default": 1,
13968                     "isAttr": true,
13969                     "type": "Integer"
13970                 }]
13971             }, {
13972                 "name": "Collaboration",
13973                 "superClass": [
13974                     "RootElement"
13975                 ],
13976                 "properties": [{
13977                     "name": "name",
13978                     "isAttr": true,
13979                     "type": "String"
13980                 }, {
13981                     "name": "isClosed",
13982                     "isAttr": true,
13983                     "type": "Boolean"
13984                 }, {
13985                     "name": "choreographyRef",
13986                     "type": "Choreography",
13987                     "isMany": true,
13988                     "isReference": true
13989                 }, {
13990                     "name": "artifacts",
13991                     "type": "Artifact",
13992                     "isMany": true
13993                 }, {
13994                     "name": "participantAssociations",
13995                     "type": "ParticipantAssociation",
13996                     "isMany": true
13997                 }, {
13998                     "name": "messageFlowAssociations",
13999                     "type": "MessageFlowAssociation",
14000                     "isMany": true
14001                 }, {
14002                     "name": "conversationAssociations",
14003                     "type": "ConversationAssociation"
14004                 }, {
14005                     "name": "participants",
14006                     "type": "Participant",
14007                     "isMany": true
14008                 }, {
14009                     "name": "messageFlows",
14010                     "type": "MessageFlow",
14011                     "isMany": true
14012                 }, {
14013                     "name": "correlationKeys",
14014                     "type": "CorrelationKey",
14015                     "isMany": true
14016                 }, {
14017                     "name": "conversations",
14018                     "type": "ConversationNode",
14019                     "isMany": true
14020                 }, {
14021                     "name": "conversationLinks",
14022                     "type": "ConversationLink",
14023                     "isMany": true
14024                 }]
14025             }, {
14026                 "name": "ChoreographyActivity",
14027                 "isAbstract": true,
14028                 "superClass": [
14029                     "FlowNode"
14030                 ],
14031                 "properties": [{
14032                     "name": "participantRefs",
14033                     "type": "Participant",
14034                     "isMany": true,
14035                     "isReference": true
14036                 }, {
14037                     "name": "initiatingParticipantRef",
14038                     "type": "Participant",
14039                     "isAttr": true,
14040                     "isReference": true
14041                 }, {
14042                     "name": "correlationKeys",
14043                     "type": "CorrelationKey",
14044                     "isMany": true
14045                 }, {
14046                     "name": "loopType",
14047                     "type": "ChoreographyLoopType",
14048                     "default": "None",
14049                     "isAttr": true
14050                 }]
14051             }, {
14052                 "name": "CallChoreography",
14053                 "superClass": [
14054                     "ChoreographyActivity"
14055                 ],
14056                 "properties": [{
14057                     "name": "calledChoreographyRef",
14058                     "type": "Choreography",
14059                     "isAttr": true,
14060                     "isReference": true
14061                 }, {
14062                     "name": "participantAssociations",
14063                     "type": "ParticipantAssociation",
14064                     "isMany": true
14065                 }]
14066             }, {
14067                 "name": "SubChoreography",
14068                 "superClass": [
14069                     "ChoreographyActivity",
14070                     "FlowElementsContainer"
14071                 ],
14072                 "properties": [{
14073                     "name": "artifacts",
14074                     "type": "Artifact",
14075                     "isMany": true
14076                 }]
14077             }, {
14078                 "name": "ChoreographyTask",
14079                 "superClass": [
14080                     "ChoreographyActivity"
14081                 ],
14082                 "properties": [{
14083                     "name": "messageFlowRef",
14084                     "type": "MessageFlow",
14085                     "isMany": true,
14086                     "isReference": true
14087                 }]
14088             }, {
14089                 "name": "Choreography",
14090                 "superClass": [
14091                     "FlowElementsContainer",
14092                     "Collaboration"
14093                 ]
14094             }, {
14095                 "name": "GlobalChoreographyTask",
14096                 "superClass": [
14097                     "Choreography"
14098                 ],
14099                 "properties": [{
14100                     "name": "initiatingParticipantRef",
14101                     "type": "Participant",
14102                     "isAttr": true,
14103                     "isReference": true
14104                 }]
14105             }, {
14106                 "name": "TextAnnotation",
14107                 "superClass": [
14108                     "Artifact"
14109                 ],
14110                 "properties": [{
14111                     "name": "text",
14112                     "type": "String"
14113                 }, {
14114                     "name": "textFormat",
14115                     "default": "text/plain",
14116                     "isAttr": true,
14117                     "type": "String"
14118                 }]
14119             }, {
14120                 "name": "Group",
14121                 "superClass": [
14122                     "Artifact"
14123                 ],
14124                 "properties": [{
14125                     "name": "categoryValueRef",
14126                     "type": "CategoryValue",
14127                     "isAttr": true,
14128                     "isReference": true
14129                 }]
14130             }, {
14131                 "name": "Association",
14132                 "superClass": [
14133                     "Artifact"
14134                 ],
14135                 "properties": [{
14136                     "name": "associationDirection",
14137                     "type": "AssociationDirection",
14138                     "isAttr": true
14139                 }, {
14140                     "name": "sourceRef",
14141                     "type": "BaseElement",
14142                     "isAttr": true,
14143                     "isReference": true
14144                 }, {
14145                     "name": "targetRef",
14146                     "type": "BaseElement",
14147                     "isAttr": true,
14148                     "isReference": true
14149                 }]
14150             }, {
14151                 "name": "Category",
14152                 "superClass": [
14153                     "RootElement"
14154                 ],
14155                 "properties": [{
14156                     "name": "categoryValue",
14157                     "type": "CategoryValue",
14158                     "isMany": true
14159                 }, {
14160                     "name": "name",
14161                     "isAttr": true,
14162                     "type": "String"
14163                 }]
14164             }, {
14165                 "name": "Artifact",
14166                 "isAbstract": true,
14167                 "superClass": [
14168                     "BaseElement"
14169                 ]
14170             }, {
14171                 "name": "CategoryValue",
14172                 "superClass": [
14173                     "BaseElement"
14174                 ],
14175                 "properties": [{
14176                     "name": "categorizedFlowElements",
14177                     "type": "FlowElement",
14178                     "isVirtual": true,
14179                     "isMany": true,
14180                     "isReference": true
14181                 }, {
14182                     "name": "value",
14183                     "isAttr": true,
14184                     "type": "String"
14185                 }]
14186             }, {
14187                 "name": "Activity",
14188                 "isAbstract": true,
14189                 "superClass": [
14190                     "FlowNode"
14191                 ],
14192                 "properties": [{
14193                     "name": "isForCompensation",
14194                     "default": false,
14195                     "isAttr": true,
14196                     "type": "Boolean"
14197                 }, {
14198                     "name": "loopCharacteristics",
14199                     "type": "LoopCharacteristics"
14200                 }, {
14201                     "name": "resources",
14202                     "type": "ResourceRole",
14203                     "isMany": true
14204                 }, {
14205                     "name": "default",
14206                     "type": "SequenceFlow",
14207                     "isAttr": true,
14208                     "isReference": true
14209                 }, {
14210                     "name": "properties",
14211                     "type": "Property",
14212                     "isMany": true
14213                 }, {
14214                     "name": "ioSpecification",
14215                     "type": "InputOutputSpecification"
14216                 }, {
14217                     "name": "boundaryEventRefs",
14218                     "type": "BoundaryEvent",
14219                     "isMany": true,
14220                     "isReference": true
14221                 }, {
14222                     "name": "dataInputAssociations",
14223                     "type": "DataInputAssociation",
14224                     "isMany": true
14225                 }, {
14226                     "name": "dataOutputAssociations",
14227                     "type": "DataOutputAssociation",
14228                     "isMany": true
14229                 }, {
14230                     "name": "startQuantity",
14231                     "default": 1,
14232                     "isAttr": true,
14233                     "type": "Integer"
14234                 }, {
14235                     "name": "completionQuantity",
14236                     "default": 1,
14237                     "isAttr": true,
14238                     "type": "Integer"
14239                 }]
14240             }, {
14241                 "name": "ServiceTask",
14242                 "superClass": [
14243                     "Task"
14244                 ],
14245                 "properties": [{
14246                     "name": "implementation",
14247                     "isAttr": true,
14248                     "type": "String"
14249                 }, {
14250                     "name": "operationRef",
14251                     "type": "Operation",
14252                     "isAttr": true,
14253                     "isReference": true
14254                 }]
14255             }, {
14256                 "name": "SubProcess",
14257                 "superClass": [
14258                     "Activity",
14259                     "FlowElementsContainer",
14260                     "InteractionNode"
14261                 ],
14262                 "properties": [{
14263                     "name": "triggeredByEvent",
14264                     "default": false,
14265                     "isAttr": true,
14266                     "type": "Boolean"
14267                 }, {
14268                     "name": "artifacts",
14269                     "type": "Artifact",
14270                     "isMany": true
14271                 }]
14272             }, {
14273                 "name": "LoopCharacteristics",
14274                 "isAbstract": true,
14275                 "superClass": [
14276                     "BaseElement"
14277                 ]
14278             }, {
14279                 "name": "MultiInstanceLoopCharacteristics",
14280                 "superClass": [
14281                     "LoopCharacteristics"
14282                 ],
14283                 "properties": [{
14284                     "name": "isSequential",
14285                     "default": false,
14286                     "isAttr": true,
14287                     "type": "Boolean"
14288                 }, {
14289                     "name": "behavior",
14290                     "type": "MultiInstanceBehavior",
14291                     "default": "All",
14292                     "isAttr": true
14293                 }, {
14294                     "name": "loopCardinality",
14295                     "type": "Expression",
14296                     "serialize": "xsi:type"
14297                 }, {
14298                     "name": "loopDataInputRef",
14299                     "type": "ItemAwareElement",
14300                     "isAttr": true,
14301                     "isReference": true
14302                 }, {
14303                     "name": "loopDataOutputRef",
14304                     "type": "ItemAwareElement",
14305                     "isAttr": true,
14306                     "isReference": true
14307                 }, {
14308                     "name": "inputDataItem",
14309                     "type": "DataInput"
14310                 }, {
14311                     "name": "outputDataItem",
14312                     "type": "DataOutput"
14313                 }, {
14314                     "name": "completionCondition",
14315                     "type": "Expression",
14316                     "serialize": "xsi:type"
14317                 }, {
14318                     "name": "complexBehaviorDefinition",
14319                     "type": "ComplexBehaviorDefinition",
14320                     "isMany": true
14321                 }, {
14322                     "name": "oneBehaviorEventRef",
14323                     "type": "EventDefinition",
14324                     "isAttr": true,
14325                     "isReference": true
14326                 }, {
14327                     "name": "noneBehaviorEventRef",
14328                     "type": "EventDefinition",
14329                     "isAttr": true,
14330                     "isReference": true
14331                 }]
14332             }, {
14333                 "name": "StandardLoopCharacteristics",
14334                 "superClass": [
14335                     "LoopCharacteristics"
14336                 ],
14337                 "properties": [{
14338                     "name": "testBefore",
14339                     "default": false,
14340                     "isAttr": true,
14341                     "type": "Boolean"
14342                 }, {
14343                     "name": "loopCondition",
14344                     "type": "Expression",
14345                     "serialize": "xsi:type"
14346                 }, {
14347                     "name": "loopMaximum",
14348                     "type": "Expression",
14349                     "serialize": "xsi:type"
14350                 }]
14351             }, {
14352                 "name": "CallActivity",
14353                 "superClass": [
14354                     "Activity"
14355                 ],
14356                 "properties": [{
14357                     "name": "calledElement",
14358                     "type": "String",
14359                     "isAttr": true
14360                 }]
14361             }, {
14362                 "name": "Task",
14363                 "superClass": [
14364                     "Activity",
14365                     "InteractionNode"
14366                 ]
14367             }, {
14368                 "name": "InitiateProcess",
14369                 "superClass": [
14370                     "Activity",
14371                     "InteractionNode"
14372                 ]
14373             }, {
14374                 "name": "Collector",
14375                 "superClass": [
14376                     "Activity",
14377                     "InteractionNode"
14378                 ]
14379             },
14380                         {
14381                 "name": "StringMatch",
14382                 "superClass": [
14383                     "Activity",
14384                     "InteractionNode"
14385                 ]
14386       },
14387                         {
14388                 "name": "VesCollector",
14389                 "superClass": [
14390                     "Activity",
14391                     "InteractionNode"
14392                 ]
14393       },
14394                         {
14395                 "name": "Holmes",
14396                 "superClass": [
14397                     "Activity",
14398                     "InteractionNode"
14399                 ]
14400             },
14401                       
14402             {
14403                 "name": "TCA",
14404                 "superClass": [
14405                     "Activity",
14406                     "InteractionNode"
14407                 ]
14408             },
14409                         {
14410                 "name": "GOC",
14411                 "superClass": [
14412                     "Activity",
14413                     "InteractionNode"
14414                 ]
14415             },
14416                         {
14417                 "name": "Policy",
14418                 "superClass": [
14419                     "Activity",
14420                     "InteractionNode"
14421                 ]
14422             },
14423                         {
14424                 "name": "SendTask",
14425                 "superClass": [
14426                     "Task"
14427                 ],
14428                 "properties": [{
14429                     "name": "implementation",
14430                     "isAttr": true,
14431                     "type": "String"
14432                 }, {
14433                     "name": "operationRef",
14434                     "type": "Operation",
14435                     "isAttr": true,
14436                     "isReference": true
14437                 }, {
14438                     "name": "messageRef",
14439                     "type": "Message",
14440                     "isAttr": true,
14441                     "isReference": true
14442                 }]
14443             }, {
14444                 "name": "ReceiveTask",
14445                 "superClass": [
14446                     "Task"
14447                 ],
14448                 "properties": [{
14449                     "name": "implementation",
14450                     "isAttr": true,
14451                     "type": "String"
14452                 }, {
14453                     "name": "instantiate",
14454                     "default": false,
14455                     "isAttr": true,
14456                     "type": "Boolean"
14457                 }, {
14458                     "name": "operationRef",
14459                     "type": "Operation",
14460                     "isAttr": true,
14461                     "isReference": true
14462                 }, {
14463                     "name": "messageRef",
14464                     "type": "Message",
14465                     "isAttr": true,
14466                     "isReference": true
14467                 }]
14468             }, {
14469                 "name": "ScriptTask",
14470                 "superClass": [
14471                     "Task"
14472                 ],
14473                 "properties": [{
14474                     "name": "scriptFormat",
14475                     "isAttr": true,
14476                     "type": "String"
14477                 }, {
14478                     "name": "script",
14479                     "type": "String"
14480                 }]
14481             }, {
14482                 "name": "BusinessRuleTask",
14483                 "superClass": [
14484                     "Task"
14485                 ],
14486                 "properties": [{
14487                     "name": "implementation",
14488                     "isAttr": true,
14489                     "type": "String"
14490                 }]
14491             }, {
14492                 "name": "AdHocSubProcess",
14493                 "superClass": [
14494                     "SubProcess"
14495                 ],
14496                 "properties": [{
14497                     "name": "completionCondition",
14498                     "type": "Expression",
14499                     "serialize": "xsi:type"
14500                 }, {
14501                     "name": "ordering",
14502                     "type": "AdHocOrdering",
14503                     "isAttr": true
14504                 }, {
14505                     "name": "cancelRemainingInstances",
14506                     "default": true,
14507                     "isAttr": true,
14508                     "type": "Boolean"
14509                 }]
14510             }, {
14511                 "name": "Transaction",
14512                 "superClass": [
14513                     "SubProcess"
14514                 ],
14515                 "properties": [{
14516                     "name": "protocol",
14517                     "isAttr": true,
14518                     "type": "String"
14519                 }, {
14520                     "name": "method",
14521                     "isAttr": true,
14522                     "type": "String"
14523                 }]
14524             }, {
14525                 "name": "GlobalScriptTask",
14526                 "superClass": [
14527                     "GlobalTask"
14528                 ],
14529                 "properties": [{
14530                     "name": "scriptLanguage",
14531                     "isAttr": true,
14532                     "type": "String"
14533                 }, {
14534                     "name": "script",
14535                     "isAttr": true,
14536                     "type": "String"
14537                 }]
14538             }, {
14539                 "name": "GlobalBusinessRuleTask",
14540                 "superClass": [
14541                     "GlobalTask"
14542                 ],
14543                 "properties": [{
14544                     "name": "implementation",
14545                     "isAttr": true,
14546                     "type": "String"
14547                 }]
14548             }, {
14549                 "name": "ComplexBehaviorDefinition",
14550                 "superClass": [
14551                     "BaseElement"
14552                 ],
14553                 "properties": [{
14554                     "name": "condition",
14555                     "type": "FormalExpression"
14556                 }, {
14557                     "name": "event",
14558                     "type": "ImplicitThrowEvent"
14559                 }]
14560             }, {
14561                 "name": "ResourceRole",
14562                 "superClass": [
14563                     "BaseElement"
14564                 ],
14565                 "properties": [{
14566                     "name": "resourceRef",
14567                     "type": "Resource",
14568                     "isReference": true
14569                 }, {
14570                     "name": "resourceParameterBindings",
14571                     "type": "ResourceParameterBinding",
14572                     "isMany": true
14573                 }, {
14574                     "name": "resourceAssignmentExpression",
14575                     "type": "ResourceAssignmentExpression"
14576                 }, {
14577                     "name": "name",
14578                     "isAttr": true,
14579                     "type": "String"
14580                 }]
14581             }, {
14582                 "name": "ResourceParameterBinding",
14583                 "properties": [{
14584                     "name": "expression",
14585                     "type": "Expression",
14586                     "serialize": "xsi:type"
14587                 }, {
14588                     "name": "parameterRef",
14589                     "type": "ResourceParameter",
14590                     "isAttr": true,
14591                     "isReference": true
14592                 }]
14593             }, {
14594                 "name": "ResourceAssignmentExpression",
14595                 "properties": [{
14596                     "name": "expression",
14597                     "type": "Expression",
14598                     "serialize": "xsi:type"
14599                 }]
14600             }, {
14601                 "name": "Import",
14602                 "properties": [{
14603                     "name": "importType",
14604                     "isAttr": true,
14605                     "type": "String"
14606                 }, {
14607                     "name": "location",
14608                     "isAttr": true,
14609                     "type": "String"
14610                 }, {
14611                     "name": "namespace",
14612                     "isAttr": true,
14613                     "type": "String"
14614                 }]
14615             }, {
14616                 "name": "Definitions",
14617                 "superClass": [
14618                     "BaseElement"
14619                 ],
14620                 "properties": [{
14621                     "name": "name",
14622                     "isAttr": true,
14623                     "type": "String"
14624                 }, {
14625                     "name": "targetNamespace",
14626                     "isAttr": true,
14627                     "type": "String"
14628                 }, {
14629                     "name": "expressionLanguage",
14630                     "default": "http://www.w3.org/1999/XPath",
14631                     "isAttr": true,
14632                     "type": "String"
14633                 }, {
14634                     "name": "typeLanguage",
14635                     "default": "http://www.w3.org/2001/XMLSchema",
14636                     "isAttr": true,
14637                     "type": "String"
14638                 }, {
14639                     "name": "imports",
14640                     "type": "Import",
14641                     "isMany": true
14642                 }, {
14643                     "name": "extensions",
14644                     "type": "Extension",
14645                     "isMany": true
14646                 }, {
14647                     "name": "rootElements",
14648                     "type": "RootElement",
14649                     "isMany": true
14650                 }, {
14651                     "name": "diagrams",
14652                     "isMany": true,
14653                     "type": "bpmndi:BPMNDiagram"
14654                 }, {
14655                     "name": "exporter",
14656                     "isAttr": true,
14657                     "type": "String"
14658                 }, {
14659                     "name": "relationships",
14660                     "type": "Relationship",
14661                     "isMany": true
14662                 }, {
14663                     "name": "exporterVersion",
14664                     "isAttr": true,
14665                     "type": "String"
14666                 }]
14667             }],
14668             "emumerations": [{
14669                 "name": "ProcessType",
14670                 "literalValues": [{
14671                     "name": "None"
14672                 }, {
14673                     "name": "Public"
14674                 }, {
14675                     "name": "Private"
14676                 }]
14677             }, {
14678                 "name": "GatewayDirection",
14679                 "literalValues": [{
14680                     "name": "Unspecified"
14681                 }, {
14682                     "name": "Converging"
14683                 }, {
14684                     "name": "Diverging"
14685                 }, {
14686                     "name": "Mixed"
14687                 }]
14688             }, {
14689                 "name": "EventBasedGatewayType",
14690                 "literalValues": [{
14691                     "name": "Parallel"
14692                 }, {
14693                     "name": "Exclusive"
14694                 }]
14695             }, {
14696                 "name": "RelationshipDirection",
14697                 "literalValues": [{
14698                     "name": "None"
14699                 }, {
14700                     "name": "Forward"
14701                 }, {
14702                     "name": "Backward"
14703                 }, {
14704                     "name": "Both"
14705                 }]
14706             }, {
14707                 "name": "ItemKind",
14708                 "literalValues": [{
14709                     "name": "Physical"
14710                 }, {
14711                     "name": "Information"
14712                 }]
14713             }, {
14714                 "name": "ChoreographyLoopType",
14715                 "literalValues": [{
14716                     "name": "None"
14717                 }, {
14718                     "name": "Standard"
14719                 }, {
14720                     "name": "MultiInstanceSequential"
14721                 }, {
14722                     "name": "MultiInstanceParallel"
14723                 }]
14724             }, {
14725                 "name": "AssociationDirection",
14726                 "literalValues": [{
14727                     "name": "None"
14728                 }, {
14729                     "name": "One"
14730                 }, {
14731                     "name": "Both"
14732                 }]
14733             }, {
14734                 "name": "MultiInstanceBehavior",
14735                 "literalValues": [{
14736                     "name": "None"
14737                 }, {
14738                     "name": "One"
14739                 }, {
14740                     "name": "All"
14741                 }, {
14742                     "name": "Complex"
14743                 }]
14744             }, {
14745                 "name": "AdHocOrdering",
14746                 "literalValues": [{
14747                     "name": "Parallel"
14748                 }, {
14749                     "name": "Sequential"
14750                 }]
14751             }],
14752             "prefix": "bpmn",
14753             "xml": {
14754                 "tagAlias": "lowerCase",
14755                 "typePrefix": "t"
14756             }
14757         }
14758     }, {}],
14759     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmndi.json": [function(require, module, exports) {
14760         module.exports = {
14761             "name": "BPMNDI",
14762             "uri": "http://www.omg.org/spec/BPMN/20100524/DI",
14763             "types": [{
14764                 "name": "BPMNDiagram",
14765                 "properties": [{
14766                     "name": "plane",
14767                     "type": "BPMNPlane",
14768                     "redefines": "di:Diagram#rootElement"
14769                 }, {
14770                     "name": "labelStyle",
14771                     "type": "BPMNLabelStyle",
14772                     "isMany": true
14773                 }],
14774                 "superClass": [
14775                     "di:Diagram"
14776                 ]
14777             }, {
14778                 "name": "BPMNPlane",
14779                 "properties": [{
14780                     "name": "bpmnElement",
14781                     "isAttr": true,
14782                     "isReference": true,
14783                     "type": "bpmn:BaseElement",
14784                     "redefines": "di:DiagramElement#modelElement"
14785                 }],
14786                 "superClass": [
14787                     "di:Plane"
14788                 ]
14789             }, {
14790                 "name": "BPMNShape",
14791                 "properties": [{
14792                     "name": "bpmnElement",
14793                     "isAttr": true,
14794                     "isReference": true,
14795                     "type": "bpmn:BaseElement",
14796                     "redefines": "di:DiagramElement#modelElement"
14797                 }, {
14798                     "name": "isHorizontal",
14799                     "isAttr": true,
14800                     "type": "Boolean"
14801                 }, {
14802                     "name": "isExpanded",
14803                     "isAttr": true,
14804                     "type": "Boolean"
14805                 }, {
14806                     "name": "isMarkerVisible",
14807                     "isAttr": true,
14808                     "type": "Boolean"
14809                 }, {
14810                     "name": "label",
14811                     "type": "BPMNLabel"
14812                 }, {
14813                     "name": "isMessageVisible",
14814                     "isAttr": true,
14815                     "type": "Boolean"
14816                 }, {
14817                     "name": "participantBandKind",
14818                     "type": "ParticipantBandKind",
14819                     "isAttr": true
14820                 }, {
14821                     "name": "choreographyActivityShape",
14822                     "type": "BPMNShape",
14823                     "isAttr": true,
14824                     "isReference": true
14825                 }],
14826                 "superClass": [
14827                     "di:LabeledShape"
14828                 ]
14829             }, {
14830                 "name": "BPMNEdge",
14831                 "properties": [{
14832                     "name": "label",
14833                     "type": "BPMNLabel"
14834                 }, {
14835                     "name": "bpmnElement",
14836                     "isAttr": true,
14837                     "isReference": true,
14838                     "type": "bpmn:BaseElement",
14839                     "redefines": "di:DiagramElement#modelElement"
14840                 }, {
14841                     "name": "sourceElement",
14842                     "isAttr": true,
14843                     "isReference": true,
14844                     "type": "di:DiagramElement",
14845                     "redefines": "di:Edge#source"
14846                 }, {
14847                     "name": "targetElement",
14848                     "isAttr": true,
14849                     "isReference": true,
14850                     "type": "di:DiagramElement",
14851                     "redefines": "di:Edge#target"
14852                 }, {
14853                     "name": "messageVisibleKind",
14854                     "type": "MessageVisibleKind",
14855                     "isAttr": true,
14856                     "default": "initiating"
14857                 }],
14858                 "superClass": [
14859                     "di:LabeledEdge"
14860                 ]
14861             }, {
14862                 "name": "BPMNLabel",
14863                 "properties": [{
14864                     "name": "labelStyle",
14865                     "type": "BPMNLabelStyle",
14866                     "isAttr": true,
14867                     "isReference": true,
14868                     "redefines": "di:DiagramElement#style"
14869                 }],
14870                 "superClass": [
14871                     "di:Label"
14872                 ]
14873             }, {
14874                 "name": "BPMNLabelStyle",
14875                 "properties": [{
14876                     "name": "font",
14877                     "type": "dc:Font"
14878                 }],
14879                 "superClass": [
14880                     "di:Style"
14881                 ]
14882             }],
14883             "emumerations": [{
14884                 "name": "ParticipantBandKind",
14885                 "literalValues": [{
14886                     "name": "top_initiating"
14887                 }, {
14888                     "name": "middle_initiating"
14889                 }, {
14890                     "name": "bottom_initiating"
14891                 }, {
14892                     "name": "top_non_initiating"
14893                 }, {
14894                     "name": "middle_non_initiating"
14895                 }, {
14896                     "name": "bottom_non_initiating"
14897                 }]
14898             }, {
14899                 "name": "MessageVisibleKind",
14900                 "literalValues": [{
14901                     "name": "initiating"
14902                 }, {
14903                     "name": "non_initiating"
14904                 }]
14905             }],
14906             "associations": [],
14907             "prefix": "bpmndi"
14908         }
14909     }, {}],
14910     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\dc.json": [function(require, module, exports) {
14911         module.exports = {
14912             "name": "DC",
14913             "uri": "http://www.omg.org/spec/DD/20100524/DC",
14914             "types": [{
14915                 "name": "Boolean"
14916             }, {
14917                 "name": "Integer"
14918             }, {
14919                 "name": "Real"
14920             }, {
14921                 "name": "String"
14922             }, {
14923                 "name": "Font",
14924                 "properties": [{
14925                     "name": "name",
14926                     "type": "String",
14927                     "isAttr": true
14928                 }, {
14929                     "name": "size",
14930                     "type": "Real",
14931                     "isAttr": true
14932                 }, {
14933                     "name": "isBold",
14934                     "type": "Boolean",
14935                     "isAttr": true
14936                 }, {
14937                     "name": "isItalic",
14938                     "type": "Boolean",
14939                     "isAttr": true
14940                 }, {
14941                     "name": "isUnderline",
14942                     "type": "Boolean",
14943                     "isAttr": true
14944                 }, {
14945                     "name": "isStrikeThrough",
14946                     "type": "Boolean",
14947                     "isAttr": true
14948                 }]
14949             }, {
14950                 "name": "Point",
14951                 "properties": [{
14952                     "name": "x",
14953                     "type": "Real",
14954                     "default": "0",
14955                     "isAttr": true
14956                 }, {
14957                     "name": "y",
14958                     "type": "Real",
14959                     "default": "0",
14960                     "isAttr": true
14961                 }]
14962             }, {
14963                 "name": "Bounds",
14964                 "properties": [{
14965                     "name": "x",
14966                     "type": "Real",
14967                     "default": "0",
14968                     "isAttr": true
14969                 }, {
14970                     "name": "y",
14971                     "type": "Real",
14972                     "default": "0",
14973                     "isAttr": true
14974                 }, {
14975                     "name": "width",
14976                     "type": "Real",
14977                     "isAttr": true
14978                 }, {
14979                     "name": "height",
14980                     "type": "Real",
14981                     "isAttr": true
14982                 }]
14983             }],
14984             "prefix": "dc",
14985             "associations": []
14986         }
14987     }, {}],
14988     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\di.json": [function(require, module, exports) {
14989         module.exports = {
14990             "name": "DI",
14991             "uri": "http://www.omg.org/spec/DD/20100524/DI",
14992             "types": [{
14993                 "name": "DiagramElement",
14994                 "isAbstract": true,
14995                 "properties": [{
14996                     "name": "extension",
14997                     "type": "Extension"
14998                 }, {
14999                     "name": "owningDiagram",
15000                     "type": "Diagram",
15001                     "isReadOnly": true,
15002                     "isVirtual": true,
15003                     "isReference": true
15004                 }, {
15005                     "name": "owningElement",
15006                     "type": "DiagramElement",
15007                     "isReadOnly": true,
15008                     "isVirtual": true,
15009                     "isReference": true
15010                 }, {
15011                     "name": "modelElement",
15012                     "isReadOnly": true,
15013                     "isVirtual": true,
15014                     "isReference": true,
15015                     "type": "Element"
15016                 }, {
15017                     "name": "style",
15018                     "type": "Style",
15019                     "isReadOnly": true,
15020                     "isVirtual": true,
15021                     "isReference": true
15022                 }, {
15023                     "name": "ownedElement",
15024                     "type": "DiagramElement",
15025                     "isReadOnly": true,
15026                     "isVirtual": true,
15027                     "isMany": true
15028                 }]
15029             }, {
15030                 "name": "Node",
15031                 "isAbstract": true,
15032                 "superClass": [
15033                     "DiagramElement"
15034                 ]
15035             }, {
15036                 "name": "Edge",
15037                 "isAbstract": true,
15038                 "superClass": [
15039                     "DiagramElement"
15040                 ],
15041                 "properties": [{
15042                     "name": "source",
15043                     "type": "DiagramElement",
15044                     "isReadOnly": true,
15045                     "isVirtual": true,
15046                     "isReference": true
15047                 }, {
15048                     "name": "target",
15049                     "type": "DiagramElement",
15050                     "isReadOnly": true,
15051                     "isVirtual": true,
15052                     "isReference": true
15053                 }, {
15054                     "name": "waypoint",
15055                     "isUnique": false,
15056                     "isMany": true,
15057                     "type": "dc:Point",
15058                     "serialize": "xsi:type"
15059                 }]
15060             }, {
15061                 "name": "Diagram",
15062                 "isAbstract": true,
15063                 "properties": [{
15064                     "name": "rootElement",
15065                     "type": "DiagramElement",
15066                     "isReadOnly": true,
15067                     "isVirtual": true
15068                 }, {
15069                     "name": "name",
15070                     "isAttr": true,
15071                     "type": "String"
15072                 }, {
15073                     "name": "documentation",
15074                     "isAttr": true,
15075                     "type": "String"
15076                 }, {
15077                     "name": "resolution",
15078                     "isAttr": true,
15079                     "type": "Real"
15080                 }, {
15081                     "name": "ownedStyle",
15082                     "type": "Style",
15083                     "isReadOnly": true,
15084                     "isVirtual": true,
15085                     "isMany": true
15086                 }]
15087             }, {
15088                 "name": "Shape",
15089                 "isAbstract": true,
15090                 "superClass": [
15091                     "Node"
15092                 ],
15093                 "properties": [{
15094                     "name": "bounds",
15095                     "type": "dc:Bounds"
15096                 }]
15097             }, {
15098                 "name": "Plane",
15099                 "isAbstract": true,
15100                 "superClass": [
15101                     "Node"
15102                 ],
15103                 "properties": [{
15104                     "name": "planeElement",
15105                     "type": "DiagramElement",
15106                     "subsettedProperty": "DiagramElement-ownedElement",
15107                     "isMany": true
15108                 }]
15109             }, {
15110                 "name": "LabeledEdge",
15111                 "isAbstract": true,
15112                 "superClass": [
15113                     "Edge"
15114                 ],
15115                 "properties": [{
15116                     "name": "ownedLabel",
15117                     "type": "Label",
15118                     "isReadOnly": true,
15119                     "subsettedProperty": "DiagramElement-ownedElement",
15120                     "isVirtual": true,
15121                     "isMany": true
15122                 }]
15123             }, {
15124                 "name": "LabeledShape",
15125                 "isAbstract": true,
15126                 "superClass": [
15127                     "Shape"
15128                 ],
15129                 "properties": [{
15130                     "name": "ownedLabel",
15131                     "type": "Label",
15132                     "isReadOnly": true,
15133                     "subsettedProperty": "DiagramElement-ownedElement",
15134                     "isVirtual": true,
15135                     "isMany": true
15136                 }]
15137             }, {
15138                 "name": "Label",
15139                 "isAbstract": true,
15140                 "superClass": [
15141                     "Node"
15142                 ],
15143                 "properties": [{
15144                     "name": "bounds",
15145                     "type": "dc:Bounds"
15146                 }]
15147             }, {
15148                 "name": "Style",
15149                 "isAbstract": true
15150             }, {
15151                 "name": "Extension",
15152                 "properties": [{
15153                     "name": "values",
15154                     "type": "Element",
15155                     "isMany": true
15156                 }]
15157             }],
15158             "associations": [],
15159             "prefix": "di",
15160             "xml": {
15161                 "tagAlias": "lowerCase"
15162             }
15163         }
15164     }, {}],
15165     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js": [function(require, module, exports) {
15166         module.exports = {
15167             __depends__: [require('diagram-js/lib/features/interaction-events')],
15168             __init__: ['directEditing'],
15169             directEditing: ['type', require('./lib/DirectEditing')]
15170         };
15171     }, {
15172         "./lib/DirectEditing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\DirectEditing.js",
15173         "diagram-js/lib/features/interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js"
15174     }],
15175     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\DirectEditing.js": [function(require, module, exports) {
15176         'use strict';
15177
15178         var bind = require('lodash/function/bind'),
15179             find = require('lodash/collection/find');
15180
15181         var TextBox = require('./TextBox');
15182
15183
15184         /**
15185          * A direct editing component that allows users to edit an elements text
15186          * directly in the diagram
15187          * 
15188          * @param {EventBus}
15189          *            eventBus the event bus
15190          */
15191         function DirectEditing(eventBus, canvas) {
15192
15193             this._eventBus = eventBus;
15194
15195             this._providers = [];
15196             this._textbox = new TextBox({
15197                 container: canvas.getContainer(),
15198                 keyHandler: bind(this._handleKey, this)
15199             });
15200         }
15201
15202         DirectEditing.$inject = ['eventBus', 'canvas'];
15203
15204
15205         /**
15206          * Register a direct editing provider
15207          * 
15208          * @param {Object}
15209          *            provider the provider, must expose an #activate(element) method
15210          *            that returns an activation context ({ bounds: {x, y, width, height },
15211          *            text }) if direct editing is available for the given element.
15212          *            Additionally the provider must expose a #update(element, value)
15213          *            method to receive direct editing updates.
15214          */
15215         DirectEditing.prototype.registerProvider = function(provider) {
15216             this._providers.push(provider);
15217         };
15218
15219
15220         /**
15221          * Returns true if direct editing is currently active
15222          * 
15223          * @return {Boolean}
15224          */
15225         DirectEditing.prototype.isActive = function() {
15226             return !!this._active;
15227         };
15228
15229
15230         /**
15231          * Cancel direct editing, if it is currently active
15232          */
15233         DirectEditing.prototype.cancel = function() {
15234             if (!this._active) {
15235                 return;
15236             }
15237
15238             this._fire('cancel');
15239             this.close();
15240         };
15241
15242
15243         DirectEditing.prototype._fire = function(event) {
15244             this._eventBus.fire('directEditing.' + event, {
15245                 active: this._active
15246             });
15247         };
15248
15249         DirectEditing.prototype.close = function() {
15250             this._textbox.destroy();
15251
15252             this._fire('deactivate');
15253
15254             this._active = null;
15255         };
15256
15257
15258         DirectEditing.prototype.complete = function() {
15259
15260             var active = this._active;
15261
15262             if (!active) {
15263                 return;
15264             }
15265
15266             var text = this.getValue();
15267
15268             if (text !== active.context.text) {
15269                 active.provider.update(active.element, text, active.context.text);
15270             }
15271
15272             this._fire('complete');
15273
15274             this.close();
15275         };
15276
15277
15278         DirectEditing.prototype.getValue = function() {
15279             return this._textbox.getValue();
15280         };
15281
15282
15283         DirectEditing.prototype._handleKey = function(e) {
15284
15285             // stop bubble
15286             e.stopPropagation();
15287
15288             var key = e.keyCode || e.charCode;
15289
15290             // ESC
15291             if (key === 27) {
15292                 e.preventDefault();
15293                 return this.cancel();
15294             }
15295
15296             // Enter
15297             if (key === 13 && !e.shiftKey) {
15298                 e.preventDefault();
15299                 return this.complete();
15300             }
15301         };
15302
15303
15304         /**
15305          * Activate direct editing on the given element
15306          * 
15307          * @param {Object}
15308          *            ElementDescriptor the descriptor for a shape or connection
15309          * @return {Boolean} true if the activation was possible
15310          */
15311         DirectEditing.prototype.activate = function(element) {
15312
15313             if (this.isActive()) {
15314                 this.cancel();
15315             }
15316
15317             // the direct editing context
15318             var context;
15319
15320             var provider = find(this._providers, function(p) {
15321                 return !!(context = p.activate(element)) ? p : null;
15322             });
15323
15324             // check if activation took place
15325             if (context) {
15326                 this._textbox.create(context.bounds, context.style, context.text);
15327
15328                 this._active = {
15329                     element: element,
15330                     context: context,
15331                     provider: provider
15332                 };
15333
15334                 this._fire('activate');
15335             }
15336
15337             return !!context;
15338         };
15339
15340
15341         module.exports = DirectEditing;
15342     }, {
15343         "./TextBox": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\TextBox.js",
15344         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
15345         "lodash/function/bind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\bind.js"
15346     }],
15347     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\TextBox.js": [function(require, module, exports) {
15348         'use strict';
15349
15350         var assign = require('lodash/object/assign'),
15351             domEvent = require('min-dom/lib/event'),
15352             domRemove = require('min-dom/lib/remove');
15353
15354         function stopPropagation(event) {
15355             event.stopPropagation();
15356         }
15357
15358         function TextBox(options) {
15359
15360             this.container = options.container;
15361             this.textarea = document.createElement('textarea');
15362
15363             this.keyHandler = options.keyHandler || function() {};
15364         }
15365
15366         module.exports = TextBox;
15367
15368
15369         TextBox.prototype.create = function(bounds, style, value) {
15370
15371             var textarea = this.textarea,
15372                 container = this.container;
15373
15374             assign(textarea.style, {
15375                 width: bounds.width + 'px',
15376                 height: bounds.height + 'px',
15377                 left: bounds.x + 'px',
15378                 top: bounds.y + 'px',
15379                 position: 'absolute',
15380                 textAlign: 'center',
15381                 boxSizing: 'border-box'
15382             }, style || {});
15383
15384             textarea.value = value;
15385             textarea.title = 'Press SHIFT+Enter for line feed';
15386
15387             domEvent.bind(textarea, 'keydown', this.keyHandler);
15388             domEvent.bind(textarea, 'mousedown', stopPropagation);
15389
15390             container.appendChild(textarea);
15391
15392             setTimeout(function() {
15393                 if (textarea.parent) {
15394                     textarea.select();
15395                 }
15396                 textarea.focus();
15397             }, 100);
15398         };
15399
15400         TextBox.prototype.destroy = function() {
15401             var textarea = this.textarea;
15402
15403             textarea.value = '';
15404
15405             domEvent.unbind(textarea, 'keydown', this.keyHandler);
15406             domEvent.unbind(textarea, 'mousedown', stopPropagation);
15407
15408             domRemove(textarea);
15409         };
15410
15411         TextBox.prototype.getValue = function() {
15412             return this.textarea.value;
15413         };
15414
15415     }, {
15416         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
15417         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js",
15418         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"
15419     }],
15420     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\index.js": [function(require, module, exports) {
15421         'use strict';
15422
15423         var hat = require('hat');
15424
15425
15426         /**
15427          * Create a new id generator / cache instance.
15428          * 
15429          * You may optionally provide a seed that is used internally.
15430          * 
15431          * @param {Seed}
15432          *            seed
15433          */
15434         function Ids(seed) {
15435             seed = seed || [128, 36, 1];
15436             this._seed = seed.length ? hat.rack(seed[0], seed[1], seed[2]) : seed;
15437         }
15438
15439         module.exports = Ids;
15440
15441         /**
15442          * Generate a next id.
15443          * 
15444          * @param {Object}
15445          *            [element] element to bind the id to
15446          * 
15447          * @return {String} id
15448          */
15449         Ids.prototype.next = function(element) {
15450             return this._seed(element || true);
15451         };
15452
15453         /**
15454          * Generate a next id with a given prefix.
15455          * 
15456          * @param {Object}
15457          *            [element] element to bind the id to
15458          * 
15459          * @return {String} id
15460          */
15461         Ids.prototype.nextPrefixed = function(prefix, element) {
15462             var id;
15463
15464             do {
15465                 id = prefix + this.next(true);
15466             } while (this.assigned(id));
15467
15468             // claim {prefix}{random}
15469             this.claim(id, element);
15470
15471             // return
15472             return id;
15473         };
15474
15475         /**
15476          * Manually claim an existing id.
15477          * 
15478          * @param {String}
15479          *            id
15480          * @param {String}
15481          *            [element] element the id is claimed by
15482          */
15483         Ids.prototype.claim = function(id, element) {
15484             this._seed.set(id, element || true);
15485         };
15486
15487         /**
15488          * Returns true if the given id has already been assigned.
15489          * 
15490          * @param {String}
15491          *            id
15492          * @return {Boolean}
15493          */
15494         Ids.prototype.assigned = function(id) {
15495             return this._seed.get(id) || false;
15496         };
15497     }, {
15498         "hat": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\node_modules\\hat\\index.js"
15499     }],
15500     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\node_modules\\hat\\index.js": [function(require, module, exports) {
15501         var hat = module.exports = function(bits, base) {
15502             if (!base) base = 16;
15503             if (bits === undefined) bits = 128;
15504             if (bits <= 0) return '0';
15505
15506             var digits = Math.log(Math.pow(2, bits)) / Math.log(base);
15507             for (var i = 2; digits === Infinity; i *= 2) {
15508                 digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;
15509             }
15510
15511             var rem = digits - Math.floor(digits);
15512
15513             var res = '';
15514
15515             for (var i = 0; i < Math.floor(digits); i++) {
15516                 var x = Math.floor(Math.random() * base).toString(base);
15517                 res = x + res;
15518             }
15519
15520             if (rem) {
15521                 var b = Math.pow(base, rem);
15522                 var x = Math.floor(Math.random() * b).toString(base);
15523                 res = x + res;
15524             }
15525
15526             var parsed = parseInt(res, base);
15527             if (parsed !== Infinity && parsed >= Math.pow(2, bits)) {
15528                 return hat(bits, base)
15529             } else return res;
15530         };
15531
15532         hat.rack = function(bits, base, expandBy) {
15533             var fn = function(data) {
15534                 var iters = 0;
15535                 do {
15536                     if (iters++ > 10) {
15537                         if (expandBy) bits += expandBy;
15538                         else throw new Error('too many ID collisions, use more bits')
15539                     }
15540
15541                     var id = hat(bits, base);
15542                 } while (Object.hasOwnProperty.call(hats, id));
15543
15544                 hats[id] = data;
15545                 return id;
15546             };
15547             var hats = fn.hats = {};
15548
15549             fn.get = function(id) {
15550                 return fn.hats[id];
15551             };
15552
15553             fn.set = function(id, value) {
15554                 fn.hats[id] = value;
15555                 return fn;
15556             };
15557
15558             fn.bits = bits || 128;
15559             fn.base = base || 16;
15560             return fn;
15561         };
15562
15563     }, {}],
15564     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js": [function(require, module, exports) {
15565         if (typeof Object.create === 'function') {
15566             // implementation from standard node.js 'util' module
15567             module.exports = function inherits(ctor, superCtor) {
15568                 ctor.super_ = superCtor
15569                 ctor.prototype = Object.create(superCtor.prototype, {
15570                     constructor: {
15571                         value: ctor,
15572                         enumerable: false,
15573                         writable: true,
15574                         configurable: true
15575                     }
15576                 });
15577             };
15578         } else {
15579             // old school shim for old browsers
15580             module.exports = function inherits(ctor, superCtor) {
15581                 ctor.super_ = superCtor
15582                 var TempCtor = function() {}
15583                 TempCtor.prototype = superCtor.prototype
15584                 ctor.prototype = new TempCtor()
15585                 ctor.prototype.constructor = ctor
15586             }
15587         }
15588
15589     }, {}],
15590     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js": [function(require, module, exports) {
15591         module.exports = require('domify');
15592     }, {
15593         "domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"
15594     }],
15595     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js": [function(require, module, exports) {
15596         module.exports = require('component-event');
15597     }, {
15598         "component-event": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
15599     }],
15600     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js": [function(require, module, exports) {
15601         module.exports = require('component-query');
15602     }, {
15603         "component-query": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
15604     }],
15605     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js": [function(require, module, exports) {
15606         module.exports = function(el) {
15607             el.parentNode && el.parentNode.removeChild(el);
15608         };
15609     }, {}],
15610     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js": [function(require, module, exports) {
15611         var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
15612             unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
15613             prefix = bind !== 'addEventListener' ? 'on' : '';
15614
15615         /**
15616          * Bind `el` event `type` to `fn`.
15617          * 
15618          * @param {Element}
15619          *            el
15620          * @param {String}
15621          *            type
15622          * @param {Function}
15623          *            fn
15624          * @param {Boolean}
15625          *            capture
15626          * @return {Function}
15627          * @api public
15628          */
15629
15630         exports.bind = function(el, type, fn, capture) {
15631             el[bind](prefix + type, fn, capture || false);
15632             return fn;
15633         };
15634
15635         /**
15636          * Unbind `el` event `type`'s callback `fn`.
15637          * 
15638          * @param {Element}
15639          *            el
15640          * @param {String}
15641          *            type
15642          * @param {Function}
15643          *            fn
15644          * @param {Boolean}
15645          *            capture
15646          * @return {Function}
15647          * @api public
15648          */
15649
15650         exports.unbind = function(el, type, fn, capture) {
15651             el[unbind](prefix + type, fn, capture || false);
15652             return fn;
15653         };
15654     }, {}],
15655     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js": [function(require, module, exports) {
15656         function one(selector, el) {
15657             return el.querySelector(selector);
15658         }
15659
15660         exports = module.exports = function(selector, el) {
15661             el = el || document;
15662             return one(selector, el);
15663         };
15664
15665         exports.all = function(selector, el) {
15666             el = el || document;
15667             return el.querySelectorAll(selector);
15668         };
15669
15670         exports.engine = function(obj) {
15671             if (!obj.one) throw new Error('.one callback required');
15672             if (!obj.all) throw new Error('.all callback required');
15673             one = obj.one;
15674             exports.all = obj.all;
15675             return exports;
15676         };
15677
15678     }, {}],
15679     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js": [function(require, module, exports) {
15680
15681         /**
15682          * Expose `parse`.
15683          */
15684
15685         module.exports = parse;
15686
15687         /**
15688          * Tests for browser support.
15689          */
15690
15691         var div = document.createElement('div');
15692         // Setup
15693         div.innerHTML = '  <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
15694         // Make sure that link elements get serialized correctly by innerHTML
15695         // This requires a wrapper element in IE
15696         var innerHTMLBug = !div.getElementsByTagName('link').length;
15697         div = undefined;
15698
15699         /**
15700          * Wrap map from jquery.
15701          */
15702
15703         var map = {
15704             legend: [1, '<fieldset>', '</fieldset>'],
15705             tr: [2, '<table><tbody>', '</tbody></table>'],
15706             col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
15707             // for script/link/style tags to work in IE6-8, you have to wrap
15708             // in a div with a non-whitespace character in front, ha!
15709             _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
15710         };
15711
15712         map.td =
15713             map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
15714
15715         map.option =
15716             map.optgroup = [1, '<select multiple="multiple">', '</select>'];
15717
15718         map.thead =
15719             map.tbody =
15720             map.colgroup =
15721             map.caption =
15722             map.tfoot = [1, '<table>', '</table>'];
15723
15724         map.polyline =
15725             map.ellipse =
15726             map.polygon =
15727             map.circle =
15728             map.text =
15729             map.line =
15730             map.path =
15731             map.rect =
15732             map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">', '</svg>'];
15733
15734         /**
15735          * Parse `html` and return a DOM Node instance, which could be a TextNode, HTML
15736          * DOM Node of some kind (<div> for example), or a DocumentFragment instance,
15737          * depending on the contents of the `html` string.
15738          * 
15739          * @param {String}
15740          *            html - HTML string to "domify"
15741          * @param {Document}
15742          *            doc - The `document` instance to create the Node for
15743          * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
15744          * @api private
15745          */
15746
15747         function parse(html, doc) {
15748             if ('string' != typeof html) throw new TypeError('String expected');
15749
15750             // default to the global `document` object
15751             if (!doc) doc = document;
15752
15753             // tag name
15754             var m = /<([\w:]+)/.exec(html);
15755             if (!m) return doc.createTextNode(html);
15756
15757             html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing
15758             // whitespace
15759
15760             var tag = m[1];
15761
15762             // body support
15763             if (tag == 'body') {
15764                 var el = doc.createElement('html');
15765                 el.innerHTML = html;
15766                 return el.removeChild(el.lastChild);
15767             }
15768
15769             // wrap map
15770             var wrap = map[tag] || map._default;
15771             var depth = wrap[0];
15772             var prefix = wrap[1];
15773             var suffix = wrap[2];
15774             var el = doc.createElement('div');
15775             el.innerHTML = prefix + html + suffix;
15776             while (depth--) el = el.lastChild;
15777
15778             // one element
15779             if (el.firstChild == el.lastChild) {
15780                 return el.removeChild(el.firstChild);
15781             }
15782
15783             // several elements
15784             var fragment = doc.createDocumentFragment();
15785             while (el.firstChild) {
15786                 fragment.appendChild(el.removeChild(el.firstChild));
15787             }
15788
15789             return fragment;
15790         }
15791
15792     }, {}],
15793     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js": [function(require, module, exports) {
15794         module.exports = require('./lib/refs');
15795
15796         module.exports.Collection = require('./lib/collection');
15797     }, {
15798         "./lib/collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js",
15799         "./lib/refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js"
15800     }],
15801     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js": [function(require, module, exports) {
15802         'use strict';
15803
15804         /**
15805          * An empty collection stub. Use {@link RefsCollection.extend} to extend a
15806          * collection with ref semantics.
15807          * 
15808          * @classdesc A change and inverse-reference aware collection with set
15809          *            semantics.
15810          * 
15811          * @class RefsCollection
15812          */
15813         function RefsCollection() {}
15814
15815         /**
15816          * Extends a collection with {@link Refs} aware methods
15817          * 
15818          * @memberof RefsCollection
15819          * @static
15820          * 
15821          * @param {Array
15822          *            <Object>} collection
15823          * @param {Refs}
15824          *            refs instance
15825          * @param {Object}
15826          *            property represented by the collection
15827          * @param {Object}
15828          *            target object the collection is attached to
15829          * 
15830          * @return {RefsCollection<Object>} the extended array
15831          */
15832         function extend(collection, refs, property, target) {
15833
15834             var inverseProperty = property.inverse;
15835
15836             /**
15837              * Removes the given element from the array and returns it.
15838              * 
15839              * @method RefsCollection#remove
15840              * 
15841              * @param {Object}
15842              *            element the element to remove
15843              */
15844             collection.remove = function(element) {
15845                 var idx = this.indexOf(element);
15846                 if (idx !== -1) {
15847                     this.splice(idx, 1);
15848
15849                     // unset inverse
15850                     refs.unset(element, inverseProperty, target);
15851                 }
15852
15853                 return element;
15854             };
15855
15856             /**
15857              * Returns true if the collection contains the given element
15858              * 
15859              * @method RefsCollection#contains
15860              * 
15861              * @param {Object}
15862              *            element the element to check for
15863              */
15864             collection.contains = function(element) {
15865                 return this.indexOf(element) !== -1;
15866             };
15867
15868             /**
15869              * Adds an element to the array, unless it exists already (set semantics).
15870              * 
15871              * @method RefsCollection#add
15872              * 
15873              * @param {Object}
15874              *            element the element to add
15875              */
15876             collection.add = function(element) {
15877
15878                 if (!this.contains(element)) {
15879                     this.push(element);
15880
15881                     // set inverse
15882                     refs.set(element, inverseProperty, target);
15883                 }
15884             };
15885
15886             return collection;
15887         }
15888
15889
15890         module.exports.extend = extend;
15891     }, {}],
15892     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js": [function(require, module, exports) {
15893         'use strict';
15894
15895         var Collection = require('./collection');
15896
15897         function hasOwnProperty(e, property) {
15898             return Object.prototype.hasOwnProperty.call(e, property.name || property);
15899         }
15900
15901
15902         function defineCollectionProperty(ref, property, target) {
15903             Object.defineProperty(target, property.name, {
15904                 enumerable: property.enumerable,
15905                 value: Collection.extend(target[property.name] || [], ref, property, target)
15906             });
15907         }
15908
15909
15910         function defineProperty(ref, property, target) {
15911
15912             var inverseProperty = property.inverse;
15913
15914             var _value = target[property.name];
15915
15916             Object.defineProperty(target, property.name, {
15917                 enumerable: property.enumerable,
15918
15919                 get: function() {
15920                     return _value;
15921                 },
15922
15923                 set: function(value) {
15924
15925                     // return if we already performed all changes
15926                     if (value === _value) {
15927                         return;
15928                     }
15929
15930                     var old = _value;
15931
15932                     // temporary set null
15933                     _value = null;
15934
15935                     if (old) {
15936                         ref.unset(old, inverseProperty, target);
15937                     }
15938
15939                     // set new value
15940                     _value = value;
15941
15942                     // set inverse value
15943                     ref.set(_value, inverseProperty, target);
15944                 }
15945             });
15946
15947         }
15948
15949         /**
15950          * Creates a new references object defining two inversly related attribute
15951          * descriptors a and b.
15952          * 
15953          * <p>
15954          * When bound to an object using {@link Refs#bind} the references get activated
15955          * and ensure that add and remove operations are applied reversely, too.
15956          * </p>
15957          * 
15958          * <p>
15959          * For attributes represented as collections {@link Refs} provides the
15960          * {@link RefsCollection#add}, {@link RefsCollection#remove} and
15961          * {@link RefsCollection#contains} extensions that must be used to properly hook
15962          * into the inverse change mechanism.
15963          * </p>
15964          * 
15965          * @class Refs
15966          * 
15967          * @classdesc A bi-directional reference between two attributes.
15968          * 
15969          * @param {Refs.AttributeDescriptor}
15970          *            a property descriptor
15971          * @param {Refs.AttributeDescriptor}
15972          *            b property descriptor
15973          * 
15974          * @example
15975          * 
15976          * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, {
15977          * name: 'car' });
15978          * 
15979          * var car = { name: 'toyota' }; var wheels = [{ pos: 'front-left' }, { pos:
15980          * 'front-right' }];
15981          * 
15982          * refs.bind(car, 'wheels');
15983          * 
15984          * car.wheels // [] car.wheels.add(wheels[0]); car.wheels.add(wheels[1]);
15985          * 
15986          * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]
15987          * 
15988          * wheels[0].car // { name: 'toyota' }; car.wheels.remove(wheels[0]);
15989          * 
15990          * wheels[0].car // undefined
15991          */
15992         function Refs(a, b) {
15993
15994             if (!(this instanceof Refs)) {
15995                 return new Refs(a, b);
15996             }
15997
15998             // link
15999             a.inverse = b;
16000             b.inverse = a;
16001
16002             this.props = {};
16003             this.props[a.name] = a;
16004             this.props[b.name] = b;
16005         }
16006
16007         /**
16008          * Binds one side of a bi-directional reference to a target object.
16009          * 
16010          * @memberOf Refs
16011          * 
16012          * @param {Object}
16013          *            target
16014          * @param {String}
16015          *            property
16016          */
16017         Refs.prototype.bind = function(target, property) {
16018             if (typeof property === 'string') {
16019                 if (!this.props[property]) {
16020                     throw new Error('no property <' + property + '> in ref');
16021                 }
16022                 property = this.props[property];
16023             }
16024
16025             if (property.collection) {
16026                 defineCollectionProperty(this, property, target);
16027             } else {
16028                 defineProperty(this, property, target);
16029             }
16030         };
16031
16032         Refs.prototype.ensureBound = function(target, property) {
16033             if (!hasOwnProperty(target, property)) {
16034                 this.bind(target, property);
16035             }
16036         };
16037
16038         Refs.prototype.unset = function(target, property, value) {
16039
16040             if (target) {
16041                 this.ensureBound(target, property);
16042
16043                 if (property.collection) {
16044                     target[property.name].remove(value);
16045                 } else {
16046                     target[property.name] = undefined;
16047                 }
16048             }
16049         };
16050
16051         Refs.prototype.set = function(target, property, value) {
16052
16053             if (target) {
16054                 this.ensureBound(target, property);
16055
16056                 if (property.collection) {
16057                     target[property.name].add(value);
16058                 } else {
16059                     target[property.name] = value;
16060                 }
16061             }
16062         };
16063
16064         module.exports = Refs;
16065
16066
16067         /**
16068          * An attribute descriptor to be used specify an attribute in a {@link Refs}
16069          * instance
16070          * 
16071          * @typedef {Object} Refs.AttributeDescriptor
16072          * @property {String} name
16073          * @property {boolean} [collection=false]
16074          * @property {boolean} [enumerable=false]
16075          */
16076     }, {
16077         "./collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js"
16078     }],
16079     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\index.js": [function(require, module, exports) {
16080         module.exports = require('./lib/Diagram');
16081     }, {
16082         "./lib/Diagram": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\Diagram.js"
16083     }],
16084     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\Diagram.js": [function(require, module, exports) {
16085         'use strict';
16086
16087         var di = require('didi');
16088
16089
16090         /**
16091          * Bootstrap an injector from a list of modules, instantiating a number of
16092          * default components
16093          * 
16094          * @ignore
16095          * @param {Array
16096          *            <didi.Module>} bootstrapModules
16097          * 
16098          * @return {didi.Injector} a injector to use to access the components
16099          */
16100         function bootstrap(bootstrapModules) {
16101
16102             var modules = [],
16103                 components = [];
16104
16105             function hasModule(m) {
16106                 return modules.indexOf(m) >= 0;
16107             }
16108
16109             function addModule(m) {
16110                 modules.push(m);
16111             }
16112
16113             function visit(m) {
16114                 if (hasModule(m)) {
16115                     return;
16116                 }
16117
16118                 (m.__depends__ || []).forEach(visit);
16119
16120                 if (hasModule(m)) {
16121                     return;
16122                 }
16123
16124                 addModule(m);
16125
16126                 (m.__init__ || []).forEach(function(c) {
16127                     components.push(c);
16128                 });
16129             }
16130
16131             bootstrapModules.forEach(visit);
16132
16133             var injector = new di.Injector(modules);
16134
16135             components.forEach(function(c) {
16136
16137                 try {
16138                     // eagerly resolve component (fn or string)
16139                     injector[typeof c === 'string' ? 'get' : 'invoke'](c);
16140                 } catch (e) {
16141                     console.error('Failed to instantiate component');
16142                     console.error(e.stack);
16143
16144                     throw e;
16145                 }
16146             });
16147
16148             return injector;
16149         }
16150
16151         /**
16152          * Creates an injector from passed options.
16153          * 
16154          * @ignore
16155          * @param {Object}
16156          *            options
16157          * @return {didi.Injector}
16158          */
16159         function createInjector(options) {
16160
16161             options = options || {};
16162
16163             var configModule = {
16164                 'config': ['value', options]
16165             };
16166
16167             var coreModule = require('./core');
16168
16169             var modules = [configModule, coreModule].concat(options.modules || []);
16170
16171             return bootstrap(modules);
16172         }
16173
16174
16175         /**
16176          * The main diagram-js entry point that bootstraps the diagram with the given
16177          * configuration.
16178          * 
16179          * To register extensions with the diagram, pass them as Array<didi.Module> to
16180          * the constructor.
16181          * 
16182          * @class djs.Diagram
16183          * @memberOf djs
16184          * @constructor
16185          * 
16186          * @example
16187          * 
16188          * <caption>Creating a plug-in that logs whenever a shape is added to the
16189          * canvas.</caption>
16190          *  // plug-in implemenentation function MyLoggingPlugin(eventBus) {
16191          * eventBus.on('shape.added', function(event) { console.log('shape ',
16192          * event.shape, ' was added to the diagram'); }); }
16193          *  // export as module module.exports = { __init__: [ 'myLoggingPlugin' ],
16194          * myLoggingPlugin: [ 'type', MyLoggingPlugin ] };
16195          * 
16196          *  // instantiate the diagram with the new plug-in
16197          * 
16198          * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ]
16199          * });
16200          * 
16201          * diagram.invoke([ 'canvas', function(canvas) { // add shape to drawing canvas
16202          * canvas.addShape({ x: 10, y: 10 }); });
16203          *  // 'shape ... was added to the diagram' logged to console
16204          * 
16205          * @param {Object}
16206          *            options
16207          * @param {Array
16208          *            <didi.Module>} [options.modules] external modules to instantiate
16209          *            with the diagram
16210          * @param {didi.Injector}
16211          *            [injector] an (optional) injector to bootstrap the diagram with
16212          */
16213         function Diagram(options, injector) {
16214
16215             // create injector unless explicitly specified
16216             this.injector = injector = injector || createInjector(options);
16217
16218             // API
16219
16220             /**
16221              * Resolves a diagram service
16222              * 
16223              * @method Diagram#get
16224              * 
16225              * @param {String}
16226              *            name the name of the diagram service to be retrieved
16227              * @param {Object}
16228              *            [locals] a number of locals to use to resolve certain
16229              *            dependencies
16230              */
16231             this.get = injector.get;
16232
16233             /**
16234              * Executes a function into which diagram services are injected
16235              * 
16236              * @method Diagram#invoke
16237              * 
16238              * @param {Function|Object[]}
16239              *            fn the function to resolve
16240              * @param {Object}
16241              *            locals a number of locals to use to resolve certain
16242              *            dependencies
16243              */
16244             this.invoke = injector.invoke;
16245
16246             // init
16247
16248             // indicate via event
16249
16250
16251             /**
16252              * An event indicating that all plug-ins are loaded.
16253              * 
16254              * Use this event to fire other events to interested plug-ins
16255              * 
16256              * @memberOf Diagram
16257              * 
16258              * @event diagram.init
16259              * 
16260              * @example
16261              * 
16262              * eventBus.on('diagram.init', function() { eventBus.fire('my-custom-event', {
16263              * foo: 'BAR' }); });
16264              * 
16265              * @type {Object}
16266              */
16267             this.get('eventBus').fire('diagram.init');
16268         }
16269
16270         module.exports = Diagram;
16271
16272
16273         /**
16274          * Destroys the diagram
16275          * 
16276          * @method Diagram#destroy
16277          */
16278         Diagram.prototype.destroy = function() {
16279             this.get('eventBus').fire('diagram.destroy');
16280         };
16281     }, {
16282         "./core": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js",
16283         "didi": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\index.js"
16284     }],
16285     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js": [function(require, module, exports) {
16286         'use strict';
16287
16288         var forEach = require('lodash/collection/forEach'),
16289             isFunction = require('lodash/lang/isFunction'),
16290             isArray = require('lodash/lang/isArray');
16291
16292
16293         /**
16294          * A utility that can be used to plug-in into the command execution for
16295          * extension and/or validation.
16296          * 
16297          * @param {EventBus}
16298          *            eventBus
16299          * 
16300          * @example
16301          * 
16302          * var inherits = require('inherits');
16303          * 
16304          * var CommandInterceptor =
16305          * require('diagram-js/lib/command/CommandInterceptor');
16306          * 
16307          * function CommandLogger(eventBus) { CommandInterceptor.call(this, eventBus);
16308          * 
16309          * this.preExecute(function(event) { console.log('command pre-execute', event);
16310          * }); }
16311          * 
16312          * inherits(CommandLogger, CommandInterceptor);
16313          * 
16314          */
16315         function CommandInterceptor(eventBus) {
16316             this._eventBus = eventBus;
16317         }
16318
16319         CommandInterceptor.$inject = ['eventBus'];
16320
16321         module.exports = CommandInterceptor;
16322
16323         function unwrapEvent(fn) {
16324             return function(event) {
16325                 return fn(event.context, event.command, event);
16326             };
16327         }
16328
16329         /**
16330          * Register an interceptor for a command execution
16331          * 
16332          * @param {String|Array
16333          *            <String>} [events] list of commands to register on
16334          * @param {String}
16335          *            [hook] command hook, i.e. preExecute, executed to listen on
16336          * @param {Function}
16337          *            handlerFn interceptor to be invoked with (event)
16338          * @param {Boolean}
16339          *            unwrap if true, unwrap the event and pass (context, command,
16340          *            event) to the listener instead
16341          */
16342         CommandInterceptor.prototype.on = function(events, hook, handlerFn, unwrap) {
16343
16344             if (isFunction(hook)) {
16345                 unwrap = handlerFn;
16346                 handlerFn = hook;
16347                 hook = null;
16348             }
16349
16350             if (!isFunction(handlerFn)) {
16351                 throw new Error('handlerFn must be a function');
16352             }
16353
16354             if (!isArray(events)) {
16355                 events = [events];
16356             }
16357
16358             var eventBus = this._eventBus;
16359
16360             forEach(events, function(event) {
16361                 // concat commandStack(.event)?(.hook)?
16362                 var fullEvent = ['commandStack', event, hook].filter(function(e) {
16363                     return e;
16364                 }).join('.');
16365
16366                 eventBus.on(fullEvent, unwrap ? unwrapEvent(handlerFn) : handlerFn);
16367             });
16368         };
16369
16370
16371         var hooks = [
16372             'canExecute',
16373             'preExecute',
16374             'execute',
16375             'executed',
16376             'postExecute',
16377             'revert',
16378             'reverted'
16379         ];
16380
16381         /*
16382          * Install hook shortcuts
16383          * 
16384          * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
16385          * which will in term forward to CommandInterceptor#on.
16386          */
16387         forEach(hooks, function(hook) {
16388             CommandInterceptor.prototype[hook] = function(events, fn, unwrap) {
16389                 if (isFunction(events)) {
16390                     unwrap = fn;
16391                     fn = events;
16392                     events = null;
16393                 }
16394
16395                 this.on(events, hook, fn, unwrap);
16396             };
16397         });
16398     }, {
16399         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
16400         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
16401         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js"
16402     }],
16403     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandStack.js": [function(require, module, exports) {
16404         'use strict';
16405
16406         var unique = require('lodash/array/unique'),
16407             isArray = require('lodash/lang/isArray'),
16408             assign = require('lodash/object/assign');
16409
16410         var InternalEvent = require('../core/EventBus').Event;
16411
16412
16413         /**
16414          * A service that offers un- and redoable execution of commands.
16415          * 
16416          * The command stack is responsible for executing modeling actions in a un- and
16417          * redoable manner. To do this it delegates the actual command execution to
16418          * {@link CommandHandler}s.
16419          * 
16420          * Command handlers provide {@link CommandHandler#execute(ctx)} and
16421          * {@link CommandHandler#revert(ctx)} methods to un- and redo a command
16422          * identified by a command context.
16423          * 
16424          *  ## Life-Cycle events
16425          * 
16426          * In the process the command stack fires a number of life-cycle events that
16427          * other components to participate in the command execution.
16428          *  * preExecute * execute * executed * postExecute * revert * reverted
16429          * 
16430          * A special event is used for validating, whether a command can be performed
16431          * prior to its execution.
16432          *  * canExecute
16433          * 
16434          * Each of the events is fired as `commandStack.{eventName}` and
16435          * `commandStack.{commandName}.{eventName}`, respectively. This gives components
16436          * fine grained control on where to hook into.
16437          * 
16438          * The event object fired transports `command`, the name of the command and
16439          * `context`, the command context.
16440          * 
16441          *  ## Creating Command Handlers
16442          * 
16443          * Command handlers should provide the {@link CommandHandler#execute(ctx)} and
16444          * {@link CommandHandler#revert(ctx)} methods to implement redoing and undoing
16445          * of a command. They must ensure undo is performed properly in order not to
16446          * break the undo chain.
16447          * 
16448          * Command handlers may execute other modeling operations (and thus commands) in
16449          * their `preExecute` and `postExecute` phases. The command stack will properly
16450          * group all commands together into a logical unit that may be re- and undone
16451          * atomically.
16452          * 
16453          * Command handlers must not execute other commands from within their core
16454          * implementation (`execute`, `revert`).
16455          * 
16456          *  ## Change Tracking
16457          * 
16458          * During the execution of the CommandStack it will keep track of all elements
16459          * that have been touched during the command's execution.
16460          * 
16461          * At the end of the CommandStack execution it will notify interested components
16462          * via an 'elements.changed' event with all the dirty elements.
16463          * 
16464          * The event can be picked up by components that are interested in the fact that
16465          * elements have been changed. One use case for this is updating their graphical
16466          * representation after moving / resizing or deletion.
16467          * 
16468          * 
16469          * @param {EventBus}
16470          *            eventBus
16471          * @param {Injector}
16472          *            injector
16473          */
16474         function CommandStack(eventBus, injector) {
16475             /**
16476              * A map of all registered command handlers.
16477              * 
16478              * @type {Object}
16479              */
16480             this._handlerMap = {};
16481
16482             /**
16483              * A stack containing all re/undoable actions on the diagram
16484              * 
16485              * @type {Array<Object>}
16486              */
16487             this._stack = [];
16488
16489             /**
16490              * The current index on the stack
16491              * 
16492              * @type {Number}
16493              */
16494             this._stackIdx = -1;
16495
16496             /**
16497              * Current active commandStack execution
16498              * 
16499              * @type {Object}
16500              */
16501             this._currentExecution = {
16502                 actions: [],
16503                 dirty: []
16504             };
16505
16506
16507             this._injector = injector;
16508             this._eventBus = eventBus;
16509
16510             this._uid = 1;
16511             this._selectedModel = selected_model;
16512             
16513             commandStackList.push(this);
16514         }
16515
16516         CommandStack.$inject = ['eventBus', 'injector'];
16517         
16518         module.exports = CommandStack;
16519
16520
16521         /**
16522          * Execute a command
16523          * 
16524          * @param {String}
16525          *            command the command to execute
16526          * @param {Object}
16527          *            context the environment to execute the command in
16528          */
16529         CommandStack.prototype.execute = function(command, context) {
16530             if (!command) {
16531                 throw new Error('command required');
16532             }
16533
16534             var action = {
16535                 command: command,
16536                 context: context
16537             };
16538
16539             this._pushAction(action);
16540             this._internalExecute(action);
16541             this._popAction(action);
16542         };
16543
16544
16545         /**
16546          * Ask whether a given command can be executed.
16547          * 
16548          * Implementors may hook into the mechanism on two ways:
16549          *  * in event listeners:
16550          * 
16551          * Users may prevent the execution via an event listener. It must prevent the
16552          * default action for `commandStack.(<command>.)canExecute` events.
16553          *  * in command handlers:
16554          * 
16555          * If the method {@link CommandHandler#canExecute} is implemented in a handler
16556          * it will be called to figure out whether the execution is allowed.
16557          * 
16558          * @param {String}
16559          *            command the command to execute
16560          * @param {Object}
16561          *            context the environment to execute the command in
16562          * 
16563          * @return {Boolean} true if the command can be executed
16564          */
16565         CommandStack.prototype.canExecute = function(command, context) {
16566
16567             var action = {
16568                 command: command,
16569                 context: context
16570             };
16571
16572             var handler = this._getHandler(command);
16573
16574             if (!handler) {
16575                 return false;
16576             }
16577
16578             var result = this._fire(command, 'canExecute', action);
16579
16580             // handler#canExecute will only be called if no listener
16581             // decided on a result already
16582             if (result === undefined && handler.canExecute) {
16583                 result = handler.canExecute(context);
16584             }
16585
16586             return result;
16587         };
16588
16589
16590         /**
16591          * Clear the command stack, erasing all undo / redo history
16592          */
16593         CommandStack.prototype.clear = function() {
16594             this._stack.length = 0;
16595             this._stackIdx = -1;
16596
16597             this._fire('changed');
16598         };
16599
16600
16601         /**
16602          * Undo last command(s)
16603          */
16604         CommandStack.prototype.undo = function() {
16605             var action = this._getUndoAction(),
16606                 next;
16607             if (action) {
16608                 this._pushAction(action);
16609
16610                 while (action) {
16611                     this._internalUndo(action);
16612                     next = this._getUndoAction();
16613
16614                     if (!next || next.id !== action.id) {
16615                         break;
16616                     }
16617
16618                     action = next;
16619                 }
16620
16621                 this._popAction();
16622             }
16623         };
16624
16625
16626         /**
16627          * Redo last command(s)
16628          */
16629         CommandStack.prototype.redo = function() {
16630             var action = this._getRedoAction(),
16631                 next;
16632
16633             if (action) {
16634                 this._pushAction(action);
16635
16636                 while (action) {
16637                     this._internalExecute(action, true);
16638                     next = this._getRedoAction();
16639
16640                     if (!next || next.id !== action.id) {
16641                         break;
16642                     }
16643
16644                     action = next;
16645                 }
16646
16647                 this._popAction();
16648             }
16649         };
16650
16651
16652         /**
16653          * Register a handler instance with the command stack
16654          * 
16655          * @param {String}
16656          *            command
16657          * @param {CommandHandler}
16658          *            handler
16659          */
16660         CommandStack.prototype.register = function(command, handler) {
16661             this._setHandler(command, handler);
16662         };
16663
16664
16665         /**
16666          * Register a handler type with the command stack by instantiating it and
16667          * injecting its dependencies.
16668          * 
16669          * @param {String}
16670          *            command
16671          * @param {Function}
16672          *            a constructor for a {@link CommandHandler}
16673          */
16674         CommandStack.prototype.registerHandler = function(command, handlerCls) {
16675
16676             if (!command || !handlerCls) {
16677                 throw new Error('command and handlerCls must be defined');
16678             }
16679
16680             var handler = this._injector.instantiate(handlerCls);
16681             this.register(command, handler);
16682         };
16683
16684         CommandStack.prototype.canUndo = function() {
16685             return !!this._getUndoAction();
16686         };
16687
16688         CommandStack.prototype.canRedo = function() {
16689             return !!this._getRedoAction();
16690         };
16691
16692         // //// stack access //////////////////////////////////////
16693
16694         CommandStack.prototype._getRedoAction = function() {
16695             return this._stack[this._stackIdx + 1];
16696         };
16697
16698
16699         CommandStack.prototype._getUndoAction = function() {
16700             return this._stack[this._stackIdx];
16701         };
16702
16703
16704         // //// internal functionality /////////////////////////////
16705
16706         CommandStack.prototype._internalUndo = function(action) {
16707             var command = action.command,
16708                 context = action.context;
16709
16710             var handler = this._getHandler(command);
16711
16712             this._fire(command, 'revert', action);
16713
16714             this._markDirty(handler.revert(context));
16715
16716             this._revertedAction(action);
16717
16718             this._fire(command, 'reverted', action);
16719         };
16720
16721
16722         CommandStack.prototype._fire = function(command, qualifier, event) {
16723             if (arguments.length < 3) {
16724                 event = qualifier;
16725                 qualifier = null;
16726             }
16727
16728             var names = qualifier ? [command + '.' + qualifier, qualifier] : [command],
16729                 i, name, result;
16730
16731             event = assign(new InternalEvent(), event);
16732
16733             for (i = 0; !!(name = names[i]); i++) {
16734                 result = this._eventBus.fire('commandStack.' + name, event);
16735
16736                 if (event.cancelBubble) {
16737                     break;
16738                 }
16739             }
16740
16741             return result;
16742         };
16743
16744         CommandStack.prototype._createId = function() {
16745             return this._uid++;
16746         };
16747
16748
16749         CommandStack.prototype._internalExecute = function(action, redo) {
16750             var command = action.command,
16751                 context = action.context;
16752
16753             var handler = this._getHandler(command);
16754
16755             if (!handler) {
16756                 throw new Error('no command handler registered for <' + command + '>');
16757             }
16758
16759             this._pushAction(action);
16760
16761             if (!redo) {
16762                 this._fire(command, 'preExecute', action);
16763
16764                 if (handler.preExecute) {
16765                     handler.preExecute(context);
16766                 }
16767             }
16768
16769             this._fire(command, 'execute', action);
16770
16771             // execute
16772             this._markDirty(handler.execute(context));
16773
16774             // log to stack
16775             this._executedAction(action, redo);
16776
16777             this._fire(command, 'executed', action);
16778
16779             if (!redo) {
16780                 if (handler.postExecute) {
16781                     handler.postExecute(context);
16782                 }
16783
16784                 this._fire(command, 'postExecute', action);
16785             }
16786
16787             this._popAction(action);
16788         };
16789
16790
16791         CommandStack.prototype._pushAction = function(action) {
16792
16793             var execution = this._currentExecution,
16794                 actions = execution.actions;
16795
16796             var baseAction = actions[0];
16797
16798             if (!action.id) {
16799                 action.id = (baseAction && baseAction.id) || this._createId();
16800             }
16801
16802             actions.push(action);
16803         };
16804
16805
16806         CommandStack.prototype._popAction = function() {
16807             var execution = this._currentExecution,
16808                 actions = execution.actions,
16809                 dirty = execution.dirty;
16810
16811             actions.pop();
16812
16813             if (!actions.length) {
16814                 this._eventBus.fire('elements.changed', {
16815                     elements: unique(dirty)
16816                 });
16817
16818                 dirty.length = 0;
16819
16820                 this._fire('changed');
16821             }
16822         };
16823
16824
16825         CommandStack.prototype._markDirty = function(elements) {
16826             var execution = this._currentExecution;
16827
16828             if (!elements) {
16829                 return;
16830             }
16831
16832             elements = isArray(elements) ? elements : [elements];
16833
16834             execution.dirty = execution.dirty.concat(elements);
16835         };
16836
16837
16838         CommandStack.prototype._executedAction = function(action, redo) {
16839             var stackIdx = ++this._stackIdx;
16840
16841             if (!redo) {
16842                 this._stack.splice(stackIdx, this._stack.length, action);
16843             }
16844         };
16845
16846
16847         CommandStack.prototype._revertedAction = function(action) {
16848             this._stackIdx--;
16849         };
16850
16851
16852         CommandStack.prototype._getHandler = function(command) {
16853             return this._handlerMap[command];
16854         };
16855
16856         CommandStack.prototype._setHandler = function(command, handler) {
16857             if (!command || !handler) {
16858                 throw new Error('command and handler required');
16859             }
16860
16861             if (this._handlerMap[command]) {
16862                 throw new Error('overriding handler for command <' + command + '>');
16863             }
16864
16865             this._handlerMap[command] = handler;
16866         };
16867
16868     }, {
16869         "../core/EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
16870         "lodash/array/unique": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\unique.js",
16871         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
16872         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
16873     }],
16874     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js": [function(require, module, exports) {
16875         module.exports = {
16876             __depends__: [require('../core')],
16877             commandStack: ['type', require('./CommandStack')]
16878         };
16879     }, {
16880         "../core": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js",
16881         "./CommandStack": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandStack.js"
16882     }],
16883     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\Canvas.js": [function(require, module, exports) {
16884         'use strict';
16885
16886         var isNumber = require('lodash/lang/isNumber'),
16887             assign = require('lodash/object/assign'),
16888             forEach = require('lodash/collection/forEach');
16889
16890         var Collections = require('../util/Collections');
16891
16892         var Snap = require('../../vendor/snapsvg');
16893
16894         function round(number, resolution) {
16895             return Math.round(number * resolution) / resolution;
16896         }
16897
16898         function ensurePx(number) {
16899             return isNumber(number) ? number + 'px' : number;
16900         }
16901
16902         /**
16903          * Creates a HTML container element for a SVG element with the given
16904          * configuration
16905          * 
16906          * @param {Object}
16907          *            options
16908          * @return {HTMLElement} the container element
16909          */
16910         function createContainer(options) {
16911
16912             options = assign({}, {
16913                 width: '100%',
16914                 height: '100%'
16915             }, options);
16916
16917             var container = options.container || document.body;
16918
16919             // create a <div> around the svg element with the respective size
16920             // this way we can always get the correct container size
16921             // (this is impossible for <svg> elements at the moment)
16922             var parent = document.createElement('div');
16923             parent.setAttribute('class', 'djs-container');
16924
16925             assign(parent.style, {
16926                 position: 'relative',
16927                 overflow: 'hidden',
16928                 width: ensurePx(options.width),
16929                 height: ensurePx(options.height)
16930             });
16931
16932             container.appendChild(parent);
16933
16934             return parent;
16935         }
16936
16937         function createGroup(parent, cls) {
16938             return parent.group().attr({
16939                 'class': cls
16940             });
16941         }
16942
16943         var BASE_LAYER = 'base';
16944
16945
16946         /**
16947          * The main drawing canvas.
16948          * 
16949          * @class
16950          * @constructor
16951          * 
16952          * @emits Canvas#canvas.init
16953          * 
16954          * @param {Object}
16955          *            config
16956          * @param {EventBus}
16957          *            eventBus
16958          * @param {GraphicsFactory}
16959          *            graphicsFactory
16960          * @param {ElementRegistry}
16961          *            elementRegistry
16962          */
16963         function Canvas(config, eventBus, graphicsFactory, elementRegistry) {
16964             this._eventBus = eventBus;
16965             this._elementRegistry = elementRegistry;
16966             this._graphicsFactory = graphicsFactory;
16967
16968             this._init(config || {});
16969         }
16970
16971         Canvas.$inject = ['config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry'];
16972
16973         module.exports = Canvas;
16974
16975
16976         Canvas.prototype._init = function(config) {
16977
16978             // Creates a <svg> element that is wrapped into a <div>.
16979             // This way we are always able to correctly figure out the size of the svg
16980             // element
16981             // by querying the parent node.
16982             //
16983             // (It is not possible to get the size of a svg element cross browser @
16984             // 2014-04-01)
16985             //
16986             // <div class="djs-container" style="width: {desired-width}, height:
16987             // {desired-height}">
16988             // <svg width="100%" height="100%">
16989             // ...
16990             // </svg>
16991             // </div>
16992
16993             // html container
16994             var eventBus = this._eventBus,
16995
16996                 container = createContainer(config),
16997                 svg = Snap.createSnapAt('100%', '100%', container),
16998                 viewport = createGroup(svg, 'viewport'),
16999
17000                 self = this;
17001
17002             this._container = container;
17003             this._svg = svg;
17004             this._viewport = viewport;
17005             this._layers = {};
17006
17007             eventBus.on('diagram.init', function(event) {
17008
17009                 /**
17010                  * An event indicating that the canvas is ready to be drawn on.
17011                  * 
17012                  * @memberOf Canvas
17013                  * 
17014                  * @event canvas.init
17015                  * 
17016                  * @type {Object}
17017                  * @property {Snap<SVGSVGElement>} svg the created svg element
17018                  * @property {Snap<SVGGroup>} viewport the direct parent of diagram
17019                  *           elements and shapes
17020                  */
17021                 eventBus.fire('canvas.init', {
17022                     svg: svg,
17023                     viewport: viewport
17024                 });
17025             });
17026
17027             eventBus.on('diagram.destroy', function() {
17028
17029                 var parent = self._container.parentNode;
17030
17031                 if (parent) {
17032                     parent.removeChild(container);
17033                 }
17034
17035                 eventBus.fire('canvas.destroy', {
17036                     svg: self._svg,
17037                     viewport: self._viewport
17038                 });
17039
17040                 self._svg.remove();
17041
17042                 self._svg = self._container = self._layers = self._viewport = null;
17043             });
17044
17045         };
17046
17047         /**
17048          * Returns the default layer on which all elements are drawn.
17049          * 
17050          * @returns {Snap<SVGGroup>}
17051          */
17052         Canvas.prototype.getDefaultLayer = function() {
17053             return this.getLayer(BASE_LAYER);
17054         };
17055
17056         /**
17057          * Returns a layer that is used to draw elements or annotations on it.
17058          * 
17059          * @param {String}
17060          *            name
17061          * 
17062          * @returns {Snap<SVGGroup>}
17063          */
17064         Canvas.prototype.getLayer = function(name) {
17065
17066             if (!name) {
17067                 throw new Error('must specify a name');
17068             }
17069
17070             var layer = this._layers[name];
17071             if (!layer) {
17072                 layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);
17073             }
17074
17075             return layer;
17076         };
17077
17078
17079         /**
17080          * Returns the html element that encloses the drawing canvas.
17081          * 
17082          * @return {DOMNode}
17083          */
17084         Canvas.prototype.getContainer = function() {
17085             return this._container;
17086         };
17087
17088
17089         // ///////////// markers ///////////////////////////////////
17090
17091         Canvas.prototype._updateMarker = function(element, marker, add) {
17092             var container;
17093
17094             if (!element.id) {
17095                 element = this._elementRegistry.get(element);
17096             }
17097
17098             // we need to access all
17099             container = this._elementRegistry._elements[element.id];
17100
17101             if (!container) {
17102                 return;
17103             }
17104
17105             forEach([container.gfx, container.secondaryGfx], function(gfx) {
17106                 if (gfx) {
17107                     // invoke either addClass or removeClass based on mode
17108                     gfx[add ? 'addClass' : 'removeClass'](marker);
17109                 }
17110             });
17111
17112             /**
17113              * An event indicating that a marker has been updated for an element
17114              * 
17115              * @event element.marker.update
17116              * @type {Object}
17117              * @property {djs.model.Element} element the shape
17118              * @property {Object} gfx the graphical representation of the shape
17119              * @property {String} marker
17120              * @property {Boolean} add true if the marker was added, false if it got
17121              *           removed
17122              */
17123             this._eventBus.fire('element.marker.update', {
17124                 element: element,
17125                 gfx: container.gfx,
17126                 marker: marker,
17127                 add: !!add
17128             });
17129         };
17130
17131
17132         /**
17133          * Adds a marker to an element (basically a css class).
17134          * 
17135          * Fires the element.marker.update event, making it possible to integrate
17136          * extension into the marker life-cycle, too.
17137          * 
17138          * @example canvas.addMarker('foo', 'some-marker');
17139          * 
17140          * var fooGfx = canvas.getGraphics('foo');
17141          * 
17142          * fooGfx; // <g class="... some-marker"> ... </g>
17143          * 
17144          * @param {String|djs.model.Base}
17145          *            element
17146          * @param {String}
17147          *            marker
17148          */
17149         Canvas.prototype.addMarker = function(element, marker) {
17150             this._updateMarker(element, marker, true);
17151         };
17152
17153
17154         /**
17155          * Remove a marker from an element.
17156          * 
17157          * Fires the element.marker.update event, making it possible to integrate
17158          * extension into the marker life-cycle, too.
17159          * 
17160          * @param {String|djs.model.Base}
17161          *            element
17162          * @param {String}
17163          *            marker
17164          */
17165         Canvas.prototype.removeMarker = function(element, marker) {
17166             this._updateMarker(element, marker, false);
17167         };
17168
17169         /**
17170          * Check the existence of a marker on element.
17171          * 
17172          * @param {String|djs.model.Base}
17173          *            element
17174          * @param {String}
17175          *            marker
17176          */
17177         Canvas.prototype.hasMarker = function(element, marker) {
17178             if (!element.id) {
17179                 element = this._elementRegistry.get(element);
17180             }
17181
17182             var gfx = this.getGraphics(element);
17183
17184             return gfx && gfx.hasClass(marker);
17185         };
17186
17187         /**
17188          * Toggles a marker on an element.
17189          * 
17190          * Fires the element.marker.update event, making it possible to integrate
17191          * extension into the marker life-cycle, too.
17192          * 
17193          * @param {String|djs.model.Base}
17194          *            element
17195          * @param {String}
17196          *            marker
17197          */
17198         Canvas.prototype.toggleMarker = function(element, marker) {
17199             if (this.hasMarker(element, marker)) {
17200                 this.removeMarker(element, marker);
17201             } else {
17202                 this.addMarker(element, marker);
17203             }
17204         };
17205
17206         Canvas.prototype.getRootElement = function() {
17207             if (!this._rootElement) {
17208                 this.setRootElement({
17209                     id: '__implicitroot'
17210                 });
17211             }
17212
17213             return this._rootElement;
17214         };
17215
17216
17217
17218         // ////////////// root element handling ///////////////////////////
17219
17220         /**
17221          * Sets a given element as the new root element for the canvas and returns the
17222          * new root element.
17223          * 
17224          * @param {Object|djs.model.Root}
17225          *            element
17226          * @param {Boolean}
17227          *            [override] whether to override the current root element, if any
17228          * 
17229          * @return {Object|djs.model.Root} new root element
17230          */
17231         Canvas.prototype.setRootElement = function(element, override) {
17232
17233             this._ensureValidId(element);
17234
17235             var oldRoot = this._rootElement,
17236                 elementRegistry = this._elementRegistry,
17237                 eventBus = this._eventBus;
17238
17239             if (oldRoot) {
17240                 if (!override) {
17241                     throw new Error('rootElement already set, need to specify override');
17242                 }
17243
17244                 // simulate element remove event sequence
17245                 eventBus.fire('root.remove', {
17246                     element: oldRoot
17247                 });
17248                 eventBus.fire('root.removed', {
17249                     element: oldRoot
17250                 });
17251
17252                 elementRegistry.remove(oldRoot);
17253             }
17254
17255             var gfx = this.getDefaultLayer();
17256
17257             // resemble element add event sequence
17258             eventBus.fire('root.add', {
17259                 element: element
17260             });
17261
17262             elementRegistry.add(element, gfx, this._svg);
17263
17264             eventBus.fire('root.added', {
17265                 element: element,
17266                 gfx: gfx
17267             });
17268
17269             this._rootElement = element;
17270
17271             return element;
17272         };
17273
17274
17275
17276         // /////////// add functionality ///////////////////////////////
17277
17278         Canvas.prototype._ensureValidId = function(element) {
17279             if (!element.id) {
17280                 throw new Error('element must have an id');
17281             }
17282
17283             if (this._elementRegistry.get(element.id)) {
17284                 throw new Error('element with id ' + element.id + ' already exists');
17285             }
17286         };
17287
17288         Canvas.prototype._setParent = function(element, parent) {
17289             Collections.add(parent.children, element);
17290             element.parent = parent;
17291         };
17292
17293         /**
17294          * Adds an element to the canvas.
17295          * 
17296          * This wires the parent <-> child relationship between the element and a
17297          * explicitly specified parent or an implicit root element.
17298          * 
17299          * During add it emits the events
17300          *  * <{type}.add> (element, parent) * <{type}.added> (element, gfx)
17301          * 
17302          * Extensions may hook into these events to perform their magic.
17303          * 
17304          * @param {String}
17305          *            type
17306          * @param {Object|djs.model.Base}
17307          *            element
17308          * @param {Object|djs.model.Base}
17309          *            [parent]
17310          * 
17311          * @return {Object|djs.model.Base} the added element
17312          */
17313         Canvas.prototype._addElement = function(type, element, parent) {
17314
17315             parent = parent || this.getRootElement();
17316
17317             var eventBus = this._eventBus,
17318                 graphicsFactory = this._graphicsFactory;
17319
17320             this._ensureValidId(element);
17321
17322             eventBus.fire(type + '.add', {
17323                 element: element,
17324                 parent: parent
17325             });
17326
17327             this._setParent(element, parent);
17328
17329             // create graphics
17330             var gfx = graphicsFactory.create(type, element);
17331
17332             this._elementRegistry.add(element, gfx);
17333
17334             // update its visual
17335             graphicsFactory.update(type, element, gfx);
17336
17337             eventBus.fire(type + '.added', {
17338                 element: element,
17339                 gfx: gfx
17340             });
17341
17342             return element;
17343         };
17344
17345         /**
17346          * Adds a shape to the canvas
17347          * 
17348          * @param {Object|djs.model.Shape}
17349          *            shape to add to the diagram
17350          * @param {djs.model.Base}
17351          *            [parent]
17352          * 
17353          * @return {djs.model.Shape} the added shape
17354          */
17355         Canvas.prototype.addShape = function(shape, parent) {
17356             return this._addElement('shape', shape, parent);
17357         };
17358
17359         /**
17360          * Adds a connection to the canvas
17361          * 
17362          * @param {Object|djs.model.Connection}
17363          *            connection to add to the diagram
17364          * @param {djs.model.Base}
17365          *            [parent]
17366          * 
17367          * @return {djs.model.Connection} the added connection
17368          */
17369         Canvas.prototype.addConnection = function(connection, parent) {
17370             return this._addElement('connection', connection, parent);
17371         };
17372
17373
17374         /**
17375          * Internal remove element
17376          */
17377         Canvas.prototype._removeElement = function(element, type) {
17378             console.log(element);
17379             var elementRegistry = this._elementRegistry,
17380                 graphicsFactory = this._graphicsFactory,
17381                 eventBus = this._eventBus;
17382
17383             element = elementRegistry.get(element.id || element);
17384
17385             if (!element) {
17386                 // element was removed already
17387                 return;
17388             }
17389
17390             eventBus.fire(type + '.remove', {
17391                 element: element
17392             });
17393
17394             graphicsFactory.remove(element);
17395
17396             // unset parent <-> child relationship
17397             Collections.remove(element.parent && element.parent.children, element);
17398             element.parent = null;
17399
17400             eventBus.fire(type + '.removed', {
17401                 element: element
17402             });
17403
17404             elementRegistry.remove(element);
17405
17406             return element;
17407         };
17408
17409
17410         /**
17411          * Removes a shape from the canvas
17412          * 
17413          * @param {String|djs.model.Shape}
17414          *            shape or shape id to be removed
17415          * 
17416          * @return {djs.model.Shape} the removed shape
17417          */
17418         Canvas.prototype.removeShape = function(shape) {
17419
17420             /**
17421              * An event indicating that a shape is about to be removed from the canvas.
17422              * 
17423              * @memberOf Canvas
17424              * 
17425              * @event shape.remove
17426              * @type {Object}
17427              * @property {djs.model.Shape} element the shape descriptor
17428              * @property {Object} gfx the graphical representation of the shape
17429              */
17430
17431             /**
17432              * An event indicating that a shape has been removed from the canvas.
17433              * 
17434              * @memberOf Canvas
17435              * 
17436              * @event shape.removed
17437              * @type {Object}
17438              * @property {djs.model.Shape} element the shape descriptor
17439              * @property {Object} gfx the graphical representation of the shape
17440              */
17441             return this._removeElement(shape, 'shape');
17442         };
17443
17444
17445         /**
17446          * Removes a connection from the canvas
17447          * 
17448          * @param {String|djs.model.Connection}
17449          *            connection or connection id to be removed
17450          * 
17451          * @return {djs.model.Connection} the removed connection
17452          */
17453         Canvas.prototype.removeConnection = function(connection) {
17454
17455             /**
17456              * An event indicating that a connection is about to be removed from the
17457              * canvas.
17458              * 
17459              * @memberOf Canvas
17460              * 
17461              * @event connection.remove
17462              * @type {Object}
17463              * @property {djs.model.Connection} element the connection descriptor
17464              * @property {Object} gfx the graphical representation of the connection
17465              */
17466
17467             /**
17468              * An event indicating that a connection has been removed from the canvas.
17469              * 
17470              * @memberOf Canvas
17471              * 
17472              * @event connection.removed
17473              * @type {Object}
17474              * @property {djs.model.Connection} element the connection descriptor
17475              * @property {Object} gfx the graphical representation of the connection
17476              */
17477             return this._removeElement(connection, 'connection');
17478         };
17479
17480
17481         /**
17482          * Sends a shape to the front.
17483          * 
17484          * This method takes parent / child relationships between shapes into account
17485          * and makes sure that children are properly handled, too.
17486          * 
17487          * @param {djs.model.Shape}
17488          *            shape descriptor of the shape to be sent to front
17489          * @param {boolean}
17490          *            [bubble=true] whether to send parent shapes to front, too
17491          */
17492         Canvas.prototype.sendToFront = function(shape, bubble) {
17493
17494             if (bubble !== false) {
17495                 bubble = true;
17496             }
17497
17498             if (bubble && shape.parent) {
17499                 this.sendToFront(shape.parent);
17500             }
17501
17502             forEach(shape.children, function(child) {
17503                 this.sendToFront(child, false);
17504             }, this);
17505
17506             var gfx = this.getGraphics(shape),
17507                 gfxParent = gfx.parent();
17508
17509             gfx.remove().appendTo(gfxParent);
17510         };
17511
17512
17513         /**
17514          * Return the graphical object underlaying a certain diagram element
17515          * 
17516          * @param {String|djs.model.Base}
17517          *            element descriptor of the element
17518          * @param {Boolean}
17519          *            [secondary=false] whether to return the secondary connected
17520          *            element
17521          * 
17522          * @return {SVGElement}
17523          */
17524         Canvas.prototype.getGraphics = function(element, secondary) {
17525             return this._elementRegistry.getGraphics(element, secondary);
17526         };
17527
17528
17529         Canvas.prototype._fireViewboxChange = function() {
17530             this._eventBus.fire('canvas.viewbox.changed', {
17531                 viewbox: this.viewbox(false)
17532             });
17533         };
17534
17535
17536         /**
17537          * Gets or sets the view box of the canvas, i.e. the area that is currently
17538          * displayed
17539          * 
17540          * @param {Object}
17541          *            [box] the new view box to set
17542          * @param {Number}
17543          *            box.x the top left X coordinate of the canvas visible in view box
17544          * @param {Number}
17545          *            box.y the top left Y coordinate of the canvas visible in view box
17546          * @param {Number}
17547          *            box.width the visible width
17548          * @param {Number}
17549          *            box.height
17550          * 
17551          * @example
17552          * 
17553          * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })
17554          *  // sets the visible area of the diagram to (100|100) -> (600|100) // and and
17555          * scales it according to the diagram width
17556          * 
17557          * @return {Object} the current view box
17558          */
17559         Canvas.prototype.viewbox = function(box) {
17560
17561             if (box === undefined && this._cachedViewbox) {
17562                 return this._cachedViewbox;
17563             }
17564
17565             var viewport = this._viewport,
17566                 innerBox,
17567                 outerBox = this.getSize(),
17568                 matrix,
17569                 scale,
17570                 x, y;
17571
17572             if (!box) {
17573                 // compute the inner box based on the
17574                 // diagrams default layer. This allows us to exclude
17575                 // external components, such as overlays
17576                 innerBox = this.getDefaultLayer().getBBox(true);
17577
17578                 matrix = viewport.transform().localMatrix;
17579                 scale = round(matrix.a, 1000);
17580
17581                 x = round(-matrix.e || 0, 1000);
17582                 y = round(-matrix.f || 0, 1000);
17583
17584                 box = this._cachedViewbox = {
17585                     x: x ? x / scale : 0,
17586                     y: y ? y / scale : 0,
17587                     width: outerBox.width / scale,
17588                     height: outerBox.height / scale,
17589                     scale: scale,
17590                     inner: {
17591                         width: innerBox.width,
17592                         height: innerBox.height,
17593                         x: innerBox.x,
17594                         y: innerBox.y
17595                     },
17596                     outer: outerBox
17597                 };
17598
17599                 return box;
17600             } else {
17601                 scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
17602
17603                 matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);
17604                 viewport.transform(matrix);
17605
17606                 this._fireViewboxChange();
17607             }
17608
17609             return box;
17610         };
17611
17612
17613         /**
17614          * Gets or sets the scroll of the canvas.
17615          * 
17616          * @param {Object}
17617          *            [delta] the new scroll to apply.
17618          * 
17619          * @param {Number}
17620          *            [delta.dx]
17621          * @param {Number}
17622          *            [delta.dy]
17623          */
17624         Canvas.prototype.scroll = function(delta) {
17625             var node = this._viewport.node;
17626             var matrix = node.getCTM();
17627
17628             if (delta) {
17629                 delta = assign({
17630                     dx: 0,
17631                     dy: 0
17632                 }, delta || {});
17633
17634                 matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
17635
17636                 setCTM(node, matrix);
17637
17638                 this._fireViewboxChange();
17639             }
17640
17641             return {
17642                 x: matrix.e,
17643                 y: matrix.f
17644             };
17645         };
17646
17647
17648         /**
17649          * Gets or sets the current zoom of the canvas, optionally zooming to the
17650          * specified position.
17651          * 
17652          * @param {String|Number}
17653          *            [newScale] the new zoom level, either a number, i.e. 0.9, or
17654          *            `fit-viewport` to adjust the size to fit the current viewport
17655          * @param {String|Point}
17656          *            [center] the reference point { x: .., y: ..} to zoom to, 'auto' to
17657          *            zoom into mid or null
17658          * 
17659          * @return {Number} the current scale
17660          */
17661         Canvas.prototype.zoom = function(newScale, center) {
17662
17663             if (newScale === 'fit-viewport') {
17664                 return this._fitViewport(center);
17665             }
17666
17667             var vbox = this.viewbox();
17668
17669             if (newScale === undefined) {
17670                 return vbox.scale;
17671             }
17672
17673             var outer = vbox.outer;
17674
17675             if (center === 'auto') {
17676                 center = {
17677                     x: outer.width / 2,
17678                     y: outer.height / 2
17679                 };
17680             }
17681
17682             var matrix = this._setZoom(newScale, center);
17683
17684             this._fireViewboxChange();
17685
17686             return round(matrix.a, 1000);
17687         };
17688
17689         function setCTM(node, m) {
17690             var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
17691             node.setAttribute('transform', mstr);
17692         }
17693
17694         Canvas.prototype._fitViewport = function(center) {
17695
17696             var vbox = this.viewbox(),
17697                 outer = vbox.outer,
17698                 inner = vbox.inner,
17699                 newScale,
17700                 newViewbox;
17701
17702             // display the complete diagram without zooming in.
17703             // instead of relying on internal zoom, we perform a
17704             // hard reset on the canvas viewbox to realize this
17705             //
17706             // if diagram does not need to be zoomed in, we focus it around
17707             // the diagram origin instead
17708
17709             if (inner.x >= 0 &&
17710                 inner.y >= 0 &&
17711                 inner.x + inner.width <= outer.width &&
17712                 inner.y + inner.height <= outer.height &&
17713                 !center) {
17714
17715                 newViewbox = {
17716                     x: 0,
17717                     y: 0,
17718                     width: Math.max(inner.width + inner.x, outer.width),
17719                     height: Math.max(inner.height + inner.y, outer.height)
17720                 };
17721             } else {
17722
17723                 newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);
17724                 newViewbox = {
17725                     x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),
17726                     y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),
17727                     width: outer.width / newScale,
17728                     height: outer.height / newScale
17729                 };
17730             }
17731
17732             this.viewbox(newViewbox);
17733
17734             return this.viewbox().scale;
17735         };
17736
17737
17738         Canvas.prototype._setZoom = function(scale, center) {
17739
17740             var svg = this._svg.node,
17741                 viewport = this._viewport.node;
17742
17743             var matrix = svg.createSVGMatrix();
17744             var point = svg.createSVGPoint();
17745
17746             var centerPoint,
17747                 originalPoint,
17748                 currentMatrix,
17749                 scaleMatrix,
17750                 newMatrix;
17751
17752             currentMatrix = viewport.getCTM();
17753
17754
17755             var currentScale = currentMatrix.a;
17756
17757             if (center) {
17758                 centerPoint = assign(point, center);
17759
17760                 // revert applied viewport transformations
17761                 originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
17762
17763                 // create scale matrix
17764                 scaleMatrix = matrix
17765                     .translate(originalPoint.x, originalPoint.y)
17766                     .scale(1 / currentScale * scale)
17767                     .translate(-originalPoint.x, -originalPoint.y);
17768
17769                 newMatrix = currentMatrix.multiply(scaleMatrix);
17770             } else {
17771                 newMatrix = matrix.scale(scale);
17772             }
17773
17774             setCTM(this._viewport.node, newMatrix);
17775
17776             return newMatrix;
17777         };
17778
17779
17780         /**
17781          * Returns the size of the canvas
17782          * 
17783          * @return {Dimensions}
17784          */
17785         Canvas.prototype.getSize = function() {
17786             return {
17787                 width: this._container.clientWidth,
17788                 height: this._container.clientHeight
17789             };
17790         };
17791
17792
17793         /**
17794          * Return the absolute bounding box for the given element
17795          * 
17796          * The absolute bounding box may be used to display overlays in the callers
17797          * (browser) coordinate system rather than the zoomed in/out canvas coordinates.
17798          * 
17799          * @param {ElementDescriptor}
17800          *            element
17801          * @return {Bounds} the absolute bounding box
17802          */
17803         Canvas.prototype.getAbsoluteBBox = function(element) {
17804             var vbox = this.viewbox();
17805             var bbox;
17806
17807             // connection
17808             // use svg bbox
17809             if (element.waypoints) {
17810                 var gfx = this.getGraphics(element);
17811
17812                 var transformBBox = gfx.getBBox(true);
17813                 bbox = gfx.getBBox();
17814
17815                 bbox.x -= transformBBox.x;
17816                 bbox.y -= transformBBox.y;
17817
17818                 bbox.width += 2 * transformBBox.x;
17819                 bbox.height += 2 * transformBBox.y;
17820             }
17821             // shapes
17822             // use data
17823             else {
17824                 bbox = element;
17825             }
17826
17827             var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
17828             var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
17829
17830             var width = bbox.width * vbox.scale;
17831             var height = bbox.height * vbox.scale;
17832
17833             return {
17834                 x: x,
17835                 y: y,
17836                 width: width,
17837                 height: height
17838             };
17839         };
17840
17841     }, {
17842         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
17843         "../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
17844         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
17845         "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
17846         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
17847     }],
17848     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js": [function(require, module, exports) {
17849         'use strict';
17850
17851         var Model = require('../model');
17852
17853
17854         /**
17855          * A factory for diagram-js shapes
17856          */
17857         function ElementFactory() {
17858             this._uid = 12;
17859         }
17860
17861         module.exports = ElementFactory;
17862
17863
17864         ElementFactory.prototype.createRoot = function(attrs) {
17865             return this.create('root', attrs);
17866         };
17867
17868         ElementFactory.prototype.createLabel = function(attrs) {
17869             return this.create('label', attrs);
17870         };
17871
17872         ElementFactory.prototype.createShape = function(attrs) {
17873             // alert("In createShape");
17874             return this.create('shape', attrs);
17875         };
17876
17877         ElementFactory.prototype.createConnection = function(attrs) {
17878             return this.create('connection', attrs);
17879         };
17880
17881         /**
17882          * Create a model element with the given type and a number of pre-set
17883          * attributes.
17884          * 
17885          * @param {String}
17886          *            type
17887          * @param {Object}
17888          *            attrs
17889          * @return {djs.model.Base} the newly created model instance
17890          */
17891         ElementFactory.prototype.create = function(type, attrs) {
17892             // alert("In create");
17893
17894             attrs = attrs || {};
17895
17896             if (!attrs.id) {
17897                 attrs.id = type + '_' + (this._uid++);
17898             }
17899
17900             return Model.create(type, attrs);
17901         };
17902     }, {
17903         "../model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js"
17904     }],
17905     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementRegistry.js": [function(require, module, exports) {
17906         'use strict';
17907
17908         var ELEMENT_ID = 'data-element-id';
17909
17910
17911         /**
17912          * @class
17913          * 
17914          * A registry that keeps track of all shapes in the diagram.
17915          */
17916         function ElementRegistry() {
17917             this._elements = {};
17918         }
17919
17920         module.exports = ElementRegistry;
17921
17922         /**
17923          * Register a pair of (element, gfx, (secondaryGfx)).
17924          * 
17925          * @param {djs.model.Base}
17926          *            element
17927          * @param {Snap
17928          *            <SVGElement>} gfx
17929          * @param {Snap
17930          *            <SVGElement>} [secondaryGfx] optional other element to register,
17931          *            too
17932          */
17933         ElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {
17934
17935             var id = element.id;
17936
17937             this._validateId(id);
17938
17939             // associate dom node with element
17940             gfx.attr(ELEMENT_ID, id);
17941
17942             if (secondaryGfx) {
17943                 secondaryGfx.attr(ELEMENT_ID, id);
17944             }
17945
17946             this._elements[id] = {
17947                 element: element,
17948                 gfx: gfx,
17949                 secondaryGfx: secondaryGfx
17950             };
17951         };
17952
17953         /**
17954          * Removes an element from the registry.
17955          * 
17956          * @param {djs.model.Base}
17957          *            element
17958          */
17959         ElementRegistry.prototype.remove = function(element) {
17960             var elements = this._elements,
17961                 id = element.id || element,
17962                 container = id && elements[id];
17963
17964             if (container) {
17965
17966                 // unset element id on gfx
17967                 container.gfx.attr(ELEMENT_ID, null);
17968
17969                 if (container.secondaryGfx) {
17970                     container.secondaryGfx.attr(ELEMENT_ID, null);
17971                 }
17972
17973                 delete elements[id];
17974             }
17975         };
17976
17977         /**
17978          * Update the id of an element
17979          * 
17980          * @param {djs.model.Base}
17981          *            element
17982          * @param {String}
17983          *            newId
17984          */
17985         ElementRegistry.prototype.updateId = function(element, newId) {
17986
17987             this._validateId(newId);
17988
17989             if (typeof element === 'string') {
17990                 element = this.get(element);
17991             }
17992
17993             var gfx = this.getGraphics(element),
17994                 secondaryGfx = this.getGraphics(element, true);
17995
17996             this.remove(element);
17997
17998             element.id = newId;
17999
18000             this.add(element, gfx, secondaryGfx);
18001         };
18002
18003         /**
18004          * Return the model element for a given id or graphics.
18005          * 
18006          * @example
18007          * 
18008          * elementRegistry.get('SomeElementId_1'); elementRegistry.get(gfx);
18009          * 
18010          * 
18011          * @param {String|SVGElement}
18012          *            filter for selecting the element
18013          * 
18014          * @return {djs.model.Base}
18015          */
18016         ElementRegistry.prototype.get = function(filter) {
18017             var id;
18018
18019             if (typeof filter === 'string') {
18020                 id = filter;
18021             } else {
18022                 id = filter && filter.attr(ELEMENT_ID);
18023             }
18024
18025             var container = this._elements[id];
18026             return container && container.element;
18027         };
18028
18029         /**
18030          * Return all elements that match a given filter function.
18031          * 
18032          * @param {Function}
18033          *            fn
18034          * 
18035          * @return {Array<djs.model.Base>}
18036          */
18037         ElementRegistry.prototype.filter = function(fn) {
18038
18039             var filtered = [];
18040
18041             this.forEach(function(element, gfx) {
18042                 if (fn(element, gfx)) {
18043                     filtered.push(element);
18044                 }
18045             });
18046
18047             return filtered;
18048         };
18049
18050         /**
18051          * Iterate over all diagram elements.
18052          * 
18053          * @param {Function}
18054          *            fn
18055          */
18056         ElementRegistry.prototype.forEach = function(fn) {
18057
18058             var map = this._elements;
18059
18060             Object.keys(map).forEach(function(id) {
18061                 var container = map[id],
18062                     element = container.element,
18063                     gfx = container.gfx;
18064
18065                 return fn(element, gfx);
18066             });
18067         };
18068
18069         /**
18070          * Return the graphical representation of an element or its id.
18071          * 
18072          * @example elementRegistry.getGraphics('SomeElementId_1');
18073          *          elementRegistry.getGraphics(rootElement); // <g ...>
18074          * 
18075          * elementRegistry.getGraphics(rootElement, true); // <svg ...>
18076          * 
18077          * 
18078          * @param {String|djs.model.Base}
18079          *            filter
18080          * @param {Boolean}
18081          *            [secondary=false] whether to return the secondary connected
18082          *            element
18083          * 
18084          * @return {SVGElement}
18085          */
18086         ElementRegistry.prototype.getGraphics = function(filter, secondary) {
18087             var id = filter.id || filter;
18088
18089             var container = this._elements[id];
18090             return container && (secondary ? container.secondaryGfx : container.gfx);
18091         };
18092
18093         /**
18094          * Validate the suitability of the given id and signals a problem with an
18095          * exception.
18096          * 
18097          * @param {String}
18098          *            id
18099          * 
18100          * @throws {Error}
18101          *             if id is empty or already assigned
18102          */
18103         ElementRegistry.prototype._validateId = function(id) {
18104             if (!id) {
18105                 throw new Error('element must have an id');
18106             }
18107
18108             if (this._elements[id]) {
18109                 throw new Error('element with id ' + id + ' already added');
18110             }
18111         };
18112     }, {}],
18113     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js": [function(require, module, exports) {
18114         'use strict';
18115
18116         var isFunction = require('lodash/lang/isFunction'),
18117             isArray = require('lodash/lang/isArray'),
18118             isNumber = require('lodash/lang/isNumber'),
18119             assign = require('lodash/object/assign');
18120
18121         var DEFAULT_PRIORITY = 1000;
18122
18123
18124         /**
18125          * A general purpose event bus.
18126          * 
18127          * This component is used to communicate across a diagram instance. Other parts
18128          * of a diagram can use it to listen to and broadcast events.
18129          * 
18130          *  ## Registering for Events
18131          * 
18132          * The event bus provides the {@link EventBus#on} and {@link EventBus#once}
18133          * methods to register for events. {@link EventBus#off} can be used to remove
18134          * event registrations. Listeners receive an instance of {@link Event} as the
18135          * first argument. It allows them to hook into the event execution.
18136          * 
18137          * ```javascript
18138          *  // listen for event eventBus.on('foo', function(event) {
18139          *  // access event type event.type; // 'foo'
18140          *  // stop propagation to other listeners event.stopPropagation();
18141          *  // prevent event default event.preventDefault(); });
18142          *  // listen for event with custom payload eventBus.on('bar', function(event,
18143          * payload) { console.log(payload); });
18144          *  // listen for event returning value eventBus.on('foobar', function(event) {
18145          *  // stop event propagation + prevent default return false;
18146          *  // stop event propagation + return custom result return { complex:
18147          * 'listening result' }; });
18148          * 
18149          *  // listen with custom priority (default=1000, higher is better)
18150          * eventBus.on('priorityfoo', 1500, function(event) { console.log('invoked
18151          * first!'); }); ```
18152          * 
18153          *  ## Emitting Events
18154          * 
18155          * Events can be emitted via the event bus using {@link EventBus#fire}.
18156          * 
18157          * ```javascript
18158          *  // false indicates that the default action // was prevented by listeners if
18159          * (eventBus.fire('foo') === false) { console.log('default has been
18160          * prevented!'); };
18161          * 
18162          *  // custom args + return value listener eventBus.on('sum', function(event, a,
18163          * b) { return a + b; });
18164          *  // you can pass custom arguments + retrieve result values. var sum =
18165          * eventBus.fire('sum', 1, 2); console.log(sum); // 3 ```
18166          */
18167         function EventBus() {
18168             this._listeners = {};
18169
18170             // cleanup on destroy
18171
18172             var self = this;
18173
18174             // destroy on lowest priority to allow
18175             // message passing until the bitter end
18176             this.on('diagram.destroy', 1, function() {
18177                 self._listeners = null;
18178             });
18179         }
18180
18181         module.exports = EventBus;
18182
18183
18184         /**
18185          * Register an event listener for events with the given name.
18186          * 
18187          * The callback will be invoked with `event, ...additionalArguments` that have
18188          * been passed to {@link EventBus#fire}.
18189          * 
18190          * Returning false from a listener will prevent the events default action (if
18191          * any is specified). To stop an event from being processed further in other
18192          * listeners execute {@link Event#stopPropagation}.
18193          * 
18194          * Returning anything but `undefined` from a listener will stop the listener
18195          * propagation.
18196          * 
18197          * @param {String|Array
18198          *            <String>} events
18199          * @param {Number}
18200          *            [priority=1000] the priority in which this listener is called,
18201          *            larger is higher
18202          * @param {Function}
18203          *            callback
18204          */
18205         EventBus.prototype.on = function(events, priority, callback) {
18206
18207             events = isArray(events) ? events : [events];
18208
18209             if (isFunction(priority)) {
18210                 callback = priority;
18211                 priority = DEFAULT_PRIORITY;
18212             }
18213
18214             if (!isNumber(priority)) {
18215                 throw new Error('priority must be a number');
18216             }
18217
18218             var self = this,
18219                 listener = {
18220                     priority: priority,
18221                     callback: callback
18222                 };
18223
18224             events.forEach(function(e) {
18225                 self._addListener(e, listener);
18226             });
18227         };
18228
18229
18230         /**
18231          * Register an event listener that is executed only once.
18232          * 
18233          * @param {String}
18234          *            event the event name to register for
18235          * @param {Function}
18236          *            callback the callback to execute
18237          */
18238         EventBus.prototype.once = function(event, callback) {
18239
18240             var self = this;
18241
18242             function wrappedCallback() {
18243                 callback.apply(self, arguments);
18244                 self.off(event, wrappedCallback);
18245             }
18246
18247             this.on(event, wrappedCallback);
18248         };
18249
18250
18251         /**
18252          * Removes event listeners by event and callback.
18253          * 
18254          * If no callback is given, all listeners for a given event name are being
18255          * removed.
18256          * 
18257          * @param {String}
18258          *            event
18259          * @param {Function}
18260          *            [callback]
18261          */
18262         EventBus.prototype.off = function(event, callback) {
18263             var listeners = this._getListeners(event),
18264                 listener, idx;
18265
18266             if (callback) {
18267
18268                 // move through listeners from back to front
18269                 // and remove matching listeners
18270                 for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {
18271                     if (listener.callback === callback) {
18272                         listeners.splice(idx, 1);
18273                     }
18274                 }
18275             } else {
18276                 // clear listeners
18277                 listeners.length = 0;
18278             }
18279         };
18280
18281
18282         /**
18283          * Fires a named event.
18284          * 
18285          * @example
18286          *  // fire event by name events.fire('foo');
18287          *  // fire event object with nested type var event = { type: 'foo' };
18288          * events.fire(event);
18289          *  // fire event with explicit type var event = { x: 10, y: 20 };
18290          * events.fire('element.moved', event);
18291          *  // pass additional arguments to the event events.on('foo', function(event,
18292          * bar) { alert(bar); });
18293          * 
18294          * events.fire({ type: 'foo' }, 'I am bar!');
18295          * 
18296          * @param {String}
18297          *            [name] the optional event name
18298          * @param {Object}
18299          *            [event] the event object
18300          * @param {...Object}
18301          *            additional arguments to be passed to the callback functions
18302          * 
18303          * @return {Boolean} the events return value, if specified or false if the
18304          *         default action was prevented by listeners
18305          */
18306         EventBus.prototype.fire = function(type, data) {
18307
18308             var event,
18309                 originalType,
18310                 listeners, idx, listener,
18311                 returnValue,
18312                 args;
18313
18314             args = Array.prototype.slice.call(arguments);
18315
18316             if (typeof type === 'object') {
18317                 event = type;
18318                 type = event.type;
18319             }
18320
18321             if (!type) {
18322                 throw new Error('no event type specified');
18323             }
18324
18325             listeners = this._listeners[type];
18326
18327             if (!listeners) {
18328                 return;
18329             }
18330
18331             // we make sure we fire instances of our home made
18332             // events here. We wrap them only once, though
18333             if (data instanceof Event) {
18334                 // we are fine, we alread have an event
18335                 event = data;
18336             } else {
18337                 event = new Event();
18338                 event.init(data);
18339             }
18340
18341             // ensure we pass the event as the first parameter
18342             args[0] = event;
18343
18344             // original event type (in case we delegate)
18345             originalType = event.type;
18346
18347             try {
18348
18349                 // update event type before delegation
18350                 if (type !== originalType) {
18351                     event.type = type;
18352                 }
18353
18354                 for (idx = 0; !!(listener = listeners[idx]); idx++) {
18355
18356                     // handle stopped propagation
18357                     if (event.cancelBubble) {
18358                         break;
18359                     }
18360
18361                     try {
18362                         // returning false prevents the default action
18363                         returnValue = event.returnValue = listener.callback.apply(null, args);
18364
18365                         // stop propagation on return value
18366                         if (returnValue !== undefined) {
18367                             event.stopPropagation();
18368                         }
18369
18370                         // prevent default on return false
18371                         if (returnValue === false) {
18372                             event.preventDefault();
18373                         }
18374                     } catch (e) {
18375                         if (!this.handleError(e)) {
18376                             console.error('unhandled error in event listener');
18377                             console.error(e.stack);
18378
18379                             throw e;
18380                         }
18381                     }
18382                 }
18383             } finally {
18384                 // reset event type after delegation
18385                 if (type !== originalType) {
18386                     event.type = originalType;
18387                 }
18388             }
18389
18390             // set the return value to false if the event default
18391             // got prevented and no other return value exists
18392             if (returnValue === undefined && event.defaultPrevented) {
18393                 returnValue = false;
18394             }
18395
18396             return returnValue;
18397         };
18398
18399
18400         EventBus.prototype.handleError = function(error) {
18401             return this.fire('error', {
18402                 error: error
18403             }) === false;
18404         };
18405
18406
18407         /*
18408          * Add new listener with a certain priority to the list of listeners (for the
18409          * given event).
18410          * 
18411          * The semantics of listener registration / listener execution are first
18412          * register, first serve: New listeners will always be inserted after existing
18413          * listeners with the same priority.
18414          * 
18415          * Example: Inserting two listeners with priority 1000 and 1300
18416          *  * before: [ 1500, 1500, 1000, 1000 ] * after: [ 1500, 1500, (new=1300),
18417          * 1000, 1000, (new=1000) ]
18418          * 
18419          * @param {String} event @param {Object} listener { priority, callback }
18420          */
18421         EventBus.prototype._addListener = function(event, newListener) {
18422
18423             var listeners = this._getListeners(event),
18424                 existingListener,
18425                 idx;
18426
18427             // ensure we order listeners by priority from
18428             // 0 (high) to n > 0 (low)
18429             for (idx = 0; !!(existingListener = listeners[idx]); idx++) {
18430                 if (existingListener.priority < newListener.priority) {
18431
18432                     // prepend newListener at before existingListener
18433                     listeners.splice(idx, 0, newListener);
18434                     return;
18435                 }
18436             }
18437
18438             listeners.push(newListener);
18439         };
18440
18441
18442         EventBus.prototype._getListeners = function(name) {
18443             var listeners = this._listeners[name];
18444
18445             if (!listeners) {
18446                 this._listeners[name] = listeners = [];
18447             }
18448
18449             return listeners;
18450         };
18451
18452
18453         /**
18454          * A event that is emitted via the event bus.
18455          */
18456         function Event() {}
18457
18458         module.exports.Event = Event;
18459
18460         Event.prototype.stopPropagation = function() {
18461             this.cancelBubble = true;
18462         };
18463
18464         Event.prototype.preventDefault = function() {
18465             this.defaultPrevented = true;
18466         };
18467
18468         Event.prototype.init = function(data) {
18469             assign(this, data || {});
18470         };
18471
18472     }, {
18473         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
18474         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
18475         "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
18476         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
18477     }],
18478     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\GraphicsFactory.js": [function(require, module, exports) {
18479         'use strict';
18480
18481         var forEach = require('lodash/collection/forEach'),
18482             reduce = require('lodash/collection/reduce');
18483
18484         var GraphicsUtil = require('../util/GraphicsUtil'),
18485             domClear = require('min-dom/lib/clear');
18486
18487         /**
18488          * A factory that creates graphical elements
18489          * 
18490          * @param {Renderer}
18491          *            renderer
18492          */
18493         function GraphicsFactory(renderer, elementRegistry) {
18494             this._renderer = renderer;
18495             this._elementRegistry = elementRegistry;
18496         }
18497
18498         GraphicsFactory.$inject = ['renderer', 'elementRegistry'];
18499
18500         module.exports = GraphicsFactory;
18501
18502
18503         GraphicsFactory.prototype._getChildren = function(element) {
18504
18505             var gfx = this._elementRegistry.getGraphics(element);
18506
18507             var childrenGfx;
18508
18509             // root element
18510             if (!element.parent) {
18511                 childrenGfx = gfx;
18512             } else {
18513                 childrenGfx = GraphicsUtil.getChildren(gfx);
18514                 if (!childrenGfx) {
18515                     childrenGfx = gfx.parent().group().attr('class', 'djs-children');
18516                 }
18517             }
18518
18519             return childrenGfx;
18520         };
18521
18522         /**
18523          * Clears the graphical representation of the element and returns the cleared
18524          * visual (the <g class="djs-visual" /> element).
18525          */
18526         GraphicsFactory.prototype._clear = function(gfx) {
18527             var visual = GraphicsUtil.getVisual(gfx);
18528
18529             domClear(visual.node);
18530
18531             return visual;
18532         };
18533
18534         /**
18535          * Creates a gfx container for shapes and connections
18536          * 
18537          * The layout is as follows:
18538          * 
18539          * <g class="djs-group">
18540          * 
18541          * <!-- the gfx --> <g class="djs-element djs-(shape|connection)"> <g
18542          * class="djs-visual"> <!-- the renderer draws in here --> </g>
18543          * 
18544          * <!-- extensions (overlays, click box, ...) goes here </g>
18545          * 
18546          * <!-- the gfx child nodes --> <g class="djs-children"></g> </g>
18547          * 
18548          * @param {Object}
18549          *            parent
18550          * @param {String}
18551          *            type the type of the element, i.e. shape | connection
18552          */
18553         GraphicsFactory.prototype._createContainer = function(type, parentGfx) {
18554             var outerGfx = parentGfx.group().attr('class', 'djs-group'),
18555                 gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);
18556
18557             // create visual
18558             gfx.group().attr('class', 'djs-visual');
18559
18560             return gfx;
18561         };
18562
18563         GraphicsFactory.prototype.create = function(type, element) {
18564             var childrenGfx = this._getChildren(element.parent);
18565             return this._createContainer(type, childrenGfx);
18566         };
18567
18568
18569         GraphicsFactory.prototype.updateContainments = function(elements) {
18570
18571             var self = this,
18572                 elementRegistry = this._elementRegistry,
18573                 parents;
18574
18575
18576             parents = reduce(elements, function(map, e) {
18577
18578                 if (e.parent) {
18579                     map[e.parent.id] = e.parent;
18580                 }
18581
18582                 return map;
18583             }, {});
18584
18585             // update all parents of changed and reorganized their children
18586             // in the correct order (as indicated in our model)
18587             forEach(parents, function(parent) {
18588
18589                 var childGfx = self._getChildren(parent),
18590                     children = parent.children;
18591
18592                 if (!children) {
18593                     return;
18594                 }
18595
18596                 forEach(children.slice().reverse(), function(c) {
18597                     var gfx = elementRegistry.getGraphics(c);
18598                     gfx.parent().prependTo(childGfx);
18599                 });
18600             });
18601
18602         };
18603
18604         GraphicsFactory.prototype.update = function(type, element, gfx) {
18605
18606             // Do not update root element
18607             if (!element.parent) {
18608                 return;
18609             }
18610
18611             var visual = this._clear(gfx);
18612
18613             // redraw
18614             if (type === 'shape') {
18615                 this._renderer.drawShape(visual, element);
18616
18617                 // update positioning
18618                 gfx.translate(element.x, element.y);
18619             } else
18620             if (type === 'connection') {
18621                 this._renderer.drawConnection(visual, element);
18622             } else {
18623                 throw new Error('unknown type: ' + type);
18624             }
18625
18626             gfx.attr('display', element.hidden ? 'none' : 'block');
18627         };
18628
18629
18630         GraphicsFactory.prototype.remove = function(element) {
18631             var gfx = this._elementRegistry.getGraphics(element);
18632
18633             // remove
18634             gfx.parent().remove();
18635         };
18636
18637     }, {
18638         "../util/GraphicsUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\GraphicsUtil.js",
18639         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
18640         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
18641         "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js"
18642     }],
18643     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js": [function(require, module, exports) {
18644         module.exports = {
18645             __depends__: [require('../draw')],
18646             __init__: ['canvas'],
18647             canvas: ['type', require('./Canvas')],
18648             elementRegistry: ['type', require('./ElementRegistry')],
18649             elementFactory: ['type', require('./ElementFactory')],
18650             eventBus: ['type', require('./EventBus')],
18651             graphicsFactory: ['type', require('./GraphicsFactory')]
18652         };
18653     }, {
18654         "../draw": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\index.js",
18655         "./Canvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\Canvas.js",
18656         "./ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js",
18657         "./ElementRegistry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementRegistry.js",
18658         "./EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
18659         "./GraphicsFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\GraphicsFactory.js"
18660     }],
18661     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js": [function(require, module, exports) {
18662         'use strict';
18663
18664         var Snap = require('../../vendor/snapsvg');
18665
18666
18667         /**
18668          * The default renderer used for shapes and connections.
18669          * 
18670          * @param {Styles}
18671          *            styles
18672          */
18673         function Renderer(styles) {
18674             this.CONNECTION_STYLE = styles.style(['no-fill'], {
18675                 strokeWidth: 5,
18676                 stroke: 'fuchsia'
18677             });
18678             this.SHAPE_STYLE = styles.style({
18679                 fill: 'white',
18680                 stroke: 'fuchsia',
18681                 strokeWidth: 2
18682             });
18683         }
18684
18685         module.exports = Renderer;
18686
18687         Renderer.$inject = ['styles'];
18688
18689
18690         Renderer.prototype.drawShape = function drawShape(gfxGroup, data) {
18691             return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);
18692         };
18693
18694         Renderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {
18695             return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);
18696         };
18697
18698         function componentsToPath(components) {
18699             return components.join(',').replace(/,?([A-z]),?/g, '$1');
18700         }
18701
18702         /**
18703          * Gets the default SVG path of a shape that represents it's visual bounds.
18704          * 
18705          * @param {djs.model.Shape}
18706          *            shape
18707          * @return {string} svg path
18708          */
18709         Renderer.prototype.getShapePath = function getShapePath(shape) {
18710
18711             var x = shape.x,
18712                 y = shape.y,
18713                 width = shape.width,
18714                 height = shape.height;
18715
18716             var shapePath = [
18717                 ['M', x, y],
18718                 ['l', width, 0],
18719                 ['l', 0, height],
18720                 ['l', -width, 0],
18721                 ['z']
18722             ];
18723
18724             return componentsToPath(shapePath);
18725         };
18726
18727         /**
18728          * Gets the default SVG path of a connection that represents it's visual bounds.
18729          * 
18730          * @param {djs.model.Connection}
18731          *            connection
18732          * @return {string} svg path
18733          */
18734         Renderer.prototype.getConnectionPath = function getConnectionPath(connection) {
18735             var waypoints = connection.waypoints;
18736
18737             var idx, point, connectionPath = [];
18738
18739             for (idx = 0; !!(point = waypoints[idx]); idx++) {
18740
18741                 // take invisible docking into account
18742                 // when creating the path
18743                 point = point.original || point;
18744
18745                 connectionPath.push([idx === 0 ? 'M' : 'L', point.x, point.y]);
18746             }
18747
18748             return componentsToPath(connectionPath);
18749         };
18750
18751
18752         function toSVGPoints(points) {
18753             var result = '';
18754
18755             for (var i = 0, p; !!(p = points[i]); i++) {
18756                 result += p.x + ',' + p.y + ' ';
18757             }
18758
18759             return result;
18760         }
18761
18762         function createLine(points, attrs) {
18763             return Snap.create('polyline', {
18764                 points: toSVGPoints(points)
18765             }).attr(attrs || {});
18766         }
18767
18768         function updateLine(gfx, points) {
18769             return gfx.attr({
18770                 points: toSVGPoints(points)
18771             });
18772         }
18773
18774         module.exports.createLine = createLine;
18775         module.exports.updateLine = updateLine;
18776     }, {
18777         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js"
18778     }],
18779     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Styles.js": [function(require, module, exports) {
18780         'use strict';
18781
18782         var isArray = require('lodash/lang/isArray'),
18783             assign = require('lodash/object/assign'),
18784             reduce = require('lodash/collection/reduce');
18785
18786
18787         /**
18788          * A component that manages shape styles
18789          */
18790         function Styles() {
18791
18792             var defaultTraits = {
18793
18794                 'no-fill': {
18795                     fill: 'none'
18796                 },
18797                 'no-border': {
18798                     strokeOpacity: 0.0
18799                 },
18800                 'no-events': {
18801                     pointerEvents: 'none'
18802                 }
18803             };
18804
18805             /**
18806              * Builds a style definition from a className, a list of traits and an
18807              * object of additional attributes.
18808              * 
18809              * @param {String}
18810              *            className
18811              * @param {Array
18812              *            <String>} traits
18813              * @param {Object}
18814              *            additionalAttrs
18815              * 
18816              * @return {Object} the style defintion
18817              */
18818             this.cls = function(className, traits, additionalAttrs) {
18819                 var attrs = this.style(traits, additionalAttrs);
18820
18821                 return assign(attrs, {
18822                     'class': className
18823                 });
18824             };
18825
18826             /**
18827              * Builds a style definition from a list of traits and an object of
18828              * additional attributes.
18829              * 
18830              * @param {Array
18831              *            <String>} traits
18832              * @param {Object}
18833              *            additionalAttrs
18834              * 
18835              * @return {Object} the style defintion
18836              */
18837             this.style = function(traits, additionalAttrs) {
18838
18839                 if (!isArray(traits) && !additionalAttrs) {
18840                     additionalAttrs = traits;
18841                     traits = [];
18842                 }
18843
18844                 var attrs = reduce(traits, function(attrs, t) {
18845                     return assign(attrs, defaultTraits[t] || {});
18846                 }, {});
18847
18848                 return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
18849             };
18850         }
18851
18852         module.exports = Styles;
18853     }, {
18854         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
18855         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
18856         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
18857     }],
18858     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\index.js": [function(require, module, exports) {
18859         module.exports = {
18860             renderer: ['type', require('./Renderer')],
18861             styles: ['type', require('./Styles')]
18862         };
18863     }, {
18864         "./Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
18865         "./Styles": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Styles.js"
18866     }],
18867     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointMove.js": [function(require, module, exports) {
18868         'use strict';
18869
18870         var Geometry = require('../../util/Geometry'),
18871             Util = require('./Util');
18872
18873         var MARKER_OK = 'connect-ok',
18874             MARKER_NOT_OK = 'connect-not-ok',
18875             MARKER_CONNECT_HOVER = 'connect-hover',
18876             MARKER_CONNECT_UPDATING = 'djs-updating';
18877
18878         var COMMAND_BENDPOINT_UPDATE = 'connection.updateWaypoints',
18879             COMMAND_RECONNECT_START = 'connection.reconnectStart',
18880             COMMAND_RECONNECT_END = 'connection.reconnectEnd';
18881
18882         var round = Math.round;
18883
18884
18885         /**
18886          * A component that implements moving of bendpoints
18887          */
18888         function BendpointMove(injector, eventBus, canvas, dragging, graphicsFactory, rules, modeling) {
18889
18890             var connectionDocking;
18891
18892             // optional connection docking integration
18893             try {
18894                 connectionDocking = injector.get('connectionDocking');
18895             } catch (e) {}
18896
18897
18898             // API
18899
18900             this.start = function(event, connection, bendpointIndex, insert) {
18901
18902                 var type,
18903                     context,
18904                     waypoints = connection.waypoints,
18905                     gfx = canvas.getGraphics(connection);
18906
18907                 if (!insert && bendpointIndex === 0) {
18908                     type = COMMAND_RECONNECT_START;
18909                 } else
18910                 if (!insert && bendpointIndex === waypoints.length - 1) {
18911                     type = COMMAND_RECONNECT_END;
18912                 } else {
18913                     type = COMMAND_BENDPOINT_UPDATE;
18914                 }
18915
18916                 context = {
18917                     connection: connection,
18918                     bendpointIndex: bendpointIndex,
18919                     insert: insert,
18920                     type: type
18921                 };
18922
18923                 dragging.activate(event, 'bendpoint.move', {
18924                     data: {
18925                         connection: connection,
18926                         connectionGfx: gfx,
18927                         context: context
18928                     }
18929                 });
18930             };
18931
18932
18933             // DRAGGING IMPLEMENTATION
18934
18935
18936             function redrawConnection(data) {
18937                 graphicsFactory.update('connection', data.connection, data.connectionGfx);
18938             }
18939
18940             function filterRedundantWaypoints(waypoints) {
18941                 return waypoints.filter(function(r, idx) {
18942                     return !Geometry.pointsOnLine(waypoints[idx - 1], waypoints[idx + 1], r);
18943                 });
18944             }
18945
18946             eventBus.on('bendpoint.move.start', function(e) {
18947
18948                 var context = e.context,
18949                     connection = context.connection,
18950                     originalWaypoints = connection.waypoints,
18951                     waypoints = originalWaypoints.slice(),
18952                     insert = context.insert,
18953                     idx = context.bendpointIndex;
18954
18955                 context.originalWaypoints = originalWaypoints;
18956
18957                 if (insert) {
18958                     // insert placeholder for bendpoint to-be-added
18959                     waypoints.splice(idx, 0, null);
18960                 }
18961
18962                 connection.waypoints = waypoints;
18963
18964                 // add dragger gfx
18965                 context.draggerGfx = Util.addBendpoint(canvas.getLayer('overlays'));
18966                 context.draggerGfx.addClass('djs-dragging');
18967
18968                 canvas.addMarker(connection, MARKER_CONNECT_UPDATING);
18969             });
18970
18971             eventBus.on('bendpoint.move.hover', function(e) {
18972                 e.context.hover = e.hover;
18973
18974                 canvas.addMarker(e.hover, MARKER_CONNECT_HOVER);
18975             });
18976
18977             eventBus.on([
18978                 'bendpoint.move.out',
18979                 'bendpoint.move.cleanup'
18980             ], function(e) {
18981
18982                 // remove connect marker
18983                 // if it was added
18984                 var hover = e.context.hover;
18985
18986                 if (hover) {
18987                     canvas.removeMarker(hover, MARKER_CONNECT_HOVER);
18988                     canvas.removeMarker(hover, e.context.target ? MARKER_OK : MARKER_NOT_OK);
18989                 }
18990             });
18991
18992             eventBus.on('bendpoint.move.move', function(e) {
18993
18994                 var context = e.context,
18995                     moveType = context.type,
18996                     connection = e.connection,
18997                     source, target;
18998
18999                 connection.waypoints[context.bendpointIndex] = {
19000                     x: e.x,
19001                     y: e.y
19002                 };
19003
19004                 if (connectionDocking) {
19005
19006                     if (context.hover) {
19007                         if (moveType === COMMAND_RECONNECT_START) {
19008                             source = context.hover;
19009                         }
19010
19011                         if (moveType === COMMAND_RECONNECT_END) {
19012                             target = context.hover;
19013                         }
19014                     }
19015
19016                     connection.waypoints = connectionDocking.getCroppedWaypoints(connection, source, target);
19017                 }
19018
19019                 // asks whether reconnect / bendpoint move / bendpoint add
19020                 // is allowed at the given position
19021                 var allowed = context.allowed = rules.allowed(context.type, context);
19022
19023                 if (allowed) {
19024
19025                     if (context.hover) {
19026                         canvas.removeMarker(context.hover, MARKER_NOT_OK);
19027                         canvas.addMarker(context.hover, MARKER_OK);
19028
19029                         context.target = context.hover;
19030                     }
19031                 } else
19032                 if (allowed === false) {
19033                     if (context.hover) {
19034                         canvas.removeMarker(context.hover, MARKER_OK);
19035                         canvas.addMarker(context.hover, MARKER_NOT_OK);
19036
19037                         context.target = null;
19038                     }
19039                 }
19040
19041                 // add dragger gfx
19042                 context.draggerGfx.translate(e.x, e.y);
19043
19044                 redrawConnection(e);
19045             });
19046
19047             eventBus.on([
19048                 'bendpoint.move.end',
19049                 'bendpoint.move.cancel'
19050             ], function(e) {
19051
19052                 var context = e.context,
19053                     connection = context.connection;
19054
19055                 // remove dragger gfx
19056                 context.draggerGfx.remove();
19057
19058                 context.newWaypoints = connection.waypoints.slice();
19059
19060                 connection.waypoints = context.originalWaypoints;
19061
19062                 canvas.removeMarker(connection, MARKER_CONNECT_UPDATING);
19063             });
19064
19065             eventBus.on('bendpoint.move.end', function(e) {
19066
19067                 var context = e.context,
19068                     waypoints = context.newWaypoints,
19069                     bendpointIndex = context.bendpointIndex,
19070                     bendpoint = waypoints[bendpointIndex],
19071                     allowed = context.allowed;
19072
19073                 // ensure we have actual pixel values bendpoint
19074                 // coordinates (important when zoom level was > 1 during move)
19075                 bendpoint.x = round(bendpoint.x);
19076                 bendpoint.y = round(bendpoint.y);
19077
19078                 if (allowed === true && context.type === COMMAND_RECONNECT_START) {
19079                     modeling.reconnectStart(context.connection, context.target, bendpoint);
19080                 } else
19081                 if (allowed === true && context.type === COMMAND_RECONNECT_END) {
19082                     modeling.reconnectEnd(context.connection, context.target, bendpoint);
19083                 } else
19084                 if (allowed !== false && context.type === COMMAND_BENDPOINT_UPDATE) {
19085                     modeling.updateWaypoints(context.connection, filterRedundantWaypoints(waypoints));
19086                 } else {
19087                     redrawConnection(e);
19088
19089                     return false;
19090                 }
19091             });
19092
19093             eventBus.on('bendpoint.move.cancel', function(e) {
19094                 redrawConnection(e);
19095             });
19096         }
19097
19098         BendpointMove.$inject = ['injector', 'eventBus', 'canvas', 'dragging', 'graphicsFactory', 'rules', 'modeling'];
19099
19100         module.exports = BendpointMove;
19101     }, {
19102         "../../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js",
19103         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js"
19104     }],
19105     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointSnapping.js": [function(require, module, exports) {
19106         'use strict';
19107
19108         var assign = require('lodash/object/assign'),
19109             pick = require('lodash/object/pick'),
19110             forEach = require('lodash/collection/forEach');
19111
19112         var Snap = require('../../../vendor/snapsvg');
19113
19114         var round = Math.round;
19115
19116
19117         function BendpointSnapping(eventBus) {
19118
19119             function snapTo(candidates, point) {
19120                 return Snap.snapTo(candidates, point);
19121             }
19122
19123             function toPoint(e) {
19124                 return pick(e, ['x', 'y']);
19125             }
19126
19127             function mid(element) {
19128                 if (element.width) {
19129                     return {
19130                         x: round(element.width / 2 + element.x),
19131                         y: round(element.height / 2 + element.y)
19132                     };
19133                 }
19134             }
19135
19136             function getSnapPoints(context) {
19137
19138                 var snapPoints = context.snapPoints,
19139                     waypoints = context.connection.waypoints,
19140                     bendpointIndex = context.bendpointIndex,
19141                     referenceWaypoints = [waypoints[bendpointIndex - 1], waypoints[bendpointIndex + 1]];
19142
19143                 if (!snapPoints) {
19144                     context.snapPoints = snapPoints = {
19145                         horizontal: [],
19146                         vertical: []
19147                     };
19148
19149                     forEach(referenceWaypoints, function(p) {
19150                         // we snap on existing bendpoints only,
19151                         // not placeholders that are inserted during add
19152                         if (p) {
19153                             p = p.original || p;
19154
19155                             snapPoints.horizontal.push(p.y);
19156                             snapPoints.vertical.push(p.x);
19157                         }
19158                     });
19159                 }
19160
19161                 return snapPoints;
19162             }
19163
19164             eventBus.on('bendpoint.move.start', function(event) {
19165                 event.context.snapStart = toPoint(event);
19166             });
19167
19168             eventBus.on('bendpoint.move.move', 1500, function(event) {
19169
19170                 var context = event.context,
19171                     snapPoints = getSnapPoints(context),
19172                     start = context.snapStart,
19173                     target = context.target,
19174                     targetMid = target && mid(target),
19175                     x = start.x + event.dx,
19176                     y = start.y + event.dy,
19177                     sx, sy;
19178
19179                 if (!snapPoints) {
19180                     return;
19181                 }
19182
19183                 // snap
19184                 sx = snapTo(targetMid ? snapPoints.vertical.concat([targetMid.x]) : snapPoints.vertical, x);
19185                 sy = snapTo(targetMid ? snapPoints.horizontal.concat([targetMid.y]) : snapPoints.horizontal, y);
19186
19187
19188                 // correction x/y
19189                 var cx = (x - sx),
19190                     cy = (y - sy);
19191
19192                 // update delta
19193                 assign(event, {
19194                     dx: event.dx - cx,
19195                     dy: event.dy - cy,
19196                     x: event.x - cx,
19197                     y: event.y - cy
19198                 });
19199             });
19200         }
19201
19202
19203         BendpointSnapping.$inject = ['eventBus'];
19204
19205         module.exports = BendpointSnapping;
19206     }, {
19207         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
19208         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
19209         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
19210         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
19211     }],
19212     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Bendpoints.js": [function(require, module, exports) {
19213         'use strict';
19214
19215         var domEvent = require('min-dom/lib/event'),
19216             Util = require('./Util');
19217
19218         var BENDPOINT_CLS = Util.BENDPOINT_CLS;
19219
19220
19221         /**
19222          * A service that adds editable bendpoints to connections.
19223          */
19224         function Bendpoints(injector, eventBus, canvas, interactionEvents, bendpointMove) {
19225
19226             function getConnectionIntersection(waypoints, event) {
19227                 var localPosition = Util.toCanvasCoordinates(canvas, event);
19228                 return Util.getApproxIntersection(waypoints, localPosition);
19229             }
19230
19231             function activateBendpointMove(event, connection) {
19232                 var waypoints = connection.waypoints,
19233                     intersection = getConnectionIntersection(waypoints, event);
19234
19235                 if (!intersection) {
19236                     return;
19237                 }
19238
19239                 bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);
19240             }
19241
19242             function getBendpointsContainer(element, create) {
19243
19244                 var layer = canvas.getLayer('overlays'),
19245                     gfx = layer.select('.djs-bendpoints[data-element-id=' + element.id + ']');
19246
19247                 if (!gfx && create) {
19248                     gfx = layer.group().addClass('djs-bendpoints').attr('data-element-id', element.id);
19249
19250                     domEvent.bind(gfx.node, 'mousedown', function(event) {
19251                         activateBendpointMove(event, element);
19252                     });
19253                 }
19254
19255                 return gfx;
19256             }
19257
19258             function createBendpoints(gfx, connection) {
19259                 connection.waypoints.forEach(function(p, idx) {
19260                     Util.addBendpoint(gfx).translate(p.x, p.y);
19261                 });
19262
19263                 // add floating bendpoint
19264                 Util.addBendpoint(gfx).addClass('floating');
19265             }
19266
19267             function clearBendpoints(gfx) {
19268                 gfx.selectAll('.' + BENDPOINT_CLS).forEach(function(s) {
19269                     s.remove();
19270                 });
19271             }
19272
19273             function addBendpoints(connection) {
19274                 var gfx = getBendpointsContainer(connection);
19275
19276                 if (!gfx) {
19277                     gfx = getBendpointsContainer(connection, true);
19278                     createBendpoints(gfx, connection);
19279                 }
19280
19281                 return gfx;
19282             }
19283
19284             function updateBendpoints(connection) {
19285
19286                 var gfx = getBendpointsContainer(connection);
19287
19288                 if (gfx) {
19289                     clearBendpoints(gfx);
19290                     createBendpoints(gfx, connection);
19291                 }
19292             }
19293
19294             eventBus.on('connection.changed', function(event) {
19295                 updateBendpoints(event.element);
19296             });
19297
19298             eventBus.on('connection.remove', function(event) {
19299                 var gfx = getBendpointsContainer(event.element);
19300                 if (gfx) {
19301                     gfx.remove();
19302                 }
19303             });
19304
19305             eventBus.on('element.marker.update', function(event) {
19306
19307                 var element = event.element,
19308                     bendpointsGfx;
19309
19310                 if (!element.waypoints) {
19311                     return;
19312                 }
19313
19314                 bendpointsGfx = addBendpoints(element);
19315                 bendpointsGfx[event.add ? 'addClass' : 'removeClass'](event.marker);
19316             });
19317
19318             eventBus.on('element.mousemove', function(event) {
19319
19320                 var element = event.element,
19321                     waypoints = element.waypoints,
19322                     bendpointsGfx,
19323                     floating,
19324                     intersection;
19325
19326                 if (waypoints) {
19327
19328                     bendpointsGfx = getBendpointsContainer(element, true);
19329                     floating = bendpointsGfx.select('.floating');
19330
19331                     if (!floating) {
19332                         return;
19333                     }
19334
19335                     intersection = getConnectionIntersection(waypoints, event.originalEvent);
19336
19337                     if (intersection) {
19338                         floating.translate(intersection.point.x, intersection.point.y);
19339                     }
19340                 }
19341             });
19342
19343             eventBus.on('element.mousedown', function(event) {
19344
19345                 var originalEvent = event.originalEvent,
19346                     element = event.element,
19347                     waypoints = element.waypoints;
19348
19349                 if (!waypoints) {
19350                     return;
19351                 }
19352
19353                 activateBendpointMove(originalEvent, element, waypoints);
19354             });
19355
19356             eventBus.on('selection.changed', function(event) {
19357                 var newSelection = event.newSelection,
19358                     primary = newSelection[0];
19359
19360                 if (primary && primary.waypoints) {
19361                     addBendpoints(primary);
19362                 }
19363             });
19364
19365             eventBus.on('element.hover', function(event) {
19366                 var element = event.element;
19367
19368                 if (element.waypoints) {
19369                     addBendpoints(element);
19370
19371                     interactionEvents.registerEvent(event.gfx.node, 'mousemove', 'element.mousemove');
19372                 }
19373             });
19374
19375             eventBus.on('element.out', function(event) {
19376                 interactionEvents.unregisterEvent(event.gfx.node, 'mousemove', 'element.mousemove');
19377             });
19378         }
19379
19380         Bendpoints.$inject = ['injector', 'eventBus', 'canvas', 'interactionEvents', 'bendpointMove'];
19381
19382         module.exports = Bendpoints;
19383     }, {
19384         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js",
19385         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
19386     }],
19387     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js": [function(require, module, exports) {
19388         'use strict';
19389
19390         var Snap = require('../../../vendor/snapsvg');
19391
19392         var Events = require('../../util/Event'),
19393             Geometry = require('../../util/Geometry');
19394
19395         var BENDPOINT_CLS = module.exports.BENDPOINT_CLS = 'djs-bendpoint';
19396
19397         module.exports.toCanvasCoordinates = function(canvas, event) {
19398
19399             var position = Events.toPoint(event),
19400                 clientRect = canvas._container.getBoundingClientRect(),
19401                 offset;
19402
19403             // canvas relative position
19404
19405             offset = {
19406                 x: clientRect.left,
19407                 y: clientRect.top
19408             };
19409
19410             // update actual event payload with canvas relative measures
19411
19412             var viewbox = canvas.viewbox();
19413
19414             return {
19415                 x: viewbox.x + (position.x - offset.x) / viewbox.scale,
19416                 y: viewbox.y + (position.y - offset.y) / viewbox.scale
19417             };
19418         };
19419
19420         module.exports.addBendpoint = function(parentGfx) {
19421             var groupGfx = parentGfx.group().addClass(BENDPOINT_CLS);
19422
19423             groupGfx.circle(0, 0, 4).addClass('djs-visual');
19424             groupGfx.circle(0, 0, 10).addClass('djs-hit');
19425
19426             return groupGfx;
19427         };
19428
19429
19430         function circlePath(center, r) {
19431             var x = center.x,
19432                 y = center.y;
19433
19434             return [
19435                 ['M', x, y],
19436                 ['m', 0, -r],
19437                 ['a', r, r, 0, 1, 1, 0, 2 * r],
19438                 ['a', r, r, 0, 1, 1, 0, -2 * r],
19439                 ['z']
19440             ];
19441         }
19442
19443         function linePath(points) {
19444             var segments = [];
19445
19446             points.forEach(function(p, idx) {
19447                 segments.push([idx === 0 ? 'M' : 'L', p.x, p.y]);
19448             });
19449
19450             return segments;
19451         }
19452
19453
19454         var INTERSECTION_THRESHOLD = 10;
19455
19456         function getBendpointIntersection(waypoints, reference) {
19457
19458             var i, w;
19459
19460             for (i = 0; !!(w = waypoints[i]); i++) {
19461
19462                 if (Geometry.distance(w, reference) <= INTERSECTION_THRESHOLD) {
19463                     return {
19464                         point: waypoints[i],
19465                         bendpoint: true,
19466                         index: i
19467                     };
19468                 }
19469             }
19470
19471             return null;
19472         }
19473
19474         function getPathIntersection(waypoints, reference) {
19475
19476             var intersections = Snap.path.intersection(circlePath(reference, INTERSECTION_THRESHOLD), linePath(waypoints));
19477
19478             var a = intersections[0],
19479                 b = intersections[intersections.length - 1],
19480                 idx;
19481
19482             if (!a) {
19483                 // no intersection
19484                 return null;
19485             }
19486
19487             if (a !== b) {
19488
19489                 if (a.segment2 !== b.segment2) {
19490                     // we use the bendpoint in between both segments
19491                     // as the intersection point
19492
19493                     idx = Math.max(a.segment2, b.segment2) - 1;
19494
19495                     return {
19496                         point: waypoints[idx],
19497                         bendpoint: true,
19498                         index: idx
19499                     };
19500                 }
19501
19502                 return {
19503                     point: {
19504                         x: (Math.round(a.x + b.x) / 2),
19505                         y: (Math.round(a.y + b.y) / 2)
19506                     },
19507                     index: a.segment2
19508                 };
19509             }
19510
19511             return {
19512                 point: {
19513                     x: Math.round(a.x),
19514                     y: Math.round(a.y)
19515                 },
19516                 index: a.segment2
19517             };
19518         }
19519
19520         /**
19521          * Returns the closest point on the connection towards a given reference point.
19522          * 
19523          * @param {Array
19524          *            <Point>} waypoints
19525          * @param {Point}
19526          *            reference
19527          * 
19528          * @return {Object} intersection data (segment, point)
19529          */
19530         module.exports.getApproxIntersection = function(waypoints, reference) {
19531             return getBendpointIntersection(waypoints, reference) || getPathIntersection(waypoints, reference);
19532         };
19533     }, {
19534         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
19535         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
19536         "../../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js"
19537     }],
19538     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\index.js": [function(require, module, exports) {
19539         module.exports = {
19540             __depends__: [require('../dragging'), require('../rules')],
19541             __init__: ['bendpoints', 'bendpointSnapping'],
19542             bendpoints: ['type', require('./Bendpoints')],
19543             bendpointMove: ['type', require('./BendpointMove')],
19544             bendpointSnapping: ['type', require('./BendpointSnapping')]
19545         };
19546     }, {
19547         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
19548         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
19549         "./BendpointMove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointMove.js",
19550         "./BendpointSnapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointSnapping.js",
19551         "./Bendpoints": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Bendpoints.js"
19552     }],
19553     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\ChangeSupport.js": [function(require, module, exports) {
19554         'use strict';
19555
19556         /**
19557          * Adds change support to the diagram, including
19558          * 
19559          * <ul>
19560          * <li>redrawing shapes and connections on change</li>
19561          * </ul>
19562          * 
19563          * @param {EventBus}
19564          *            eventBus
19565          * @param {ElementRegistry}
19566          *            elementRegistry
19567          * @param {GraphicsFactory}
19568          *            graphicsFactory
19569          */
19570         function ChangeSupport(eventBus, elementRegistry, graphicsFactory) {
19571
19572             // redraw shapes / connections on change
19573
19574             eventBus.on('element.changed', function(event) {
19575
19576                 var element = event.element;
19577
19578                 if (!event.gfx) {
19579                     event.gfx = elementRegistry.getGraphics(element);
19580                 }
19581
19582                 // shape + gfx may have been deleted
19583                 if (!event.gfx) {
19584                     return;
19585                 }
19586
19587                 if (element.waypoints) {
19588                     eventBus.fire('connection.changed', event);
19589                 } else {
19590                     eventBus.fire('shape.changed', event);
19591                 }
19592             });
19593
19594             eventBus.on('elements.changed', function(event) {
19595
19596                 var elements = event.elements;
19597
19598                 elements.forEach(function(e) {
19599                     eventBus.fire('element.changed', {
19600                         element: e
19601                     });
19602                 });
19603
19604                 graphicsFactory.updateContainments(elements);
19605             });
19606
19607             eventBus.on('shape.changed', function(event) {
19608                 graphicsFactory.update('shape', event.element, event.gfx);
19609             });
19610
19611             eventBus.on('connection.changed', function(event) {
19612                 graphicsFactory.update('connection', event.element, event.gfx);
19613             });
19614         }
19615
19616         ChangeSupport.$inject = ['eventBus', 'elementRegistry', 'graphicsFactory'];
19617
19618         module.exports = ChangeSupport;
19619
19620     }, {}],
19621     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js": [function(require, module, exports) {
19622         module.exports = {
19623             __init__: ['changeSupport'],
19624             changeSupport: ['type', require('./ChangeSupport')]
19625         };
19626     }, {
19627         "./ChangeSupport": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\ChangeSupport.js"
19628     }],
19629     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\Connect.js": [function(require, module, exports) {
19630         'use strict';
19631
19632         var LayoutUtil = require('../../layout/LayoutUtil');
19633
19634         var MARKER_OK = 'connect-ok',
19635             MARKER_NOT_OK = 'connect-not-ok';
19636
19637
19638         function Connect(eventBus, dragging, modeling, rules, canvas, renderer) {
19639
19640             // TODO(nre): separate UI and events
19641
19642             // rules
19643
19644             function canConnect(source, target) {
19645                 return rules.allowed('connection.create', {
19646                     source: source,
19647                     target: target
19648                 });
19649             }
19650
19651
19652             // layouting
19653
19654             function crop(start, end, source, target) {
19655
19656                 var sourcePath = renderer.getShapePath(source),
19657                     targetPath = target && renderer.getShapePath(target),
19658                     connectionPath = renderer.getConnectionPath({
19659                         waypoints: [start, end]
19660                     });
19661
19662                 start = LayoutUtil.getElementLineIntersection(sourcePath, connectionPath, true) || start;
19663                 end = (target && LayoutUtil.getElementLineIntersection(targetPath, connectionPath, false)) || end;
19664
19665                 return [start, end];
19666             }
19667
19668
19669             // event handlers
19670
19671             eventBus.on('connect.move', function(event) {
19672
19673                 var context = event.context,
19674                     source = context.source,
19675                     target = context.target,
19676                     visual = context.visual,
19677                     start, end, waypoints;
19678
19679                 // update connection visuals during drag
19680
19681                 start = LayoutUtil.getMidPoint(source);
19682
19683                 end = {
19684                     x: event.x,
19685                     y: event.y
19686                 };
19687
19688                 waypoints = crop(start, end, source, target);
19689
19690                 visual.attr('points', [waypoints[0].x, waypoints[0].y, waypoints[1].x, waypoints[1].y]);
19691             });
19692
19693             eventBus.on('connect.hover', function(event) {
19694                 var context = event.context,
19695                     source = context.source,
19696                     hover = event.hover,
19697                     canExecute;
19698
19699                 canExecute = context.canExecute = canConnect(source, hover);
19700
19701                 // simply ignore hover
19702                 if (canExecute === null) {
19703                     return;
19704                 }
19705
19706                 context.target = hover;
19707
19708                 canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
19709             });
19710
19711             eventBus.on(['connect.out', 'connect.cleanup'], function(event) {
19712                 var context = event.context;
19713
19714                 if (context.target) {
19715                     canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
19716                 }
19717
19718                 context.target = null;
19719             });
19720
19721             eventBus.on('connect.cleanup', function(event) {
19722                 var context = event.context;
19723
19724                 if (context.visual) {
19725                     context.visual.remove();
19726                 }
19727             });
19728
19729             eventBus.on('connect.start', function(event) {
19730                 var context = event.context,
19731                     visual;
19732
19733                 visual = canvas.getDefaultLayer().polyline().attr({
19734                     'stroke': '#333',
19735                     'strokeDasharray': [1],
19736                     'strokeWidth': 2,
19737                     'pointer-events': 'none'
19738                 });
19739
19740                 context.visual = visual;
19741             });
19742
19743             eventBus.on('connect.end', function(event) {
19744
19745                 var context = event.context,
19746                     source = context.source,
19747                     target = context.target,
19748                     canExecute = context.canExecute || canConnect(source, target);
19749
19750                 if (!canExecute) {
19751                     return false;
19752                 }
19753
19754                 modeling.connect(source, target);
19755             });
19756
19757
19758             // API
19759
19760             this.start = function(event, source, autoActivate) {
19761
19762                 dragging.activate(event, 'connect', {
19763                     autoActivate: autoActivate,
19764                     data: {
19765                         shape: source,
19766                         context: {
19767                             source: source
19768                         }
19769                     }
19770                 });
19771             };
19772         }
19773
19774         Connect.$inject = ['eventBus', 'dragging', 'modeling', 'rules', 'canvas', 'renderer'];
19775
19776         module.exports = Connect;
19777     }, {
19778         "../../layout/LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js"
19779     }],
19780     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\index.js": [function(require, module, exports) {
19781         module.exports = {
19782             __depends__: [
19783                 require('../selection'),
19784                 require('../rules'),
19785                 require('../dragging')
19786             ],
19787             connect: ['type', require('./Connect')]
19788         };
19789
19790     }, {
19791         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
19792         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
19793         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
19794         "./Connect": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\Connect.js"
19795     }],
19796     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\ContextPad.js": [function(require, module, exports) {
19797         'use strict';
19798
19799         var isFunction = require('lodash/lang/isFunction'),
19800             forEach = require('lodash/collection/forEach'),
19801
19802             domDelegate = require('min-dom/lib/delegate'),
19803             domClear = require('min-dom/lib/clear'),
19804             domEvent = require('min-dom/lib/event'),
19805             domAttr = require('min-dom/lib/attr'),
19806             domQuery = require('min-dom/lib/query'),
19807             domClasses = require('min-dom/lib/classes'),
19808             domify = require('min-dom/lib/domify');
19809
19810
19811         var entrySelector = '.entry';
19812
19813
19814         /**
19815          * A context pad that displays element specific, contextual actions next to a
19816          * diagram element.
19817          * 
19818          * @param {EventBus}
19819          *            eventBus
19820          * @param {Overlays}
19821          *            overlays
19822          */
19823         function ContextPad(eventBus, overlays) {
19824
19825             this._providers = [];
19826
19827             this._eventBus = eventBus;
19828             this._overlays = overlays;
19829
19830             this._current = null;
19831
19832             this._init();
19833         }
19834
19835         ContextPad.$inject = ['eventBus', 'overlays'];
19836
19837         /**
19838          * Registers events needed for interaction with other components
19839          */
19840         ContextPad.prototype._init = function() {
19841
19842             var eventBus = this._eventBus;
19843
19844             var self = this;
19845
19846             eventBus.on('selection.changed', function(e) {
19847
19848                 var selection = e.newSelection;
19849
19850                 if (selection.length === 1) {
19851                     self.open(selection[0]);
19852                 } else {
19853                     self.close();
19854                 }
19855             });
19856         };
19857
19858
19859         /**
19860          * Register a provider with the context pad
19861          * 
19862          * @param {ContextPadProvider}
19863          *            provider
19864          */
19865         ContextPad.prototype.registerProvider = function(provider) {
19866             this._providers.push(provider);
19867         };
19868
19869
19870         /**
19871          * Returns the context pad entries for a given element
19872          * 
19873          * @param {djs.element.Base}
19874          *            element
19875          * 
19876          * @return {Array<ContextPadEntryDescriptor>} list of entries
19877          */
19878         ContextPad.prototype.getEntries = function(element) {
19879             var entries = {};
19880
19881             // loop through all providers and their entries.
19882             // group entries by id so that overriding an entry is possible
19883             forEach(this._providers, function(provider) {
19884                 var e = provider.getContextPadEntries(element);
19885
19886                 forEach(e, function(entry, id) {
19887                     entries[id] = entry;
19888                 });
19889             });
19890
19891             return entries;
19892         };
19893
19894
19895         /**
19896          * Trigger an action available on the opened context pad
19897          * 
19898          * @param {String}
19899          *            action
19900          * @param {Event}
19901          *            event
19902          */
19903         ContextPad.prototype.trigger = function(action, event, autoActivate) {
19904
19905             var current = this._current,
19906                 element = current.element,
19907                 entries = current.entries,
19908                 entry,
19909                 handler,
19910                 originalEvent,
19911                 button = event.delegateTarget || event.target;
19912
19913             if (!button) {
19914                 return event.preventDefault();
19915             }
19916
19917             entry = entries[domAttr(button, 'data-action')];
19918             handler = entry.action;
19919
19920             originalEvent = event.originalEvent || event;
19921
19922             // simple action (via callback function)
19923             if (isFunction(handler)) {
19924                 if (action === 'click') {
19925                     return handler(originalEvent, element, autoActivate);
19926                 }
19927             } else {
19928                 if (handler[action]) {
19929                     return handler[action](originalEvent, element, autoActivate);
19930                 }
19931             }
19932
19933             // silence other actions
19934             event.preventDefault();
19935         };
19936
19937
19938         /**
19939          * Open the context pad for the given element
19940          * 
19941          * @param {djs.model.Base}
19942          *            element
19943          */
19944         ContextPad.prototype.open = function(element) {
19945
19946             if (this._current && this._current.open) {
19947
19948                 if (this._current.element === element) {
19949                     // no change needed
19950                     return;
19951                 }
19952
19953                 this.close();
19954             }
19955
19956             this._updateAndOpen(element);
19957         };
19958
19959
19960         ContextPad.prototype._updateAndOpen = function(element) {
19961
19962             var entries = this.getEntries(element),
19963                 pad = this.getPad(element),
19964                 html = pad.html;
19965
19966             domClear(html);
19967
19968             forEach(entries, function(entry, id) {
19969                 var grouping = entry.group || 'default',
19970                     control = domify(entry.html || '<div class="entry" draggable="true"></div>'),
19971                     container;
19972
19973                 domAttr(control, 'data-action', id);
19974
19975                 container = domQuery('[data-group=' + grouping + ']', html);
19976                 if (!container) {
19977                     container = domify('<div class="group" data-group="' + grouping + '"></div>');
19978                     html.appendChild(container);
19979                 }
19980
19981                 container.appendChild(control);
19982
19983                 if (entry.className) {
19984                     domClasses(control).add(entry.className);
19985                 }
19986
19987                 if (entry.title) {
19988                     domAttr(control, 'title', entry.title);
19989                 }
19990
19991                 if (entry.imageUrl) {
19992                     control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
19993                 }
19994             });
19995
19996             domClasses(html).add('open');
19997
19998             this._current = {
19999                 element: element,
20000                 pad: pad,
20001                 entries: entries,
20002                 open: true
20003             };
20004
20005             this._eventBus.fire('contextPad.open', {
20006                 current: this._current
20007             });
20008         };
20009
20010         ContextPad.prototype.getPad = function(element) {
20011
20012             var self = this;
20013
20014             var overlays = this._overlays,
20015                 pads = overlays.get({
20016                     element: element,
20017                     type: 'context-pad'
20018                 });
20019
20020             // create context pad on demand if needed
20021             if (!pads.length) {
20022
20023                 var html = domify('<div class="djs-context-pad"></div>');
20024
20025                 domDelegate.bind(html, entrySelector, 'click', function(event) {
20026                     self.trigger('click', event);
20027                 });
20028
20029                 domDelegate.bind(html, entrySelector, 'dragstart', function(event) {
20030                     self.trigger('dragstart', event);
20031                 });
20032
20033                 // stop propagation of mouse events
20034                 domEvent.bind(html, 'mousedown', function(event) {
20035                     event.stopPropagation();
20036                 });
20037
20038
20039                 overlays.add(element, 'context-pad', {
20040                     position: {
20041                         right: -9,
20042                         top: -6
20043                     },
20044                     html: html
20045                 });
20046
20047                 pads = overlays.get({
20048                     element: element,
20049                     type: 'context-pad'
20050                 });
20051
20052                 this._eventBus.fire('contextPad.create', {
20053                     element: element,
20054                     pad: pads[0]
20055                 });
20056             }
20057
20058             return pads[0];
20059         };
20060
20061
20062         /**
20063          * Close the context pad
20064          */
20065         ContextPad.prototype.close = function() {
20066
20067             var html;
20068
20069             if (this._current) {
20070                 if (this._current.open) {
20071                     html = this._current.pad.html;
20072                     domClasses(html).remove('open');
20073                 }
20074
20075                 this._current.open = false;
20076
20077                 this._eventBus.fire('contextPad.close', {
20078                     current: this._current
20079                 });
20080             }
20081         };
20082
20083
20084         /**
20085          * Return the element the context pad is currently opened for, if it is opened.
20086          * 
20087          * @example
20088          * 
20089          * contextPad.open(shape1);
20090          * 
20091          * if (contextPad.isOpen()) { // yes, we are open }
20092          * 
20093          * @return {djs.model.Base} element
20094          */
20095         ContextPad.prototype.isOpen = function() {
20096             return this._current && this._current.open;
20097         };
20098
20099         module.exports = ContextPad;
20100
20101     }, {
20102         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
20103         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
20104         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
20105         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
20106         "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js",
20107         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
20108         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
20109         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
20110         "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js"
20111     }],
20112     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\index.js": [function(require, module, exports) {
20113         module.exports = {
20114             __depends__: [
20115                 require('../interaction-events'),
20116                 require('../overlays')
20117             ],
20118             contextPad: ['type', require('./ContextPad')]
20119         };
20120     }, {
20121         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
20122         "../overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js",
20123         "./ContextPad": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\ContextPad.js"
20124     }],
20125     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\Create.js": [function(require, module, exports) {
20126         'use strict';
20127
20128         var MARKER_OK = 'drop-ok',
20129             MARKER_NOT_OK = 'drop-not-ok';
20130
20131
20132         function Create(eventBus, dragging, rules, modeling, canvas, elementFactory, renderer, styles) {
20133
20134             // rules
20135
20136             function canCreate(shape, target, source) {
20137
20138                 if (source) {
20139                     return rules.allowed('shape.append', {
20140                         source: source,
20141                         shape: shape,
20142                         parent: target
20143                     });
20144                 } else {
20145                     return rules.allowed('shape.create', {
20146                         shape: shape,
20147                         parent: target
20148                     });
20149                 }
20150             }
20151
20152
20153             // visual helpers
20154
20155             function createVisual(shape) {
20156                 var group, preview, visual;
20157
20158                 group = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
20159
20160                 preview = group.group().addClass('djs-dragger');
20161
20162                 preview.translate(shape.width / -2, shape.height / -2);
20163
20164                 visual = preview.group().addClass('djs-visual');
20165
20166                 // hijack renderer to draw preview
20167                 renderer.drawShape(visual, shape);
20168
20169                 return group;
20170             }
20171
20172
20173             // event handlers
20174
20175             eventBus.on('create.move', function(event) {
20176
20177                 var context = event.context,
20178                     shape = context.shape,
20179                     visual = context.visual;
20180
20181                 // lazy init drag visual once we received the first real
20182                 // drag move event (this allows us to get the proper canvas local
20183                 // coordinates)
20184                 if (!visual) {
20185                     visual = context.visual = createVisual(shape);
20186                 }
20187
20188                 visual.translate(event.x, event.y);
20189
20190                 var hover = event.hover,
20191                     canExecute;
20192
20193                 canExecute = context.canExecute = hover && canCreate(context.shape, hover, context.source);
20194
20195                 // ignore hover visually if canExecute is null
20196                 if (hover && canExecute !== null) {
20197                     context.target = hover;
20198                     canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
20199                 }
20200             });
20201
20202             eventBus.on(['create.end', 'create.out', 'create.cleanup'], function(event) {
20203                 var context = event.context;
20204
20205                 if (context.target) {
20206                     canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
20207                 }
20208             });
20209
20210             eventBus.on('create.end', function(event) {
20211                 var context = event.context,
20212                     source = context.source,
20213                     shape = context.shape,
20214                     target = context.target,
20215                     canExecute = context.canExecute,
20216                     position = {
20217                         x: event.x,
20218                         y: event.y
20219                     };
20220
20221                 if (!canExecute) {
20222                     return false;
20223                 }
20224
20225                 if (source) {
20226                     modeling.appendShape(source, shape, position, target);
20227                 } else {
20228                     modeling.createShape(shape, position, target);
20229                 }
20230             });
20231
20232
20233             eventBus.on('create.cleanup', function(event) {
20234                 var context = event.context;
20235
20236                 if (context.visual) {
20237                     context.visual.remove();
20238                 }
20239             });
20240
20241             // API
20242
20243             this.start = function(event, shape, source) {
20244
20245                 dragging.activate(event, 'create', {
20246                     cursor: 'grabbing',
20247                     autoActivate: true,
20248                     data: {
20249                         shape: shape,
20250                         context: {
20251                             shape: shape,
20252                             source: source
20253                         }
20254                     }
20255                 });
20256             };
20257         }
20258
20259         Create.$inject = ['eventBus', 'dragging', 'rules', 'modeling', 'canvas', 'elementFactory', 'renderer', 'styles'];
20260
20261         module.exports = Create;
20262     }, {}],
20263     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js": [function(require, module, exports) {
20264         module.exports = {
20265             __depends__: [
20266                 require('../dragging'),
20267                 require('../selection')
20268             ],
20269             create: ['type', require('./Create')]
20270         };
20271     }, {
20272         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
20273         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
20274         "./Create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\Create.js"
20275     }],
20276     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\Dragging.js": [function(require, module, exports) {
20277         'use strict';
20278
20279         /* global TouchEvent */
20280
20281         var assign = require('lodash/object/assign');
20282
20283         var domEvent = require('min-dom/lib/event'),
20284             Event = require('../../util/Event'),
20285             ClickTrap = require('../../util/ClickTrap'),
20286             Cursor = require('../../util/Cursor');
20287
20288         function suppressEvent(event) {
20289             if (event instanceof MouseEvent) {
20290                 Event.stopEvent(event, true);
20291             } else {
20292                 Event.preventDefault(event);
20293             }
20294         }
20295
20296         function getLength(point) {
20297             return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
20298         }
20299
20300         function substract(p1, p2) {
20301             return {
20302                 x: p1.x - p2.x,
20303                 y: p1.y - p2.y
20304             };
20305         }
20306
20307         /**
20308          * A helper that fires canvas localized drag events and realizes the general
20309          * "drag-and-drop" look and feel.
20310          * 
20311          * Calling {@link Dragging#activate} activates dragging on a canvas.
20312          * 
20313          * It provides the following:
20314          *  * emits the events `start`, `move`, `end`, `cancel` and `cleanup` via the
20315          * {@link EventBus}. Each of the events is prefixed with a prefix that is
20316          * assigned during activate. * sets and restores the cursor * sets and restores
20317          * the selection * ensures there can be only one drag operation active at a time
20318          * 
20319          * Dragging may be canceled manually by calling {@link Dragging#cancel} or by
20320          * pressing ESC.
20321          * 
20322          * @example
20323          * 
20324          * function MyDragComponent(eventBus, dragging) {
20325          * 
20326          * eventBus.on('mydrag.start', function(event) { console.log('yes, we start
20327          * dragging'); });
20328          * 
20329          * eventBus.on('mydrag.move', function(event) { console.log('canvas local
20330          * coordinates', event.x, event.y, event.dx, event.dy);
20331          *  // local drag data is passed with the event event.context.foo; // "BAR"
20332          *  // the original mouse event, too event.originalEvent; // MouseEvent(...) });
20333          * 
20334          * eventBus.on('element.click', function(event) { dragging.activate(event,
20335          * 'mydrag', { cursor: 'grabbing', data: { context: { foo: "BAR" } } }); }); }
20336          */
20337         function Dragging(eventBus, canvas, selection) {
20338
20339             var defaultOptions = {
20340                 threshold: 5
20341             };
20342
20343             // the currently active drag operation
20344             // dragging is active as soon as this context exists.
20345             //
20346             // it is visually _active_ only when a context.active flag is set to true.
20347             var context;
20348
20349
20350             // helpers
20351
20352             function fire(type) {
20353
20354                 var ActualEvent = require('../../core/EventBus').Event;
20355
20356                 var event = assign(new ActualEvent(), context.payload, context.data);
20357
20358                 // default integration
20359                 if (eventBus.fire('drag.' + type, event) === false) {
20360                     return false;
20361                 }
20362
20363                 return eventBus.fire(context.prefix + '.' + type, event);
20364             }
20365
20366             // event listeners
20367
20368             function move(event, activate) {
20369
20370                 var payload = context.payload,
20371                     start = context.start,
20372                     position = Event.toPoint(event),
20373                     delta = substract(position, start),
20374                     clientRect = canvas._container.getBoundingClientRect(),
20375                     offset;
20376
20377                 // canvas relative position
20378
20379                 offset = {
20380                     x: clientRect.left,
20381                     y: clientRect.top
20382                 };
20383
20384                 // update actual event payload with canvas relative measures
20385
20386                 var viewbox = canvas.viewbox();
20387
20388                 var movement = {
20389                     x: viewbox.x + (position.x - offset.x) / viewbox.scale,
20390                     y: viewbox.y + (position.y - offset.y) / viewbox.scale,
20391                     dx: delta.x / viewbox.scale,
20392                     dy: delta.y / viewbox.scale
20393                 };
20394
20395                 // activate context explicitly or once threshold is reached
20396
20397                 if (!context.active && (activate || getLength(delta) > context.threshold)) {
20398
20399                     // fire start event with original
20400                     // starting coordinates
20401
20402                     assign(payload, {
20403                         x: movement.x - movement.dx,
20404                         y: movement.y - movement.dy,
20405                         dx: 0,
20406                         dy: 0
20407                     }, {
20408                         originalEvent: event
20409                     });
20410
20411                     if (false === fire('start')) {
20412                         return cancel();
20413                     }
20414
20415                     context.active = true;
20416
20417                     // unset selection
20418                     if (!context.keepSelection) {
20419                         context.previousSelection = selection.get();
20420                         selection.select(null);
20421                     }
20422
20423                     // allow custom cursor
20424                     if (context.cursor) {
20425                         Cursor.set(context.cursor);
20426                     }
20427                 }
20428
20429                 suppressEvent(event);
20430
20431                 if (context.active) {
20432
20433                     // fire move event with actual coordinates
20434                     assign(payload, movement, {
20435                         originalEvent: event
20436                     });
20437
20438                     fire('move');
20439                 }
20440             }
20441
20442             function end(event) {
20443
20444                 var returnValue = true;
20445
20446                 if (context.active) {
20447
20448                     if (event) {
20449                         context.payload.originalEvent = event;
20450
20451                         // suppress original event (click, ...)
20452                         // because we just ended a drag operation
20453                         suppressEvent(event);
20454                     }
20455
20456                     // implementations may stop restoring the
20457                     // original state (selections, ...) by preventing the
20458                     // end events default action
20459                     returnValue = fire('end');
20460                 }
20461
20462                 if (returnValue === false) {
20463                     fire('rejected');
20464                 }
20465
20466                 cleanup(returnValue !== true);
20467             }
20468
20469
20470             // cancel active drag operation if the user presses
20471             // the ESC key on the keyboard
20472
20473             function checkCancel(event) {
20474
20475                 if (event.which === 27) {
20476                     event.preventDefault();
20477
20478                     cancel();
20479                 }
20480             }
20481
20482
20483             // prevent ghost click that might occur after a finished
20484             // drag and drop session
20485
20486             function trapClickAndEnd(event) {
20487
20488                 var untrap;
20489
20490                 // trap the click in case we are part of an active
20491                 // drag operation. This will effectively prevent
20492                 // the ghost click that cannot be canceled otherwise.
20493                 if (context.active) {
20494                     untrap = ClickTrap.install();
20495                     setTimeout(untrap, 400);
20496                 }
20497
20498                 end(event);
20499             }
20500
20501             function trapTouch(event) {
20502                 move(event);
20503             }
20504
20505             // update the drag events hover (djs.model.Base) and hoverGfx
20506             // (Snap<SVGElement>)
20507             // properties during hover and out and fire {prefix}.hover and {prefix}.out
20508             // properties
20509             // respectively
20510
20511             function hover(event) {
20512                 var payload = context.payload;
20513
20514                 payload.hoverGfx = event.gfx;
20515                 payload.hover = event.element;
20516
20517                 fire('hover');
20518             }
20519
20520             function out(event) {
20521                 fire('out');
20522
20523                 var payload = context.payload;
20524
20525                 payload.hoverGfx = null;
20526                 payload.hover = null;
20527             }
20528
20529
20530             // life-cycle methods
20531
20532             function cancel(restore) {
20533
20534                 if (!context) {
20535                     return;
20536                 }
20537
20538                 if (context.active) {
20539                     fire('cancel');
20540                 }
20541
20542                 cleanup(restore);
20543             }
20544
20545             function cleanup(restore) {
20546
20547                 fire('cleanup');
20548
20549                 // reset cursor
20550                 Cursor.unset();
20551
20552                 // reset dom listeners
20553                 domEvent.unbind(document, 'mousemove', move);
20554
20555                 domEvent.unbind(document, 'mousedown', trapClickAndEnd, true);
20556                 domEvent.unbind(document, 'mouseup', trapClickAndEnd, true);
20557
20558                 domEvent.unbind(document, 'keyup', checkCancel);
20559
20560                 domEvent.unbind(document, 'touchstart', trapTouch, true);
20561                 domEvent.unbind(document, 'touchcancel', cancel, true);
20562                 domEvent.unbind(document, 'touchmove', move, true);
20563                 domEvent.unbind(document, 'touchend', end, true);
20564
20565                 eventBus.off('element.hover', hover);
20566                 eventBus.off('element.out', out);
20567
20568                 // restore selection, unless it has changed
20569                 if (restore !== false && context.previousSelection && !selection.get().length) {
20570                     selection.select(context.previousSelection);
20571                 }
20572
20573                 context = null;
20574             }
20575
20576             /**
20577              * Activate a drag operation
20578              * 
20579              * @param {MouseEvent|TouchEvent}
20580              *            [event]
20581              * @param {String}
20582              *            prefix
20583              * @param {Object}
20584              *            [options]
20585              */
20586             function activate(event, prefix, options) {
20587
20588                 // only one drag operation may be active, at a time
20589                 if (context) {
20590                     cancel(false);
20591                 }
20592
20593                 options = assign({}, defaultOptions, options || {});
20594
20595                 var data = options.data || {},
20596                     originalEvent,
20597                     start;
20598
20599                 if (event) {
20600                     originalEvent = Event.getOriginal(event) || event;
20601                     start = Event.toPoint(event);
20602
20603                     suppressEvent(event);
20604                 } else {
20605                     originalEvent = null;
20606                     start = {
20607                         x: 0,
20608                         y: 0
20609                     };
20610                 }
20611
20612                 context = assign({
20613                     prefix: prefix,
20614                     data: data,
20615                     payload: {},
20616                     start: start
20617                 }, options);
20618
20619                 // skip dom registration if trigger
20620                 // is set to manual (during testing)
20621                 if (!options.manual) {
20622
20623                     // add dom listeners
20624
20625                     // fixes TouchEvent not being available on desktop Firefox
20626                     if (typeof TouchEvent !== 'undefined' && originalEvent instanceof TouchEvent) {
20627                         domEvent.bind(document, 'touchstart', trapTouch, true);
20628                         domEvent.bind(document, 'touchcancel', cancel, true);
20629                         domEvent.bind(document, 'touchmove', move, true);
20630                         domEvent.bind(document, 'touchend', end, true);
20631                     } else {
20632                         // assume we use the mouse to interact per default
20633                         domEvent.bind(document, 'mousemove', move);
20634
20635                         domEvent.bind(document, 'mousedown', trapClickAndEnd, true);
20636                         domEvent.bind(document, 'mouseup', trapClickAndEnd, true);
20637                     }
20638
20639                     domEvent.bind(document, 'keyup', checkCancel);
20640
20641                     eventBus.on('element.hover', hover);
20642                     eventBus.on('element.out', out);
20643                 }
20644
20645                 fire('activate');
20646
20647                 if (options.autoActivate) {
20648                     move(event, true);
20649                 }
20650             }
20651
20652             // cancel on diagram destruction
20653             eventBus.on('diagram.destroy', cancel);
20654
20655
20656             // API
20657
20658             this.activate = activate;
20659             this.move = move;
20660             this.hover = hover;
20661             this.out = out;
20662             this.end = end;
20663
20664             this.cancel = cancel;
20665
20666             // for introspection
20667
20668             this.active = function() {
20669                 return context;
20670             };
20671
20672             this.setOptions = function(options) {
20673                 assign(defaultOptions, options);
20674             };
20675         }
20676
20677         Dragging.$inject = ['eventBus', 'canvas', 'selection'];
20678
20679         module.exports = Dragging;
20680     }, {
20681         "../../core/EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
20682         "../../util/ClickTrap": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js",
20683         "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
20684         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
20685         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
20686         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
20687     }],
20688     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js": [function(require, module, exports) {
20689         module.exports = {
20690             __depends__: [
20691                 require('../selection')
20692             ],
20693             dragging: ['type', require('./Dragging')]
20694         };
20695     }, {
20696         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
20697         "./Dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\Dragging.js"
20698     }],
20699     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\InteractionEvents.js": [function(require, module, exports) {
20700         'use strict';
20701
20702         var forEach = require('lodash/collection/forEach'),
20703             domDelegate = require('min-dom/lib/delegate'),
20704             Renderer = require('../../draw/Renderer'),
20705             createLine = Renderer.createLine,
20706             updateLine = Renderer.updateLine;
20707
20708
20709         var isPrimaryButton = require('../../util/Mouse').isPrimaryButton;
20710
20711         var Snap = require('../../../vendor/snapsvg');
20712
20713         /**
20714          * A plugin that provides interaction events for diagram elements.
20715          * 
20716          * It emits the following events:
20717          *  * element.hover * element.out * element.click * element.dblclick *
20718          * element.mousedown
20719          * 
20720          * Each event is a tuple { element, gfx, originalEvent }.
20721          * 
20722          * Canceling the event via Event#preventDefault() prevents the original DOM
20723          * operation.
20724          * 
20725          * @param {EventBus}
20726          *            eventBus
20727          */
20728         function InteractionEvents(eventBus, elementRegistry, styles) {
20729
20730             var HIT_STYLE = styles.cls('djs-hit', ['no-fill', 'no-border'], {
20731                 stroke: 'white',
20732                 strokeWidth: 15
20733             });
20734
20735             function fire(type, event) {
20736                 var target = event.delegateTarget || event.target,
20737                     gfx = target && new Snap(target),
20738                     element = elementRegistry.get(gfx),
20739                     returnValue;
20740
20741                 if (!gfx || !element) {
20742                     return;
20743                 }
20744
20745                 returnValue = eventBus.fire(type, {
20746                     element: element,
20747                     gfx: gfx,
20748                     originalEvent: event
20749                 });
20750
20751                 if (returnValue === false) {
20752                     event.stopPropagation();
20753                     event.preventDefault();
20754                 }
20755             }
20756
20757             var handlers = {};
20758
20759             function mouseHandler(type) {
20760
20761                 var fn = handlers[type];
20762
20763                 if (!fn) {
20764                     fn = handlers[type] = function(event) {
20765                         // only indicate left mouse button interactions
20766                         if (isPrimaryButton(event)) {
20767                             fire(type, event);
20768                         }
20769                     };
20770                 }
20771
20772                 return fn;
20773             }
20774
20775             var bindings = {
20776                 mouseover: 'element.hover',
20777                 mouseout: 'element.out',
20778                 click: 'element.click',
20779                 dblclick: 'element.dblclick',
20780                 mousedown: 'element.mousedown',
20781                 mouseup: 'element.mouseup',
20782                 keydown: 'element.keyup'
20783
20784             };
20785
20786             var elementSelector = 'svg, .djs-element';
20787
20788             // /// event registration
20789
20790             function registerEvent(node, event, localEvent) {
20791                 var handler = mouseHandler(localEvent);
20792                 handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);
20793             }
20794
20795             function unregisterEvent(node, event, localEvent) {
20796                 domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);
20797             }
20798
20799             function registerEvents(svg) {
20800                 forEach(bindings, function(val, key) {
20801                     registerEvent(svg.node, key, val);
20802                 });
20803             }
20804
20805             function unregisterEvents(svg) {
20806                 forEach(bindings, function(val, key) {
20807                     unregisterEvent(svg.node, key, val);
20808                 });
20809             }
20810
20811             eventBus.on('canvas.destroy', function(event) {
20812                 unregisterEvents(event.svg);
20813             });
20814
20815             eventBus.on('canvas.init', function(event) {
20816                 registerEvents(event.svg);
20817             });
20818
20819
20820             eventBus.on(['shape.added', 'connection.added'], function(event) {
20821                 var element = event.element,
20822                     gfx = event.gfx,
20823                     hit,
20824                     type;
20825
20826                 if (element.waypoints) {
20827                     hit = createLine(element.waypoints);
20828                     type = 'connection';
20829                 } else {
20830                     hit = Snap.create('rect', {
20831                         x: 0,
20832                         y: 0,
20833                         width: element.width,
20834                         height: element.height
20835                     });
20836                     type = 'shape';
20837                 }
20838
20839                 hit.attr(HIT_STYLE).appendTo(gfx.node);
20840             });
20841
20842             // update djs-hit on change
20843
20844             eventBus.on('shape.changed', function(event) {
20845
20846                 var element = event.element,
20847                     gfx = event.gfx,
20848                     hit = gfx.select('.djs-hit');
20849
20850                 hit.attr({
20851                     width: element.width,
20852                     height: element.height
20853                 });
20854             });
20855
20856             eventBus.on('connection.changed', function(event) {
20857
20858                 var element = event.element,
20859                     gfx = event.gfx,
20860                     hit = gfx.select('.djs-hit');
20861
20862                 updateLine(hit, element.waypoints);
20863             });
20864
20865
20866             // API
20867
20868             this.fire = fire;
20869
20870             this.mouseHandler = mouseHandler;
20871
20872             this.registerEvent = registerEvent;
20873             this.unregisterEvent = unregisterEvent;
20874         }
20875
20876
20877         InteractionEvents.$inject = ['eventBus', 'elementRegistry', 'styles'];
20878
20879         module.exports = InteractionEvents;
20880
20881
20882         /**
20883          * An event indicating that the mouse hovered over an element
20884          * 
20885          * @event element.hover
20886          * 
20887          * @type {Object}
20888          * @property {djs.model.Base} element
20889          * @property {Snap<Element>} gfx
20890          * @property {Event} originalEvent
20891          */
20892
20893         /**
20894          * An event indicating that the mouse has left an element
20895          * 
20896          * @event element.out
20897          * 
20898          * @type {Object}
20899          * @property {djs.model.Base} element
20900          * @property {Snap<Element>} gfx
20901          * @property {Event} originalEvent
20902          */
20903
20904         /**
20905          * An event indicating that the mouse has clicked an element
20906          * 
20907          * @event element.click
20908          * 
20909          * @type {Object}
20910          * @property {djs.model.Base} element
20911          * @property {Snap<Element>} gfx
20912          * @property {Event} originalEvent
20913          */
20914
20915         /**
20916          * An event indicating that the mouse has double clicked an element
20917          * 
20918          * @event element.dblclick
20919          * 
20920          * @type {Object}
20921          * @property {djs.model.Base} element
20922          * @property {Snap<Element>} gfx
20923          * @property {Event} originalEvent
20924          */
20925
20926         /**
20927          * An event indicating that the mouse has gone down on an element.
20928          * 
20929          * @event element.mousedown
20930          * 
20931          * @type {Object}
20932          * @property {djs.model.Base} element
20933          * @property {Snap<Element>} gfx
20934          * @property {Event} originalEvent
20935          */
20936
20937         /**
20938          * An event indicating that the mouse has gone up on an element.
20939          * 
20940          * @event element.mouseup
20941          * 
20942          * @type {Object}
20943          * @property {djs.model.Base} element
20944          * @property {Snap<Element>} gfx
20945          * @property {Event} originalEvent
20946          */
20947     }, {
20948         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
20949         "../../draw/Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
20950         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
20951         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
20952         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js"
20953     }],
20954     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js": [function(require, module, exports) {
20955         module.exports = {
20956             __init__: ['interactionEvents'],
20957             interactionEvents: ['type', require('./InteractionEvents')]
20958         };
20959     }, {
20960         "./InteractionEvents": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\InteractionEvents.js"
20961     }],
20962     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\Keyboard.js": [function(require, module, exports) {
20963         'use strict';
20964
20965         var domEvent = require('min-dom/lib/event'),
20966             domMatches = require('min-dom/lib/matches');
20967         //keyboard.bindTo=DOMElement;
20968        // var $ = require('jquery'),
20969        
20970        
20971         
20972         
20973         /**
20974          * A keyboard abstraction that may be activated and
20975          * deactivated by users at will, consuming key events
20976          * and triggering diagram actions.
20977          *
20978          * The implementation fires the following key events that allow
20979          * other components to hook into key handling:
20980          *
20981          *  - keyboard.bind
20982          *  - keyboard.unbind
20983          *  - keyboard.init
20984          *  - keyboard.destroy
20985          *
20986          * All events contain the fields (node, listeners).
20987          *
20988          * A default binding for the keyboard may be specified via the
20989          * `keyboard.bindTo` configuration option.
20990          *
20991          * @param {EventBus} eventBus
20992          * @param {CommandStack} commandStack
20993          * @param {Modeling} modeling
20994          * @param {Selection} selection
20995          * 
20996          */
20997         
20998         function Keyboard(config, eventBus, commandStack, modeling, selection, zoomScroll, canvas) {
20999           
21000           $(document).keydown(function(e){
21001                   if(commandStack._selectedModel == selected_model){
21002                           if(commandStack._eventBus._listeners != null){
21003                                   
21004                                   var model_commandStack = [];
21005                                   for(var i = 0; i < commandStackList.length; i++){
21006                                           if(commandStackList[i]._selectedModel == selected_model){
21007                                                   if(commandStackList[i]._stack.length > 0){
21008                                                           model_commandStack.push(commandStackList[i]); 
21009                                                   }
21010                                           }
21011                                   }
21012                                   
21013                                   var selected_commandStack;
21014                                   for(var i = model_commandStack.length-1; i >= 0; i--){
21015                                           if(model_commandStack[i]._stackIdx > -1){
21016                                                   selected_commandStack = model_commandStack[i];
21017                                                   break;
21018                                           }
21019                                   }
21020                                   
21021                                if(e.which == 90 && e.ctrlKey){
21022                                    if(commandStack == selected_commandStack){
21023                                                    commandStack.undo();
21024                                                    return true;
21025                                    }
21026                                    } else if(e.which == 89 && e.ctrlKey){
21027                                            commandStack.redo();
21028                                            return true;
21029                                    } 
21030                           }
21031                         
21032                         
21033                   }
21034                         
21035
21036                 });
21037                 
21038           var self = this;
21039
21040           this._commandStack = commandStack;
21041           this._modeling = modeling;
21042           this._selection = selection;
21043           this._eventBus = eventBus;
21044           this._zoomScroll = zoomScroll;
21045           this._canvas = canvas;
21046
21047           this._listeners = [];
21048
21049           // our key handler is a singleton that passes
21050           // (keycode, modifiers) to each listener.
21051           //
21052           // listeners must indicate that they handled a key event
21053           // by returning true. This stops the event propagation.
21054           //
21055           this._keyHandler = function(event) {
21056
21057             var i, l,
21058                 target = event.target,
21059                 listeners = self._listeners,
21060                 code = event.keyCode || event.charCode || -1;
21061
21062             if (domMatches(target, 'input, textarea')) {
21063               return;
21064             }
21065
21066             for (i = 0; !!(l = listeners[i]); i++) {
21067               if (l(code, event)) {
21068                 event.preventDefault();
21069                 event.stopPropagation();
21070               }
21071             }
21072           };
21073
21074           // properly clean dom registrations
21075           eventBus.on('diagram.destroy', function() {
21076             self._fire('destroy');
21077
21078             self.unbind();
21079             self._listeners = null;
21080           });
21081
21082           eventBus.on('diagram.init', function() {
21083             self._fire('init');
21084
21085             if (config && config.bindTo) {
21086               self.bind(config.bindTo);
21087             }
21088           });
21089
21090           this._init();
21091         }
21092
21093         Keyboard.$inject = [
21094           'config.keyboard',
21095           'eventBus',
21096           'commandStack',
21097           'modeling',
21098           'selection',
21099           'zoomScroll',
21100           'canvas'];
21101
21102         module.exports = Keyboard;
21103
21104
21105         Keyboard.prototype.bind = function(node) {
21106           this._node = node;
21107
21108           // bind key events
21109           domEvent.bind(node, 'keydown', this._keyHandler, true);
21110
21111           this._fire('bind');
21112         };
21113
21114         Keyboard.prototype.getBinding = function() {
21115           return this._node;
21116         };
21117
21118         Keyboard.prototype.unbind = function() {
21119           var node = this._node;
21120
21121           if (node) {
21122             this._fire('unbind');
21123
21124             // unbind key events
21125             domEvent.unbind(node, 'keydown', this._keyHandler, true);
21126           }
21127
21128           this._node = null;
21129         };
21130
21131
21132         Keyboard.prototype._fire = function(event) {
21133           this._eventBus.fire('keyboard.' + event, { node: this._node, listeners: this._listeners });
21134           
21135           
21136         };
21137       
21138
21139         
21140         Keyboard.prototype._init = function() {
21141
21142           var listeners = this._listeners,
21143               commandStack = this._commandStack,
21144               modeling = this._modeling,
21145               selection = this._selection,
21146               zoomScroll = this._zoomScroll,
21147               canvas = this._canvas;
21148           
21149           // init default listeners
21150
21151           // undo
21152           // (CTRL|CMD) + Z
21153           function undo(key, modifiers) {
21154                   
21155             if (isCmd(modifiers) && !isShift(modifiers) && key === 90) {
21156               commandStack.undo();
21157
21158               return true;
21159             }
21160           }
21161
21162           // redo
21163           // CTRL + Y
21164           // CMD + SHIFT + Z
21165           function redo(key, modifiers) {
21166
21167             if (isCmd(modifiers) && (key === 89 || (key === 90 && isShift(modifiers)))) {
21168               commandStack.redo();
21169
21170               return true;
21171             }
21172           }
21173
21174           /**
21175            * zoom in one step
21176            * CTRL + +
21177            *
21178            * 107 = numpad plus
21179            * 187 = regular plus
21180            * 171 = regular plus in Firefox (german keyboard layout)
21181            *  61 = regular plus in Firefox (US keyboard layout)
21182            */
21183           function zoomIn(key, modifiers) {
21184
21185             if ((key === 107 || key === 187 || key === 171 || key === 61) && isCmd(modifiers)) {
21186
21187               zoomScroll.stepZoom(1);
21188
21189               return true;
21190             }
21191           }
21192
21193           /**
21194            * zoom out one step
21195            * CTRL + -
21196            *
21197            * 109 = numpad minus
21198            * 189 = regular minus
21199            * 173 = regular minus in Firefox (US and german keyboard layout)
21200            */
21201           function zoomOut(key, modifiers) {
21202
21203             if ((key === 109 || key === 189 || key === 173)  && isCmd(modifiers)) {
21204
21205               zoomScroll.stepZoom(-1);
21206
21207               return true;
21208             }
21209           }
21210
21211           /**
21212            * zoom to the default level
21213            * CTRL + 0
21214            *
21215            * 96 = numpad zero
21216            * 48 = regular zero
21217            */
21218           function zoomDefault(key, modifiers) {
21219
21220             if ((key === 96 || key === 48) && isCmd(modifiers)) {
21221
21222               canvas.zoom(1);
21223
21224               return true;
21225             }
21226           }
21227
21228           // delete selected element
21229           // DEL
21230           function remove(key, modifiers) {
21231
21232             if (key === 46) {
21233
21234               var selectedElements = selection.get();
21235               console.log(selectedElements);
21236               if (selectedElements.length) {
21237                 modeling.removeElements(selectedElements.slice());
21238               }
21239
21240               return true;
21241             }
21242           }
21243
21244           listeners.push(undo);
21245           listeners.push(redo);
21246           listeners.push(remove);
21247           listeners.push(zoomIn);
21248           listeners.push(zoomOut);
21249           listeners.push(zoomDefault);
21250         };
21251
21252
21253         /**
21254          * Add a listener function that is notified with (key, modifiers) whenever
21255          * the keyboard is bound and the user presses a key.
21256          *
21257          * @param {Function} listenerFn
21258          */
21259         Keyboard.prototype.addListener = function(listenerFn) {
21260                 
21261           this._listeners.push(listenerFn);
21262         };
21263
21264         Keyboard.prototype.hasModifier = hasModifier;
21265         Keyboard.prototype.isCmd = isCmd;
21266         Keyboard.prototype.isShift = isShift;
21267
21268
21269         function hasModifier(modifiers) {
21270           return (modifiers.ctrlKey || modifiers.metaKey || modifiers.shiftKey || modifiers.altKey);
21271         }
21272
21273         function isCmd(modifiers) {
21274           return modifiers.ctrlKey || modifiers.metaKey;
21275         }
21276
21277         function isShift(modifiers) {
21278           return modifiers.shiftKey;
21279         }
21280
21281     }, {
21282         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
21283         "min-dom/lib/matches": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js"
21284     }],
21285     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\index.js": [function(require, module, exports) {
21286         module.exports = {
21287             __init__: ['keyboard'],
21288             keyboard: ['type', require('./Keyboard')]
21289         };
21290
21291     }, {
21292         "./Keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\Keyboard.js"
21293     }],
21294     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\LassoTool.js": [function(require, module, exports) {
21295         'use strict';
21296
21297         var values = require('lodash/object/values');
21298
21299         var getEnclosedElements = require('../../util/Elements').getEnclosedElements;
21300
21301         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
21302
21303         var Snap = require('../../../vendor/snapsvg');
21304
21305
21306         function LassoTool(eventBus, canvas, dragging, elementRegistry, selection) {
21307
21308             this._selection = selection;
21309             this._dragging = dragging;
21310
21311             var self = this;
21312
21313             // lasso visuals implementation
21314
21315             /**
21316              * A helper that realizes the selection box visual
21317              */
21318             var visuals = {
21319
21320                 create: function(context) {
21321                     var container = canvas.getDefaultLayer(),
21322                         frame;
21323
21324                     frame = context.frame = Snap.create('rect', {
21325                         class: 'djs-lasso-overlay',
21326                         width: 1,
21327                         height: 1,
21328                         x: 0,
21329                         y: 0
21330                     });
21331
21332                     frame.appendTo(container);
21333                 },
21334
21335                 update: function(context) {
21336                     var frame = context.frame,
21337                         bbox = context.bbox;
21338
21339                     frame.attr({
21340                         x: bbox.x,
21341                         y: bbox.y,
21342                         width: bbox.width,
21343                         height: bbox.height
21344                     });
21345                 },
21346
21347                 remove: function(context) {
21348
21349                     if (context.frame) {
21350                         context.frame.remove();
21351                     }
21352                 }
21353             };
21354
21355
21356             eventBus.on('lasso.selection.end', function(event) {
21357
21358                 setTimeout(function() {
21359                     self.activateLasso(event.originalEvent, true);
21360                 });
21361             });
21362
21363             // lasso interaction implementation
21364
21365             eventBus.on('lasso.end', function(event) {
21366
21367                 var bbox = toBBox(event);
21368
21369                 var elements = elementRegistry.filter(function(element) {
21370                     return element;
21371                 });
21372
21373                 self.select(elements, bbox);
21374             });
21375
21376             eventBus.on('lasso.start', function(event) {
21377
21378                 var context = event.context;
21379
21380                 context.bbox = toBBox(event);
21381                 visuals.create(context);
21382             });
21383
21384             eventBus.on('lasso.move', function(event) {
21385
21386                 var context = event.context;
21387
21388                 context.bbox = toBBox(event);
21389                 visuals.update(context);
21390             });
21391
21392             eventBus.on('lasso.end', function(event) {
21393
21394                 var context = event.context;
21395
21396                 visuals.remove(context);
21397             });
21398
21399             eventBus.on('lasso.cleanup', function(event) {
21400
21401                 var context = event.context;
21402
21403                 visuals.remove(context);
21404             });
21405
21406
21407             // event integration
21408
21409             eventBus.on('element.mousedown', 1500, function(event) {
21410
21411                 if (hasPrimaryModifier(event)) {
21412                     self.activateLasso(event.originalEvent);
21413
21414                     event.stopPropagation();
21415                 }
21416             });
21417         }
21418
21419         LassoTool.$inject = [
21420             'eventBus',
21421             'canvas',
21422             'dragging',
21423             'elementRegistry',
21424             'selection'
21425         ];
21426
21427         module.exports = LassoTool;
21428
21429
21430         LassoTool.prototype.activateLasso = function(event, autoActivate) {
21431
21432             this._dragging.activate(event, 'lasso', {
21433                 autoActivate: autoActivate,
21434                 cursor: 'crosshair',
21435                 data: {
21436                     context: {}
21437                 }
21438             });
21439         };
21440
21441         LassoTool.prototype.activateSelection = function(event) {
21442
21443             this._dragging.activate(event, 'lasso.selection', {
21444                 cursor: 'crosshair'
21445             });
21446         };
21447
21448         LassoTool.prototype.select = function(elements, bbox) {
21449             var selectedElements = getEnclosedElements(elements, bbox);
21450
21451             this._selection.select(values(selectedElements));
21452         };
21453
21454
21455         function toBBox(event) {
21456
21457             var start = {
21458
21459                 x: event.x - event.dx,
21460                 y: event.y - event.dy
21461             };
21462
21463             var end = {
21464                 x: event.x,
21465                 y: event.y
21466             };
21467
21468             var bbox;
21469
21470             if ((start.x <= end.x && start.y < end.y) ||
21471                 (start.x < end.x && start.y <= end.y)) {
21472
21473                 bbox = {
21474                     x: start.x,
21475                     y: start.y,
21476                     width: end.x - start.x,
21477                     height: end.y - start.y
21478                 };
21479             } else if ((start.x >= end.x && start.y < end.y) ||
21480                 (start.x > end.x && start.y <= end.y)) {
21481
21482                 bbox = {
21483                     x: end.x,
21484                     y: start.y,
21485                     width: start.x - end.x,
21486                     height: end.y - start.y
21487                 };
21488             } else if ((start.x <= end.x && start.y > end.y) ||
21489                 (start.x < end.x && start.y >= end.y)) {
21490
21491                 bbox = {
21492                     x: start.x,
21493                     y: end.y,
21494                     width: end.x - start.x,
21495                     height: start.y - end.y
21496                 };
21497             } else if ((start.x >= end.x && start.y > end.y) ||
21498                 (start.x > end.x && start.y >= end.y)) {
21499
21500                 bbox = {
21501                     x: end.x,
21502                     y: end.y,
21503                     width: start.x - end.x,
21504                     height: start.y - end.y
21505                 };
21506             } else {
21507
21508                 bbox = {
21509                     x: end.x,
21510                     y: end.y,
21511                     width: 0,
21512                     height: 0
21513                 };
21514             }
21515             return bbox;
21516         }
21517     }, {
21518         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
21519         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
21520         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
21521         "lodash/object/values": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js"
21522     }],
21523     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\index.js": [function(require, module, exports) {
21524         'use strict';
21525
21526         module.exports = {
21527             __init__: ['lassoTool'],
21528             lassoTool: ['type', require('./LassoTool')]
21529         };
21530
21531     }, {
21532         "./LassoTool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\LassoTool.js"
21533     }],
21534     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js": [function(require, module, exports) {
21535         'use strict';
21536
21537         var forEach = require('lodash/collection/forEach');
21538
21539         var model = require('../../model');
21540
21541
21542         /**
21543          * The basic modeling entry point.
21544          * 
21545          * @param {EventBus}
21546          *            eventBus
21547          * @param {ElementFactory}
21548          *            elementFactory
21549          * @param {CommandStack}
21550          *            commandStack
21551          */
21552         function Modeling(eventBus, elementFactory, commandStack) {
21553             this._eventBus = eventBus;
21554             this._elementFactory = elementFactory;
21555             this._commandStack = commandStack;
21556             var self = this;
21557
21558             eventBus.on('diagram.init', function() {
21559                 // register modeling handlers
21560                 self.registerHandlers(commandStack);
21561             });
21562         }
21563
21564         Modeling.$inject = ['eventBus', 'elementFactory', 'commandStack'];
21565
21566         module.exports = Modeling;
21567
21568
21569         Modeling.prototype.getHandlers = function() {
21570             return {
21571                 'shape.append': require('./cmd/AppendShapeHandler'),
21572                 'shape.create': require('./cmd/CreateShapeHandler'),
21573                 'shape.delete': require('./cmd/DeleteShapeHandler'),
21574                 'shape.move': require('./cmd/MoveShapeHandler'),
21575                 'shapes.move': require('./cmd/MoveShapesHandler'),
21576                 'shape.resize': require('./cmd/ResizeShapeHandler'),
21577                 'shape.replace': require('./cmd/ReplaceShapeHandler'),
21578
21579                 'spaceTool': require('./cmd/SpaceToolHandler'),
21580
21581                 'label.create': require('./cmd/CreateLabelHandler'),
21582
21583                 'connection.create': require('./cmd/CreateConnectionHandler'),
21584                 'connection.delete': require('./cmd/DeleteConnectionHandler'),
21585                 'connection.move': require('./cmd/MoveConnectionHandler'),
21586                 'connection.layout': require('./cmd/LayoutConnectionHandler'),
21587
21588                 'connection.updateWaypoints': require('./cmd/UpdateWaypointsHandler'),
21589
21590                 'connection.reconnectStart': require('./cmd/ReconnectConnectionHandler'),
21591                 'connection.reconnectEnd': require('./cmd/ReconnectConnectionHandler'),
21592
21593                 'elements.delete': require('./cmd/DeleteElementsHandler'),
21594                 'element.updateAnchors': require('./cmd/UpdateAnchorsHandler')
21595             };
21596         };
21597
21598         /**
21599          * Register handlers with the command stack
21600          * 
21601          * @param {CommandStack}
21602          *            commandStack
21603          */
21604         Modeling.prototype.registerHandlers = function(commandStack) {
21605             forEach(this.getHandlers(), function(handler, id) {
21606                 commandStack.registerHandler(id, handler);
21607             });
21608         };
21609
21610
21611         // /// modeling helpers /////////////////////////////////////////
21612
21613
21614         Modeling.prototype.moveShape = function(shape, delta, newParent, hints) {
21615
21616             var context = {
21617                 shape: shape,
21618                 delta: delta,
21619                 newParent: newParent,
21620                 hints: hints || {}
21621             };
21622
21623             this._commandStack.execute('shape.move', context);
21624         };
21625
21626
21627         Modeling.prototype.moveShapes = function(shapes, delta, newParent, hints) {
21628
21629             var context = {
21630                 shapes: shapes,
21631                 delta: delta,
21632                 newParent: newParent,
21633                 hints: hints || {}
21634             };
21635
21636             this._commandStack.execute('shapes.move', context);
21637         };
21638
21639         /**
21640          * Update the anchors on the element with the given delta movement
21641          * 
21642          * @param {djs.model.Element}
21643          *            element
21644          * @param {Point}
21645          *            delta
21646          */
21647         Modeling.prototype.updateAnchors = function(element, delta) {
21648             var context = {
21649                 element: element,
21650                 delta: delta
21651             };
21652
21653             this._commandStack.execute('element.updateAnchors', context);
21654         };
21655
21656         Modeling.prototype.moveConnection = function(connection, delta, newParent, hints) {
21657
21658             var context = {
21659                 connection: connection,
21660                 delta: delta,
21661                 newParent: newParent,
21662                 hints: hints || {}
21663             };
21664
21665             this._commandStack.execute('connection.move', context);
21666         };
21667
21668
21669         Modeling.prototype.layoutConnection = function(connection, hints) {
21670
21671             var context = {
21672                 connection: connection,
21673                 hints: hints || {}
21674             };
21675
21676             this._commandStack.execute('connection.layout', context);
21677         };
21678
21679
21680         Modeling.prototype.createConnection = function(source, target, connection, parent) {
21681
21682             connection = this._create('connection', connection);
21683
21684             var context = {
21685                 source: source,
21686                 target: target,
21687                 parent: parent,
21688                 connection: connection
21689             };
21690
21691             this._commandStack.execute('connection.create', context);
21692
21693             return context.connection;
21694         };
21695
21696         Modeling.prototype.createShape = function(shape, position, parent) {
21697
21698             shape = this._create('shape', shape);
21699
21700             var context = {
21701                 position: position,
21702                 parent: parent,
21703                 shape: shape
21704             };
21705
21706             this._commandStack.execute('shape.create', context);
21707
21708             return context.shape;
21709         };
21710
21711
21712         Modeling.prototype.createLabel = function(labelTarget, position, label, parent) {
21713
21714             label = this._create('label', label);
21715
21716             var context = {
21717                 labelTarget: labelTarget,
21718                 position: position,
21719                 parent: parent,
21720                 shape: label
21721             };
21722
21723             this._commandStack.execute('label.create', context);
21724
21725             return context.shape;
21726         };
21727
21728
21729         Modeling.prototype.appendShape = function(source, shape, position, parent, connection, connectionParent) {
21730
21731             shape = this._create('shape', shape);
21732
21733             var context = {
21734                 source: source,
21735                 position: position,
21736                 parent: parent,
21737                 shape: shape,
21738                 connection: connection,
21739                 connectionParent: connectionParent
21740             };
21741
21742             this._commandStack.execute('shape.append', context);
21743
21744             return context.shape;
21745         };
21746
21747
21748         Modeling.prototype.removeElements = function(elements) {
21749           console.log(elements);
21750             var context = {
21751                 elements: elements
21752             };
21753
21754             this._commandStack.execute('elements.delete', context);
21755         };
21756
21757
21758         Modeling.prototype.removeShape = function(shape) {
21759             var context = {
21760                 shape: shape
21761             };
21762
21763             this._commandStack.execute('shape.delete', context);
21764         };
21765
21766
21767         Modeling.prototype.removeConnection = function(connection) {
21768             var context = {
21769                 connection: connection
21770             };
21771
21772             this._commandStack.execute('connection.delete', context);
21773         };
21774
21775         Modeling.prototype.replaceShape = function(oldShape, newShape, options) {
21776             var context = {
21777                 oldShape: oldShape,
21778                 newData: newShape,
21779                 options: options
21780             };
21781
21782             this._commandStack.execute('shape.replace', context);
21783
21784             return context.newShape;
21785         };
21786
21787         Modeling.prototype.resizeShape = function(shape, newBounds) {
21788             var context = {
21789                 shape: shape,
21790                 newBounds: newBounds
21791             };
21792
21793             this._commandStack.execute('shape.resize', context);
21794         };
21795
21796         Modeling.prototype.createSpace = function(movingShapes, resizingShapes, delta, direction) {
21797             var context = {
21798                 movingShapes: movingShapes,
21799                 resizingShapes: resizingShapes,
21800                 delta: delta,
21801                 direction: direction
21802             };
21803
21804             this._commandStack.execute('spaceTool', context);
21805         };
21806
21807         Modeling.prototype.updateWaypoints = function(connection, newWaypoints) {
21808             var context = {
21809                 connection: connection,
21810                 newWaypoints: newWaypoints
21811             };
21812
21813             this._commandStack.execute('connection.updateWaypoints', context);
21814         };
21815
21816         Modeling.prototype.reconnectStart = function(connection, newSource, dockingPoint) {
21817             var context = {
21818                 connection: connection,
21819                 newSource: newSource,
21820                 dockingPoint: dockingPoint
21821             };
21822
21823             this._commandStack.execute('connection.reconnectStart', context);
21824         };
21825
21826         Modeling.prototype.reconnectEnd = function(connection, newTarget, dockingPoint) {
21827             var context = {
21828                 connection: connection,
21829                 newTarget: newTarget,
21830                 dockingPoint: dockingPoint
21831             };
21832
21833             this._commandStack.execute('connection.reconnectEnd', context);
21834         };
21835
21836         Modeling.prototype.connect = function(source, target, attrs) {
21837             return this.createConnection(source, target, attrs || {}, source.parent);
21838         };
21839
21840
21841         Modeling.prototype._create = function(type, attrs) {
21842             if (attrs instanceof model.Base) {
21843                 return attrs;
21844             } else {
21845                 return this._elementFactory.create(type, attrs);
21846             }
21847         };
21848
21849     }, {
21850         "../../model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js",
21851         "./cmd/AppendShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\AppendShapeHandler.js",
21852         "./cmd/CreateConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateConnectionHandler.js",
21853         "./cmd/CreateLabelHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateLabelHandler.js",
21854         "./cmd/CreateShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js",
21855         "./cmd/DeleteConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteConnectionHandler.js",
21856         "./cmd/DeleteElementsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteElementsHandler.js",
21857         "./cmd/DeleteShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteShapeHandler.js",
21858         "./cmd/LayoutConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\LayoutConnectionHandler.js",
21859         "./cmd/MoveConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveConnectionHandler.js",
21860         "./cmd/MoveShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapeHandler.js",
21861         "./cmd/MoveShapesHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapesHandler.js",
21862         "./cmd/ReconnectConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReconnectConnectionHandler.js",
21863         "./cmd/ReplaceShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReplaceShapeHandler.js",
21864         "./cmd/ResizeShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ResizeShapeHandler.js",
21865         "./cmd/SpaceToolHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\SpaceToolHandler.js",
21866         "./cmd/UpdateAnchorsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateAnchorsHandler.js",
21867         "./cmd/UpdateWaypointsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateWaypointsHandler.js",
21868         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
21869     }],
21870     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\AppendShapeHandler.js": [function(require, module, exports) {
21871         'use strict';
21872
21873         var inherits = require('inherits');
21874
21875
21876         /**
21877          * A handler that implements reversible appending of shapes to a source shape.
21878          * 
21879          * @param {canvas}
21880          *            Canvas
21881          * @param {elementFactory}
21882          *            ElementFactory
21883          * @param {modeling}
21884          *            Modeling
21885          */
21886         function AppendShapeHandler(modeling) {
21887             this._modeling = modeling;
21888         }
21889
21890         inherits(AppendShapeHandler, require('./NoopHandler'));
21891
21892
21893         AppendShapeHandler.$inject = ['modeling'];
21894
21895         module.exports = AppendShapeHandler;
21896
21897
21898         // //// api /////////////////////////////////////////////
21899
21900         /**
21901          * Creates a new shape
21902          * 
21903          * @param {Object}
21904          *            context
21905          * @param {ElementDescriptor}
21906          *            context.shape the new shape
21907          * @param {ElementDescriptor}
21908          *            context.source the source object
21909          * @param {ElementDescriptor}
21910          *            context.parent the parent object
21911          * @param {Point}
21912          *            context.position position of the new element
21913          */
21914         AppendShapeHandler.prototype.preExecute = function(context) {
21915
21916             if (!context.source) {
21917                 throw new Error('source required');
21918             }
21919
21920             var parent = context.parent || context.source.parent,
21921                 shape = this._modeling.createShape(context.shape, context.position, parent);
21922
21923             context.shape = shape;
21924         };
21925
21926         AppendShapeHandler.prototype.postExecute = function(context) {
21927             var parent = context.connectionParent || context.shape.parent;
21928
21929             // create connection
21930             this._modeling.connect(context.source, context.shape, context.connection, parent);
21931         };
21932     }, {
21933         "./NoopHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js",
21934         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
21935     }],
21936     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateConnectionHandler.js": [function(require, module, exports) {
21937         'use strict';
21938
21939
21940         function CreateConnectionHandler(canvas, layouter) {
21941             this._canvas = canvas;
21942             this._layouter = layouter;
21943         }
21944
21945         CreateConnectionHandler.$inject = ['canvas', 'layouter'];
21946
21947         module.exports = CreateConnectionHandler;
21948
21949
21950
21951         // //// api /////////////////////////////////////////
21952
21953         /**
21954          * Appends a shape to a target shape
21955          * 
21956          * @param {Object}
21957          *            context
21958          * @param {djs.element.Base}
21959          *            context.source the source object
21960          * @param {djs.element.Base}
21961          *            context.target the parent object
21962          * @param {Point}
21963          *            context.position position of the new element
21964          */
21965         CreateConnectionHandler.prototype.execute = function(context) {
21966
21967             var source = context.source,
21968                 target = context.target,
21969                 parent = context.parent;
21970
21971             if (!source || !target) {
21972                 throw new Error('source and target required');
21973             }
21974
21975             if (!parent) {
21976                 throw new Error('parent required');
21977             }
21978
21979             var connection = context.connection;
21980
21981             connection.source = source;
21982             connection.target = target;
21983
21984             if (!connection.waypoints) {
21985                 connection.waypoints = this._layouter.layoutConnection(connection);
21986             }
21987
21988             // add connection
21989             this._canvas.addConnection(connection, parent);
21990
21991             return connection;
21992         };
21993
21994         CreateConnectionHandler.prototype.revert = function(context) {
21995             var connection = context.connection;
21996
21997             this._canvas.removeConnection(connection);
21998
21999             connection.source = null;
22000             connection.target = null;
22001         };
22002     }, {}],
22003     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateLabelHandler.js": [function(require, module, exports) {
22004         'use strict';
22005
22006         var inherits = require('inherits');
22007
22008         var CreateShapeHandler = require('./CreateShapeHandler');
22009
22010
22011         /**
22012          * A handler that attaches a label to a given target shape.
22013          * 
22014          * @param {canvas}
22015          *            Canvas
22016          */
22017         function CreateLabelHandler(canvas) {
22018             CreateShapeHandler.call(this, canvas);
22019         }
22020
22021         inherits(CreateLabelHandler, CreateShapeHandler);
22022
22023         CreateLabelHandler.$inject = ['canvas'];
22024
22025         module.exports = CreateLabelHandler;
22026
22027
22028
22029         // //// api /////////////////////////////////////////
22030
22031
22032         /**
22033          * Appends a label to a target shape.
22034          * 
22035          * @method CreateLabelHandler#execute
22036          * 
22037          * @param {Object}
22038          *            context
22039          * @param {ElementDescriptor}
22040          *            context.target the element the label is attached to
22041          * @param {ElementDescriptor}
22042          *            context.parent the parent object
22043          * @param {Point}
22044          *            context.position position of the new element
22045          */
22046
22047         /**
22048          * Undo append by removing the shape
22049          */
22050         CreateLabelHandler.prototype.revert = function(context) {
22051             context.shape.labelTarget = null;
22052             this._canvas.removeShape(context.shape);
22053         };
22054
22055
22056         // //// helpers /////////////////////////////////////////
22057
22058         CreateLabelHandler.prototype.getParent = function(context) {
22059             return context.parent || context.labelTarget && context.labelTarget.parent;
22060         };
22061
22062         CreateLabelHandler.prototype.addElement = function(shape, parent, context) {
22063             shape.labelTarget = context.labelTarget;
22064             this._canvas.addShape(shape, parent, true);
22065         };
22066     }, {
22067         "./CreateShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js",
22068         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
22069     }],
22070     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js": [function(require, module, exports) {
22071         'use strict';
22072
22073         var assign = require('lodash/object/assign');
22074
22075
22076         /**
22077          * A handler that implements reversible addition of shapes.
22078          * 
22079          * @param {canvas}
22080          *            Canvas
22081          */
22082         function CreateShapeHandler(canvas) {
22083             this._canvas = canvas;
22084         }
22085
22086         CreateShapeHandler.$inject = ['canvas'];
22087
22088         module.exports = CreateShapeHandler;
22089
22090
22091
22092         // //// api /////////////////////////////////////////
22093
22094
22095         /**
22096          * Appends a shape to a target shape
22097          * 
22098          * @param {Object}
22099          *            context
22100          * @param {djs.model.Base}
22101          *            context.parent the parent object
22102          * @param {Point}
22103          *            context.position position of the new element
22104          */
22105         CreateShapeHandler.prototype.execute = function(context) {
22106
22107             var parent = this.getParent(context);
22108
22109             var shape = context.shape;
22110
22111             this.setPosition(shape, context);
22112
22113             this.addElement(shape, parent, context);
22114
22115             return shape;
22116         };
22117
22118
22119         /**
22120          * Undo append by removing the shape
22121          */
22122         CreateShapeHandler.prototype.revert = function(context) {
22123             this._canvas.removeShape(context.shape);
22124         };
22125
22126
22127         // //// helpers /////////////////////////////////////////
22128
22129         CreateShapeHandler.prototype.getParent = function(context) {
22130             var parent = context.parent;
22131
22132             if (!parent) {
22133                 throw new Error('parent required');
22134             }
22135
22136             return parent;
22137         };
22138
22139         CreateShapeHandler.prototype.getPosition = function(context) {
22140             if (!context.position) {
22141                 throw new Error('no position given');
22142             }
22143
22144             return context.position;
22145         };
22146
22147         CreateShapeHandler.prototype.addElement = function(shape, parent) {
22148             this._canvas.addShape(shape, parent);
22149         };
22150
22151         CreateShapeHandler.prototype.setPosition = function(shape, context) {
22152             var position = this.getPosition(context);
22153
22154             // update to center position
22155             // specified in create context
22156             assign(shape, {
22157                 x: position.x - shape.width / 2,
22158                 y: position.y - shape.height / 2
22159             });
22160         };
22161     }, {
22162         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22163     }],
22164     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteConnectionHandler.js": [function(require, module, exports) {
22165         'use strict';
22166
22167         var Collections = require('../../../util/Collections');
22168
22169
22170         /**
22171          * A handler that implements reversible deletion of Connections.
22172          * 
22173          */
22174         function DeleteConnectionHandler(canvas, modeling) {
22175             this._canvas = canvas;
22176             this._modeling = modeling;
22177         }
22178
22179         DeleteConnectionHandler.$inject = ['canvas', 'modeling'];
22180
22181         module.exports = DeleteConnectionHandler;
22182
22183
22184         /**
22185          * - Remove attached label
22186          */
22187         DeleteConnectionHandler.prototype.preExecute = function(context) {
22188
22189             var connection = context.connection;
22190
22191             // Remove label
22192             if (connection.label) {
22193                 this._modeling.removeShape(connection.label);
22194             }
22195         };
22196
22197         DeleteConnectionHandler.prototype.execute = function(context) {
22198
22199             var connection = context.connection,
22200                 parent = connection.parent;
22201
22202             context.parent = parent;
22203             context.parentIndex = Collections.indexOf(parent.children, connection);
22204
22205             context.source = connection.source;
22206             context.target = connection.target;
22207
22208             this._canvas.removeConnection(connection);
22209
22210             connection.source = null;
22211             connection.target = null;
22212             connection.label = null;
22213         };
22214
22215         /**
22216          * Command revert implementation.
22217          */
22218         DeleteConnectionHandler.prototype.revert = function(context) {
22219
22220             var connection = context.connection,
22221                 parent = context.parent,
22222                 parentIndex = context.parentIndex;
22223
22224             connection.source = context.source;
22225             connection.target = context.target;
22226
22227             // restore previous location in old parent
22228             Collections.add(parent.children, connection, parentIndex);
22229
22230             this._canvas.addConnection(connection, parent);
22231         };
22232
22233     }, {
22234         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
22235     }],
22236     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteElementsHandler.js": [function(require, module, exports) {
22237         'use strict';
22238
22239         var forEach = require('lodash/collection/forEach'),
22240             inherits = require('inherits');
22241
22242
22243         function DeleteElementsHandler(modeling, elementRegistry) {
22244             this._modeling = modeling;
22245             this._elementRegistry = elementRegistry;
22246         }
22247
22248         inherits(DeleteElementsHandler, require('./NoopHandler'));
22249
22250         DeleteElementsHandler.$inject = ['modeling', 'elementRegistry'];
22251
22252         module.exports = DeleteElementsHandler;
22253
22254
22255         DeleteElementsHandler.prototype.postExecute = function(context) {
22256
22257             var modeling = this._modeling,
22258                 elementRegistry = this._elementRegistry,
22259                 elements = context.elements;
22260
22261             forEach(elements, function(element) {
22262
22263                 // element may have been removed with previous
22264                 // remove operations already (e.g. in case of nesting)
22265                 if (!elementRegistry.get(element.id)) {
22266                     return;
22267                 }
22268
22269                 if (element.waypoints) {
22270                     modeling.removeConnection(element);
22271                 } else {
22272                     modeling.removeShape(element);
22273                 }
22274             });
22275         };
22276     }, {
22277         "./NoopHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js",
22278         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js",
22279         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22280     }],
22281     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteShapeHandler.js": [function(require, module, exports) {
22282         'use strict';
22283
22284         var Collections = require('../../../util/Collections');
22285
22286
22287         /**
22288          * A handler that implements reversible deletion of shapes.
22289          * 
22290          */
22291         function DeleteShapeHandler(canvas, modeling) {
22292             this._canvas = canvas;
22293             this._modeling = modeling;
22294         }
22295
22296         DeleteShapeHandler.$inject = ['canvas', 'modeling'];
22297
22298         module.exports = DeleteShapeHandler;
22299
22300
22301         /**
22302          * - Remove connections - Remove all direct children
22303          */
22304         DeleteShapeHandler.prototype.preExecute = function(context) {
22305
22306             var shape = context.shape,
22307                 label = shape.label,
22308                 modeling = this._modeling;
22309
22310             // Clean up on removeShape(label)
22311             if (shape.labelTarget) {
22312                 context.labelTarget = shape.labelTarget;
22313                 shape.labelTarget = null;
22314             }
22315
22316             // Remove label
22317             if (label) {
22318                 this._modeling.removeShape(label);
22319             }
22320
22321             // remove connections
22322             this._saveClear(shape.incoming, function(connection) {
22323                 // To make sure that the connection isn't removed twice
22324                 // For example if a container is removed
22325                 modeling.removeConnection(connection);
22326             });
22327
22328             this._saveClear(shape.outgoing, function(connection) {
22329                 modeling.removeConnection(connection);
22330             });
22331
22332
22333             // remove children
22334             this._saveClear(shape.children, function(e) {
22335                 modeling.removeShape(e);
22336             });
22337         };
22338
22339
22340         DeleteShapeHandler.prototype._saveClear = function(collection, remove) {
22341
22342             var e;
22343
22344             while (!!(e = collection[0])) {
22345                 remove(e);
22346             }
22347         };
22348
22349
22350         /**
22351          * Remove shape and remember the parent
22352          */
22353         DeleteShapeHandler.prototype.execute = function(context) {
22354
22355             var shape = context.shape,
22356                 parent = shape.parent;
22357
22358             context.parent = parent;
22359             context.parentIndex = Collections.indexOf(parent.children, shape);
22360
22361             shape.label = null;
22362
22363             this._canvas.removeShape(shape);
22364         };
22365
22366
22367         /**
22368          * Command revert implementation
22369          */
22370         DeleteShapeHandler.prototype.revert = function(context) {
22371
22372             var shape = context.shape,
22373                 parent = context.parent,
22374                 parentIndex = context.parentIndex,
22375                 labelTarget = context.labelTarget;
22376
22377             // restore previous location in old parent
22378             Collections.add(parent.children, shape, parentIndex);
22379
22380             if (labelTarget) {
22381                 labelTarget.label = shape;
22382             }
22383
22384             this._canvas.addShape(shape, parent);
22385         };
22386
22387     }, {
22388         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
22389     }],
22390     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\LayoutConnectionHandler.js": [function(require, module, exports) {
22391         'use strict';
22392
22393         var assign = require('lodash/object/assign');
22394
22395
22396         /**
22397          * A handler that implements reversible moving of shapes.
22398          */
22399         function LayoutConnectionHandler(layouter, canvas) {
22400             this._layouter = layouter;
22401             this._canvas = canvas;
22402         }
22403
22404         LayoutConnectionHandler.$inject = ['layouter', 'canvas'];
22405
22406         module.exports = LayoutConnectionHandler;
22407
22408         LayoutConnectionHandler.prototype.execute = function(context) {
22409
22410             var connection = context.connection,
22411                 parent = connection.parent,
22412                 connectionSiblings = parent.children;
22413
22414             var oldIndex = connectionSiblings.indexOf(connection);
22415
22416             assign(context, {
22417                 oldWaypoints: connection.waypoints,
22418                 oldIndex: oldIndex
22419             });
22420
22421             sendToFront(connection);
22422
22423             connection.waypoints = this._layouter.layoutConnection(connection, context.hints);
22424
22425             return connection;
22426         };
22427
22428         LayoutConnectionHandler.prototype.revert = function(context) {
22429
22430             var connection = context.connection,
22431                 parent = connection.parent,
22432                 connectionSiblings = parent.children,
22433                 currentIndex = connectionSiblings.indexOf(connection),
22434                 oldIndex = context.oldIndex;
22435
22436             connection.waypoints = context.oldWaypoints;
22437
22438             if (oldIndex !== currentIndex) {
22439
22440                 // change position of connection in shape
22441                 connectionSiblings.splice(currentIndex, 1);
22442                 connectionSiblings.splice(oldIndex, 0, connection);
22443             }
22444
22445             return connection;
22446         };
22447
22448         // connections should have a higher z-order as there source and targets
22449         function sendToFront(connection) {
22450
22451             var connectionSiblings = connection.parent.children;
22452
22453             var connectionIdx = connectionSiblings.indexOf(connection),
22454                 sourceIdx = findIndex(connectionSiblings, connection.source),
22455                 targetIdx = findIndex(connectionSiblings, connection.target),
22456
22457                 // ensure we do not send the connection back
22458                 // if it is already in front
22459                 insertIndex = Math.max(sourceIdx + 1, targetIdx + 1, connectionIdx);
22460
22461             if (connectionIdx < insertIndex) {
22462                 connectionSiblings.splice(insertIndex, 0, connection); // add to new
22463                 // position
22464                 connectionSiblings.splice(connectionIdx, 1); // remove from old position
22465             }
22466
22467             function findIndex(array, obj) {
22468
22469                 var index = array.indexOf(obj);
22470                 if (index < 0 && obj) {
22471                     var parent = obj.parent;
22472                     index = findIndex(array, parent);
22473                 }
22474                 return index;
22475             }
22476
22477             return insertIndex;
22478         }
22479
22480     }, {
22481         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22482     }],
22483     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveConnectionHandler.js": [function(require, module, exports) {
22484         'use strict';
22485
22486         var forEach = require('lodash/collection/forEach');
22487
22488         var Collections = require('../../../util/Collections');
22489
22490
22491         /**
22492          * A handler that implements reversible moving of connections.
22493          * 
22494          * The handler differs from the layout connection handler in a sense that it
22495          * preserves the connection layout.
22496          */
22497         function MoveConnectionHandler() {}
22498
22499         module.exports = MoveConnectionHandler;
22500
22501
22502         MoveConnectionHandler.prototype.execute = function(context) {
22503
22504             var updateAnchors = (context.hints.updateAnchors !== false);
22505
22506             var connection = context.connection,
22507                 delta = context.delta;
22508
22509             var newParent = this.getNewParent(connection, context),
22510                 oldParent = connection.parent;
22511
22512             // save old position + parent in context
22513             context.oldParent = oldParent;
22514             context.oldParentIndex = Collections.indexOf(oldParent.children, connection);
22515
22516             // update waypoint positions
22517             forEach(connection.waypoints, function(p) {
22518                 p.x += delta.x;
22519                 p.y += delta.y;
22520
22521                 if (updateAnchors && p.original) {
22522                     p.original.x += delta.x;
22523                     p.original.y += delta.y;
22524                 }
22525             });
22526
22527             // update parent
22528             connection.parent = newParent;
22529
22530             return connection;
22531         };
22532
22533         MoveConnectionHandler.prototype.revert = function(context) {
22534
22535             var updateAnchors = (context.hints.updateAnchors !== false);
22536
22537             var connection = context.connection,
22538                 oldParent = context.oldParent,
22539                 oldParentIndex = context.oldParentIndex,
22540                 delta = context.delta;
22541
22542             // restore previous location in old parent
22543             Collections.add(oldParent.children, connection, oldParentIndex);
22544
22545             // restore parent
22546             connection.parent = oldParent;
22547
22548             // revert to old waypoint positions
22549             forEach(connection.waypoints, function(p) {
22550                 p.x -= delta.x;
22551                 p.y -= delta.y;
22552
22553                 if (updateAnchors && p.original) {
22554                     p.original.x -= delta.x;
22555                     p.original.y -= delta.y;
22556                 }
22557             });
22558
22559             return connection;
22560         };
22561
22562
22563         MoveConnectionHandler.prototype.getNewParent = function(connection, context) {
22564             return context.newParent || connection.parent;
22565         };
22566
22567     }, {
22568         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
22569         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22570     }],
22571     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapeHandler.js": [function(require, module, exports) {
22572         'use strict';
22573
22574         var assign = require('lodash/object/assign'),
22575             forEach = require('lodash/collection/forEach');
22576
22577         var MoveHelper = require('./helper/MoveHelper'),
22578             Collections = require('../../../util/Collections');
22579
22580
22581         /**
22582          * A handler that implements reversible moving of shapes.
22583          */
22584         function MoveShapeHandler(modeling) {
22585             this._modeling = modeling;
22586
22587             this._helper = new MoveHelper(modeling);
22588         }
22589
22590         MoveShapeHandler.$inject = ['modeling'];
22591
22592         module.exports = MoveShapeHandler;
22593
22594
22595         MoveShapeHandler.prototype.execute = function(context) {
22596
22597             var shape = context.shape,
22598                 delta = context.delta,
22599                 newParent = this.getNewParent(context),
22600                 oldParent = shape.parent;
22601
22602             // save old parent in context
22603             context.oldParent = oldParent;
22604             context.oldParentIndex = Collections.indexOf(oldParent.children, shape);
22605
22606             // update shape parent + position
22607             assign(shape, {
22608                 parent: newParent,
22609                 x: shape.x + delta.x,
22610                 y: shape.y + delta.y
22611             });
22612
22613             return shape;
22614         };
22615
22616         MoveShapeHandler.prototype.postExecute = function(context) {
22617
22618             var shape = context.shape,
22619                 delta = context.delta;
22620
22621             var modeling = this._modeling;
22622
22623             if (context.hints.updateAnchors !== false) {
22624                 modeling.updateAnchors(shape, delta);
22625             }
22626
22627             if (context.hints.layout !== false) {
22628                 forEach(shape.incoming, function(c) {
22629                     modeling.layoutConnection(c, {
22630                         endChanged: true
22631                     });
22632                 });
22633
22634                 forEach(shape.outgoing, function(c) {
22635                     modeling.layoutConnection(c, {
22636                         startChanged: true
22637                     });
22638                 });
22639             }
22640
22641             if (context.hints.recurse !== false) {
22642                 this.moveChildren(context);
22643             }
22644         };
22645
22646         MoveShapeHandler.prototype.revert = function(context) {
22647
22648             var shape = context.shape,
22649                 oldParent = context.oldParent,
22650                 oldParentIndex = context.oldParentIndex,
22651                 delta = context.delta;
22652
22653             // restore previous location in old parent
22654             Collections.add(oldParent.children, shape, oldParentIndex);
22655
22656             // revert to old position and parent
22657             assign(shape, {
22658                 parent: oldParent,
22659                 x: shape.x - delta.x,
22660                 y: shape.y - delta.y
22661             });
22662
22663             return shape;
22664         };
22665
22666         MoveShapeHandler.prototype.moveChildren = function(context) {
22667
22668             var delta = context.delta,
22669                 shape = context.shape;
22670
22671             this._helper.moveRecursive(shape.children, delta, null);
22672         };
22673
22674         MoveShapeHandler.prototype.getNewParent = function(context) {
22675             return context.newParent || context.shape.parent;
22676         };
22677     }, {
22678         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
22679         "./helper/MoveHelper": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js",
22680         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22681         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22682     }],
22683     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapesHandler.js": [function(require, module, exports) {
22684         'use strict';
22685
22686         var MoveHelper = require('./helper/MoveHelper');
22687
22688
22689         /**
22690          * A handler that implements reversible moving of shapes.
22691          */
22692         function MoveShapesHandler(modeling) {
22693             this._helper = new MoveHelper(modeling);
22694         }
22695
22696         MoveShapesHandler.$inject = ['modeling'];
22697
22698         module.exports = MoveShapesHandler;
22699
22700         MoveShapesHandler.prototype.preExecute = function(context) {
22701             context.closure = this._helper.getClosure(context.shapes);
22702         };
22703
22704         MoveShapesHandler.prototype.postExecute = function(context) {
22705             this._helper.moveClosure(context.closure, context.delta, context.newParent);
22706         };
22707
22708
22709         MoveShapesHandler.prototype.execute = function(context) {};
22710         MoveShapesHandler.prototype.revert = function(context) {};
22711
22712     }, {
22713         "./helper/MoveHelper": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js"
22714     }],
22715     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js": [function(require, module, exports) {
22716         'use strict';
22717
22718         function NoopHandler() {}
22719
22720         module.exports = NoopHandler;
22721
22722         NoopHandler.prototype.execute = function() {};
22723         NoopHandler.prototype.revert = function() {};
22724     }, {}],
22725     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReconnectConnectionHandler.js": [function(require, module, exports) {
22726         'use strict';
22727
22728
22729         function ReconnectConnectionHandler(layouter) {}
22730
22731         ReconnectConnectionHandler.$inject = ['layouter'];
22732
22733         module.exports = ReconnectConnectionHandler;
22734
22735         ReconnectConnectionHandler.prototype.execute = function(context) {
22736
22737             var newSource = context.newSource,
22738                 newTarget = context.newTarget,
22739                 connection = context.connection;
22740
22741             if (!newSource && !newTarget) {
22742                 throw new Error('newSource or newTarget are required');
22743             }
22744
22745             if (newSource && newTarget) {
22746                 throw new Error('must specify either newSource or newTarget');
22747             }
22748
22749             if (newSource) {
22750                 context.oldSource = connection.source;
22751                 connection.source = newSource;
22752
22753                 context.oldDockingPoint = connection.waypoints[0];
22754                 connection.waypoints[0] = context.dockingPoint;
22755             }
22756
22757             if (newTarget) {
22758                 context.oldTarget = connection.target;
22759                 connection.target = newTarget;
22760
22761                 context.oldDockingPoint = connection.waypoints[connection.waypoints.length - 1];
22762                 connection.waypoints[connection.waypoints.length - 1] = context.dockingPoint;
22763             }
22764
22765             return connection;
22766         };
22767
22768         ReconnectConnectionHandler.prototype.revert = function(context) {
22769
22770             var newSource = context.newSource,
22771                 newTarget = context.newTarget,
22772                 connection = context.connection;
22773
22774             if (newSource) {
22775                 connection.source = context.oldSource;
22776                 connection.waypoints[0] = context.oldDockingPoint;
22777             }
22778
22779             if (newTarget) {
22780                 connection.target = context.oldTarget;
22781                 connection.waypoints[connection.waypoints.length - 1] = context.oldDockingPoint;
22782             }
22783
22784             return connection;
22785         };
22786     }, {}],
22787     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReplaceShapeHandler.js": [function(require, module, exports) {
22788         'use strict';
22789
22790         var forEach = require('lodash/collection/forEach');
22791
22792
22793         /**
22794          * A handler that implements reversible replacing of shapes. Internally the old
22795          * shape will be removed and the new shape will be added.
22796          * 
22797          * 
22798          * @class
22799          * @constructor
22800          * 
22801          * @param {canvas}
22802          *            Canvas
22803          */
22804         function ReplaceShapeHandler(modeling, rules) {
22805             this._modeling = modeling;
22806             this._rules = rules;
22807         }
22808
22809         ReplaceShapeHandler.$inject = ['modeling', 'rules'];
22810
22811         module.exports = ReplaceShapeHandler;
22812
22813
22814
22815         // //// api /////////////////////////////////////////
22816
22817
22818         /**
22819          * Replaces a shape with an replacement Element.
22820          * 
22821          * The newData object should contain type, x, y.
22822          * 
22823          * If possible also the incoming/outgoing connection will be restored.
22824          * 
22825          * @param {Object}
22826          *            context
22827          */
22828         ReplaceShapeHandler.prototype.preExecute = function(context) {
22829
22830             var modeling = this._modeling,
22831                 rules = this._rules;
22832
22833             var oldShape = context.oldShape,
22834                 newData = context.newData,
22835                 newShape;
22836
22837
22838             // (1) place a new shape at the given position
22839
22840             var position = {
22841                 x: newData.x,
22842                 y: newData.y
22843             };
22844
22845             newShape = context.newShape = context.newShape || modeling.createShape(newData, position, oldShape.parent);
22846
22847
22848             // (2) reconnect connections to the new shape (where allowed)
22849
22850             var incoming = oldShape.incoming.slice(),
22851                 outgoing = oldShape.outgoing.slice();
22852
22853             forEach(incoming, function(connection) {
22854                 var waypoints = connection.waypoints,
22855                     docking = waypoints[waypoints.length - 1],
22856                     allowed = rules.allowed('connection.reconnectEnd', {
22857                         source: connection.source,
22858                         target: newShape,
22859                         connection: connection
22860                     });
22861
22862                 if (allowed) {
22863                     modeling.reconnectEnd(connection, newShape, docking);
22864                 }
22865             });
22866
22867             forEach(outgoing, function(connection) {
22868                 var waypoints = connection.waypoints,
22869                     docking = waypoints[0],
22870                     allowed = rules.allowed('connection.reconnectStart', {
22871                         source: newShape,
22872                         target: connection.target,
22873                         connection: connection
22874                     });
22875
22876                 if (allowed) {
22877                     modeling.reconnectStart(connection, newShape, docking);
22878                 }
22879             });
22880         };
22881
22882
22883         ReplaceShapeHandler.prototype.postExecute = function(context) {
22884             var modeling = this._modeling;
22885
22886             var oldShape = context.oldShape;
22887
22888             modeling.removeShape(oldShape);
22889         };
22890
22891
22892         ReplaceShapeHandler.prototype.execute = function(context) {};
22893
22894         ReplaceShapeHandler.prototype.revert = function(context) {};
22895
22896     }, {
22897         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22898     }],
22899     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ResizeShapeHandler.js": [function(require, module, exports) {
22900         'use strict';
22901
22902         var assign = require('lodash/object/assign'),
22903             forEach = require('lodash/collection/forEach');
22904
22905
22906         /**
22907          * A handler that implements reversible resizing of shapes.
22908          * 
22909          */
22910         function ResizeShapeHandler(modeling) {
22911             this._modeling = modeling;
22912         }
22913
22914         ResizeShapeHandler.$inject = ['modeling'];
22915
22916         module.exports = ResizeShapeHandler;
22917
22918         /**
22919          * { shape: {....} newBounds: { width: 20, height: 40, x: 5, y: 10 }
22920          *  }
22921          */
22922         ResizeShapeHandler.prototype.execute = function(context) {
22923
22924             var shape = context.shape,
22925                 newBounds = context.newBounds;
22926
22927             if (newBounds.x === undefined || newBounds.y === undefined ||
22928                 newBounds.width === undefined || newBounds.height === undefined) {
22929                 throw new Error('newBounds must have {x, y, width, height} properties');
22930             }
22931
22932             if (newBounds.width < 10 || newBounds.height < 10) {
22933                 throw new Error('width and height cannot be less than 10px');
22934             }
22935
22936             // save old bbox in context
22937             context.oldBounds = {
22938                 width: shape.width,
22939                 height: shape.height,
22940                 x: shape.x,
22941                 y: shape.y
22942             };
22943
22944             // update shape
22945             assign(shape, {
22946                 width: newBounds.width,
22947                 height: newBounds.height,
22948                 x: newBounds.x,
22949                 y: newBounds.y
22950             });
22951
22952             return shape;
22953         };
22954
22955         ResizeShapeHandler.prototype.postExecute = function(context) {
22956
22957             var shape = context.shape;
22958
22959             var modeling = this._modeling;
22960
22961             forEach(shape.incoming, function(c) {
22962                 modeling.layoutConnection(c, {
22963                     endChanged: true
22964                 });
22965             });
22966
22967             forEach(shape.outgoing, function(c) {
22968                 modeling.layoutConnection(c, {
22969                     startChanged: true
22970                 });
22971             });
22972
22973         };
22974
22975         ResizeShapeHandler.prototype.revert = function(context) {
22976
22977             var shape = context.shape,
22978                 oldBounds = context.oldBounds;
22979
22980             // restore previous bbox
22981             assign(shape, {
22982                 width: oldBounds.width,
22983                 height: oldBounds.height,
22984                 x: oldBounds.x,
22985                 y: oldBounds.y
22986             });
22987
22988             return shape;
22989         };
22990
22991     }, {
22992         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22993         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22994     }],
22995     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\SpaceToolHandler.js": [function(require, module, exports) {
22996         'use strict';
22997
22998         var forEach = require('lodash/collection/forEach');
22999
23000         var SpaceUtil = require('../../space-tool/SpaceUtil');
23001
23002         /**
23003          * A handler that implements reversible creating and removing of space.
23004          * 
23005          * It executes in two phases:
23006          * 
23007          * (1) resize all affected resizeShapes (2) move all affected moveShapes
23008          */
23009         function SpaceToolHandler(modeling) {
23010             this._modeling = modeling;
23011         }
23012
23013         SpaceToolHandler.$inject = ['modeling'];
23014
23015         module.exports = SpaceToolHandler;
23016
23017
23018         SpaceToolHandler.prototype.preExecute = function(context) {
23019
23020             // resize
23021             var modeling = this._modeling,
23022                 resizingShapes = context.resizingShapes,
23023                 delta = context.delta,
23024                 direction = context.direction;
23025
23026             forEach(resizingShapes, function(shape) {
23027                 var newBounds = SpaceUtil.resizeBounds(shape, direction, delta);
23028
23029                 modeling.resizeShape(shape, newBounds);
23030             });
23031         };
23032
23033         SpaceToolHandler.prototype.postExecute = function(context) {
23034             // move
23035             var modeling = this._modeling,
23036                 movingShapes = context.movingShapes,
23037                 delta = context.delta;
23038
23039             modeling.moveShapes(movingShapes, delta);
23040         };
23041
23042         SpaceToolHandler.prototype.execute = function(context) {};
23043         SpaceToolHandler.prototype.revert = function(context) {};
23044
23045     }, {
23046         "../../space-tool/SpaceUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js",
23047         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
23048     }],
23049     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateAnchorsHandler.js": [function(require, module, exports) {
23050         'use strict';
23051
23052         var forEach = require('lodash/collection/forEach'),
23053             assign = require('lodash/object/assign');
23054
23055
23056         /**
23057          * Update the anchors of
23058          */
23059         function UpdateAnchorsHandler() {}
23060
23061         module.exports = UpdateAnchorsHandler;
23062
23063
23064         UpdateAnchorsHandler.prototype.execute = function(context) {
23065
23066             // update connection anchors
23067             return this.updateAnchors(context.element, context.delta);
23068         };
23069
23070         UpdateAnchorsHandler.prototype.revert = function(context) {
23071
23072             var delta = context.delta,
23073                 revertedDelta = {
23074                     x: -1 * delta.x,
23075                     y: -1 * delta.y
23076                 };
23077
23078             // revert update connection anchors
23079             return this.updateAnchors(context.element, revertedDelta);
23080         };
23081
23082         /**
23083          * Update anchors on the element according to the delta movement.
23084          * 
23085          * @param {djs.model.Element}
23086          *            element
23087          * @param {Point}
23088          *            delta
23089          * 
23090          * @return Array<djs.model.Connection>
23091          */
23092         UpdateAnchorsHandler.prototype.updateAnchors = function(element, delta) {
23093
23094             function add(point, delta) {
23095                 return {
23096                     x: point.x + delta.x,
23097                     y: point.y + delta.y
23098                 };
23099             }
23100
23101             function updateAnchor(waypoint) {
23102                 var original = waypoint.original;
23103
23104                 waypoint.original = assign(original || {}, add(original || waypoint, delta));
23105             }
23106
23107             var changed = [];
23108
23109             forEach(element.incoming, function(c) {
23110                 var waypoints = c.waypoints;
23111                 updateAnchor(waypoints[waypoints.length - 1]);
23112
23113                 changed.push(c);
23114             });
23115
23116             forEach(element.outgoing, function(c) {
23117                 var waypoints = c.waypoints;
23118                 updateAnchor(waypoints[0]);
23119
23120                 changed.push(c);
23121             });
23122
23123             return changed;
23124         };
23125     }, {
23126         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
23127         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
23128     }],
23129     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateWaypointsHandler.js": [function(require, module, exports) {
23130         'use strict';
23131
23132         function UpdateWaypointsHandler() {}
23133
23134         module.exports = UpdateWaypointsHandler;
23135
23136         UpdateWaypointsHandler.prototype.execute = function(context) {
23137
23138             var connection = context.connection,
23139                 newWaypoints = context.newWaypoints;
23140
23141             context.oldWaypoints = connection.waypoints;
23142
23143             connection.waypoints = newWaypoints;
23144
23145             return connection;
23146         };
23147
23148         UpdateWaypointsHandler.prototype.revert = function(context) {
23149
23150             var connection = context.connection,
23151                 oldWaypoints = context.oldWaypoints;
23152
23153             connection.waypoints = oldWaypoints;
23154
23155             return connection;
23156         };
23157     }, {}],
23158     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js": [function(require, module, exports) {
23159         'use strict';
23160
23161         var forEach = require('lodash/collection/forEach');
23162
23163         var Elements = require('../../../../util/Elements');
23164
23165
23166         /**
23167          * A helper that is able to carry out serialized move operations on multiple
23168          * elements.
23169          * 
23170          * @param {Modeling}
23171          *            modeling
23172          */
23173         function MoveHelper(modeling) {
23174             this._modeling = modeling;
23175         }
23176
23177         module.exports = MoveHelper;
23178
23179         /**
23180          * Move the specified elements and all children by the given delta.
23181          * 
23182          * This moves all enclosed connections, too and layouts all affected external
23183          * connections.
23184          * 
23185          * @param {Array
23186          *            <djs.model.Base>} elements
23187          * @param {Point}
23188          *            delta
23189          * @param {djs.model.Base}
23190          *            newParent applied to the first level of shapes
23191          * 
23192          * @return {Array<djs.model.Base>} list of touched elements
23193          */
23194         MoveHelper.prototype.moveRecursive = function(elements, delta, newParent) {
23195             return this.moveClosure(this.getClosure(elements), delta, newParent);
23196         };
23197
23198         /**
23199          * Move the given closure of elmements
23200          */
23201         MoveHelper.prototype.moveClosure = function(closure, delta, newParent) {
23202
23203             var modeling = this._modeling;
23204
23205             var allShapes = closure.allShapes,
23206                 allConnections = closure.allConnections,
23207                 enclosedConnections = closure.enclosedConnections,
23208                 topLevel = closure.topLevel;
23209
23210             // move all shapes
23211             forEach(allShapes, function(s) {
23212
23213                 modeling.moveShape(s, delta, topLevel[s.id] && newParent, {
23214                     recurse: false,
23215                     layout: false
23216                 });
23217             });
23218
23219             // move all child connections / layout external connections
23220             forEach(allConnections, function(c) {
23221
23222                 var startMoved = !!allShapes[c.source.id],
23223                     endMoved = !!allShapes[c.target.id];
23224
23225                 if (enclosedConnections[c.id] &&
23226                     startMoved && endMoved) {
23227                     modeling.moveConnection(c, delta, topLevel[c.id] && newParent, {
23228                         updateAnchors: false
23229                     });
23230                 } else {
23231                     modeling.layoutConnection(c, {
23232                         startChanged: startMoved,
23233                         endChanged: endMoved
23234                     });
23235                 }
23236             });
23237         };
23238
23239         /**
23240          * Returns the closure for the selected elements
23241          * 
23242          * @param {Array
23243          *            <djs.model.Base>} elements
23244          * @return {Object} closure
23245          */
23246         MoveHelper.prototype.getClosure = function(elements) {
23247             return Elements.getClosure(elements);
23248         };
23249
23250     }, {
23251         "../../../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
23252         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
23253     }],
23254     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js": [function(require, module, exports) {
23255         module.exports = {
23256             __depends__: [
23257                 require('../../command'),
23258                 require('../change-support'),
23259                 require('../rules')
23260             ],
23261             __init__: ['modeling'],
23262             modeling: ['type', require('./Modeling')],
23263             layouter: ['type', require('../../layout/BaseLayouter')]
23264         };
23265
23266     }, {
23267         "../../command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
23268         "../../layout/BaseLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js",
23269         "../change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js",
23270         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
23271         "./Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js"
23272     }],
23273     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\Move.js": [function(require, module, exports) {
23274         'use strict';
23275
23276         var assign = require('lodash/object/assign'),
23277             filter = require('lodash/collection/filter'),
23278             groupBy = require('lodash/collection/groupBy');
23279
23280
23281         var LOW_PRIORITY = 500,
23282             HIGH_PRIORITY = 1500;
23283
23284         var getOriginalEvent = require('../../util/Event').getOriginal;
23285
23286         var round = Math.round;
23287
23288
23289         /**
23290          * Return a filtered list of elements that do not contain those nested into
23291          * others.
23292          * 
23293          * @param {Array
23294          *            <djs.model.Base>} elements
23295          * 
23296          * @return {Array<djs.model.Base>} filtered
23297          */
23298         function removeNested(elements) {
23299
23300             var ids = groupBy(elements, 'id');
23301
23302             return filter(elements, function(element) {
23303                 while (!!(element = element.parent)) {
23304                     if (ids[element.id]) {
23305                         return false;
23306                     }
23307                 }
23308
23309                 return true;
23310             });
23311         }
23312
23313
23314
23315         /**
23316          * A plugin that makes shapes draggable / droppable.
23317          * 
23318          * @param {EventBus}
23319          *            eventBus
23320          * @param {Dragging}
23321          *            dragging
23322          * @param {Modeling}
23323          *            modeling
23324          * @param {Selection}
23325          *            selection
23326          * @param {Rules}
23327          *            rules
23328          */
23329         function MoveEvents(eventBus, dragging, modeling, selection, rules) {
23330
23331             // rules
23332
23333             function canMove(shapes, delta, target) {
23334
23335                 return rules.allowed('shapes.move', {
23336                     shapes: shapes,
23337                     delta: delta,
23338                     newParent: target
23339                 });
23340             }
23341
23342
23343             // move events
23344
23345             // assign a high priority to this handler to setup the environment
23346             // others may hook up later, e.g. at default priority and modify
23347             // the move environment
23348             //
23349             eventBus.on('shape.move.start', HIGH_PRIORITY, function(event) {
23350                 
23351                 var context = event.context,
23352                     shape = event.shape,
23353                     shapes = selection.get().slice();
23354
23355                 // move only single shape shape if the dragged element
23356                 // is not part of the current selection
23357                 if (shapes.indexOf(shape) === -1) {
23358                     shapes = [shape];
23359                 }
23360
23361                 // ensure we remove nested elements in the collection
23362                 shapes = removeNested(shapes);
23363
23364                 // attach shapes to drag context
23365                 assign(context, {
23366                     shapes: shapes,
23367                     shape: shape
23368                 });
23369
23370                 // check if we can move the elements
23371                 if (!canMove(shapes)) {
23372                     // suppress move operation
23373                     event.stopPropagation();
23374
23375                     return false;
23376                 }
23377             });
23378
23379             // assign a low priority to this handler
23380             // to let others modify the move event before we update
23381             // the context
23382             //
23383             eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
23384
23385                 var context = event.context,
23386                     shapes = context.shapes,
23387                     hover = event.hover,
23388                     delta = {
23389                         x: event.dx,
23390                         y: event.dy
23391                     },
23392                     canExecute;
23393
23394                 // check if we can move the elements
23395                 canExecute = canMove(shapes, delta, hover);
23396
23397                 context.delta = delta;
23398                 context.canExecute = canExecute;
23399
23400                 // simply ignore move over
23401                 if (canExecute === null) {
23402                     context.target = null;
23403
23404                     return;
23405                 }
23406
23407                 context.target = hover;
23408             });
23409
23410             eventBus.on('shape.move.end', function(event) {
23411
23412                 var context = event.context;
23413
23414                 var delta = context.delta,
23415                     canExecute = context.canExecute;
23416
23417                 if (!canExecute) {
23418                     return false;
23419                 }
23420
23421                 // ensure we have actual pixel values deltas
23422                 // (important when zoom level was > 1 during move)
23423                 delta.x = round(delta.x);
23424                 delta.y = round(delta.y);
23425
23426                 modeling.moveShapes(context.shapes, delta, context.target);
23427             });
23428
23429
23430             // move activation
23431
23432             eventBus.on('element.mousedown', function(event) {
23433
23434                 var originalEvent = getOriginalEvent(event);
23435
23436                 if (!originalEvent) {
23437                     throw new Error('must supply DOM mousedown event');
23438                 }
23439
23440                 start(originalEvent, event.element);
23441             });
23442
23443
23444             function start(event, element, activate) {
23445
23446                 // do not move connections or the root element
23447                 if (element.waypoints || !element.parent) {
23448                     return;
23449                 }
23450
23451                 dragging.activate(event, 'shape.move', {
23452                     cursor: 'grabbing',
23453                     autoActivate: activate,
23454                     data: {
23455                         shape: element,
23456                         context: {}
23457                     }
23458                 });
23459             }
23460
23461             // API
23462
23463             this.start = start;
23464         }
23465
23466         MoveEvents.$inject = ['eventBus', 'dragging', 'modeling', 'selection', 'rules'];
23467
23468         module.exports = MoveEvents;
23469
23470     }, {
23471         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
23472         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
23473         "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
23474         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
23475     }],
23476     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\MoveVisuals.js": [function(require, module, exports) {
23477         'use strict';
23478
23479         var flatten = require('lodash/array/flatten'),
23480             forEach = require('lodash/collection/forEach'),
23481             filter = require('lodash/collection/filter'),
23482             find = require('lodash/collection/find'),
23483             map = require('lodash/collection/map');
23484
23485         var Elements = require('../../util/Elements');
23486
23487         var LOW_PRIORITY = 500;
23488
23489         var MARKER_DRAGGING = 'djs-dragging',
23490             MARKER_OK = 'drop-ok',
23491             MARKER_NOT_OK = 'drop-not-ok';
23492
23493
23494         /**
23495          * A plugin that makes shapes draggable / droppable.
23496          * 
23497          * @param {EventBus}
23498          *            eventBus
23499          * @param {ElementRegistry}
23500          *            elementRegistry
23501          * @param {Canvas}
23502          *            canvas
23503          * @param {Styles}
23504          *            styles
23505          */
23506         function MoveVisuals(eventBus, elementRegistry, canvas, styles) {
23507
23508             function getGfx(e) {
23509                 return elementRegistry.getGraphics(e);
23510             }
23511
23512             function getVisualDragShapes(shapes) {
23513
23514                 var elements = Elements.selfAndDirectChildren(shapes, true);
23515                 var filteredElements = removeEdges(elements);
23516
23517                 return filteredElements;
23518             }
23519
23520             function getAllDraggedElements(shapes) {
23521                 var allShapes = Elements.selfAndAllChildren(shapes, true);
23522
23523                 var allConnections = map(allShapes, function(shape) {
23524                     return (shape.incoming || []).concat(shape.outgoing || []);
23525                 });
23526
23527                 return flatten(allShapes.concat(allConnections), true);
23528             }
23529
23530             function addDragger(shape, dragGroup) {
23531                 var gfx = getGfx(shape);
23532                 var dragger = gfx.clone();
23533                 var bbox = gfx.getBBox();
23534
23535                 dragger.attr(styles.cls('djs-dragger', [], {
23536                     x: bbox.x,
23537                     y: bbox.y
23538                 }));
23539
23540                 dragGroup.add(dragger);
23541             }
23542
23543             // assign a low priority to this handler
23544             // to let others modify the move context before
23545             // we draw things
23546             //
23547             eventBus.on('shape.move.start', LOW_PRIORITY, function(event) {
23548
23549                 var context = event.context,
23550                     dragShapes = context.shapes;
23551
23552                 var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
23553
23554                 var visuallyDraggedShapes = getVisualDragShapes(dragShapes);
23555
23556                 visuallyDraggedShapes.forEach(function(shape) {
23557                     addDragger(shape, dragGroup);
23558                 });
23559
23560
23561                 // cache all dragged elements / gfx
23562                 // so that we can quickly undo their state changes later
23563                 var allDraggedElements = context.allDraggedElements = getAllDraggedElements(dragShapes);
23564
23565                 // add dragging marker
23566                 forEach(allDraggedElements, function(e) {
23567                     canvas.addMarker(e, MARKER_DRAGGING);
23568                 });
23569
23570                 context.dragGroup = dragGroup;
23571             });
23572
23573             // assign a low priority to this handler
23574             // to let others modify the move context before
23575             // we draw things
23576             //
23577             eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
23578
23579                 var context = event.context,
23580                     dragGroup = context.dragGroup,
23581                     target = context.target;
23582
23583                 if (target) {
23584                     canvas.addMarker(target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
23585                 }
23586
23587                 dragGroup.translate(event.dx, event.dy);
23588             });
23589
23590             eventBus.on(['shape.move.out', 'shape.move.cleanup'], function(event) {
23591                 var context = event.context;
23592
23593                 if (context.target) {
23594                     canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
23595                 }
23596             });
23597
23598             eventBus.on('shape.move.cleanup', function(event) {
23599
23600                 var context = event.context,
23601                     allDraggedElements = context.allDraggedElements,
23602                     dragGroup = context.dragGroup;
23603
23604
23605                 // remove dragging marker
23606                 forEach(allDraggedElements, function(e) {
23607                     canvas.removeMarker(e, MARKER_DRAGGING);
23608                 });
23609
23610                 if (dragGroup) {
23611                     dragGroup.remove();
23612                 }
23613             });
23614         }
23615
23616         // returns elements minus all connections
23617         // where source or target is not elements
23618         function removeEdges(elements) {
23619
23620             var filteredElements = filter(elements, function(element) {
23621
23622                 if (!element.waypoints) { // shapes
23623                     return true;
23624                 } else { // connections
23625                     var srcFound = find(elements, element.source);
23626                     var targetFound = find(elements, element.target);
23627
23628                     return srcFound && targetFound;
23629                 }
23630             });
23631
23632             return filteredElements;
23633         }
23634
23635         MoveVisuals.$inject = ['eventBus', 'elementRegistry', 'canvas', 'styles'];
23636
23637         module.exports = MoveVisuals;
23638
23639     }, {
23640         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
23641         "lodash/array/flatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\flatten.js",
23642         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
23643         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
23644         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
23645         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js"
23646     }],
23647     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\index.js": [function(require, module, exports) {
23648         module.exports = {
23649             __depends__: [
23650                 require('../interaction-events'),
23651                 require('../selection'),
23652                 require('../outline'),
23653                 require('../rules'),
23654                 require('../dragging')
23655             ],
23656             __init__: ['move', 'moveVisuals'],
23657             move: ['type', require('./Move')],
23658             moveVisuals: ['type', require('./MoveVisuals')]
23659         };
23660
23661     }, {
23662         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
23663         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
23664         "../outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js",
23665         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
23666         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
23667         "./Move": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\Move.js",
23668         "./MoveVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\MoveVisuals.js"
23669     }],
23670     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\Outline.js": [function(require, module, exports) {
23671         'use strict';
23672
23673         var Snap = require('../../../vendor/snapsvg');
23674         var getBBox = require('../../util/Elements').getBBox;
23675
23676
23677         /**
23678          * @class
23679          * 
23680          * A plugin that adds an outline to shapes and connections that may be activated
23681          * and styled via CSS classes.
23682          * 
23683          * @param {EventBus}
23684          *            events the event bus
23685          */
23686         function Outline(eventBus, styles, elementRegistry) {
23687
23688             var OUTLINE_OFFSET = 6;
23689
23690             var OUTLINE_STYLE = styles.cls('djs-outline', ['no-fill']);
23691
23692             function createOutline(gfx, bounds) {
23693                 return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);
23694             }
23695
23696             function updateShapeOutline(outline, bounds) {
23697
23698                 outline.attr({
23699                     x: -OUTLINE_OFFSET,
23700                     y: -OUTLINE_OFFSET,
23701                     width: bounds.width + OUTLINE_OFFSET * 2,
23702                     height: bounds.height + OUTLINE_OFFSET * 2
23703                 });
23704             }
23705
23706             function updateConnectionOutline(outline, connection) {
23707
23708                 var bbox = getBBox(connection);
23709
23710                 outline.attr({
23711                     x: bbox.x - OUTLINE_OFFSET,
23712                     y: bbox.y - OUTLINE_OFFSET,
23713                     width: bbox.width + OUTLINE_OFFSET * 2,
23714                     height: bbox.height + OUTLINE_OFFSET * 2
23715                 });
23716             }
23717
23718             eventBus.on(['shape.added', 'shape.changed'], function(event) {
23719                 var element = event.element,
23720                     gfx = event.gfx;
23721
23722                 var outline = gfx.select('.djs-outline');
23723
23724                 if (!outline) {
23725                     outline = createOutline(gfx, element);
23726                 }
23727
23728                 updateShapeOutline(outline, element);
23729             });
23730
23731             eventBus.on(['connection.added', 'connection.changed'], function(event) {
23732                 var element = event.element,
23733                     gfx = event.gfx;
23734
23735                 var outline = gfx.select('.djs-outline');
23736
23737                 if (!outline) {
23738                     outline = createOutline(gfx, element);
23739                 }
23740
23741                 updateConnectionOutline(outline, element);
23742             });
23743
23744
23745         }
23746
23747
23748         Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
23749
23750         module.exports = Outline;
23751
23752     }, {
23753         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
23754         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js"
23755     }],
23756     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js": [function(require, module, exports) {
23757         'use strict';
23758
23759         module.exports = {
23760             __init__: ['outline'],
23761             outline: ['type', require('./Outline')]
23762         };
23763     }, {
23764         "./Outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\Outline.js"
23765     }],
23766     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\Overlays.js": [function(require, module, exports) {
23767         'use strict';
23768
23769         var isArray = require('lodash/lang/isArray'),
23770             isString = require('lodash/lang/isString'),
23771             isObject = require('lodash/lang/isObject'),
23772             assign = require('lodash/object/assign'),
23773             forEach = require('lodash/collection/forEach'),
23774             filter = require('lodash/collection/filter'),
23775             debounce = require('lodash/function/debounce');
23776
23777         var domify = require('min-dom/lib/domify'),
23778             domClasses = require('min-dom/lib/classes'),
23779             domRemove = require('min-dom/lib/remove');
23780
23781         var getBBox = require('../../util/Elements').getBBox;
23782
23783         // document wide unique overlay ids
23784         var ids = new(require('../../util/IdGenerator'))('ov');
23785
23786
23787         function createRoot(parent) {
23788             var root = domify('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');
23789             parent.insertBefore(root, parent.firstChild);
23790
23791             return root;
23792         }
23793
23794
23795         function setPosition(el, x, y) {
23796             assign(el.style, {
23797                 left: x + 'px',
23798                 top: y + 'px'
23799             });
23800         }
23801
23802         function setVisible(el, visible) {
23803             el.style.display = visible === false ? 'none' : '';
23804         }
23805
23806         /**
23807          * A service that allows users to attach overlays to diagram elements.
23808          * 
23809          * The overlay service will take care of overlay positioning during updates.
23810          * 
23811          * @example
23812          *  // add a pink badge on the top left of the shape overlays.add(someShape, {
23813          * position: { top: -5, left: -5 }, html: '<div style="width: 10px; background:
23814          * fuchsia; color: white;">0</div>' });
23815          *  // or add via shape id
23816          * 
23817          * overlays.add('some-element-id', { position: { top: -5, left: -5 } html: '<div
23818          * style="width: 10px; background: fuchsia; color: white;">0</div>' });
23819          *  // or add with optional type
23820          * 
23821          * overlays.add(someShape, 'badge', { position: { top: -5, left: -5 } html: '<div
23822          * style="width: 10px; background: fuchsia; color: white;">0</div>' });
23823          * 
23824          *  // remove an overlay
23825          * 
23826          * var id = overlays.add(...); overlays.remove(id);
23827          * 
23828          * @param {EventBus}
23829          *            eventBus
23830          * @param {Canvas}
23831          *            canvas
23832          * @param {ElementRegistry}
23833          *            elementRegistry
23834          */
23835         function Overlays(config, eventBus, canvas, elementRegistry) {
23836
23837             this._eventBus = eventBus;
23838             this._canvas = canvas;
23839             this._elementRegistry = elementRegistry;
23840
23841             this._ids = ids;
23842
23843             this._overlayDefaults = {
23844                 show: {
23845                     minZoom: 0.7,
23846                     maxZoom: 5.0
23847                 }
23848             };
23849
23850             /**
23851              * Mapping overlayId -> overlay
23852              */
23853             this._overlays = {};
23854
23855             /**
23856              * Mapping elementId -> overlay container
23857              */
23858             this._overlayContainers = {};
23859
23860             // root html element for all overlays
23861             this._overlayRoot = createRoot(canvas.getContainer());
23862
23863             this._init(config);
23864         }
23865
23866
23867         Overlays.$inject = ['config.overlays', 'eventBus', 'canvas', 'elementRegistry'];
23868
23869         module.exports = Overlays;
23870
23871
23872         /**
23873          * Returns the overlay with the specified id or a list of overlays for an
23874          * element with a given type.
23875          * 
23876          * @example
23877          *  // return the single overlay with the given id overlays.get('some-id');
23878          *  // return all overlays for the shape overlays.get({ element: someShape });
23879          *  // return all overlays on shape with type 'badge' overlays.get({ element:
23880          * someShape, type: 'badge' });
23881          *  // shape can also be specified as id overlays.get({ element: 'element-id',
23882          * type: 'badge' });
23883          * 
23884          * 
23885          * @param {Object}
23886          *            search
23887          * @param {String}
23888          *            [search.id]
23889          * @param {String|djs.model.Base}
23890          *            [search.element]
23891          * @param {String}
23892          *            [search.type]
23893          * 
23894          * @return {Object|Array<Object>} the overlay(s)
23895          */
23896         Overlays.prototype.get = function(search) {
23897
23898             if (isString(search)) {
23899                 search = {
23900                     id: search
23901                 };
23902             }
23903
23904             if (search.element) {
23905                 var container = this._getOverlayContainer(search.element, true);
23906
23907                 // return a list of overlays when searching by element (+type)
23908                 if (container) {
23909                     return search.type ? filter(container.overlays, {
23910                         type: search.type
23911                     }) : container.overlays.slice();
23912                 } else {
23913                     return [];
23914                 }
23915             } else
23916             if (search.type) {
23917                 return filter(this._overlays, {
23918                     type: search.type
23919                 });
23920             } else {
23921                 // return single element when searching by id
23922                 return search.id ? this._overlays[search.id] : null;
23923             }
23924         };
23925
23926         /**
23927          * Adds a HTML overlay to an element.
23928          * 
23929          * @param {String|djs.model.Base}
23930          *            element attach overlay to this shape
23931          * @param {String}
23932          *            [type] optional type to assign to the overlay
23933          * @param {Object}
23934          *            overlay the overlay configuration
23935          * 
23936          * @param {String|DOMElement}
23937          *            overlay.html html element to use as an overlay
23938          * @param {Object}
23939          *            [overlay.show] show configuration
23940          * @param {Number}
23941          *            [overlay.show.minZoom] minimal zoom level to show the overlay
23942          * @param {Number}
23943          *            [overlay.show.maxZoom] maximum zoom level to show the overlay
23944          * @param {Object}
23945          *            overlay.position where to attach the overlay
23946          * @param {Number}
23947          *            [overlay.position.left] relative to element bbox left attachment
23948          * @param {Number}
23949          *            [overlay.position.top] relative to element bbox top attachment
23950          * @param {Number}
23951          *            [overlay.position.bottom] relative to element bbox bottom
23952          *            attachment
23953          * @param {Number}
23954          *            [overlay.position.right] relative to element bbox right attachment
23955          * 
23956          * @return {String} id that may be used to reference the overlay for update or
23957          *         removal
23958          */
23959         Overlays.prototype.add = function(element, type, overlay) {
23960
23961             if (isObject(type)) {
23962                 overlay = type;
23963                 type = null;
23964             }
23965
23966             if (!element.id) {
23967                 element = this._elementRegistry.get(element);
23968             }
23969
23970             if (!overlay.position) {
23971                 throw new Error('must specifiy overlay position');
23972             }
23973
23974             if (!overlay.html) {
23975                 throw new Error('must specifiy overlay html');
23976             }
23977
23978             if (!element) {
23979                 throw new Error('invalid element specified');
23980             }
23981
23982             var id = this._ids.next();
23983
23984             overlay = assign({}, this._overlayDefaults, overlay, {
23985                 id: id,
23986                 type: type,
23987                 element: element,
23988                 html: overlay.html
23989             });
23990
23991             this._addOverlay(overlay);
23992
23993             return id;
23994         };
23995
23996
23997         /**
23998          * Remove an overlay with the given id or all overlays matching the given
23999          * filter.
24000          * 
24001          * @see Overlays#get for filter options.
24002          * 
24003          * @param {String}
24004          *            [id]
24005          * @param {Object}
24006          *            [filter]
24007          */
24008         Overlays.prototype.remove = function(filter) {
24009
24010             var overlays = this.get(filter) || [];
24011
24012             if (!isArray(overlays)) {
24013                 overlays = [overlays];
24014             }
24015
24016             var self = this;
24017
24018             forEach(overlays, function(overlay) {
24019
24020                 var container = self._getOverlayContainer(overlay.element, true);
24021
24022                 if (overlay) {
24023                     domRemove(overlay.html);
24024                     domRemove(overlay.htmlContainer);
24025
24026                     delete overlay.htmlContainer;
24027                     delete overlay.element;
24028
24029                     delete self._overlays[overlay.id];
24030                 }
24031
24032                 if (container) {
24033                     var idx = container.overlays.indexOf(overlay);
24034                     if (idx !== -1) {
24035                         container.overlays.splice(idx, 1);
24036                     }
24037                 }
24038             });
24039
24040         };
24041
24042
24043         Overlays.prototype.show = function() {
24044             setVisible(this._overlayRoot);
24045         };
24046
24047
24048         Overlays.prototype.hide = function() {
24049             setVisible(this._overlayRoot, false);
24050         };
24051
24052
24053         Overlays.prototype._updateOverlayContainer = function(container) {
24054             var element = container.element,
24055                 html = container.html;
24056
24057             // update container left,top according to the elements x,y coordinates
24058             // this ensures we can attach child elements relative to this container
24059
24060             var x = element.x,
24061                 y = element.y;
24062
24063             if (element.waypoints) {
24064                 var bbox = getBBox(element);
24065                 x = bbox.x;
24066                 y = bbox.y;
24067             }
24068
24069             setPosition(html, x, y);
24070         };
24071
24072
24073         Overlays.prototype._updateOverlay = function(overlay) {
24074
24075             var position = overlay.position,
24076                 htmlContainer = overlay.htmlContainer,
24077                 element = overlay.element;
24078
24079             // update overlay html relative to shape because
24080             // it is already positioned on the element
24081
24082             // update relative
24083             var left = position.left,
24084                 top = position.top;
24085
24086             if (position.right !== undefined) {
24087
24088                 var width;
24089
24090                 if (element.waypoints) {
24091                     width = getBBox(element).width;
24092                 } else {
24093                     width = element.width;
24094                 }
24095
24096                 left = position.right * -1 + width;
24097             }
24098
24099             if (position.bottom !== undefined) {
24100
24101                 var height;
24102
24103                 if (element.waypoints) {
24104                     height = getBBox(element).height;
24105                 } else {
24106                     height = element.height;
24107                 }
24108
24109                 top = position.bottom * -1 + height;
24110             }
24111
24112             setPosition(htmlContainer, left || 0, top || 0);
24113         };
24114
24115
24116         Overlays.prototype._createOverlayContainer = function(element) {
24117             var html = domify('<div class="djs-overlays djs-overlays-' + element.id + '" style="position: absolute" />');
24118
24119             this._overlayRoot.appendChild(html);
24120
24121             var container = {
24122                 html: html,
24123                 element: element,
24124                 overlays: []
24125             };
24126
24127             this._updateOverlayContainer(container);
24128
24129             return container;
24130         };
24131
24132
24133         Overlays.prototype._updateRoot = function(viewbox) {
24134             var a = viewbox.scale || 1;
24135             var d = viewbox.scale || 1;
24136
24137             var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
24138
24139             this._overlayRoot.style.transform = matrix;
24140             this._overlayRoot.style['-ms-transform'] = matrix;
24141         };
24142
24143
24144         Overlays.prototype._getOverlayContainer = function(element, raw) {
24145             var id = (element && element.id) || element;
24146
24147             var container = this._overlayContainers[id];
24148             if (!container && !raw) {
24149                 container = this._overlayContainers[id] = this._createOverlayContainer(element);
24150             }
24151
24152             return container;
24153         };
24154
24155
24156         Overlays.prototype._addOverlay = function(overlay) {
24157
24158             var id = overlay.id,
24159                 element = overlay.element,
24160                 html = overlay.html,
24161                 htmlContainer,
24162                 overlayContainer;
24163
24164             // unwrap jquery (for those who need it)
24165             if (html.get) {
24166                 html = html.get(0);
24167             }
24168
24169             // create proper html elements from
24170             // overlay HTML strings
24171             if (isString(html)) {
24172                 html = domify(html);
24173             }
24174
24175             overlayContainer = this._getOverlayContainer(element);
24176
24177             htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: absolute">');
24178
24179             htmlContainer.appendChild(html);
24180
24181             if (overlay.type) {
24182                 domClasses(htmlContainer).add('djs-overlay-' + overlay.type);
24183             }
24184
24185             overlay.htmlContainer = htmlContainer;
24186
24187             overlayContainer.overlays.push(overlay);
24188             overlayContainer.html.appendChild(htmlContainer);
24189
24190             this._overlays[id] = overlay;
24191
24192             this._updateOverlay(overlay);
24193         };
24194
24195         Overlays.prototype._updateOverlayVisibilty = function(viewbox) {
24196
24197             forEach(this._overlays, function(overlay) {
24198                 var show = overlay.show,
24199                     htmlContainer = overlay.htmlContainer,
24200                     visible = true;
24201
24202                 if (show) {
24203                     if (show.minZoom > viewbox.scale ||
24204                         show.maxZoom < viewbox.scale) {
24205                         visible = false;
24206                     }
24207
24208                     setVisible(htmlContainer, visible);
24209                 }
24210             });
24211         };
24212
24213         Overlays.prototype._init = function(config) {
24214
24215             var eventBus = this._eventBus;
24216
24217             var self = this;
24218
24219
24220             // scroll/zoom integration
24221
24222             var updateViewbox = function(viewbox) {
24223                 self._updateRoot(viewbox);
24224                 self._updateOverlayVisibilty(viewbox);
24225
24226                 self.show();
24227             };
24228
24229             if (!config || config.deferUpdate !== false) {
24230                 updateViewbox = debounce(updateViewbox, 300);
24231             }
24232
24233             eventBus.on('canvas.viewbox.changed', function(event) {
24234                 self.hide();
24235                 updateViewbox(event.viewbox);
24236             });
24237
24238
24239             // remove integration
24240
24241             eventBus.on(['shape.remove', 'connection.remove'], function(e) {
24242                 var overlays = self.get({
24243                     element: e.element
24244                 });
24245
24246                 forEach(overlays, function(o) {
24247                     self.remove(o.id);
24248                 });
24249             });
24250
24251
24252             // move integration
24253
24254             eventBus.on([
24255                 'element.changed'
24256             ], function(e) {
24257                 var element = e.element;
24258
24259                 var container = self._getOverlayContainer(element, true);
24260
24261                 if (container) {
24262                     forEach(container.overlays, function(overlay) {
24263                         self._updateOverlay(overlay);
24264                     });
24265
24266                     self._updateOverlayContainer(container);
24267                 }
24268             });
24269
24270
24271             // marker integration, simply add them on the overlays as classes, too.
24272
24273             eventBus.on('element.marker.update', function(e) {
24274                 var container = self._getOverlayContainer(e.element, true);
24275                 if (container) {
24276                     domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);
24277                 }
24278             });
24279         };
24280
24281     }, {
24282         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
24283         "../../util/IdGenerator": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js",
24284         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
24285         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24286         "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js",
24287         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
24288         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
24289         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
24290         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
24291         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24292         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24293         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
24294     }],
24295     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js": [function(require, module, exports) {
24296         module.exports = {
24297             __init__: ['overlays'],
24298             overlays: ['type', require('./Overlays')]
24299         };
24300     }, {
24301         "./Overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\Overlays.js"
24302     }],
24303     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\Palette.js": [function(require, module, exports) {
24304         'use strict';
24305
24306         var isFunction = require('lodash/lang/isFunction'),
24307             forEach = require('lodash/collection/forEach');
24308
24309         var domify = require('min-dom/lib/domify'),
24310             domQuery = require('min-dom/lib/query'),
24311             domAttr = require('min-dom/lib/attr'),
24312             domClear = require('min-dom/lib/clear'),
24313             domClasses = require('min-dom/lib/classes'),
24314             domMatches = require('min-dom/lib/matches'),
24315             domDelegate = require('min-dom/lib/delegate'),
24316             domEvent = require('min-dom/lib/event');
24317
24318
24319         var toggleSelector = '.djs-palette-toggle',
24320             entrySelector = '.entry',
24321             elementSelector = toggleSelector + ', ' + entrySelector;
24322
24323
24324         /**
24325          * A palette containing modeling elements.
24326          */
24327         function Palette(eventBus, canvas) {
24328
24329             this._eventBus = eventBus;
24330             this._canvas = canvas;
24331
24332             this._providers = [];
24333         }
24334
24335         Palette.$inject = ['eventBus', 'canvas'];
24336
24337         module.exports = Palette;
24338
24339
24340         /**
24341          * Register a provider with the palette
24342          * 
24343          * @param {PaletteProvider}
24344          *            provider
24345          */
24346         Palette.prototype.registerProvider = function(provider) {
24347             this._providers.push(provider);
24348
24349             if (!this._container) {
24350                 this._init();
24351             }
24352
24353             this._update();
24354         };
24355
24356
24357         /**
24358          * Returns the palette entries for a given element
24359          * 
24360          * @return {Array<PaletteEntryDescriptor>} list of entries
24361          */
24362         Palette.prototype.getEntries = function() {
24363
24364             var entries = {};
24365
24366             // loop through all providers and their entries.
24367             // group entries by id so that overriding an entry is possible
24368             forEach(this._providers, function(provider) {
24369                 var e = provider.getPaletteEntries();
24370
24371                 forEach(e, function(entry, id) {
24372                     entries[id] = entry;
24373                 });
24374             });
24375
24376             return entries;
24377         };
24378
24379
24380         /**
24381          * Initialize
24382          */
24383         Palette.prototype._init = function() {
24384             var parent = this._canvas.getContainer(),
24385                 container = this._container = domify(Palette.HTML_MARKUP),
24386                 self = this;
24387
24388             parent.appendChild(container);
24389
24390             domDelegate.bind(container, elementSelector, 'click', function(event) {
24391
24392                 var target = event.delegateTarget;
24393
24394                 if (domMatches(target, toggleSelector)) {
24395                     return self.toggle();
24396                 }
24397
24398                 self.trigger('click', event);
24399             });
24400
24401             // prevent drag propagation
24402             domEvent.bind(container, 'mousedown', function(event) {
24403                 event.stopPropagation();
24404             });
24405
24406             // prevent drag propagation
24407             domDelegate.bind(container, entrySelector, 'dragstart', function(event) {
24408                 self.trigger('dragstart', event);
24409             });
24410
24411             this._eventBus.fire('palette.create', {
24412                 html: container
24413             });
24414         };
24415
24416
24417         Palette.prototype._update = function() {
24418
24419             var entriesContainer = domQuery('.djs-palette-entries', this._container),
24420                 entries = this._entries = this.getEntries();
24421
24422             domClear(entriesContainer);
24423
24424             forEach(entries, function(entry, id) {
24425
24426                 var grouping = entry.group || 'default';
24427
24428                 var container = domQuery('[data-group=' + grouping + ']', entriesContainer);
24429                 if (!container) {
24430                     container = domify('<div class="group" data-group="' + grouping + '"></div>');
24431                     entriesContainer.appendChild(container);
24432                 }
24433
24434                 var html = entry.html || (
24435                     entry.separator ?
24436                     '<hr class="separator" />' :
24437                     '<div class="entry" draggable="true"></div>');
24438
24439
24440                 var control = domify(html);
24441                 // alert("Control ::" + control + " HTML :: " + html);
24442
24443                 container.appendChild(control);
24444
24445                 if (!entry.separator) {
24446                     domAttr(control, 'data-action', id);
24447
24448                     if (entry.title) {
24449                         domAttr(control, 'title', entry.title);
24450                     }
24451
24452
24453
24454                     if (entry.className) {
24455                         domClasses(control).add(entry.className);
24456                     }
24457
24458                     if (entry.imageUrl) {
24459                         control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
24460                     }
24461                 }
24462
24463                 // alert("Entry Title :: " + entry.title + " Entry HTML :: " + html);
24464             });
24465
24466             // open after update
24467             this.open(true);
24468         };
24469
24470
24471         /**
24472          * Trigger an action available on the palette
24473          * 
24474          * @param {String}
24475          *            action
24476          * @param {Event}
24477          *            event
24478          */
24479         Palette.prototype.trigger = function(action, event, autoActivate) {
24480
24481             var entries = this._entries,
24482                 entry,
24483                 handler,
24484                 originalEvent,
24485                 button = event.delegateTarget || event.target;
24486
24487             if (!button) {
24488                 return event.preventDefault();
24489             }
24490
24491
24492             entry = entries[domAttr(button, 'data-action')];
24493             handler = entry.action;
24494
24495             originalEvent = event.originalEvent || event;
24496
24497             // simple action (via callback function)
24498             if (isFunction(handler)) {
24499                 if (action === 'click') {
24500                     return handler(originalEvent, autoActivate);
24501                 }
24502             } else {
24503                 if (handler[action]) {
24504                     return handler[action](originalEvent, autoActivate);
24505                 }
24506             }
24507
24508             // silence other actions
24509             event.preventDefault();
24510         };
24511
24512
24513         /**
24514          * Close the palette
24515          */
24516         Palette.prototype.close = function() {
24517             domClasses(this._container).remove('open');
24518         };
24519
24520
24521         /**
24522          * Open the palette
24523          */
24524         Palette.prototype.open = function() {
24525             domClasses(this._container).add('open');
24526         };
24527
24528
24529         Palette.prototype.toggle = function(open) {
24530             if (this.isOpen()) {
24531                 this.close();
24532             } else {
24533                 this.open();
24534             }
24535         };
24536
24537
24538         /**
24539          * Return true if the palette is opened.
24540          * 
24541          * @example
24542          * 
24543          * palette.open();
24544          * 
24545          * if (palette.isOpen()) { // yes, we are open }
24546          * 
24547          * @return {boolean} true if palette is opened
24548          */
24549         Palette.prototype.isOpen = function() {
24550             return this._container && domClasses(this._container).has('open');
24551         };
24552
24553
24554         /* markup definition */
24555
24556         Palette.HTML_MARKUP =
24557             '<div class="djs-palette">' +
24558             '<div class="djs-palette-entries"></div>' +
24559             '<div class="djs-palette-toggle"></div>' +
24560             '</div>';
24561     }, {
24562         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24563         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
24564         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
24565         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24566         "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js",
24567         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
24568         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24569         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
24570         "min-dom/lib/matches": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js",
24571         "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js"
24572     }],
24573     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\index.js": [function(require, module, exports) {
24574         module.exports = {
24575             __init__: ['palette'],
24576             palette: ['type', require('./Palette')]
24577         };
24578
24579     }, {
24580         "./Palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\Palette.js"
24581     }],
24582     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\PopupMenu.js": [function(require, module, exports) {
24583         'use strict';
24584
24585         var forEach = require('lodash/collection/forEach'),
24586             assign = require('lodash/object/assign'),
24587             domEvent = require('min-dom/lib/event'),
24588             domify = require('min-dom/lib/domify'),
24589             domClasses = require('min-dom/lib/classes'),
24590             domAttr = require('min-dom/lib/attr'),
24591             domRemove = require('min-dom/lib/remove');
24592
24593
24594         function PopupMenu(eventBus, canvas) {
24595
24596             this._eventBus = eventBus;
24597             this._canvas = canvas;
24598             this._instances = {};
24599         }
24600
24601         PopupMenu.$inject = ['eventBus', 'canvas'];
24602
24603         module.exports = PopupMenu;
24604
24605         PopupMenu.prototype.open = function(name, position, entries, options) {
24606
24607             var outer = this,
24608                 canvas = this._canvas,
24609                 instances = outer._instances;
24610
24611             // return existing instance
24612             if (instances[name]) {
24613                 return instances[name];
24614             }
24615
24616             var parent = canvas.getContainer();
24617
24618             // ------------------------
24619             function PopupMenuInstance() {
24620
24621                 var self = this;
24622
24623                 self._actions = {};
24624                 self.name = name || 'popup-menu';
24625
24626                 var _options = {
24627                     entryClassName: 'entry'
24628                 };
24629                 assign(_options, options);
24630
24631                 // Container setup
24632                 var container = this._container = domify('<div class="djs-popup">');
24633
24634                 assign(container.style, {
24635                     position: 'absolute',
24636                     left: position.x + 'px',
24637                     top: position.y + 'px'
24638                 });
24639                 domClasses(container).add(name);
24640
24641                 // Add entries
24642                 forEach(entries, function(entry) {
24643
24644                     var entryContainer = domify('<div>');
24645                     domClasses(entryContainer).add(entry.className || _options.entryClassName);
24646                     domClasses(entryContainer).add('djs-popup-entry');
24647
24648                     if (entry.style) {
24649                         domAttr(entryContainer, 'style', entry.style);
24650                     }
24651
24652                     if (entry.action) {
24653                         domAttr(entryContainer, 'data-action', entry.action.name);
24654                         self._actions[entry.action.name] = entry.action.handler;
24655                     }
24656
24657                     var title = domify('<span>');
24658                     title.textContent = entry.label;
24659                     entryContainer.appendChild(title);
24660
24661                     container.appendChild(entryContainer);
24662                 });
24663
24664                 // Event handler
24665                 domEvent.bind(container, 'click', function(event) {
24666                     self.trigger(event);
24667                 });
24668
24669
24670
24671                 // apply canvas zoom level
24672                 var zoom = canvas.zoom();
24673
24674                 container.style.transformOrigin = 'top left';
24675                 container.style.transform = 'scale(' + zoom + ')';
24676
24677                 // Attach to DOM
24678                 parent.appendChild(container);
24679
24680                 // Add Handler
24681                 this.bindHandlers();
24682             }
24683
24684             PopupMenuInstance.prototype.close = function() {
24685                 this.unbindHandlers();
24686                 domRemove(this._container);
24687                 delete outer._instances[this.name];
24688             };
24689
24690             PopupMenuInstance.prototype.bindHandlers = function() {
24691
24692                 var self = this,
24693                     eventBus = outer._eventBus;
24694
24695                 this._closeHandler = function() {
24696                     self.close();
24697                 };
24698
24699                 eventBus.once('contextPad.close', this._closeHandler);
24700                 eventBus.once('canvas.viewbox.changed', this._closeHandler);
24701             };
24702
24703             PopupMenuInstance.prototype.unbindHandlers = function() {
24704
24705                 var eventBus = outer._eventBus;
24706
24707                 eventBus.off('contextPad.close', this._closeHandler);
24708                 eventBus.off('canvas.viewbox.changed', this._closeHandler);
24709             };
24710
24711             PopupMenuInstance.prototype.trigger = function(event) {
24712
24713                 var element = event.target,
24714                     actionName = element.getAttribute('data-action') ||
24715                     element.parentNode.getAttribute('data-action');
24716
24717                 var action = this._actions[actionName];
24718
24719
24720                 if (action) {
24721                     action();
24722                 }
24723
24724                 // silence other actions
24725                 event.preventDefault();
24726             };
24727
24728             var instance = outer._instances[name] = new PopupMenuInstance(position, entries, parent, options);
24729
24730             return instance;
24731         };
24732
24733     }, {
24734         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24735         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
24736         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
24737         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24738         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24739         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
24740         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
24741     }],
24742     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\index.js": [function(require, module, exports) {
24743         'use strict';
24744
24745         module.exports = {
24746             __init__: ['popupMenu'],
24747             popupMenu: ['type', require('./PopupMenu')]
24748         };
24749
24750     }, {
24751         "./PopupMenu": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\PopupMenu.js"
24752     }],
24753     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\Replace.js": [function(require, module, exports) {
24754         'use strict';
24755
24756
24757         /**
24758          * Service that allow replacing of elements.
24759          * 
24760          * 
24761          * @class
24762          * @constructor
24763          */
24764         function Replace(modeling) {
24765
24766             this._modeling = modeling;
24767         }
24768
24769         module.exports = Replace;
24770
24771         Replace.$inject = ['modeling'];
24772
24773         /**
24774          * @param {Element}
24775          *            oldElement - Element to be replaced
24776          * @param {Object}
24777          *            newElementData - Containing information about the new Element, for
24778          *            example height, width, type.
24779          * @param {Object}
24780          *            options - Custom options that will be attached to the context. It
24781          *            can be used to inject data that is needed in the command chain.
24782          *            For example it could be used in
24783          *            eventbus.on('commandStack.shape.replace.postExecute') to change
24784          *            shape attributes after shape creation.
24785          */
24786         Replace.prototype.replaceElement = function(oldElement, newElementData, options) {
24787
24788             var modeling = this._modeling;
24789
24790             var newElement = null;
24791
24792             if (oldElement.waypoints) {
24793                 // TODO
24794                 // modeling.replaceConnection
24795             } else {
24796                 // set center of element for modeling API
24797                 // if no new width / height is given use old elements size
24798                 newElementData.x = oldElement.x + (newElementData.width || oldElement.width) / 2;
24799                 newElementData.y = oldElement.y + (newElementData.height || oldElement.height) / 2;
24800
24801                 newElement = modeling.replaceShape(oldElement, newElementData, options);
24802             }
24803
24804             return newElement;
24805         };
24806
24807     }, {}],
24808     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\index.js": [function(require, module, exports) {
24809         'use strict';
24810
24811         module.exports = {
24812             __init__: ['replace'],
24813             replace: ['type', require('./Replace')]
24814         };
24815
24816     }, {
24817         "./Replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\Replace.js"
24818     }],
24819     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\Resize.js": [function(require, module, exports) {
24820         'use strict';
24821
24822         var forEach = require('lodash/collection/forEach'),
24823             filter = require('lodash/collection/filter'),
24824             pick = require('lodash/object/pick');
24825
24826         var ResizeUtil = require('./ResizeUtil'),
24827             domEvent = require('min-dom/lib/event'),
24828             Elements = require('../../util/Elements');
24829
24830         var isPrimaryButton = require('../../util/Mouse').isPrimaryButton;
24831
24832         var round = Math.round;
24833
24834         var Snap = require('../../../vendor/snapsvg');
24835
24836         var HANDLE_OFFSET = -2,
24837             HANDLE_SIZE = 5,
24838             HANDLE_HIT_SIZE = 20;
24839
24840         var MARKER_RESIZING = 'djs-resizing',
24841             MARKER_RESIZE_NOT_OK = 'resize-not-ok',
24842             CLS_RESIZER = 'djs-resizer';
24843
24844
24845         /**
24846          * Implements resize on shapes by
24847          *  * adding resize handles, * creating a visual during resize * checking resize
24848          * rules * committing a change once finished
24849          * 
24850          *  ## Customizing
24851          * 
24852          * It's possible to customize the resizing behaviour by intercepting
24853          * 'resize.start' and providing the following parameters through the 'context':
24854          *  * minDimensions ({ width, height }) - Minimum shape dimensions *
24855          * childrenBoxPadding (number) - Gap between the minimum bounding box and the
24856          * container
24857          * 
24858          * f.ex:
24859          * 
24860          * eventBus.on('resize.start', 1500, function(event) { var context =
24861          * event.context,
24862          * 
24863          * context.minDimensions = { width: 140, height: 120 };
24864          * context.childrenBoxPadding = 30; });
24865          */
24866
24867         function Resize(eventBus, elementRegistry, rules, modeling, canvas, selection, dragging) {
24868
24869             function canResize(context) {
24870                 var ctx = pick(context, ['newBounds', 'shape', 'delta', 'direction']);
24871                 return rules.allowed('shape.resize', ctx);
24872             }
24873
24874
24875             // resizing implementation //////////////////////////////////
24876
24877             /**
24878              * A helper that realizes the resize visuals
24879              */
24880             var visuals = {
24881                 create: function(context) {
24882                     var container = canvas.getDefaultLayer(),
24883                         shape = context.shape,
24884                         frame;
24885
24886                     frame = context.frame = Snap.create('rect', {
24887                         class: 'djs-resize-overlay',
24888                         width: shape.width + 10,
24889                         height: shape.height + 10,
24890                         x: shape.x - 5,
24891                         y: shape.y - 5
24892                     });
24893
24894                     frame.appendTo(container);
24895                 },
24896
24897                 update: function(context) {
24898                     var frame = context.frame,
24899                         bounds = context.newBounds;
24900
24901                     if (bounds.width > 5) {
24902                         frame.attr({
24903                             x: bounds.x,
24904                             width: bounds.width
24905                         });
24906                     }
24907
24908                     if (bounds.height > 5) {
24909                         frame.attr({
24910                             y: bounds.y,
24911                             height: bounds.height
24912                         });
24913                     }
24914
24915                     frame[context.canExecute ? 'removeClass' : 'addClass'](MARKER_RESIZE_NOT_OK);
24916                 },
24917
24918                 remove: function(context) {
24919                     if (context.frame) {
24920                         context.frame.remove();
24921                     }
24922                 }
24923             };
24924
24925             function computeMinBoundaryBox(context) {
24926
24927                 var shape = context.shape,
24928                     direction = context.direction,
24929                     minDimensions = context.minDimensions || {},
24930                     childrenBoxPadding = context.childrenBoxPadding || 20,
24931                     children,
24932                     minBoundaryBox;
24933
24934                 // grab all the shapes that are NOT labels or connections
24935                 children = filter(shape.children, function(child) {
24936                     // connections
24937                     if (child.waypoints) {
24938                         return false;
24939                     }
24940
24941                     // labels
24942                     if (child.type === 'label') {
24943                         return false;
24944                     }
24945
24946                     return true;
24947                 });
24948
24949                 // compute a minimum bounding box
24950                 // around the existing children
24951                 if (children.length) {
24952                     minBoundaryBox = Elements.getBBox(children);
24953
24954                     // add a gap between the minBoundaryBox and the resizable container
24955                     minBoundaryBox.width += childrenBoxPadding * 2;
24956                     minBoundaryBox.height += childrenBoxPadding * 2;
24957                     minBoundaryBox.x -= childrenBoxPadding;
24958                     minBoundaryBox.y -= childrenBoxPadding;
24959                 } else {
24960                     minBoundaryBox = ResizeUtil.getMinResizeBounds(direction, shape, {
24961                         width: minDimensions.width || 10,
24962                         height: minDimensions.height || 10
24963                     });
24964                 }
24965
24966                 return minBoundaryBox;
24967             }
24968
24969             eventBus.on('resize.start', function(event) {
24970
24971                 var context = event.context,
24972                     shape = context.shape,
24973                     minBoundaryBox = context.minBoundaryBox;
24974
24975                 if (minBoundaryBox === undefined) {
24976                     context.minBoundaryBox = computeMinBoundaryBox(context);
24977                 }
24978
24979                 // add resizable indicator
24980                 canvas.addMarker(shape, MARKER_RESIZING);
24981
24982                 visuals.create(context);
24983             });
24984
24985             eventBus.on('resize.move', function(event) {
24986
24987                 var context = event.context,
24988                     shape = context.shape,
24989                     direction = context.direction,
24990                     minBoundaryBox = context.minBoundaryBox,
24991                     delta;
24992
24993                 delta = {
24994                     x: event.dx,
24995                     y: event.dy
24996                 };
24997
24998                 context.delta = delta;
24999
25000                 context.newBounds = ResizeUtil.resizeBounds(shape, direction, delta);
25001
25002                 if (minBoundaryBox) {
25003                     context.newBounds = ResizeUtil.ensureMinBounds(context.newBounds, minBoundaryBox);
25004                 }
25005
25006                 // update + cache executable state
25007                 context.canExecute = canResize(context);
25008
25009                 // update resize frame visuals
25010                 visuals.update(context);
25011             });
25012
25013             eventBus.on('resize.end', function(event) {
25014                 var context = event.context,
25015                     shape = context.shape;
25016
25017                 var newBounds = context.newBounds;
25018
25019
25020                 // ensure we have actual pixel values for new bounds
25021                 // (important when zoom level was > 1 during move)
25022                 newBounds.x = round(newBounds.x);
25023                 newBounds.y = round(newBounds.y);
25024                 newBounds.width = round(newBounds.width);
25025                 newBounds.height = round(newBounds.height);
25026
25027                 // perform the actual resize
25028                 if (context.canExecute) {
25029                     modeling.resizeShape(shape, context.newBounds);
25030                 }
25031             });
25032
25033             eventBus.on('resize.cleanup', function(event) {
25034
25035                 var context = event.context,
25036                     shape = context.shape;
25037
25038                 // remove resizable indicator
25039                 canvas.removeMarker(shape, MARKER_RESIZING);
25040
25041                 // remove frame + destroy context
25042                 visuals.remove(context);
25043             });
25044
25045
25046             function activate(event, shape, direction) {
25047
25048                 dragging.activate(event, 'resize', {
25049                     autoActivate: true,
25050                     cursor: 'resize-' + (/nw|se/.test(direction) ? 'nwse' : 'nesw'),
25051                     data: {
25052                         shape: shape,
25053                         context: {
25054                             direction: direction,
25055                             shape: shape
25056                         }
25057                     }
25058                 });
25059             }
25060
25061             function makeDraggable(element, gfx, direction) {
25062
25063                 function listener(event) {
25064                     // only trigger on left mouse button
25065                     if (isPrimaryButton(event)) {
25066                         activate(event, element, direction);
25067                     }
25068                 }
25069
25070                 domEvent.bind(gfx.node, 'mousedown', listener);
25071                 domEvent.bind(gfx.node, 'touchstart', listener);
25072             }
25073
25074             function __createResizer(gfx, x, y, rotation, direction) {
25075
25076                 var group = gfx.group().addClass(CLS_RESIZER).addClass(CLS_RESIZER + '-' + direction);
25077
25078                 var origin = -HANDLE_SIZE + HANDLE_OFFSET;
25079
25080                 // Create four drag indicators on the outline
25081                 group.rect(origin, origin, HANDLE_SIZE, HANDLE_SIZE).addClass(CLS_RESIZER + '-visual');
25082                 group.rect(origin, origin, HANDLE_HIT_SIZE, HANDLE_HIT_SIZE).addClass(CLS_RESIZER + '-hit');
25083
25084                 var matrix = new Snap.Matrix().translate(x, y).rotate(rotation, 0, 0);
25085                 group.transform(matrix);
25086
25087                 return group;
25088             }
25089
25090             function createResizer(element, gfx, direction) {
25091
25092                 var resizer;
25093
25094                 if (direction === 'nw') {
25095                     resizer = __createResizer(gfx, 0, 0, 0, direction);
25096                 } else if (direction === 'ne') {
25097                     resizer = __createResizer(gfx, element.width, 0, 90, direction);
25098                 } else if (direction === 'se') {
25099                     resizer = __createResizer(gfx, element.width, element.height, 180, direction);
25100                 } else {
25101                     resizer = __createResizer(gfx, 0, element.height, 270, direction);
25102                 }
25103
25104                 makeDraggable(element, resizer, direction);
25105             }
25106
25107             // resize handles implementation ///////////////////////////////
25108
25109             function addResize(shape) {
25110
25111                 if (!canResize({
25112                         shape: shape
25113                     })) {
25114                     return;
25115                 }
25116
25117                 var gfx = elementRegistry.getGraphics(shape);
25118
25119                 createResizer(shape, gfx, 'nw');
25120                 createResizer(shape, gfx, 'ne');
25121                 createResizer(shape, gfx, 'se');
25122                 createResizer(shape, gfx, 'sw');
25123             }
25124
25125             function removeResize(shape) {
25126
25127                 var gfx = elementRegistry.getGraphics(shape);
25128                 var resizers = gfx.selectAll('.' + CLS_RESIZER);
25129
25130                 forEach(resizers, function(resizer) {
25131                     resizer.remove();
25132                 });
25133             }
25134
25135             eventBus.on('selection.changed', function(e) {
25136
25137                 var oldSelection = e.oldSelection,
25138                     newSelection = e.newSelection;
25139
25140                 // remove old selection markers
25141                 forEach(oldSelection, removeResize);
25142
25143                 // add new selection markers ONLY if single selection
25144                 if (newSelection.length === 1) {
25145                     forEach(newSelection, addResize);
25146                 }
25147             });
25148
25149             eventBus.on('shape.changed', function(e) {
25150                 var shape = e.element;
25151
25152                 removeResize(shape);
25153
25154                 if (selection.isSelected(shape)) {
25155                     addResize(shape);
25156                 }
25157             });
25158
25159
25160             // API
25161
25162             this.activate = activate;
25163         }
25164
25165         Resize.$inject = ['eventBus', 'elementRegistry', 'rules', 'modeling', 'canvas', 'selection', 'dragging'];
25166
25167         module.exports = Resize;
25168
25169     }, {
25170         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
25171         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
25172         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
25173         "./ResizeUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\ResizeUtil.js",
25174         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
25175         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
25176         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js",
25177         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
25178     }],
25179     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\ResizeUtil.js": [function(require, module, exports) {
25180         'use strict';
25181
25182         /**
25183          * Resize the given bounds by the specified delta from a given anchor point.
25184          * 
25185          * @param {Bounds}
25186          *            bounds the bounding box that should be resized
25187          * @param {String}
25188          *            direction in which the element is resized (nw, ne, se, sw)
25189          * @param {Point}
25190          *            delta of the resize operation
25191          * 
25192          * @return {Bounds} resized bounding box
25193          */
25194         module.exports.resizeBounds = function(bounds, direction, delta) {
25195
25196             var dx = delta.x,
25197                 dy = delta.y;
25198
25199             switch (direction) {
25200
25201                 case 'nw':
25202                     return {
25203                         x: bounds.x + dx,
25204                         y: bounds.y + dy,
25205                         width: bounds.width - dx,
25206                         height: bounds.height - dy
25207                     };
25208
25209                 case 'sw':
25210                     return {
25211                         x: bounds.x + dx,
25212                         y: bounds.y,
25213                         width: bounds.width - dx,
25214                         height: bounds.height + dy
25215                     };
25216
25217                 case 'ne':
25218                     return {
25219                         x: bounds.x,
25220                         y: bounds.y + dy,
25221                         width: bounds.width + dx,
25222                         height: bounds.height - dy
25223                     };
25224
25225                 case 'se':
25226                     return {
25227                         x: bounds.x,
25228                         y: bounds.y,
25229                         width: bounds.width + dx,
25230                         height: bounds.height + dy
25231                     };
25232
25233                 default:
25234                     throw new Error('unrecognized direction: ' + direction);
25235             }
25236         };
25237
25238         module.exports.reattachPoint = function(bounds, newBounds, point) {
25239
25240             var sx = bounds.width / newBounds.width,
25241                 sy = bounds.height / newBounds.height;
25242
25243             return {
25244                 x: Math.round((newBounds.x + newBounds.width / 2)) - Math.floor(((bounds.x + bounds.width / 2) - point.x) / sx),
25245                 y: Math.round((newBounds.y + newBounds.height / 2)) - Math.floor(((bounds.y + bounds.height / 2) - point.y) / sy)
25246             };
25247         };
25248
25249
25250         module.exports.ensureMinBounds = function(currentBounds, minBounds) {
25251             var topLeft = {
25252                 x: Math.min(currentBounds.x, minBounds.x),
25253                 y: Math.min(currentBounds.y, minBounds.y)
25254             };
25255
25256             var bottomRight = {
25257                 x: Math.max(currentBounds.x + currentBounds.width, minBounds.x + minBounds.width),
25258                 y: Math.max(currentBounds.y + currentBounds.height, minBounds.y + minBounds.height)
25259             };
25260
25261             return {
25262                 x: topLeft.x,
25263                 y: topLeft.y,
25264                 width: bottomRight.x - topLeft.x,
25265                 height: bottomRight.y - topLeft.y
25266             };
25267         };
25268
25269
25270         module.exports.getMinResizeBounds = function(direction, currentBounds, minDimensions) {
25271
25272             switch (direction) {
25273                 case 'nw':
25274                     return {
25275                         x: currentBounds.x + currentBounds.width - minDimensions.width,
25276                         y: currentBounds.y + currentBounds.height - minDimensions.height,
25277                         width: minDimensions.width,
25278                         height: minDimensions.height
25279                     };
25280                 case 'sw':
25281                     return {
25282                         x: currentBounds.x + currentBounds.width - minDimensions.width,
25283                         y: currentBounds.y,
25284                         width: minDimensions.width,
25285                         height: minDimensions.height
25286                     };
25287                 case 'ne':
25288                     return {
25289                         x: currentBounds.x,
25290                         y: currentBounds.y + currentBounds.height - minDimensions.height,
25291                         width: minDimensions.width,
25292                         height: minDimensions.height
25293                     };
25294                 case 'se':
25295                     return {
25296                         x: currentBounds.x,
25297                         y: currentBounds.y,
25298                         width: minDimensions.width,
25299                         height: minDimensions.height
25300                     };
25301                 default:
25302                     throw new Error('unrecognized direction: ' + direction);
25303             }
25304         };
25305
25306
25307
25308     }, {}],
25309     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\index.js": [function(require, module, exports) {
25310         module.exports = {
25311             __depends__: [
25312                 require('../modeling'),
25313                 require('../rules'),
25314                 require('../dragging')
25315             ],
25316             __init__: ['resize'],
25317             resize: ['type', require('./Resize')]
25318         };
25319
25320     }, {
25321         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
25322         "../modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js",
25323         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
25324         "./Resize": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\Resize.js"
25325     }],
25326     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\RuleProvider.js": [function(require, module, exports) {
25327         'use strict';
25328
25329         var inherits = require('inherits');
25330
25331         var CommandInterceptor = require('../../command/CommandInterceptor');
25332
25333         /**
25334          * A basic provider that may be extended to implement modeling rules.
25335          * 
25336          * Extensions should implement the init method to actually add their custom
25337          * modeling checks. Checks may be added via the #addRule(action, fn) method.
25338          * 
25339          * @param {EventBus}
25340          *            eventBus
25341          */
25342         function RuleProvider(eventBus) {
25343             CommandInterceptor.call(this, eventBus);
25344
25345             this.init();
25346         }
25347
25348         RuleProvider.$inject = ['eventBus'];
25349
25350         inherits(RuleProvider, CommandInterceptor);
25351
25352         module.exports = RuleProvider;
25353
25354
25355         /**
25356          * Adds a modeling rule for the given action, implemented through a callback
25357          * function.
25358          * 
25359          * The function will receive the modeling specific action context to perform its
25360          * check. It must return false or null to disallow the action from happening.
25361          * 
25362          * Returning <code>null</code> may encode simply ignoring the action.
25363          * 
25364          * @example
25365          * 
25366          * ResizableRules.prototype.init = function() {
25367          * 
25368          * this.addRule('shape.resize', function(context) {
25369          * 
25370          * var shape = context.shape;
25371          * 
25372          * if (!context.newBounds) { // check general resizability if (!shape.resizable) {
25373          * return false; } } else { // element must have minimum size of 10*10 points
25374          * return context.newBounds.width > 10 && context.newBounds.height > 10; } }); };
25375          * 
25376          * @param {String|Array
25377          *            <String>} actions the identifier for the modeling action to check
25378          * @param {Function}
25379          *            fn the callback function that performs the actual check
25380          */
25381         RuleProvider.prototype.addRule = function(actions, fn) {
25382
25383             var self = this;
25384
25385             if (typeof actions === 'string') {
25386                 actions = [actions];
25387             }
25388
25389             actions.forEach(function(action) {
25390
25391                 self.canExecute(action, function(context, action, event) {
25392                     return fn(context);
25393                 }, true);
25394             });
25395         };
25396     }, {
25397         "../../command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
25398         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
25399     }],
25400     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\Rules.js": [function(require, module, exports) {
25401         'use strict';
25402
25403         /**
25404          * A service that provides rules for certain diagram actions.
25405          * 
25406          * @param {CommandStack}
25407          *            commandStack
25408          */
25409         function Rules(commandStack) {
25410             this._commandStack = commandStack;
25411         }
25412
25413         Rules.$inject = ['commandStack'];
25414
25415         module.exports = Rules;
25416
25417
25418         /**
25419          * This method can be queried to ask whether certain modeling actions are
25420          * allowed or not.
25421          * 
25422          * @param {String}
25423          *            action the action to be checked
25424          * @param {Object}
25425          *            [context] the context to check the action in
25426          * 
25427          * @return {Boolean} returns true, false or null depending on whether the
25428          *         operation is allowed, not allowed or should be ignored.
25429          */
25430         Rules.prototype.allowed = function(action, context) {
25431             var allowed = this._commandStack.canExecute(action, context);
25432
25433             // map undefined to true, i.e. no rules
25434             return allowed === undefined ? true : allowed;
25435         };
25436     }, {}],
25437     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js": [function(require, module, exports) {
25438         module.exports = {
25439             __depends__: [require('../../command')],
25440             __init__: ['rules'],
25441             rules: ['type', require('./Rules')]
25442         };
25443
25444     }, {
25445         "../../command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
25446         "./Rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\Rules.js"
25447     }],
25448     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\Selection.js": [function(require, module, exports) {
25449         'use strict';
25450
25451         var isArray = require('lodash/lang/isArray'),
25452             forEach = require('lodash/collection/forEach');
25453
25454
25455         /**
25456          * A service that offers the current selection in a diagram. Offers the api to
25457          * control the selection, too.
25458          * 
25459          * @class
25460          * 
25461          * @param {EventBus}
25462          *            eventBus the event bus
25463          */
25464         function Selection(eventBus) {
25465
25466             this._eventBus = eventBus;
25467
25468             this._selectedElements = [];
25469
25470             var self = this;
25471
25472             eventBus.on(['shape.remove', 'connection.remove'], function(e) {
25473                 var element = e.element;
25474                 self.deselect(element);
25475             });
25476         }
25477
25478         Selection.$inject = ['eventBus'];
25479
25480         module.exports = Selection;
25481
25482
25483         Selection.prototype.deselect = function(element) {
25484             var selectedElements = this._selectedElements;
25485
25486             var idx = selectedElements.indexOf(element);
25487
25488             if (idx !== -1) {
25489                 var oldSelection = selectedElements.slice();
25490
25491                 selectedElements.splice(idx, 1);
25492
25493                 this._eventBus.fire('selection.changed', {
25494                     oldSelection: oldSelection,
25495                     newSelection: selectedElements
25496                 });
25497             }
25498         };
25499
25500
25501         Selection.prototype.get = function() {
25502             return this._selectedElements;
25503         };
25504
25505         Selection.prototype.isSelected = function(element) {
25506             return this._selectedElements.indexOf(element) !== -1;
25507         };
25508
25509
25510         /**
25511          * This method selects one or more elements on the diagram.
25512          * 
25513          * By passing an additional add parameter you can decide whether or not the
25514          * element(s) should be added to the already existing selection or not.
25515          * 
25516          * @method Selection#select
25517          * 
25518          * @param {Object|Object[]}
25519          *            elements element or array of elements to be selected
25520          * @param {boolean}
25521          *            [add] whether the element(s) should be appended to the current
25522          *            selection, defaults to false
25523          */
25524         Selection.prototype.select = function(elements, add) {
25525             var selectedElements = this._selectedElements,
25526                 oldSelection = selectedElements.slice();
25527
25528             if (!isArray(elements)) {
25529                 elements = elements ? [elements] : [];
25530             }
25531
25532             // selection may be cleared by passing an empty array or null
25533             // to the method
25534             if (add) {
25535                 forEach(elements, function(element) {
25536                     if (selectedElements.indexOf(element) !== -1) {
25537                         // already selected
25538                         return;
25539                     } else {
25540                         selectedElements.push(element);
25541                     }
25542                 });
25543             } else {
25544                 this._selectedElements = selectedElements = elements.slice();
25545             }
25546             this._eventBus.fire('selection.changed', {
25547                 oldSelection: oldSelection,
25548                 newSelection: selectedElements
25549             });
25550         };
25551
25552     }, {
25553         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
25554         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
25555     }],
25556     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionBehavior.js": [function(require, module, exports) {
25557         'use strict';
25558
25559         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
25560
25561
25562         function SelectionBehavior(eventBus, selection, canvas) {
25563
25564             eventBus.on('create.end', 500, function(e) {
25565                 if (e.context.canExecute) {
25566                     selection.select(e.shape);
25567                 }
25568             });
25569
25570             eventBus.on('connect.end', 500, function(e) {
25571                 if (e.context.canExecute && e.context.target) {
25572                     selection.select(e.context.target);
25573                 }
25574             });
25575
25576             eventBus.on('shape.move.end', 500, function(e) {
25577                 selection.select(e.context.shapes);
25578             });
25579
25580             eventBus.on('element.keydown', function(event) {
25581                 alert("Key Down Elements ");
25582             });
25583             // Shift + click selection
25584             eventBus.on('element.click', function(event) {
25585
25586                 var element = event.element;
25587
25588                 // do not select the root element
25589                 // or connections
25590                 if (element === canvas.getRootElement()) {
25591                     element = null;
25592                 }
25593
25594                 var isSelected = selection.isSelected(element),
25595                     isMultiSelect = selection.get().length > 1;
25596
25597                 // mouse-event: SELECTION_KEY
25598                 var add = hasPrimaryModifier(event);
25599
25600                 // select OR deselect element in multi selection
25601                 if (isSelected && isMultiSelect) {
25602                     if (add) {
25603                         return selection.deselect(element);
25604                     } else {
25605                         return selection.select(element);
25606                     }
25607                 } else
25608                 if (!isSelected) {
25609                     selection.select(element, add);
25610                 } else {
25611                     selection.deselect(element);
25612                 }
25613             });
25614
25615         }
25616
25617         SelectionBehavior.$inject = ['eventBus', 'selection', 'canvas'];
25618
25619         module.exports = SelectionBehavior;
25620
25621     }, {
25622         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js"
25623     }],
25624     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionVisuals.js": [function(require, module, exports) {
25625         'use strict';
25626
25627         var forEach = require('lodash/collection/forEach');
25628
25629         var MARKER_HOVER = 'hover',
25630             MARKER_SELECTED = 'selected';
25631
25632
25633         /**
25634          * A plugin that adds a visible selection UI to shapes and connections by
25635          * appending the <code>hover</code> and <code>selected</code> classes to
25636          * them.
25637          * 
25638          * @class
25639          * 
25640          * Makes elements selectable, too.
25641          * 
25642          * @param {EventBus}
25643          *            events
25644          * @param {SelectionService}
25645          *            selection
25646          * @param {Canvas}
25647          *            canvas
25648          */
25649         function SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {
25650
25651             this._multiSelectionBox = null;
25652
25653             function addMarker(e, cls) {
25654                 canvas.addMarker(e, cls);
25655             }
25656
25657             function removeMarker(e, cls) {
25658                 canvas.removeMarker(e, cls);
25659             }
25660
25661             events.on('element.hover', function(event) {
25662                 addMarker(event.element, MARKER_HOVER);
25663             });
25664
25665             events.on('element.out', function(event) {
25666                 removeMarker(event.element, MARKER_HOVER);
25667             });
25668
25669             events.on('selection.changed', function(event) {
25670
25671                 function deselect(s) {
25672                     removeMarker(s, MARKER_SELECTED);
25673                 }
25674
25675                 function select(s) {
25676                     addMarker(s, MARKER_SELECTED);
25677                 }
25678
25679                 var oldSelection = event.oldSelection,
25680                     newSelection = event.newSelection;
25681
25682                 forEach(oldSelection, function(e) {
25683                     if (newSelection.indexOf(e) === -1) {
25684                         deselect(e);
25685                     }
25686                 });
25687
25688                 forEach(newSelection, function(e) {
25689                     if (oldSelection.indexOf(e) === -1) {
25690                         select(e);
25691                     }
25692                 });
25693             });
25694         }
25695
25696         SelectionVisuals.$inject = [
25697             'eventBus',
25698             'canvas',
25699             'selection',
25700             'graphicsFactory',
25701             'styles'
25702         ];
25703
25704         module.exports = SelectionVisuals;
25705
25706     }, {
25707         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
25708     }],
25709     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js": [function(require, module, exports) {
25710         module.exports = {
25711             __init__: ['selectionVisuals', 'selectionBehavior'],
25712             __depends__: [
25713                 require('../interaction-events'),
25714                 require('../outline')
25715             ],
25716             selection: ['type', require('./Selection')],
25717             selectionVisuals: ['type', require('./SelectionVisuals')],
25718             selectionBehavior: ['type', require('./SelectionBehavior')]
25719         };
25720
25721     }, {
25722         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
25723         "../outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js",
25724         "./Selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\Selection.js",
25725         "./SelectionBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionBehavior.js",
25726         "./SelectionVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionVisuals.js"
25727     }],
25728     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapContext.js": [function(require, module, exports) {
25729         'use strict';
25730
25731         var forEach = require('lodash/collection/forEach');
25732
25733         var snapTo = require('./SnapUtil').snapTo;
25734
25735
25736         /**
25737          * A snap context, containing the (possibly incomplete) mappings of drop targets
25738          * (to identify the snapping) to computed snap points.
25739          */
25740         function SnapContext() {
25741
25742             /**
25743              * Map<String, SnapPoints> mapping drop targets to a list of possible
25744              * snappings.
25745              * 
25746              * @type {Object}
25747              */
25748             this._targets = {};
25749
25750             /**
25751              * Map<String, Point> initial positioning of element regarding various snap
25752              * directions.
25753              * 
25754              * @type {Object}
25755              */
25756             this._snapOrigins = {};
25757
25758             /**
25759              * List of snap locations
25760              * 
25761              * @type {Array<String>}
25762              */
25763             this._snapLocations = [];
25764
25765             /**
25766              * Map<String, Array<Point>> of default snapping locations
25767              * 
25768              * @type {Object}
25769              */
25770             this._defaultSnaps = {};
25771         }
25772
25773
25774         SnapContext.prototype.getSnapOrigin = function(snapLocation) {
25775             return this._snapOrigins[snapLocation];
25776         };
25777
25778
25779         SnapContext.prototype.setSnapOrigin = function(snapLocation, initialValue) {
25780             this._snapOrigins[snapLocation] = initialValue;
25781
25782             if (this._snapLocations.indexOf(snapLocation) === -1) {
25783                 this._snapLocations.push(snapLocation);
25784             }
25785         };
25786
25787
25788         SnapContext.prototype.addDefaultSnap = function(type, point) {
25789
25790             var snapValues = this._defaultSnaps[type];
25791
25792             if (!snapValues) {
25793                 snapValues = this._defaultSnaps[type] = [];
25794             }
25795
25796             snapValues.push(point);
25797         };
25798
25799         /**
25800          * Return a number of initialized snaps, i.e. snap locations such as top-left,
25801          * mid, bottom-right and so forth.
25802          * 
25803          * @return {Array<String>} snapLocations
25804          */
25805         SnapContext.prototype.getSnapLocations = function() {
25806             return this._snapLocations;
25807         };
25808
25809         /**
25810          * Set the snap locations for this context.
25811          * 
25812          * The order of locations determines precedence.
25813          * 
25814          * @param {Array
25815          *            <String>} snapLocations
25816          */
25817         SnapContext.prototype.setSnapLocations = function(snapLocations) {
25818             this._snapLocations = snapLocations;
25819         };
25820
25821         /**
25822          * Get snap points for a given target
25823          * 
25824          * @param {Element|String}
25825          *            target
25826          */
25827         SnapContext.prototype.pointsForTarget = function(target) {
25828
25829             var targetId = target.id || target;
25830
25831             var snapPoints = this._targets[targetId];
25832
25833             if (!snapPoints) {
25834                 snapPoints = this._targets[targetId] = new SnapPoints();
25835                 snapPoints.initDefaults(this._defaultSnaps);
25836             }
25837
25838             return snapPoints;
25839         };
25840
25841         module.exports = SnapContext;
25842
25843
25844         /**
25845          * Creates the snap points and initializes them with the given default values.
25846          * 
25847          * @param {Object
25848          *            <String, Array<Point>>} [defaultPoints]
25849          */
25850         function SnapPoints(defaultSnaps) {
25851
25852             /**
25853              * Map<String, Map<(x|y), Array<Number>>> mapping snap locations, i.e.
25854              * top-left, bottom-right, center to actual snap values.
25855              * 
25856              * @type {Object}
25857              */
25858             this._snapValues = {};
25859         }
25860
25861         SnapPoints.prototype.add = function(snapLocation, point) {
25862
25863             var snapValues = this._snapValues[snapLocation];
25864
25865             if (!snapValues) {
25866                 snapValues = this._snapValues[snapLocation] = {
25867                     x: [],
25868                     y: []
25869                 };
25870             }
25871
25872             if (snapValues.x.indexOf(point.x) === -1) {
25873                 snapValues.x.push(point.x);
25874             }
25875
25876             if (snapValues.y.indexOf(point.y) === -1) {
25877                 snapValues.y.push(point.y);
25878             }
25879         };
25880
25881
25882         SnapPoints.prototype.snap = function(point, snapLocation, axis, tolerance) {
25883             var snappingValues = this._snapValues[snapLocation];
25884
25885             return snappingValues && snapTo(point[axis], snappingValues[axis], tolerance);
25886         };
25887
25888         /**
25889          * Initialize a number of default snapping points.
25890          * 
25891          * @param {Object}
25892          *            defaultSnaps
25893          */
25894         SnapPoints.prototype.initDefaults = function(defaultSnaps) {
25895
25896             var self = this;
25897
25898             forEach(defaultSnaps || {}, function(snapPoints, snapLocation) {
25899                 forEach(snapPoints, function(point) {
25900                     self.add(snapLocation, point);
25901                 });
25902             });
25903         };
25904     }, {
25905         "./SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
25906         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
25907     }],
25908     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js": [function(require, module, exports) {
25909         'use strict';
25910
25911         var abs = Math.abs,
25912             round = Math.round;
25913
25914
25915         /**
25916          * Snap value to a collection of reference values.
25917          * 
25918          * @param {Number}
25919          *            value
25920          * @param {Array
25921          *            <Number>} values
25922          * @param {Number}
25923          *            [tolerance=10]
25924          * 
25925          * @return {Number} the value we snapped to or null, if none snapped
25926          */
25927         function snapTo(value, values, tolerance) {
25928             tolerance = tolerance === undefined ? 10 : tolerance;
25929
25930             var idx, snapValue;
25931
25932             for (idx = 0; idx < values.length; idx++) {
25933                 snapValue = values[idx];
25934
25935                 if (abs(snapValue - value) <= tolerance) {
25936                     return snapValue;
25937                 }
25938             }
25939         }
25940
25941
25942         module.exports.snapTo = snapTo;
25943
25944
25945         function topLeft(bounds) {
25946             return {
25947                 x: bounds.x,
25948                 y: bounds.y
25949             };
25950         }
25951
25952         module.exports.topLeft = topLeft;
25953
25954
25955         function mid(bounds, defaultValue) {
25956
25957             if (!bounds || isNaN(bounds.x) || isNaN(bounds.y)) {
25958                 return defaultValue;
25959             }
25960
25961             return {
25962                 x: round(bounds.x + bounds.width / 2),
25963                 y: round(bounds.y + bounds.height / 2)
25964             };
25965         }
25966
25967         module.exports.mid = mid;
25968
25969
25970         function bottomRight(bounds) {
25971             return {
25972                 x: bounds.x + bounds.width,
25973                 y: bounds.y + bounds.height
25974             };
25975         }
25976
25977         module.exports.bottomRight = bottomRight;
25978     }, {}],
25979     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\Snapping.js": [function(require, module, exports) {
25980         'use strict';
25981
25982         var filter = require('lodash/collection/filter'),
25983             forEach = require('lodash/collection/forEach'),
25984             debounce = require('lodash/function/debounce');
25985
25986
25987         var mid = require('./SnapUtil').mid;
25988
25989         var SnapContext = require('./SnapContext');
25990
25991         /**
25992          * A general purpose snapping component for diagram elements.
25993          * 
25994          * @param {EventBus}
25995          *            eventBus
25996          * @param {Canvas}
25997          *            canvas
25998          */
25999         function Snapping(eventBus, canvas) {
26000
26001             this._canvas = canvas;
26002
26003             var self = this;
26004
26005             eventBus.on(['shape.move.start', 'create.start'], function(event) {
26006                 self.initSnap(event);
26007             });
26008
26009             eventBus.on(['shape.move.move', 'shape.move.end', 'create.move', 'create.end'], function(event) {
26010                 if (event.snapped) {
26011                     return;
26012                 }
26013
26014                 self.snap(event);
26015             });
26016
26017             eventBus.on(['shape.move.cleanup', 'create.cleanup'], function(event) {
26018                 self.hide();
26019             });
26020
26021             // delay hide by 1000 seconds since last match
26022             this._asyncHide = debounce(this.hide, 1000);
26023         }
26024
26025         Snapping.$inject = ['eventBus', 'canvas'];
26026
26027         module.exports = Snapping;
26028
26029
26030         Snapping.prototype.initSnap = function(event) {
26031
26032             var context = event.context,
26033                 shape = context.shape,
26034                 snapContext = context.snapContext;
26035
26036             if (!snapContext) {
26037                 snapContext = context.snapContext = new SnapContext();
26038             }
26039
26040             var snapMid = mid(shape, event);
26041
26042             snapContext.setSnapOrigin('mid', {
26043                 x: snapMid.x - event.x,
26044                 y: snapMid.y - event.y
26045             });
26046
26047             return snapContext;
26048         };
26049
26050
26051         Snapping.prototype.snap = function(event) {
26052
26053             var context = event.context,
26054                 snapContext = context.snapContext,
26055                 shape = context.shape,
26056                 target = context.target,
26057                 snapLocations = snapContext.getSnapLocations();
26058
26059             if (!target) {
26060                 return;
26061             }
26062
26063             var snapPoints = snapContext.pointsForTarget(target);
26064
26065             if (!snapPoints.initialized) {
26066                 this.addTargetSnaps(snapPoints, shape, target);
26067
26068                 snapPoints.initialized = true;
26069             }
26070
26071
26072             var snapping = {};
26073
26074             forEach(snapLocations, function(location) {
26075
26076                 var snapOrigin = snapContext.getSnapOrigin(location);
26077
26078                 var snapCurrent = {
26079                     x: event.x + snapOrigin.x,
26080                     y: event.y + snapOrigin.y
26081                 };
26082
26083                 // snap on both axis, if not snapped already
26084                 forEach(['x', 'y'], function(axis) {
26085                     var locationSnapping;
26086
26087                     if (!snapping[axis]) {
26088                         locationSnapping = snapPoints.snap(snapCurrent, location, axis, 7);
26089
26090                         if (locationSnapping !== undefined) {
26091                             snapping[axis] = {
26092                                 value: locationSnapping,
26093                                 originValue: locationSnapping - snapOrigin[axis]
26094                             };
26095                         }
26096                     }
26097                 });
26098
26099                 // no more need to snap, drop out of interation
26100                 if (snapping.x && snapping.y) {
26101                     return false;
26102                 }
26103             });
26104
26105
26106             // show snap visuals
26107
26108             this.showSnapLine('vertical', snapping.x && snapping.x.value);
26109             this.showSnapLine('horizontal', snapping.y && snapping.y.value);
26110
26111
26112             // adjust event { x, y, dx, dy } and mark as snapping
26113             var cx, cy;
26114
26115             if (snapping.x) {
26116
26117                 cx = event.x - snapping.x.originValue;
26118
26119                 event.x = snapping.x.originValue;
26120                 event.dx = event.dx - cx;
26121
26122                 event.snapped = true;
26123             }
26124
26125             if (snapping.y) {
26126                 cy = event.y - snapping.y.originValue;
26127
26128                 event.y = snapping.y.originValue;
26129                 event.dy = event.dy - cy;
26130
26131                 event.snapped = true;
26132             }
26133         };
26134
26135
26136         Snapping.prototype._createLine = function(orientation) {
26137
26138             var root = this._canvas.getLayer('snap');
26139
26140             var line = root.path('M0,0 L0,0').addClass('djs-snap-line');
26141
26142             return {
26143                 update: function(position) {
26144
26145                     if (position === undefined) {
26146                         line.attr({
26147                             display: 'none'
26148                         });
26149                     } else {
26150                         if (orientation === 'horizontal') {
26151                             line.attr({
26152                                 path: 'M-100000,' + position + ' L+100000,' + position,
26153                                 display: ''
26154                             });
26155                         } else {
26156                             line.attr({
26157                                 path: 'M ' + position + ',-100000 L ' + position + ', +100000',
26158                                 display: ''
26159                             });
26160                         }
26161                     }
26162                 }
26163             };
26164         };
26165
26166
26167         Snapping.prototype._createSnapLines = function() {
26168
26169             this._snapLines = {
26170                 horizontal: this._createLine('horizontal'),
26171                 vertical: this._createLine('vertical')
26172             };
26173         };
26174
26175         Snapping.prototype.showSnapLine = function(orientation, position) {
26176
26177             var line = this.getSnapLine(orientation);
26178
26179             if (line) {
26180                 line.update(position);
26181             }
26182
26183             this._asyncHide();
26184         };
26185
26186         Snapping.prototype.getSnapLine = function(orientation) {
26187             if (!this._snapLines) {
26188                 this._createSnapLines();
26189             }
26190
26191             return this._snapLines[orientation];
26192         };
26193
26194         Snapping.prototype.hide = function() {
26195             forEach(this._snapLines, function(l) {
26196                 l.update();
26197             });
26198         };
26199
26200         Snapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
26201
26202             var siblings = this.getSiblings(shape, target);
26203
26204             forEach(siblings, function(s) {
26205                 snapPoints.add('mid', mid(s));
26206             });
26207
26208         };
26209
26210         Snapping.prototype.getSiblings = function(element, target) {
26211
26212             // snap to all non connection siblings
26213             return target && filter(target.children, function(e) {
26214                 return !e.hidden && !e.labelTarget && !e.waypoints && e !== element;
26215             });
26216         };
26217     }, {
26218         "./SnapContext": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapContext.js",
26219         "./SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
26220         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
26221         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
26222         "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js"
26223     }],
26224     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceTool.js": [function(require, module, exports) {
26225         'use strict';
26226
26227         var SpaceUtil = require('./SpaceUtil');
26228
26229         var Cursor = require('../../util/Cursor');
26230
26231         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
26232
26233         var abs = Math.abs,
26234             round = Math.round;
26235
26236         var HIGH_PRIORITY = 1500;
26237
26238         /**
26239          * A tool that allows users to create and remove space in a diagram.
26240          * 
26241          * The tool needs to be activated manually via
26242          * {@link SpaceTool#activate(MouseEvent)}.
26243          */
26244         function SpaceTool(eventBus, dragging, elementRegistry, modeling, rules) {
26245
26246             function canResize(shape) {
26247                 var ctx = {
26248                     shape: shape
26249                 };
26250                 return rules.allowed('shape.resize', ctx);
26251             }
26252
26253             function activateSelection(event, autoActivate) {
26254                 dragging.activate(event, 'spaceTool.selection', {
26255                     cursor: 'crosshair',
26256                     autoActivate: autoActivate,
26257                     data: {
26258                         context: {
26259                             crosshair: {}
26260                         }
26261                     }
26262                 });
26263             }
26264
26265             function activateMakeSpace(event) {
26266                 dragging.activate(event, 'spaceTool', {
26267                     autoActivate: true,
26268                     cursor: 'crosshair',
26269                     data: {
26270                         context: {}
26271                     }
26272                 });
26273             }
26274
26275
26276             eventBus.on('spaceTool.selection.end', function(event) {
26277                 setTimeout(function() {
26278                     activateMakeSpace(event.originalEvent);
26279                 });
26280             });
26281
26282
26283             var AXIS_TO_DIMENSION = {
26284                     x: 'width',
26285                     y: 'height'
26286                 },
26287                 AXIS_INVERTED = {
26288                     x: 'y',
26289                     y: 'x'
26290                 };
26291
26292
26293             function initializeMakeSpace(event, context) {
26294
26295                 var axis = abs(event.dx) > abs(event.dy) ? 'x' : 'y',
26296                     offset = event['d' + axis],
26297                     // start point of create space operation
26298                     spacePos = event[axis] - offset,
26299                     // list of moving shapes
26300                     movingShapes = [],
26301                     // list of resizing shapes
26302                     resizingShapes = [];
26303
26304                 if (abs(offset) < 5) {
26305                     return false;
26306                 }
26307
26308                 // inverts the offset to choose the shapes
26309                 // on the opposite side of the resizer if
26310                 // a key modifier is pressed
26311                 if (hasPrimaryModifier(event)) {
26312                     offset *= -1;
26313                 }
26314
26315                 // collect all elements that need to be moved _AND_
26316                 // resized given on the initial create space position
26317                 elementRegistry.forEach(function(shape) {
26318                     var shapeStart = shape[[axis]],
26319                         shapeEnd = shapeStart + shape[AXIS_TO_DIMENSION[axis]];
26320
26321                     // checking if it's root
26322                     if (!shape.parent) {
26323                         return;
26324                     }
26325
26326                     // checking if it's a shape
26327                     if (shape.waypoints) {
26328                         return;
26329                     }
26330
26331                     // shape after spacePos
26332                     if (offset > 0 && shapeStart > spacePos) {
26333                         return movingShapes.push(shape);
26334                     }
26335
26336                     // shape before spacePos
26337                     if (offset < 0 && shapeEnd < spacePos) {
26338                         return movingShapes.push(shape);
26339                     }
26340
26341                     // shape on top of spacePos, resize only if allowed
26342                     if (shapeStart < spacePos && shapeEnd > spacePos && canResize(shape)) {
26343                         return resizingShapes.push(shape);
26344                     }
26345                 });
26346
26347                 // store data in context
26348                 context.axis = axis;
26349                 context.direction = SpaceUtil.getDirection(axis, offset);
26350                 context.movingShapes = movingShapes;
26351                 context.resizingShapes = resizingShapes;
26352
26353                 Cursor.set('resize-' + (axis === 'x' ? 'ew' : 'ns'));
26354
26355                 return true;
26356             }
26357
26358
26359             eventBus.on('spaceTool.move', HIGH_PRIORITY, function(event) {
26360
26361                 var context = event.context;
26362
26363                 if (!context.initialized) {
26364                     context.initialized = initializeMakeSpace(event, context);
26365                 }
26366             });
26367
26368
26369             eventBus.on('spaceTool.end', function(event) {
26370
26371                 var context = event.context,
26372                     axis = context.axis,
26373                     direction = context.direction,
26374                     movingShapes = context.movingShapes,
26375                     resizingShapes = context.resizingShapes;
26376
26377                 // skip if create space has not been initialized yet
26378                 if (!context.initialized) {
26379                     return;
26380                 }
26381
26382                 var delta = {
26383                     x: round(event.dx),
26384                     y: round(event.dy)
26385                 };
26386                 delta[AXIS_INVERTED[axis]] = 0;
26387
26388                 return modeling.createSpace(movingShapes, resizingShapes, delta, direction);
26389             });
26390
26391             // API
26392             this.activateSelection = activateSelection;
26393             this.activateMakeSpace = activateMakeSpace;
26394         }
26395
26396         SpaceTool.$inject = ['eventBus', 'dragging', 'elementRegistry', 'modeling', 'rules'];
26397
26398         module.exports = SpaceTool;
26399
26400     }, {
26401         "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
26402         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
26403         "./SpaceUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js"
26404     }],
26405     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceToolVisuals.js": [function(require, module, exports) {
26406         'use strict';
26407
26408         var forEach = require('lodash/collection/forEach');
26409
26410
26411         var MARKER_DRAGGING = 'djs-dragging';
26412
26413
26414         /**
26415          * A plugin that makes shapes draggable / droppable.
26416          * 
26417          * @param {EventBus}
26418          *            eventBus
26419          * @param {ElementRegistry}
26420          *            elementRegistry
26421          * @param {Canvas}
26422          *            canvas
26423          * @param {Styles}
26424          *            styles
26425          */
26426
26427         function SpaceToolVisuals(eventBus, elementRegistry, canvas, styles) {
26428
26429             function getGfx(e) {
26430                 return elementRegistry.getGraphics(e);
26431             }
26432
26433             function addDragger(shape, dragGroup) {
26434                 var gfx = getGfx(shape);
26435                 var dragger = gfx.clone();
26436                 var bbox = gfx.getBBox();
26437
26438                 dragger.attr(styles.cls('djs-dragger', [], {
26439                     x: bbox.x,
26440                     y: bbox.y
26441                 }));
26442
26443                 dragGroup.add(dragger);
26444             }
26445
26446             eventBus.on('spaceTool.selection.start', function(event) {
26447                 var space = canvas.getLayer('space'),
26448                     context = event.context;
26449
26450                 var orientation = {
26451                     x: 'M 0,-10000 L 0,10000',
26452                     y: 'M -10000,0 L 10000,0'
26453                 };
26454
26455                 var crosshairGroup = space.group().attr(styles.cls('djs-crosshair-group', ['no-events']));
26456
26457                 crosshairGroup.path(orientation.x).addClass('djs-crosshair');
26458                 crosshairGroup.path(orientation.y).addClass('djs-crosshair');
26459
26460                 context.crosshairGroup = crosshairGroup;
26461             });
26462
26463             eventBus.on('spaceTool.selection.move', function(event) {
26464                 var crosshairGroup = event.context.crosshairGroup;
26465
26466                 crosshairGroup.translate(event.x, event.y);
26467             });
26468
26469             eventBus.on('spaceTool.selection.cleanup', function(event) {
26470                 var context = event.context,
26471                     crosshairGroup = context.crosshairGroup;
26472
26473                 if (crosshairGroup) {
26474                     crosshairGroup.remove();
26475                 }
26476             });
26477
26478
26479             // assign a low priority to this handler
26480             // to let others modify the move context before
26481             // we draw things
26482             eventBus.on('spaceTool.move', function(event) {
26483                 /*
26484                  * TODO (Ricardo): extend connections while adding space
26485                  */
26486
26487                 var context = event.context,
26488                     line = context.line,
26489                     axis = context.axis,
26490                     dragShapes = context.movingShapes;
26491
26492                 if (!context.initialized) {
26493                     return;
26494                 }
26495
26496                 if (!context.dragGroup) {
26497                     var spaceLayer = canvas.getLayer('space');
26498                     line = spaceLayer.path('M0,0 L0,0').addClass('djs-crosshair');
26499
26500                     context.line = line;
26501                     var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
26502
26503
26504                     forEach(dragShapes, function(shape) {
26505                         addDragger(shape, dragGroup);
26506                         canvas.addMarker(shape, MARKER_DRAGGING);
26507                     });
26508
26509                     context.dragGroup = dragGroup;
26510                 }
26511
26512                 var orientation = {
26513                     x: 'M' + event.x + ', -10000 L' + event.x + ', 10000',
26514                     y: 'M -10000, ' + event.y + ' L 10000, ' + event.y
26515                 };
26516
26517                 line.attr({
26518                     path: orientation[axis],
26519                     display: ''
26520                 });
26521
26522                 var opposite = {
26523                     x: 'y',
26524                     y: 'x'
26525                 };
26526                 var delta = {
26527                     x: event.dx,
26528                     y: event.dy
26529                 };
26530                 delta[opposite[context.axis]] = 0;
26531
26532                 context.dragGroup.translate(delta.x, delta.y);
26533             });
26534
26535             eventBus.on('spaceTool.cleanup', function(event) {
26536
26537                 var context = event.context,
26538                     shapes = context.movingShapes,
26539                     line = context.line,
26540                     dragGroup = context.dragGroup;
26541
26542                 // remove dragging marker
26543                 forEach(shapes, function(e) {
26544                     canvas.removeMarker(e, MARKER_DRAGGING);
26545                 });
26546
26547                 if (dragGroup) {
26548                     line.remove();
26549                     dragGroup.remove();
26550                 }
26551             });
26552         }
26553
26554         SpaceToolVisuals.$inject = ['eventBus', 'elementRegistry', 'canvas', 'styles'];
26555
26556         module.exports = SpaceToolVisuals;
26557
26558     }, {
26559         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
26560     }],
26561     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js": [function(require, module, exports) {
26562         'use strict';
26563
26564         /**
26565          * Get Resize direction given axis + offset
26566          * 
26567          * @param {String}
26568          *            axis (x|y)
26569          * @param {Number}
26570          *            offset
26571          * 
26572          * @return {String} (e|w|n|s)
26573          */
26574         function getDirection(axis, offset) {
26575
26576             if (axis === 'x') {
26577                 if (offset > 0) {
26578                     return 'e';
26579                 }
26580
26581                 if (offset < 0) {
26582                     return 'w';
26583                 }
26584             }
26585
26586             if (axis === 'y') {
26587                 if (offset > 0) {
26588                     return 's';
26589                 }
26590
26591                 if (offset < 0) {
26592                     return 'n';
26593                 }
26594             }
26595
26596             return null;
26597         }
26598
26599         module.exports.getDirection = getDirection;
26600
26601         /**
26602          * Resize the given bounds by the specified delta from a given anchor point.
26603          * 
26604          * @param {Bounds}
26605          *            bounds the bounding box that should be resized
26606          * @param {String}
26607          *            direction in which the element is resized (n, s, e, w)
26608          * @param {Point}
26609          *            delta of the resize operation
26610          * 
26611          * @return {Bounds} resized bounding box
26612          */
26613         module.exports.resizeBounds = function(bounds, direction, delta) {
26614
26615             var dx = delta.x,
26616                 dy = delta.y;
26617
26618             switch (direction) {
26619
26620                 case 'n':
26621                     return {
26622                         x: bounds.x,
26623                         y: bounds.y + dy,
26624                         width: bounds.width,
26625                         height: bounds.height - dy
26626                     };
26627
26628                 case 's':
26629                     return {
26630                         x: bounds.x,
26631                         y: bounds.y,
26632                         width: bounds.width,
26633                         height: bounds.height + dy
26634                     };
26635
26636                 case 'w':
26637                     return {
26638                         x: bounds.x + dx,
26639                         y: bounds.y,
26640                         width: bounds.width - dx,
26641                         height: bounds.height
26642                     };
26643
26644                 case 'e':
26645                     return {
26646                         x: bounds.x,
26647                         y: bounds.y,
26648                         width: bounds.width + dx,
26649                         height: bounds.height
26650                     };
26651
26652                 default:
26653                     throw new Error('unrecognized direction: ' + direction);
26654             }
26655         };
26656     }, {}],
26657     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\index.js": [function(require, module, exports) {
26658         module.exports = {
26659             __init__: ['spaceToolVisuals'],
26660             __depends__: [require('../dragging'), require('../modeling'), require('../rules')],
26661             spaceTool: ['type', require('./SpaceTool')],
26662             spaceToolVisuals: ['type', require('./SpaceToolVisuals')]
26663         };
26664
26665     }, {
26666         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
26667         "../modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js",
26668         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
26669         "./SpaceTool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceTool.js",
26670         "./SpaceToolVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceToolVisuals.js"
26671     }],
26672     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\Tooltips.js": [function(require, module, exports) {
26673         'use strict';
26674
26675         var isString = require('lodash/lang/isString'),
26676             assign = require('lodash/object/assign'),
26677             forEach = require('lodash/collection/forEach'),
26678             debounce = require('lodash/function/debounce');
26679
26680         var domify = require('min-dom/lib/domify'),
26681             domAttr = require('min-dom/lib/attr'),
26682             domClasses = require('min-dom/lib/classes'),
26683             domRemove = require('min-dom/lib/remove'),
26684             domDelegate = require('min-dom/lib/delegate');
26685
26686
26687         // document wide unique tooltip ids
26688         var ids = new(require('../../util/IdGenerator'))('tt');
26689
26690
26691         function createRoot(parent) {
26692             var root = domify('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />');
26693             parent.insertBefore(root, parent.firstChild);
26694
26695             return root;
26696         }
26697
26698
26699         function setPosition(el, x, y) {
26700             assign(el.style, {
26701                 left: x + 'px',
26702                 top: y + 'px'
26703             });
26704         }
26705
26706         function setVisible(el, visible) {
26707             el.style.display = visible === false ? 'none' : '';
26708         }
26709
26710
26711         var tooltipClass = 'djs-tooltip',
26712             tooltipSelector = '.' + tooltipClass;
26713
26714         /**
26715          * A service that allows users to render tool tips on the diagram.
26716          * 
26717          * The tooltip service will take care of updating the tooltip positioning during
26718          * navigation + zooming.
26719          * 
26720          * @example
26721          * 
26722          * ```javascript
26723          *  // add a pink badge on the top left of the shape tooltips.add({ position: {
26724          * x: 50, y: 100 }, html: '<div style="width: 10px; background: fuchsia; color:
26725          * white;">0</div>' });
26726          *  // or with optional life span tooltips.add({ position: { top: -5, left: -5 },
26727          * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>',
26728          * ttl: 2000 });
26729          *  // remove a tool tip var id = tooltips.add(...); tooltips.remove(id); ```
26730          * 
26731          * @param {Object}
26732          *            config
26733          * @param {EventBus}
26734          *            eventBus
26735          * @param {Canvas}
26736          *            canvas
26737          */
26738         function Tooltips(config, eventBus, canvas) {
26739
26740             this._eventBus = eventBus;
26741             this._canvas = canvas;
26742
26743             this._ids = ids;
26744
26745             this._tooltipDefaults = {
26746                 show: {
26747                     minZoom: 0.7,
26748                     maxZoom: 5.0
26749                 }
26750             };
26751
26752             /**
26753              * Mapping tooltipId -> tooltip
26754              */
26755             this._tooltips = {};
26756
26757             // root html element for all tooltips
26758             this._tooltipRoot = createRoot(canvas.getContainer());
26759
26760
26761             var self = this;
26762
26763             domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mousedown', function(event) {
26764                 event.stopPropagation();
26765             });
26766
26767             domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseover', function(event) {
26768                 self.trigger('mouseover', event);
26769             });
26770
26771             domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseout', function(event) {
26772                 self.trigger('mouseout', event);
26773             });
26774
26775             this._init(config);
26776         }
26777
26778
26779         Tooltips.$inject = ['config.tooltips', 'eventBus', 'canvas'];
26780
26781         module.exports = Tooltips;
26782
26783
26784         /**
26785          * Adds a HTML tooltip to the diagram
26786          * 
26787          * @param {Object}
26788          *            tooltip the tooltip configuration
26789          * 
26790          * @param {String|DOMElement}
26791          *            tooltip.html html element to use as an tooltip
26792          * @param {Object}
26793          *            [tooltip.show] show configuration
26794          * @param {Number}
26795          *            [tooltip.show.minZoom] minimal zoom level to show the tooltip
26796          * @param {Number}
26797          *            [tooltip.show.maxZoom] maximum zoom level to show the tooltip
26798          * @param {Object}
26799          *            tooltip.position where to attach the tooltip
26800          * @param {Number}
26801          *            [tooltip.position.left] relative to element bbox left attachment
26802          * @param {Number}
26803          *            [tooltip.position.top] relative to element bbox top attachment
26804          * @param {Number}
26805          *            [tooltip.position.bottom] relative to element bbox bottom
26806          *            attachment
26807          * @param {Number}
26808          *            [tooltip.position.right] relative to element bbox right attachment
26809          * @param {Number}
26810          *            [tooltip.timeout=-1]
26811          * 
26812          * @return {String} id that may be used to reference the tooltip for update or
26813          *         removal
26814          */
26815         Tooltips.prototype.add = function(tooltip) {
26816
26817             if (!tooltip.position) {
26818                 throw new Error('must specifiy tooltip position');
26819             }
26820
26821             if (!tooltip.html) {
26822                 throw new Error('must specifiy tooltip html');
26823             }
26824
26825             var id = this._ids.next();
26826
26827             tooltip = assign({}, this._tooltipDefaults, tooltip, {
26828                 id: id
26829             });
26830
26831             this._addTooltip(tooltip);
26832
26833             if (tooltip.timeout) {
26834                 this.setTimeout(tooltip);
26835             }
26836
26837             return id;
26838         };
26839
26840         Tooltips.prototype.trigger = function(action, event) {
26841
26842             var node = event.delegateTarget || event.target;
26843
26844             var tooltip = this.get(domAttr(node, 'data-tooltip-id'));
26845
26846             if (!tooltip) {
26847                 return;
26848             }
26849
26850             if (action === 'mouseover' && tooltip.timeout) {
26851                 this.clearTimeout(tooltip);
26852             }
26853
26854             if (action === 'mouseout' && tooltip.timeout) {
26855                 // cut timeout after mouse out
26856                 tooltip.timeout = 1000;
26857
26858                 this.setTimeout(tooltip);
26859             }
26860
26861             console.log('mouse leave', event);
26862         };
26863
26864         /**
26865          * Get a tooltip with the given id
26866          * 
26867          * @param {String}
26868          *            id
26869          */
26870         Tooltips.prototype.get = function(id) {
26871
26872             if (typeof id !== 'string') {
26873                 id = id.id;
26874             }
26875
26876             return this._tooltips[id];
26877         };
26878
26879         Tooltips.prototype.clearTimeout = function(tooltip) {
26880
26881             tooltip = this.get(tooltip);
26882
26883             if (!tooltip) {
26884                 return;
26885             }
26886
26887             var removeTimer = tooltip.removeTimer;
26888
26889             if (removeTimer) {
26890                 clearTimeout(removeTimer);
26891                 tooltip.removeTimer = null;
26892             }
26893         };
26894
26895         Tooltips.prototype.setTimeout = function(tooltip) {
26896
26897             tooltip = this.get(tooltip);
26898
26899             if (!tooltip) {
26900                 return;
26901             }
26902
26903             this.clearTimeout(tooltip);
26904
26905             var self = this;
26906
26907             tooltip.removeTimer = setTimeout(function() {
26908                 self.remove(tooltip);
26909             }, tooltip.timeout);
26910         };
26911
26912         /**
26913          * Remove an tooltip with the given id
26914          * 
26915          * @param {String}
26916          *            id
26917          */
26918         Tooltips.prototype.remove = function(id) {
26919
26920             var tooltip = this.get(id);
26921
26922             if (tooltip) {
26923                 domRemove(tooltip.html);
26924                 domRemove(tooltip.htmlContainer);
26925
26926                 delete tooltip.htmlContainer;
26927
26928                 delete this._tooltips[tooltip.id];
26929             }
26930         };
26931
26932
26933         Tooltips.prototype.show = function() {
26934             setVisible(this._tooltipRoot);
26935         };
26936
26937
26938         Tooltips.prototype.hide = function() {
26939             setVisible(this._tooltipRoot, false);
26940         };
26941
26942
26943         Tooltips.prototype._updateRoot = function(viewbox) {
26944             var a = viewbox.scale || 1;
26945             var d = viewbox.scale || 1;
26946
26947             var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
26948
26949             this._tooltipRoot.style.transform = matrix;
26950             this._tooltipRoot.style['-ms-transform'] = matrix;
26951         };
26952
26953
26954         Tooltips.prototype._addTooltip = function(tooltip) {
26955
26956             var id = tooltip.id,
26957                 html = tooltip.html,
26958                 htmlContainer,
26959                 tooltipRoot = this._tooltipRoot;
26960
26961             // unwrap jquery (for those who need it)
26962             if (html.get) {
26963                 html = html.get(0);
26964             }
26965
26966             // create proper html elements from
26967             // tooltip HTML strings
26968             if (isString(html)) {
26969                 html = domify(html);
26970             }
26971
26972             htmlContainer = domify('<div data-tooltip-id="' + id + '" class="' + tooltipClass + '" style="position: absolute">');
26973
26974             htmlContainer.appendChild(html);
26975
26976             if (tooltip.type) {
26977                 domClasses(htmlContainer).add('djs-tooltip-' + tooltip.type);
26978             }
26979
26980             if (tooltip.className) {
26981                 domClasses(htmlContainer).add(tooltip.className);
26982             }
26983
26984             tooltip.htmlContainer = htmlContainer;
26985
26986             tooltipRoot.appendChild(htmlContainer);
26987
26988             this._tooltips[id] = tooltip;
26989
26990             this._updateTooltip(tooltip);
26991         };
26992
26993
26994         Tooltips.prototype._updateTooltip = function(tooltip) {
26995
26996             var position = tooltip.position,
26997                 htmlContainer = tooltip.htmlContainer;
26998
26999             // update overlay html based on tooltip x, y
27000
27001             setPosition(htmlContainer, position.x, position.y);
27002         };
27003
27004
27005         Tooltips.prototype._updateTooltipVisibilty = function(viewbox) {
27006
27007             forEach(this._tooltips, function(tooltip) {
27008                 var show = tooltip.show,
27009                     htmlContainer = tooltip.htmlContainer,
27010                     visible = true;
27011
27012                 if (show) {
27013                     if (show.minZoom > viewbox.scale ||
27014                         show.maxZoom < viewbox.scale) {
27015                         visible = false;
27016                     }
27017
27018                     setVisible(htmlContainer, visible);
27019                 }
27020             });
27021         };
27022
27023         Tooltips.prototype._init = function(config) {
27024
27025             var self = this;
27026
27027
27028             // scroll/zoom integration
27029
27030             var updateViewbox = function(viewbox) {
27031                 self._updateRoot(viewbox);
27032                 self._updateTooltipVisibilty(viewbox);
27033
27034                 self.show();
27035             };
27036
27037             if (!config || config.deferUpdate !== false) {
27038                 updateViewbox = debounce(updateViewbox, 300);
27039             }
27040
27041             this._eventBus.on('canvas.viewbox.changed', function(event) {
27042                 self.hide();
27043                 updateViewbox(event.viewbox);
27044             });
27045         };
27046
27047     }, {
27048         "../../util/IdGenerator": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js",
27049         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
27050         "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js",
27051         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
27052         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
27053         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
27054         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
27055         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
27056         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
27057         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
27058     }],
27059     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\index.js": [function(require, module, exports) {
27060         module.exports = {
27061             __init__: ['tooltips'],
27062             tooltips: ['type', require('./Tooltips')]
27063         };
27064     }, {
27065         "./Tooltips": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\Tooltips.js"
27066     }],
27067     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchFix.js": [function(require, module, exports) {
27068         'use strict';
27069
27070         function TouchFix(canvas, eventBus) {
27071
27072             var self = this;
27073
27074             eventBus.on('canvas.init', function(e) {
27075                 self.addBBoxMarker(e.svg);
27076             });
27077         }
27078
27079         TouchFix.$inject = ['canvas', 'eventBus'];
27080
27081         module.exports = TouchFix;
27082
27083
27084         /**
27085          * Safari mobile (iOS 7) does not fire touchstart event in <SVG> element if
27086          * there is no shape between 0,0 and viewport elements origin.
27087          * 
27088          * So touchstart event is only fired when the <g class="viewport"> element was
27089          * hit. Putting an element over and below the 'viewport' fixes that behavior.
27090          */
27091         TouchFix.prototype.addBBoxMarker = function(paper) {
27092
27093             var markerStyle = {
27094                 fill: 'none',
27095                 class: 'outer-bound-marker'
27096             };
27097
27098             paper.rect(-10000, -10000, 10, 10).attr(markerStyle);
27099             paper.rect(10000, 10000, 10, 10).attr(markerStyle);
27100         };
27101
27102     }, {}],
27103     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchInteractionEvents.js": [function(require, module, exports) {
27104         'use strict';
27105
27106         var forEach = require('lodash/collection/forEach'),
27107             domEvent = require('min-dom/lib/event'),
27108             domClosest = require('min-dom/lib/closest'),
27109             Hammer = require('hammerjs'),
27110             Snap = require('../../../vendor/snapsvg'),
27111             Event = require('../../util/Event');
27112
27113         var MIN_ZOOM = 0.2,
27114             MAX_ZOOM = 4;
27115
27116         var mouseEvents = [
27117             'mousedown',
27118             'mouseup',
27119             'mouseover',
27120             'mouseout',
27121             'click',
27122             'dblclick'
27123         ];
27124
27125         function log() {
27126             if (false) {
27127                 console.log.apply(console, arguments);
27128             }
27129         }
27130
27131         function get(service, injector) {
27132             try {
27133                 return injector.get(service);
27134             } catch (e) {
27135                 return null;
27136             }
27137         }
27138
27139         function createTouchRecognizer(node) {
27140
27141             function stopEvent(event) {
27142                 Event.stopEvent(event, true);
27143             }
27144
27145             function stopMouse(event) {
27146
27147                 forEach(mouseEvents, function(e) {
27148                     domEvent.bind(node, e, stopEvent, true);
27149                 });
27150             }
27151
27152             function allowMouse(event) {
27153                 setTimeout(function() {
27154                     forEach(mouseEvents, function(e) {
27155                         domEvent.unbind(node, e, stopEvent, true);
27156                     });
27157                 }, 500);
27158             }
27159
27160             domEvent.bind(node, 'touchstart', stopMouse, true);
27161             domEvent.bind(node, 'touchend', allowMouse, true);
27162             domEvent.bind(node, 'touchcancel', allowMouse, true);
27163
27164             // A touch event recognizer that handles
27165             // touch events only (we know, we can already handle
27166             // mouse events out of the box)
27167
27168             var recognizer = new Hammer.Manager(node, {
27169                 inputClass: Hammer.TouchInput,
27170                 recognizers: []
27171             });
27172
27173
27174             var tap = new Hammer.Tap();
27175             var pan = new Hammer.Pan({
27176                 threshold: 10
27177             });
27178             var press = new Hammer.Press();
27179             var pinch = new Hammer.Pinch();
27180
27181             var doubleTap = new Hammer.Tap({
27182                 event: 'doubletap',
27183                 taps: 2
27184             });
27185
27186             pinch.requireFailure(pan);
27187             pinch.requireFailure(press);
27188
27189             recognizer.add([pan, press, pinch, doubleTap, tap]);
27190
27191             recognizer.reset = function(force) {
27192                 var recognizers = this.recognizers,
27193                     session = this.session;
27194
27195                 if (session.stopped) {
27196                     return;
27197                 }
27198
27199                 log('recognizer', 'stop');
27200
27201                 recognizer.stop(force);
27202
27203                 setTimeout(function() {
27204                     var i, r;
27205
27206                     log('recognizer', 'reset');
27207                     for (i = 0; !!(r = recognizers[i]); i++) {
27208                         r.reset();
27209                         r.state = 8; // FAILED STATE
27210                     }
27211
27212                     session.curRecognizer = null;
27213                 }, 0);
27214             };
27215
27216             recognizer.on('hammer.input', function(event) {
27217                 if (event.srcEvent.defaultPrevented) {
27218                     recognizer.reset(true);
27219                 }
27220             });
27221
27222             return recognizer;
27223         }
27224
27225         /**
27226          * A plugin that provides touch events for elements.
27227          * 
27228          * @param {EventBus}
27229          *            eventBus
27230          * @param {InteractionEvents}
27231          *            interactionEvents
27232          */
27233         function TouchInteractionEvents(injector, canvas, eventBus, elementRegistry, interactionEvents, snap) {
27234
27235             // optional integrations
27236             var dragging = get('dragging', injector),
27237                 move = get('move', injector),
27238                 contextPad = get('contextPad', injector),
27239                 palette = get('palette', injector);
27240
27241             // the touch recognizer
27242             var recognizer;
27243
27244             function handler(type) {
27245
27246                 return function(event) {
27247                     log('element', type, event);
27248
27249                     interactionEvents.fire(type, event);
27250                 };
27251             }
27252
27253             function getGfx(target) {
27254                 var node = domClosest(target, 'svg, .djs-element', true);
27255                 return node && new Snap(node);
27256             }
27257
27258             function initEvents(svg) {
27259
27260                 // touch recognizer
27261                 recognizer = createTouchRecognizer(svg);
27262
27263                 recognizer.on('doubletap', handler('element.dblclick'));
27264
27265                 recognizer.on('tap', handler('element.click'));
27266
27267                 function startGrabCanvas(event) {
27268
27269                     log('canvas', 'grab start');
27270
27271                     var lx = 0,
27272                         ly = 0;
27273
27274                     function update(e) {
27275
27276                         var dx = e.deltaX - lx,
27277                             dy = e.deltaY - ly;
27278
27279                         canvas.scroll({
27280                             dx: dx,
27281                             dy: dy
27282                         });
27283
27284                         lx = e.deltaX;
27285                         ly = e.deltaY;
27286                     }
27287
27288                     function end(e) {
27289                         recognizer.off('panmove', update);
27290                         recognizer.off('panend', end);
27291                         recognizer.off('pancancel', end);
27292
27293                         log('canvas', 'grab end');
27294                     }
27295
27296                     recognizer.on('panmove', update);
27297                     recognizer.on('panend', end);
27298                     recognizer.on('pancancel', end);
27299                 }
27300
27301                 function startGrab(event) {
27302
27303                     var gfx = getGfx(event.target),
27304                         element = gfx && elementRegistry.get(gfx);
27305
27306                     // recognizer
27307                     if (move && canvas.getRootElement() !== element) {
27308                         log('element', 'move start', element, event, true);
27309                         return move.start(event, element, true);
27310                     } else {
27311                         startGrabCanvas(event);
27312                     }
27313                 }
27314
27315                 function startZoom(e) {
27316
27317                     log('canvas', 'zoom start');
27318
27319                     var zoom = canvas.zoom(),
27320                         mid = e.center;
27321
27322                     function update(e) {
27323
27324                         var ratio = 1 - (1 - e.scale) / 1.50,
27325                             newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, ratio * zoom));
27326
27327                         canvas.zoom(newZoom, mid);
27328
27329                         Event.stopEvent(e, true);
27330                     }
27331
27332                     function end(e) {
27333                         recognizer.off('pinchmove', update);
27334                         recognizer.off('pinchend', end);
27335                         recognizer.off('pinchcancel', end);
27336
27337                         recognizer.reset(true);
27338
27339                         log('canvas', 'zoom end');
27340                     }
27341
27342                     recognizer.on('pinchmove', update);
27343                     recognizer.on('pinchend', end);
27344                     recognizer.on('pinchcancel', end);
27345                 }
27346
27347                 recognizer.on('panstart', startGrab);
27348                 recognizer.on('press', startGrab);
27349
27350                 recognizer.on('pinchstart', startZoom);
27351             }
27352
27353             if (dragging) {
27354
27355                 // simulate hover during dragging
27356                 eventBus.on('drag.move', function(event) {
27357
27358                     var position = Event.toPoint(event.originalEvent);
27359
27360                     var node = document.elementFromPoint(position.x, position.y),
27361                         gfx = getGfx(node),
27362                         element = gfx && elementRegistry.get(gfx);
27363
27364                     if (element !== event.hover) {
27365                         if (event.hover) {
27366                             dragging.out(event);
27367                         }
27368
27369                         if (element) {
27370                             dragging.hover({
27371                                 element: element,
27372                                 gfx: gfx
27373                             });
27374
27375                             event.hover = element;
27376                             event.hoverGfx = gfx;
27377                         }
27378                     }
27379                 });
27380             }
27381
27382             if (contextPad) {
27383
27384                 eventBus.on('contextPad.create', function(event) {
27385                     var node = event.pad.html;
27386
27387                     // touch recognizer
27388                     var padRecognizer = createTouchRecognizer(node);
27389
27390                     padRecognizer.on('panstart', function(event) {
27391                         log('context-pad', 'panstart', event);
27392                         contextPad.trigger('dragstart', event, true);
27393                     });
27394
27395                     padRecognizer.on('press', function(event) {
27396                         log('context-pad', 'press', event);
27397                         contextPad.trigger('dragstart', event, true);
27398                     });
27399
27400                     padRecognizer.on('tap', function(event) {
27401                         log('context-pad', 'tap', event);
27402                         contextPad.trigger('click', event);
27403                     });
27404                 });
27405             }
27406
27407             if (palette) {
27408                 eventBus.on('palette.create', function(event) {
27409                     var node = event.html;
27410
27411                     // touch recognizer
27412                     var padRecognizer = createTouchRecognizer(node);
27413
27414                     padRecognizer.on('panstart', function(event) {
27415                         log('palette', 'panstart', event);
27416                         palette.trigger('dragstart', event, true);
27417                     });
27418
27419                     padRecognizer.on('press', function(event) {
27420                         log('palette', 'press', event);
27421                         palette.trigger('dragstart', event, true);
27422                     });
27423
27424                     padRecognizer.on('tap', function(event) {
27425                         log('palette', 'tap', event);
27426                         palette.trigger('click', event);
27427                     });
27428                 });
27429             }
27430
27431             eventBus.on('canvas.init', function(event) {
27432                 initEvents(event.svg.node);
27433             });
27434         }
27435
27436
27437         TouchInteractionEvents.$inject = [
27438             'injector',
27439             'canvas',
27440             'eventBus',
27441             'elementRegistry',
27442             'interactionEvents',
27443             'touchFix'
27444         ];
27445
27446         module.exports = TouchInteractionEvents;
27447     }, {
27448         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
27449         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
27450         "hammerjs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\hammerjs\\hammer.js",
27451         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
27452         "min-dom/lib/closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\closest.js",
27453         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
27454     }],
27455     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\index.js": [function(require, module, exports) {
27456         module.exports = {
27457             __depends__: [require('../interaction-events')],
27458             __init__: ['touchInteractionEvents'],
27459             touchInteractionEvents: ['type', require('./TouchInteractionEvents')],
27460             touchFix: ['type', require('./TouchFix')]
27461         };
27462     }, {
27463         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
27464         "./TouchFix": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchFix.js",
27465         "./TouchInteractionEvents": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchInteractionEvents.js"
27466     }],
27467     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js": [function(require, module, exports) {
27468         'use strict';
27469
27470         var LayoutUtil = require('./LayoutUtil');
27471
27472
27473         /**
27474          * A base connection layouter implementation that layouts the connection by
27475          * directly connecting mid(source) + mid(target).
27476          */
27477         function BaseLayouter() {}
27478
27479         module.exports = BaseLayouter;
27480
27481
27482         /**
27483          * Return the new layouted waypoints for the given connection.
27484          * 
27485          * @param {djs.model.Connection}
27486          *            connection
27487          * @param {Object}
27488          *            hints
27489          * @param {Boolean}
27490          *            [hints.movedStart=false]
27491          * @param {Boolean}
27492          *            [hints.movedEnd=false]
27493          * 
27494          * @return {Array<Point>} the layouted connection waypoints
27495          */
27496         BaseLayouter.prototype.layoutConnection = function(connection, hints) {
27497             return [
27498                 LayoutUtil.getMidPoint(connection.source),
27499                 LayoutUtil.getMidPoint(connection.target)
27500             ];
27501         };
27502
27503     }, {
27504         "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js"
27505     }],
27506     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\CroppingConnectionDocking.js": [function(require, module, exports) {
27507         'use strict';
27508
27509         var assign = require('lodash/object/assign');
27510
27511         var LayoutUtil = require('./LayoutUtil');
27512
27513
27514         function dockingToPoint(docking) {
27515             // use the dockings actual point and
27516             // retain the original docking
27517             return assign({
27518                 original: docking.point.original || docking.point
27519             }, docking.actual);
27520         }
27521
27522
27523         /**
27524          * A {@link ConnectionDocking} that crops connection waypoints based on the
27525          * path(s) of the connection source and target.
27526          * 
27527          * @param {djs.core.ElementRegistry}
27528          *            elementRegistry
27529          */
27530         function CroppingConnectionDocking(elementRegistry, renderer) {
27531             this._elementRegistry = elementRegistry;
27532             this._renderer = renderer;
27533         }
27534
27535         CroppingConnectionDocking.$inject = ['elementRegistry', 'renderer'];
27536
27537         module.exports = CroppingConnectionDocking;
27538
27539
27540         /**
27541          * @inheritDoc ConnectionDocking#getCroppedWaypoints
27542          */
27543         CroppingConnectionDocking.prototype.getCroppedWaypoints = function(connection, source, target) {
27544
27545             source = source || connection.source;
27546             target = target || connection.target;
27547
27548             var sourceDocking = this.getDockingPoint(connection, source, true),
27549                 targetDocking = this.getDockingPoint(connection, target);
27550
27551             var croppedWaypoints = connection.waypoints.slice(sourceDocking.idx + 1, targetDocking.idx);
27552
27553             croppedWaypoints.unshift(dockingToPoint(sourceDocking));
27554             croppedWaypoints.push(dockingToPoint(targetDocking));
27555
27556             return croppedWaypoints;
27557         };
27558
27559         /**
27560          * Return the connection docking point on the specified shape
27561          * 
27562          * @inheritDoc ConnectionDocking#getDockingPoint
27563          */
27564         CroppingConnectionDocking.prototype.getDockingPoint = function(connection, shape, dockStart) {
27565
27566             var waypoints = connection.waypoints,
27567                 dockingIdx,
27568                 dockingPoint,
27569                 croppedPoint;
27570
27571             dockingIdx = dockStart ? 0 : waypoints.length - 1;
27572             dockingPoint = waypoints[dockingIdx];
27573
27574             croppedPoint = this._getIntersection(shape, connection, dockStart);
27575
27576             return {
27577                 point: dockingPoint,
27578                 actual: croppedPoint || dockingPoint,
27579                 idx: dockingIdx
27580             };
27581         };
27582
27583
27584         // //// helper methods ///////////////////////////////////////////////////
27585
27586         CroppingConnectionDocking.prototype._getIntersection = function(shape, connection, takeFirst) {
27587
27588             var shapePath = this._getShapePath(shape),
27589                 connectionPath = this._getConnectionPath(connection);
27590
27591             return LayoutUtil.getElementLineIntersection(shapePath, connectionPath, takeFirst);
27592         };
27593
27594         CroppingConnectionDocking.prototype._getConnectionPath = function(connection) {
27595             return this._renderer.getConnectionPath(connection);
27596         };
27597
27598         CroppingConnectionDocking.prototype._getShapePath = function(shape) {
27599             return this._renderer.getShapePath(shape);
27600         };
27601
27602         CroppingConnectionDocking.prototype._getGfx = function(element) {
27603             return this._elementRegistry.getGraphics(element);
27604         };
27605     }, {
27606         "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
27607         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
27608     }],
27609     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js": [function(require, module, exports) {
27610         'use strict';
27611
27612         var isArray = require('lodash/lang/isArray'),
27613             sortBy = require('lodash/collection/sortBy');
27614
27615         var Snap = require('../../vendor/snapsvg');
27616
27617         /**
27618          * Returns whether two points are in a horizontal or vertical line.
27619          * 
27620          * @param {Point}
27621          *            a
27622          * @param {Point}
27623          *            b
27624          * 
27625          * @return {String|Boolean} returns false if the points are not aligned or 'h|v'
27626          *         if they are aligned horizontally / vertically.
27627          */
27628         function pointsAligned(a, b) {
27629             switch (true) {
27630                 case a.x === b.x:
27631                     return 'h';
27632                 case a.y === b.y:
27633                     return 'v';
27634             }
27635
27636             return false;
27637         }
27638
27639         module.exports.pointsAligned = pointsAligned;
27640
27641
27642         function roundPoint(point) {
27643
27644             return {
27645                 x: Math.round(point.x),
27646                 y: Math.round(point.y)
27647             };
27648         }
27649
27650         module.exports.roundPoint = roundPoint;
27651
27652
27653         function pointsEqual(a, b) {
27654             return a.x === b.x && a.y === b.y;
27655         }
27656
27657         module.exports.pointsEqual = pointsEqual;
27658
27659
27660         function pointDistance(a, b) {
27661             return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
27662         }
27663
27664         module.exports.pointDistance = pointDistance;
27665
27666
27667         function asTRBL(bounds) {
27668             return {
27669                 top: bounds.y,
27670                 right: bounds.x + (bounds.width || 0),
27671                 bottom: bounds.y + (bounds.height || 0),
27672                 left: bounds.x
27673             };
27674         }
27675
27676         module.exports.asTRBL = asTRBL;
27677
27678
27679         function getMidPoint(bounds) {
27680             return roundPoint({
27681                 x: bounds.x + bounds.width / 2,
27682                 y: bounds.y + bounds.height / 2
27683             });
27684         }
27685
27686         module.exports.getMidPoint = getMidPoint;
27687
27688
27689         // //// orientation utils //////////////////////////////
27690
27691         function getOrientation(rect, reference, pointDistance) {
27692
27693             pointDistance = pointDistance || 0;
27694
27695             var rectOrientation = asTRBL(rect),
27696                 referenceOrientation = asTRBL(reference);
27697
27698             var top = rectOrientation.bottom + pointDistance <= referenceOrientation.top,
27699                 right = rectOrientation.left - pointDistance >= referenceOrientation.right,
27700                 bottom = rectOrientation.top - pointDistance >= referenceOrientation.bottom,
27701                 left = rectOrientation.right + pointDistance <= referenceOrientation.left;
27702
27703             var vertical = top ? 'top' : (bottom ? 'bottom' : null),
27704                 horizontal = left ? 'left' : (right ? 'right' : null);
27705
27706             if (horizontal && vertical) {
27707                 return vertical + '-' + horizontal;
27708             } else
27709             if (horizontal || vertical) {
27710                 return horizontal || vertical;
27711             } else {
27712                 return 'intersect';
27713             }
27714         }
27715
27716         module.exports.getOrientation = getOrientation;
27717
27718
27719         function hasAnyOrientation(rect, reference, pointDistance, locations) {
27720
27721             if (isArray(pointDistance)) {
27722                 locations = pointDistance;
27723                 pointDistance = 0;
27724             }
27725
27726             var orientation = getOrientation(rect, reference, pointDistance);
27727
27728             return locations.indexOf(orientation) !== -1;
27729         }
27730
27731         module.exports.hasAnyOrientation = hasAnyOrientation;
27732
27733
27734         // //// intersection utils //////////////////////////////
27735
27736         function getElementLineIntersection(elementPath, linePath, cropStart) {
27737
27738             var intersections = getIntersections(elementPath, linePath);
27739
27740             // recognize intersections
27741             // only one -> choose
27742             // two close together -> choose first
27743             // two or more distinct -> pull out appropriate one
27744             // none -> ok (fallback to point itself)
27745             if (intersections.length === 1) {
27746                 return roundPoint(intersections[0]);
27747             } else if (intersections.length === 2 && pointDistance(intersections[0], intersections[1]) < 1) {
27748                 return roundPoint(intersections[0]);
27749             } else if (intersections.length > 1) {
27750
27751                 // sort by intersections based on connection segment +
27752                 // distance from start
27753                 intersections = sortBy(intersections, function(i) {
27754                     var distance = Math.floor(i.t2 * 100) || 1;
27755
27756                     distance = 100 - distance;
27757
27758                     distance = (distance < 10 ? '0' : '') + distance;
27759
27760                     // create a sort string that makes sure we sort
27761                     // line segment ASC + line segment position DESC (for cropStart)
27762                     // line segment ASC + line segment position ASC (for cropEnd)
27763                     return i.segment2 + '#' + distance;
27764                 });
27765
27766                 return roundPoint(intersections[cropStart ? 0 : intersections.length - 1]);
27767             }
27768
27769             return null;
27770         }
27771
27772         module.exports.getElementLineIntersection = getElementLineIntersection;
27773
27774
27775         function getIntersections(a, b) {
27776             return Snap.path.intersection(a, b);
27777         }
27778
27779         module.exports.getIntersections = getIntersections;
27780     }, {
27781         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
27782         "lodash/collection/sortBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\sortBy.js",
27783         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
27784     }],
27785     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\ManhattanLayout.js": [function(require, module, exports) {
27786         'use strict';
27787
27788         var isArray = require('lodash/lang/isArray'),
27789             find = require('lodash/collection/find');
27790
27791         var LayoutUtil = require('./LayoutUtil'),
27792             Geometry = require('../util/Geometry');
27793
27794         var MIN_DISTANCE = 20;
27795
27796
27797         /**
27798          * Returns the mid points for a manhattan connection between two points.
27799          * 
27800          * @example
27801          * 
27802          * [a]----[x] | [x]--->[b]
27803          * 
27804          * @param {Point}
27805          *            a
27806          * @param {Point}
27807          *            b
27808          * @param {String}
27809          *            directions
27810          * 
27811          * @return {Array<Point>}
27812          */
27813         module.exports.getMidPoints = function(a, b, directions) {
27814
27815             directions = directions || 'h:h';
27816
27817             var xmid, ymid;
27818
27819             // one point, next to a
27820             if (directions === 'h:v') {
27821                 return [{
27822                     x: b.x,
27823                     y: a.y
27824                 }];
27825             } else
27826             // one point, above a
27827             if (directions === 'v:h') {
27828                 return [{
27829                     x: a.x,
27830                     y: b.y
27831                 }];
27832             } else
27833             // vertical edge xmid
27834             if (directions === 'h:h') {
27835                 xmid = Math.round((b.x - a.x) / 2 + a.x);
27836
27837                 return [{
27838                     x: xmid,
27839                     y: a.y
27840                 }, {
27841                     x: xmid,
27842                     y: b.y
27843                 }];
27844             } else
27845             // horizontal edge ymid
27846             if (directions === 'v:v') {
27847                 ymid = Math.round((b.y - a.y) / 2 + a.y);
27848
27849                 return [{
27850                     x: a.x,
27851                     y: ymid
27852                 }, {
27853                     x: b.x,
27854                     y: ymid
27855                 }];
27856             } else {
27857                 throw new Error(
27858                     'unknown directions: <' + directions + '>: ' +
27859                     'directions must be specified as {a direction}:{b direction} (direction in h|v)');
27860             }
27861         };
27862
27863
27864         /**
27865          * Create a connection between the two points according to the manhattan layout
27866          * (only horizontal and vertical) edges.
27867          * 
27868          * @param {Point}
27869          *            a
27870          * @param {Point}
27871          *            b
27872          * 
27873          * @param {String}
27874          *            [directions='h:h'] specifies manhattan directions for each point
27875          *            as {adirection}:{bdirection}. A directionfor a point is either `h`
27876          *            (horizontal) or `v` (vertical)
27877          * 
27878          * @return {Array<Point>}
27879          */
27880         module.exports.connectPoints = function(a, b, directions) {
27881
27882             var points = [];
27883
27884             if (!LayoutUtil.pointsAligned(a, b)) {
27885                 points = this.getMidPoints(a, b, directions);
27886             }
27887
27888             points.unshift(a);
27889             points.push(b);
27890
27891             return points;
27892         };
27893
27894
27895         /**
27896          * Connect two rectangles using a manhattan layouted connection.
27897          * 
27898          * @param {Bounds}
27899          *            source source rectangle
27900          * @param {Bounds}
27901          *            target target rectangle
27902          * @param {Point}
27903          *            [start] source docking
27904          * @param {Point}
27905          *            [end] target docking
27906          * 
27907          * @return {Array<Point>} connection points
27908          */
27909         module.exports.connectRectangles = function(source, target, start, end, options) {
27910
27911             options = options || {};
27912
27913             var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
27914
27915             var directions = this.getDirections(source, target, options.preferVertical);
27916
27917             start = start || LayoutUtil.getMidPoint(source);
27918             end = end || LayoutUtil.getMidPoint(target);
27919
27920             // overlapping elements
27921             if (!directions) {
27922                 return;
27923             }
27924
27925             if (directions === 'h:h') {
27926
27927                 switch (orientation) {
27928                     case 'top-right':
27929                     case 'right':
27930                     case 'bottom-right':
27931                         start = {
27932                             original: start,
27933                             x: source.x,
27934                             y: start.y
27935                         };
27936                         end = {
27937                             original: end,
27938                             x: target.x + target.width,
27939                             y: end.y
27940                         };
27941                         break;
27942                     case 'top-left':
27943                     case 'left':
27944                     case 'bottom-left':
27945                         start = {
27946                             original: start,
27947                             x: source.x + source.width,
27948                             y: start.y
27949                         };
27950                         end = {
27951                             original: end,
27952                             x: target.x,
27953                             y: end.y
27954                         };
27955                         break;
27956                 }
27957             }
27958
27959             if (directions === 'v:v') {
27960
27961                 switch (orientation) {
27962                     case 'top-left':
27963                     case 'top':
27964                     case 'top-right':
27965                         start = {
27966                             original: start,
27967                             x: start.x,
27968                             y: source.y + source.height
27969                         };
27970                         end = {
27971                             original: end,
27972                             x: end.x,
27973                             y: target.y
27974                         };
27975                         break;
27976                     case 'bottom-left':
27977                     case 'bottom':
27978                     case 'bottom-right':
27979                         start = {
27980                             original: start,
27981                             x: start.x,
27982                             y: source.y
27983                         };
27984                         end = {
27985                             original: end,
27986                             x: end.x,
27987                             y: target.y + target.height
27988                         };
27989                         break;
27990                 }
27991             }
27992
27993             return this.connectPoints(start, end, directions);
27994         };
27995
27996         /**
27997          * Repair the connection between two rectangles, of which one has been updated.
27998          * 
27999          * @param {Bounds}
28000          *            source
28001          * @param {Bounds}
28002          *            target
28003          * @param {Point}
28004          *            [start]
28005          * @param {Point}
28006          *            [end]
28007          * @param {Array
28008          *            <Point>} waypoints
28009          * @param {Object}
28010          *            [hints]
28011          * @param {Boolean}
28012          *            hints.preferStraight
28013          * @param {Boolean}
28014          *            hints.preferVertical
28015          * @param {Boolean}
28016          *            hints.startChanged
28017          * @param {Boolean}
28018          *            hints.endChanged
28019          * 
28020          * @return {Array<Point>} repaired waypoints
28021          */
28022         module.exports.repairConnection = function(source, target, start, end, waypoints, hints) {
28023
28024             if (isArray(start)) {
28025                 waypoints = start;
28026                 hints = end;
28027
28028                 start = LayoutUtil.getMidPoint(source);
28029                 end = LayoutUtil.getMidPoint(target);
28030             }
28031
28032             hints = hints || {};
28033
28034
28035             var repairedWaypoints;
28036
28037             // just layout non-existing or simple connections
28038             // attempt to render straight lines, if required
28039             if (!waypoints || waypoints.length < 3) {
28040
28041                 if (hints.preferStraight) {
28042                     // attempt to layout a straight line
28043                     repairedWaypoints = this.layoutStraight(source, target, start, end, hints);
28044                 }
28045             } else {
28046                 // check if we layout from start or end
28047                 if (hints.endChanged) {
28048                     repairedWaypoints = this._repairConnectionSide(target, source, end, waypoints.slice().reverse());
28049                     repairedWaypoints = repairedWaypoints && repairedWaypoints.reverse();
28050                 } else
28051                 if (hints.startChanged) {
28052                     repairedWaypoints = this._repairConnectionSide(source, target, start, waypoints);
28053                 }
28054                 // or whether nothing seems to have changed
28055                 else {
28056                     repairedWaypoints = waypoints;
28057                 }
28058             }
28059
28060             // simply reconnect if nothing else worked
28061             if (!repairedWaypoints) {
28062                 return this.connectRectangles(source, target, start, end, hints);
28063             }
28064
28065             return repairedWaypoints;
28066         };
28067
28068         function max(a, b) {
28069             return Math.max(a, b);
28070         }
28071
28072         function min(a, b) {
28073             return Math.min(a, b);
28074         }
28075
28076         function inRange(a, start, end) {
28077             return a >= start && a <= end;
28078         }
28079
28080         module.exports.layoutStraight = function(source, target, start, end, hints) {
28081
28082             var startX, endX, x,
28083                 startY, endY, y;
28084
28085             startX = max(source.x + 10, target.x + 10);
28086             endX = min(source.x + source.width - 10, target.x + target.width - 10);
28087
28088             if (startX < endX) {
28089
28090                 if (source.width === target.width) {
28091
28092                     if (hints.endChanged && inRange(end.x, startX, endX)) {
28093                         x = end.x;
28094                     } else
28095                     if (inRange(start.x, startX, endX)) {
28096                         x = start.x;
28097                     }
28098                 }
28099
28100                 if (x === undefined) {
28101                     if (source.width < target.width && inRange(start.x, startX, endX)) {
28102                         x = start.x;
28103                     } else
28104                     if (source.width > target.width && inRange(end.x, startX, endX)) {
28105                         x = end.x;
28106                     } else {
28107                         x = (startX + endX) / 2;
28108                     }
28109                 }
28110             }
28111
28112             startY = max(source.y + 10, target.y + 10);
28113             endY = min(source.y + source.height - 10, target.y + target.height - 10);
28114
28115             if (startY < endY) {
28116
28117                 if (source.height === target.height) {
28118                     if (hints.endChanged && inRange(end.y, startY, endY)) {
28119                         y = end.y;
28120                     } else
28121                     if (inRange(start.y, startY, endY)) {
28122                         y = start.y;
28123                     }
28124                 }
28125
28126                 if (y === undefined) {
28127                     if (source.height <= target.height && inRange(start.y, startY, endY)) {
28128                         y = start.y;
28129                     } else
28130                     if (target.height <= source.height && inRange(end.y, startY, endY)) {
28131                         y = end.y;
28132                     } else {
28133                         y = (startY + endY) / 2;
28134                     }
28135                 }
28136             }
28137
28138             // cannot layout straight
28139             if (x === undefined && y === undefined) {
28140                 return null;
28141             }
28142
28143             return [{
28144                 x: x !== undefined ? x : start.x,
28145                 y: y !== undefined ? y : start.y
28146             }, {
28147                 x: x !== undefined ? x : end.x,
28148                 y: y !== undefined ? y : end.y
28149             }];
28150         };
28151
28152
28153         /**
28154          * Repair a connection from one side that moved.
28155          * 
28156          * @param {Bounds}
28157          *            moved
28158          * @param {Bounds}
28159          *            other
28160          * @param {Point}
28161          *            newDocking
28162          * @param {Array
28163          *            <Point>} points originalPoints from moved to other
28164          * 
28165          * @return {Array<Point>} the repaired points between the two rectangles
28166          */
28167         module.exports._repairConnectionSide = function(moved, other, newDocking, points) {
28168
28169             function needsRelayout(moved, other, points) {
28170
28171                 if (points.length < 3) {
28172                     return true;
28173                 }
28174
28175                 if (points.length > 4) {
28176                     return false;
28177                 }
28178
28179                 // relayout if two points overlap
28180                 // this is most likely due to
28181                 return !!find(points, function(p, idx) {
28182                     var q = points[idx - 1];
28183
28184                     return q && Geometry.distance(p, q) < 3;
28185                 });
28186             }
28187
28188             function repairBendpoint(candidate, oldPeer, newPeer) {
28189
28190                 var alignment = LayoutUtil.pointsAligned(oldPeer, candidate);
28191
28192                 switch (alignment) {
28193                     case 'v':
28194                         // repair vertical alignment
28195                         return {
28196                             x: candidate.x,
28197                             y: newPeer.y
28198                         };
28199                     case 'h':
28200                         // repair horizontal alignment
28201                         return {
28202                             x: newPeer.x,
28203                             y: candidate.y
28204                         };
28205                 }
28206
28207                 return {
28208                     x: candidate.x,
28209                     y: candidate.y
28210                 };
28211             }
28212
28213             function removeOverlapping(points, a, b) {
28214                 var i;
28215
28216                 for (i = points.length - 2; i !== 0; i--) {
28217
28218                     // intersects (?) break, remove all bendpoints up to this one and
28219                     // relayout
28220                     if (Geometry.pointInRect(points[i], a, MIN_DISTANCE) ||
28221                         Geometry.pointInRect(points[i], b, MIN_DISTANCE)) {
28222
28223                         // return sliced old connection
28224                         return points.slice(i);
28225                     }
28226                 }
28227
28228                 return points;
28229             }
28230
28231
28232             // (0) only repair what has layoutable bendpoints
28233
28234             // (1) if only one bendpoint and on shape moved onto other shapes axis
28235             // (horizontally / vertically), relayout
28236
28237             if (needsRelayout(moved, other, points)) {
28238                 return null;
28239             }
28240
28241             var oldDocking = points[0],
28242                 newPoints = points.slice(),
28243                 slicedPoints;
28244
28245             // (2) repair only last line segment and only if it was layouted before
28246
28247             newPoints[0] = newDocking;
28248             newPoints[1] = repairBendpoint(newPoints[1], oldDocking, newDocking);
28249
28250
28251             // (3) if shape intersects with any bendpoint after repair,
28252             // remove all segments up to this bendpoint and repair from there
28253
28254             slicedPoints = removeOverlapping(newPoints, moved, other);
28255             if (slicedPoints !== newPoints) {
28256                 return this._repairConnectionSide(moved, other, newDocking, slicedPoints);
28257             }
28258
28259             return newPoints;
28260         };
28261
28262         /**
28263          * Returns the default manhattan directions connecting two rectangles.
28264          * 
28265          * @param {Bounds}
28266          *            source
28267          * @param {Bounds}
28268          *            target
28269          * @param {Boolean}
28270          *            preferVertical
28271          * 
28272          * @return {String}
28273          */
28274         module.exports.getDirections = function(source, target, preferVertical) {
28275             var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
28276
28277             switch (orientation) {
28278                 case 'intersect':
28279                     return null;
28280
28281                 case 'top':
28282                 case 'bottom':
28283                     return 'v:v';
28284
28285                 case 'left':
28286                 case 'right':
28287                     return 'h:h';
28288
28289                 default:
28290                     return preferVertical ? 'v:v' : 'h:h';
28291             }
28292         };
28293     }, {
28294         "../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js",
28295         "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
28296         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
28297         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
28298     }],
28299     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js": [function(require, module, exports) {
28300         'use strict';
28301
28302         var assign = require('lodash/object/assign'),
28303             inherits = require('inherits');
28304
28305         var Refs = require('object-refs');
28306
28307         var parentRefs = new Refs({
28308                 name: 'children',
28309                 enumerable: true,
28310                 collection: true
28311             }, {
28312                 name: 'parent'
28313             }),
28314             labelRefs = new Refs({
28315                 name: 'label',
28316                 enumerable: true
28317             }, {
28318                 name: 'labelTarget'
28319             }),
28320             outgoingRefs = new Refs({
28321                 name: 'outgoing',
28322                 collection: true
28323             }, {
28324                 name: 'source'
28325             }),
28326             incomingRefs = new Refs({
28327                 name: 'incoming',
28328                 collection: true
28329             }, {
28330                 name: 'target'
28331             });
28332
28333         /**
28334          * @namespace djs.model
28335          */
28336
28337         /**
28338          * @memberOf djs.model
28339          */
28340
28341         /**
28342          * The basic graphical representation
28343          * 
28344          * @class
28345          * 
28346          * @abstract
28347          */
28348         function Base() {
28349
28350             /**
28351              * The object that backs up the shape
28352              * 
28353              * @name Base#businessObject
28354              * @type Object
28355              */
28356             Object.defineProperty(this, 'businessObject', {
28357                 writable: true
28358             });
28359
28360             /**
28361              * The parent shape
28362              * 
28363              * @name Base#parent
28364              * @type Shape
28365              */
28366             parentRefs.bind(this, 'parent');
28367
28368             /**
28369              * @name Base#label
28370              * @type Label
28371              */
28372             labelRefs.bind(this, 'label');
28373
28374             /**
28375              * The list of outgoing connections
28376              * 
28377              * @name Base#outgoing
28378              * @type Array<Connection>
28379              */
28380             outgoingRefs.bind(this, 'outgoing');
28381
28382             /**
28383              * The list of outgoing connections
28384              * 
28385              * @name Base#incoming
28386              * @type Array<Connection>
28387              */
28388             incomingRefs.bind(this, 'incoming');
28389         }
28390
28391
28392         /**
28393          * A graphical object
28394          * 
28395          * @class
28396          * @constructor
28397          * 
28398          * @extends Base
28399          */
28400         function Shape() {
28401             Base.call(this);
28402
28403             /**
28404              * The list of children
28405              * 
28406              * @name Shape#children
28407              * @type Array<Base>
28408              */
28409             parentRefs.bind(this, 'children');
28410         }
28411
28412         inherits(Shape, Base);
28413
28414
28415         /**
28416          * A root graphical object
28417          * 
28418          * @class
28419          * @constructor
28420          * 
28421          * @extends Shape
28422          */
28423         function Root() {
28424             Shape.call(this);
28425         }
28426
28427         inherits(Root, Shape);
28428
28429
28430         /**
28431          * A label for an element
28432          * 
28433          * @class
28434          * @constructor
28435          * 
28436          * @extends Shape
28437          */
28438         function Label() {
28439             Shape.call(this);
28440
28441             /**
28442              * The labeled element
28443              * 
28444              * @name Label#labelTarget
28445              * @type Base
28446              */
28447             labelRefs.bind(this, 'labelTarget');
28448         }
28449
28450         inherits(Label, Shape);
28451
28452
28453         /**
28454          * A connection between two elements
28455          * 
28456          * @class
28457          * @constructor
28458          * 
28459          * @extends Base
28460          */
28461         function Connection() {
28462             Base.call(this);
28463
28464             /**
28465              * The element this connection originates from
28466              * 
28467              * @name Connection#source
28468              * @type Base
28469              */
28470             outgoingRefs.bind(this, 'source');
28471
28472             /**
28473              * The element this connection points to
28474              * 
28475              * @name Connection#target
28476              * @type Base
28477              */
28478             incomingRefs.bind(this, 'target');
28479         }
28480
28481         inherits(Connection, Base);
28482
28483
28484         var types = {
28485             connection: Connection,
28486             shape: Shape,
28487             label: Label,
28488             root: Root
28489         };
28490
28491         /**
28492          * Creates a new model element of the specified type
28493          * 
28494          * @method create
28495          * 
28496          * @example
28497          * 
28498          * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100
28499          * }); var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height:
28500          * 100 });
28501          * 
28502          * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 },
28503          * {x: 210, y: 55 } ] });
28504          * 
28505          * @param {String}
28506          *            type lower-cased model name
28507          * @param {Object}
28508          *            attrs attributes to initialize the new model instance with
28509          * 
28510          * @return {Base} the new model instance
28511          */
28512         module.exports.create = function(type, attrs) {
28513             var Type = types[type];
28514             if (!Type) {
28515                 throw new Error('unknown type: <' + type + '>');
28516             }
28517             return assign(new Type(), attrs);
28518         };
28519
28520
28521         module.exports.Base = Base;
28522         module.exports.Root = Root;
28523         module.exports.Shape = Shape;
28524         module.exports.Connection = Connection;
28525         module.exports.Label = Label;
28526     }, {
28527         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js",
28528         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
28529         "object-refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\index.js"
28530     }],
28531     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\MoveCanvas.js": [function(require, module, exports) {
28532         'use strict';
28533
28534         var Cursor = require('../../util/Cursor'),
28535             ClickTrap = require('../../util/ClickTrap'),
28536             domEvent = require('min-dom/lib/event'),
28537             Event = require('../../util/Event');
28538
28539         function substract(p1, p2) {
28540             return {
28541                 x: p1.x - p2.x,
28542                 y: p1.y - p2.y
28543             };
28544         }
28545
28546         function length(point) {
28547             return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
28548         }
28549
28550
28551         var THRESHOLD = 15;
28552
28553
28554         function MoveCanvas(eventBus, canvas) {
28555
28556             var container = canvas._container,
28557                 context;
28558
28559
28560             function handleMove(event) {
28561
28562                 var start = context.start,
28563                     position = Event.toPoint(event),
28564                     delta = substract(position, start);
28565
28566                 if (!context.dragging && length(delta) > THRESHOLD) {
28567                     context.dragging = true;
28568
28569                     // prevent mouse click in this
28570                     // interaction sequence
28571                     ClickTrap.install();
28572
28573                     Cursor.set('move');
28574                 }
28575
28576                 if (context.dragging) {
28577
28578                     var lastPosition = context.last || context.start;
28579
28580                     delta = substract(position, lastPosition);
28581
28582                     canvas.scroll({
28583                         dx: delta.x,
28584                         dy: delta.y
28585                     });
28586
28587                     context.last = position;
28588                 }
28589
28590                 // prevent select
28591                 event.preventDefault();
28592             }
28593
28594
28595             function handleEnd(event) {
28596                 domEvent.unbind(document, 'mousemove', handleMove);
28597                 domEvent.unbind(document, 'mouseup', handleEnd);
28598
28599                 context = null;
28600
28601                 Cursor.unset();
28602
28603                 // prevent select
28604                 Event.stopEvent(event);
28605             }
28606
28607             function handleStart(event) {
28608
28609                 // reject non-left left mouse button or modifier key
28610                 if (event.button || event.ctrlKey || event.shiftKey || event.altKey) {
28611                     return;
28612                 }
28613
28614                 context = {
28615                     start: Event.toPoint(event)
28616                 };
28617
28618                 domEvent.bind(document, 'mousemove', handleMove);
28619                 domEvent.bind(document, 'mouseup', handleEnd);
28620
28621                 // prevent select
28622                 Event.stopEvent(event);
28623             }
28624
28625             domEvent.bind(container, 'mousedown', handleStart);
28626         }
28627
28628
28629         MoveCanvas.$inject = ['eventBus', 'canvas'];
28630
28631         module.exports = MoveCanvas;
28632
28633     }, {
28634         "../../util/ClickTrap": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js",
28635         "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
28636         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
28637         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28638     }],
28639     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\index.js": [function(require, module, exports) {
28640         module.exports = {
28641             __init__: ['moveCanvas'],
28642             moveCanvas: ['type', require('./MoveCanvas')]
28643         };
28644     }, {
28645         "./MoveCanvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\MoveCanvas.js"
28646     }],
28647     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\touch\\index.js": [function(require, module, exports) {
28648         module.exports = {
28649             __depends__: [require('../../features/touch')]
28650         };
28651     }, {
28652         "../../features/touch": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\index.js"
28653     }],
28654     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\ZoomScroll.js": [function(require, module, exports) {
28655         'use strict';
28656
28657         var domEvent = require('min-dom/lib/event');
28658
28659         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier,
28660             hasSecondaryModifier = require('../../util/Mouse').hasSecondaryModifier;
28661
28662         var isMac = require('../../util/Platform').isMac;
28663
28664
28665         function ZoomScroll(events, canvas) {
28666                 var $canvas = $( canvas.getContainer() ), //canvas.getContainer() 
28667             $controls = $( '<div></div>' ),
28668             $zoomOut = $( '<div><span class="glyphicon glyphicon-zoom-out"></span></div>' ),
28669             $zoomIn = $( '<div><span class="glyphicon glyphicon-zoom-in"></span></div>' ),
28670             $zoomFit= $( '<div><span class="glyphicon glyphicon-fullscreen"></span></div>' ),
28671             zlevel = 1,
28672             zstep = 0.2;
28673
28674         $canvas.append( $controls );
28675         $controls.append( $zoomIn );
28676         $controls.append( $zoomOut );
28677         $controls.append( $zoomFit );
28678
28679         $controls.addClass( 'zoom-controls' );
28680         $zoomOut.addClass( 'zoom zoom-out' );
28681         $zoomIn.addClass( 'zoom zoom-in' );
28682         $zoomFit.addClass( 'zoom zoom-fit' );
28683
28684         $zoomOut.attr( 'title', 'Zoom out' );
28685         $zoomIn.attr( 'title', 'Zoom in' );
28686         $zoomFit.attr( 'title', 'Fit to viewport' );
28687
28688         // set initial zoom level
28689         //canvas.zoom( zlevel, 'auto' );
28690
28691         // update our zoom level on viewbox change
28692         events.on( 'canvas.viewbox.changed', function( evt ) {
28693             zlevel = evt.viewbox.scale;
28694         });
28695
28696         // define click handlers for controls
28697         $zoomFit.on( 'click', function() {
28698             canvas.zoom( 'fit-viewport', 'auto' );
28699         });
28700
28701         $zoomOut.on( 'click', function() {
28702             zlevel = Math.max( zlevel - zstep, zstep );
28703             canvas.zoom( zlevel, 'auto' );
28704         });
28705         
28706         $zoomIn.on( 'click', function() {
28707             zlevel = Math.min( zlevel + zstep, 7 );
28708             canvas.zoom( zlevel, 'auto' );
28709         });
28710         
28711         $(".TCS").click(function() {
28712                 console.log($(this).data("stuff"));
28713                 var modelElements = $(this).data("stuff").modelElements;
28714                 var modelName = $(this).data("model").name;
28715                 var hElements = [];
28716                 modelElements.forEach(function(mElement){
28717                         if(hElements.indexOf(mElement.elementID)==-1){
28718                                 hElements.push(mElement.elementID);
28719                         }
28720                 });
28721                 highlightPath(hElements);
28722         });
28723         
28724         function highlightPath(hElements){
28725                 clear();
28726             var elementRegistry = canvas._elementRegistry;
28727             //console.log(elementRegistry);
28728             hElements.forEach(function(hElement){
28729                 try{
28730                 //console.log(hElement);
28731                 var activityShape = elementRegistry.get(hElement);
28732                 var outgoing = activityShape.incoming;
28733                 
28734                 if (canvas.hasMarker(hElement, 'highlight')) {
28735                         canvas.removeMarker(hElement, 'highlight');
28736                         outgoing.forEach(function(flow){
28737                         var outgoingGfx = elementRegistry.getGraphics(flow.id);
28738                         if(hElements.indexOf(flow.id)!=-1){
28739                                 outgoingGfx.select('path').attr({stroke: 'black'});
28740                         }
28741                     });
28742                 } else {
28743                         canvas.addMarker(hElement, 'highlight');
28744                         outgoing.forEach(function(flow){
28745                         var outgoingGfx = elementRegistry.getGraphics(flow.id);
28746                         if(hElements.indexOf(flow.id)!=-1){
28747                                 outgoingGfx.select('path').attr({stroke: 'blue'});
28748                         }
28749                     });
28750                 }
28751                 }catch(err){
28752                         //console.log(err);
28753                 }
28754                 
28755             });
28756         }
28757         
28758         function clear() {
28759                 var elementRegistry = canvas._elementRegistry;
28760                 elementRegistry.forEach(function(hElement){
28761                         try {
28762                                 canvas.removeMarker(hElement, 'highlight');
28763                                 var outgoing = hElement.incoming;
28764                                 outgoing.forEach(function(flow){
28765                             var outgoingGfx = elementRegistry.getGraphics(flow.id);
28766                             outgoingGfx.select('path').attr({stroke: 'black'});
28767                         });
28768                         }catch(err){
28769                                 
28770                         }
28771                 });
28772         }
28773         
28774         //console.log('endzoom');
28775                 
28776                 
28777             var RANGE = {
28778                 min: 0.2,
28779                 max: 4
28780             };
28781
28782             function cap(scale) {
28783                 return Math.max(RANGE.min, Math.min(RANGE.max, scale));
28784             }
28785
28786             function reset() {
28787                 canvas.zoom('fit-viewport');
28788             }
28789
28790             function zoom(direction, position) {
28791
28792                 var currentZoom = canvas.zoom();
28793                 var factor = Math.pow(1 + Math.abs(direction), direction > 0 ? 1 : -1);
28794
28795                 canvas.zoom(cap(currentZoom * factor), position);
28796             }
28797
28798             function scroll(delta) {
28799                 canvas.scroll(delta);
28800             }
28801
28802             function init(element) {
28803
28804                 domEvent.bind(element, 'wheel', function(event) {/*
28805
28806                     event.preventDefault();
28807
28808                     // mouse-event: SELECTION_KEY
28809                     // mouse-event: AND_KEY
28810                     var isVerticalScroll = hasPrimaryModifier(event),
28811                         isHorizontalScroll = hasSecondaryModifier(event);
28812
28813                     var factor;
28814
28815                     if (isVerticalScroll || isHorizontalScroll) {
28816
28817                         if (isMac) {
28818                             factor = event.deltaMode === 0 ? 1.25 : 50;
28819                         } else {
28820                             factor = event.deltaMode === 0 ? 1 / 40 : 1 / 2;
28821                         }
28822
28823                         var delta = {};
28824
28825                         if (isHorizontalScroll) {
28826                             delta.dx = (factor * (event.deltaX || event.deltaY));
28827                         } else {
28828                             delta.dy = (factor * event.deltaY);
28829                         }
28830
28831                         scroll(delta);
28832                     } else {
28833                         factor = (event.deltaMode === 0 ? 1 / 40 : 1 / 2);
28834
28835                         var elementRect = element.getBoundingClientRect();
28836
28837                         var offset = {
28838                             x: event.clientX - elementRect.left,
28839                             y: event.clientY - elementRect.top
28840                         };
28841
28842                         // zoom in relative to diagram {x,y} coordinates
28843                         zoom(event.deltaY * factor / (-5), offset);
28844                     }
28845                 */});
28846             }
28847
28848             events.on('canvas.init', function(e) {
28849                 init(canvas._container);
28850             });
28851
28852             // API
28853             this.zoom = zoom;
28854             this.reset = reset;
28855         }
28856
28857
28858         ZoomScroll.$inject = ['eventBus', 'canvas'];
28859
28860         module.exports = ZoomScroll;
28861
28862
28863     }, {
28864         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
28865         "../../util/Platform": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js",
28866         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28867     }],
28868     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\index.js": [function(require, module, exports) {
28869         module.exports = {
28870             __init__: ['zoomScroll'],
28871             zoomScroll: ['type', require('./ZoomScroll')]
28872         };
28873     }, {
28874         "./ZoomScroll": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\ZoomScroll.js"
28875     }],
28876     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js": [function(require, module, exports) {
28877         'use strict';
28878
28879         var domEvent = require('min-dom/lib/event'),
28880             stopEvent = require('./Event').stopEvent;
28881
28882         function trap(event) {
28883             stopEvent(event);
28884
28885             toggle(false);
28886         }
28887
28888         function toggle(active) {
28889             domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);
28890         }
28891
28892         /**
28893          * Installs a click trap that prevents a ghost click following a dragging
28894          * operation.
28895          * 
28896          * @return {Function} a function to immediately remove the installed trap.
28897          */
28898         function install() {
28899
28900             toggle(true);
28901
28902             return function() {
28903                 toggle(false);
28904             };
28905         }
28906
28907         module.exports.install = install;
28908     }, {
28909         "./Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
28910         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28911     }],
28912     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js": [function(require, module, exports) {
28913         'use strict';
28914
28915         /**
28916          * Failsafe remove an element from a collection
28917          * 
28918          * @param {Array
28919          *            <Object>} [collection]
28920          * @param {Object}
28921          *            [element]
28922          * 
28923          * @return {Object} the element that got removed or undefined
28924          */
28925         module.exports.remove = function(collection, element) {
28926
28927             if (!collection || !element) {
28928                 return;
28929             }
28930
28931             var idx = collection.indexOf(element);
28932             if (idx === -1) {
28933                 return;
28934             }
28935
28936             collection.splice(idx, 1);
28937
28938             return element;
28939         };
28940
28941         /**
28942          * Fail save add an element to the given connection, ensuring it does not yet
28943          * exist.
28944          * 
28945          * @param {Array
28946          *            <Object>} collection
28947          * @param {Object}
28948          *            element
28949          * @param {Number}
28950          *            idx
28951          */
28952         module.exports.add = function(collection, element, idx) {
28953
28954             if (!collection || !element) {
28955                 return;
28956             }
28957
28958             if (isNaN(idx)) {
28959                 idx = -1;
28960             }
28961
28962             var currentIdx = collection.indexOf(element);
28963
28964             if (currentIdx !== -1) {
28965
28966                 if (currentIdx === idx) {
28967                     // nothing to do, position has not changed
28968                     return;
28969                 } else {
28970
28971                     if (idx !== -1) {
28972                         // remove from current position
28973                         collection.splice(currentIdx, 1);
28974                     } else {
28975                         // already exists in collection
28976                         return;
28977                     }
28978                 }
28979             }
28980
28981             if (idx !== -1) {
28982                 // insert at specified position
28983                 collection.splice(idx, 0, element);
28984             } else {
28985                 // push to end
28986                 collection.push(element);
28987             }
28988         };
28989
28990
28991         /**
28992          * Fail get the index of an element in a collection.
28993          * 
28994          * @param {Array
28995          *            <Object>} collection
28996          * @param {Object}
28997          *            element
28998          * 
28999          * @return {Number} the index or -1 if collection or element do not exist or the
29000          *         element is not contained.
29001          */
29002         module.exports.indexOf = function(collection, element) {
29003
29004             if (!collection || !element) {
29005                 return -1;
29006             }
29007
29008             return collection.indexOf(element);
29009         };
29010
29011     }, {}],
29012     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js": [function(require, module, exports) {
29013         'use strict';
29014
29015         var domClasses = require('min-dom/lib/classes');
29016
29017         var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;
29018
29019
29020         module.exports.set = function(mode) {
29021             var classes = domClasses(document.body);
29022
29023             classes.removeMatching(CURSOR_CLS_PATTERN);
29024
29025             if (mode) {
29026                 classes.add('djs-cursor-' + mode);
29027             }
29028         };
29029
29030         module.exports.unset = function() {
29031             this.set(null);
29032         };
29033     }, {
29034         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js"
29035     }],
29036     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js": [function(require, module, exports) {
29037         'use strict';
29038
29039         var isArray = require('lodash/lang/isArray'),
29040             isNumber = require('lodash/lang/isNumber'),
29041             groupBy = require('lodash/collection/groupBy'),
29042             forEach = require('lodash/collection/forEach');
29043
29044         /**
29045          * Adds an element to a collection and returns true if the element was added.
29046          * 
29047          * @param {Array
29048          *            <Object>} elements
29049          * @param {Object}
29050          *            e
29051          * @param {Boolean}
29052          *            unique
29053          */
29054         function add(elements, e, unique) {
29055             var canAdd = !unique || elements.indexOf(e) === -1;
29056
29057             if (canAdd) {
29058                 elements.push(e);
29059             }
29060
29061             return canAdd;
29062         }
29063
29064         function eachElement(elements, fn, depth) {
29065
29066             depth = depth || 0;
29067
29068             forEach(elements, function(s, i) {
29069                 var filter = fn(s, i, depth);
29070
29071                 if (isArray(filter) && filter.length) {
29072                     eachElement(filter, fn, depth + 1);
29073                 }
29074             });
29075         }
29076
29077         /**
29078          * Collects self + child elements up to a given depth from a list of elements.
29079          * 
29080          * @param {Array
29081          *            <djs.model.Base>} elements the elements to select the children
29082          *            from
29083          * @param {Boolean}
29084          *            unique whether to return a unique result set (no duplicates)
29085          * @param {Number}
29086          *            maxDepth the depth to search through or -1 for infinite
29087          * 
29088          * @return {Array<djs.model.Base>} found elements
29089          */
29090         function selfAndChildren(elements, unique, maxDepth) {
29091             var result = [],
29092                 processedChildren = [];
29093
29094             eachElement(elements, function(element, i, depth) {
29095                 add(result, element, unique);
29096
29097                 var children = element.children;
29098
29099                 // max traversal depth not reached yet
29100                 if (maxDepth === -1 || depth < maxDepth) {
29101
29102                     // children exist && children not yet processed
29103                     if (children && add(processedChildren, children, unique)) {
29104                         return children;
29105                     }
29106                 }
29107             });
29108
29109             return result;
29110         }
29111
29112         /**
29113          * Return self + direct children for a number of elements
29114          * 
29115          * @param {Array
29116          *            <djs.model.Base>} elements to query
29117          * @param {Boolean}
29118          *            allowDuplicates to allow duplicates in the result set
29119          * 
29120          * @return {Array<djs.model.Base>} the collected elements
29121          */
29122         function selfAndDirectChildren(elements, allowDuplicates) {
29123             return selfAndChildren(elements, !allowDuplicates, 1);
29124         }
29125
29126         /**
29127          * Return self + ALL children for a number of elements
29128          * 
29129          * @param {Array
29130          *            <djs.model.Base>} elements to query
29131          * @param {Boolean}
29132          *            allowDuplicates to allow duplicates in the result set
29133          * 
29134          * @return {Array<djs.model.Base>} the collected elements
29135          */
29136         function selfAndAllChildren(elements, allowDuplicates) {
29137             return selfAndChildren(elements, !allowDuplicates, -1);
29138         }
29139
29140         /**
29141          * Gets the the closure fo all selected elements, their connections and
29142          * 
29143          * @param {Array
29144          *            <djs.model.Base>} elements
29145          * @return {Object} enclosure
29146          */
29147         function getClosure(elements) {
29148
29149             // original elements passed to this function
29150             var topLevel = groupBy(elements, function(e) {
29151                 return e.id;
29152             });
29153
29154             var allShapes = {},
29155                 allConnections = {},
29156                 enclosedElements = {},
29157                 enclosedConnections = {};
29158
29159             function handleConnection(c) {
29160                 if (topLevel[c.source.id] && topLevel[c.target.id]) {
29161                     topLevel[c.id] = c;
29162                 }
29163
29164                 // not enclosed as a child, but maybe logically
29165                 // (connecting two moved elements?)
29166                 if (allShapes[c.source.id] && allShapes[c.target.id]) {
29167                     enclosedConnections[c.id] = enclosedElements[c.id] = c;
29168                 }
29169
29170                 allConnections[c.id] = c;
29171             }
29172
29173             function handleElement(element) {
29174
29175                 enclosedElements[element.id] = element;
29176
29177                 if (element.waypoints) {
29178                     // remember connection
29179                     enclosedConnections[element.id] = allConnections[element.id] = element;
29180                 } else {
29181                     // remember shape
29182                     allShapes[element.id] = element;
29183
29184                     // remember all connections
29185                     forEach(element.incoming, handleConnection);
29186
29187                     forEach(element.outgoing, handleConnection);
29188
29189                     // recurse into children
29190                     return element.children;
29191                 }
29192             }
29193
29194             eachElement(elements, handleElement);
29195
29196             return {
29197                 allShapes: allShapes,
29198                 allConnections: allConnections,
29199                 topLevel: topLevel,
29200                 enclosedConnections: enclosedConnections,
29201                 enclosedElements: enclosedElements
29202             };
29203         }
29204
29205         /**
29206          * Returns the surrounding bbox for all elements in the array or the element
29207          * primitive.
29208          */
29209         function getBBox(elements, stopRecursion) {
29210
29211             stopRecursion = !!stopRecursion;
29212             if (!isArray(elements)) {
29213                 elements = [elements];
29214             }
29215
29216             var minX,
29217                 minY,
29218                 maxX,
29219                 maxY;
29220
29221             forEach(elements, function(element) {
29222
29223                 // If element is a connection the bbox must be computed first
29224                 var bbox = element;
29225                 if (element.waypoints && !stopRecursion) {
29226                     bbox = getBBox(element.waypoints, true);
29227                 }
29228
29229                 var x = bbox.x,
29230                     y = bbox.y,
29231                     height = bbox.height || 0,
29232                     width = bbox.width || 0;
29233
29234                 if (x < minX || minX === undefined) {
29235                     minX = x;
29236                 }
29237                 if (y < minY || minY === undefined) {
29238                     minY = y;
29239                 }
29240
29241                 if ((x + width) > maxX || maxX === undefined) {
29242                     maxX = x + width;
29243                 }
29244                 if ((y + height) > maxY || maxY === undefined) {
29245                     maxY = y + height;
29246                 }
29247             });
29248
29249             return {
29250                 x: minX,
29251                 y: minY,
29252                 height: maxY - minY,
29253                 width: maxX - minX
29254             };
29255         }
29256
29257
29258         /**
29259          * Returns all elements that are enclosed from the bounding box.
29260          * 
29261          * @param {Array
29262          *            <Object>} elements List of Elements to search through
29263          * @param {Object}
29264          *            bbox the enclosing bbox.
29265          *            <ul>
29266          *            <li>If bbox.(width|height) is not specified the method returns
29267          *            all elements with element.x/y &gt; bbox.x/y </li>
29268          *            <li>If only bbox.x or bbox.y is specified, method return all
29269          *            elements with e.x &gt; bbox.x or e.y &gt; bbox.y.</li>
29270          *            </ul>
29271          * 
29272          */
29273         function getEnclosedElements(elements, bbox) {
29274
29275             var filteredElements = {};
29276
29277             forEach(elements, function(element) {
29278
29279                 var e = element;
29280
29281                 if (e.waypoints) {
29282                     e = getBBox(e);
29283                 }
29284
29285                 if (!isNumber(bbox.y) && (e.x > bbox.x)) {
29286                     filteredElements[element.id] = element;
29287                 }
29288                 if (!isNumber(bbox.x) && (e.y > bbox.y)) {
29289                     filteredElements[element.id] = element;
29290                 }
29291                 if (e.x > bbox.x && e.y > bbox.y) {
29292                     if (isNumber(bbox.width) && isNumber(bbox.height) &&
29293                         e.width + e.x < bbox.width + bbox.x &&
29294                         e.height + e.y < bbox.height + bbox.y) {
29295
29296                         filteredElements[element.id] = element;
29297                     } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {
29298                         filteredElements[element.id] = element;
29299                     }
29300                 }
29301             });
29302
29303             return filteredElements;
29304         }
29305
29306
29307
29308         module.exports.eachElement = eachElement;
29309         module.exports.selfAndDirectChildren = selfAndDirectChildren;
29310         module.exports.selfAndAllChildren = selfAndAllChildren;
29311         module.exports.getBBox = getBBox;
29312         module.exports.getEnclosedElements = getEnclosedElements;
29313
29314         module.exports.getClosure = getClosure;
29315
29316     }, {
29317         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
29318         "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
29319         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
29320         "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js"
29321     }],
29322     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js": [function(require, module, exports) {
29323         'use strict';
29324
29325         function __preventDefault(event) {
29326             return event && event.preventDefault();
29327         }
29328
29329         function __stopPropagation(event, immediate) {
29330             if (!event) {
29331                 return;
29332             }
29333
29334             if (event.stopPropagation) {
29335                 event.stopPropagation();
29336             }
29337
29338             if (immediate && event.stopImmediatePropagation) {
29339                 event.stopImmediatePropagation();
29340             }
29341         }
29342
29343
29344         function getOriginal(event) {
29345             return event.originalEvent || event.srcEvent;
29346         }
29347
29348         module.exports.getOriginal = getOriginal;
29349
29350
29351         function stopEvent(event, immediate) {
29352             stopPropagation(event, immediate);
29353             preventDefault(event);
29354         }
29355
29356         module.exports.stopEvent = stopEvent;
29357
29358
29359         function preventDefault(event) {
29360             __preventDefault(event);
29361             __preventDefault(getOriginal(event));
29362         }
29363
29364         module.exports.preventDefault = preventDefault;
29365
29366
29367         function stopPropagation(event, immediate) {
29368             __stopPropagation(event, immediate);
29369             __stopPropagation(getOriginal(event), immediate);
29370         }
29371
29372         module.exports.stopPropagation = stopPropagation;
29373
29374
29375         function toPoint(event) {
29376
29377             if (event.pointers && event.pointers.length) {
29378                 event = event.pointers[0];
29379             }
29380
29381             if (event.touches && event.touches.length) {
29382                 event = event.touches[0];
29383             }
29384
29385             return event ? {
29386                 x: event.clientX,
29387                 y: event.clientY
29388             } : null;
29389         }
29390
29391         module.exports.toPoint = toPoint;
29392
29393     }, {}],
29394     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js": [function(require, module, exports) {
29395         'use strict';
29396
29397         /**
29398          * Computes the distance between two points
29399          * 
29400          * @param {Point}
29401          *            p
29402          * @param {Point}
29403          *            q
29404          * 
29405          * @return {Number} distance
29406          */
29407         var distance = module.exports.distance = function(p, q) {
29408             return Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2));
29409         };
29410
29411         /**
29412          * Returns true if the point r is on the line between p and y
29413          * 
29414          * @param {Point}
29415          *            p
29416          * @param {Point}
29417          *            q
29418          * @param {Point}
29419          *            r
29420          * 
29421          * @return {Boolean}
29422          */
29423         module.exports.pointsOnLine = function(p, q, r) {
29424
29425             if (!p || !q || !r) {
29426                 return false;
29427             }
29428
29429             var val = (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x),
29430                 dist = distance(p, q);
29431
29432             // @see http://stackoverflow.com/a/907491/412190
29433             return Math.abs(val / dist) < 5;
29434         };
29435
29436         module.exports.pointInRect = function(p, rect, tolerance) {
29437             tolerance = tolerance || 0;
29438
29439             return p.x > rect.x - tolerance &&
29440                 p.y > rect.y - tolerance &&
29441                 p.x < rect.x + rect.width + tolerance &&
29442                 p.y < rect.y + rect.height + tolerance;
29443         };
29444     }, {}],
29445     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\GraphicsUtil.js": [function(require, module, exports) {
29446         'use strict';
29447
29448         /**
29449          * SVGs for elements are generated by the {@link GraphicsFactory}.
29450          * 
29451          * This utility gives quick access to the important semantic parts of an
29452          * element.
29453          */
29454
29455         /**
29456          * Returns the visual part of a diagram element
29457          * 
29458          * @param {Snap
29459          *            <SVGElement>} gfx
29460          * 
29461          * @return {Snap<SVGElement>}
29462          */
29463         function getVisual(gfx) {
29464             return gfx.select('.djs-visual');
29465         }
29466
29467         /**
29468          * Returns the children for a given diagram element.
29469          * 
29470          * @param {Snap
29471          *            <SVGElement>} gfx
29472          * @return {Snap<SVGElement>}
29473          */
29474         function getChildren(gfx) {
29475             return gfx.parent().children()[1];
29476         }
29477
29478         /**
29479          * Returns the visual bbox of an element
29480          * 
29481          * @param {Snap
29482          *            <SVGElement>} gfx
29483          * 
29484          * @return {Bounds}
29485          */
29486         function getBBox(gfx) {
29487             return getVisual(gfx).select('*').getBBox();
29488         }
29489
29490
29491         module.exports.getVisual = getVisual;
29492         module.exports.getChildren = getChildren;
29493         module.exports.getBBox = getBBox;
29494     }, {}],
29495     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js": [function(require, module, exports) {
29496         'use strict';
29497
29498         /**
29499          * Util that provides unique IDs.
29500          * 
29501          * @class djs.util.IdGenerator
29502          * @constructor
29503          * @memberOf djs.util
29504          * 
29505          * The ids can be customized via a given prefix and contain a random value to
29506          * avoid collisions.
29507          * 
29508          * @param {String}
29509          *            prefix a prefix to prepend to generated ids (for better
29510          *            readability)
29511          */
29512         function IdGenerator(prefix) {
29513
29514             this._counter = 0;
29515             this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';
29516         }
29517
29518         module.exports = IdGenerator;
29519
29520         /**
29521          * Returns a next unique ID.
29522          * 
29523          * @method djs.util.IdGenerator#next
29524          * 
29525          * @returns {String} the id
29526          */
29527         IdGenerator.prototype.next = function() {
29528             return this._prefix + (++this._counter);
29529         };
29530
29531     }, {}],
29532     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js": [function(require, module, exports) {
29533         'use strict';
29534
29535         var getOriginalEvent = require('./Event').getOriginal;
29536
29537         var isMac = require('./Platform').isMac;
29538
29539
29540         function isPrimaryButton(event) {
29541             // button === 0 -> left ÃƒÆ’ƒÂ¡ka primary mouse button
29542             return !(getOriginalEvent(event) || event).button;
29543         }
29544
29545         module.exports.isPrimaryButton = isPrimaryButton;
29546
29547         module.exports.isMac = isMac;
29548
29549         module.exports.hasPrimaryModifier = function(event) {
29550             var originalEvent = getOriginalEvent(event) || event;
29551
29552             if (!isPrimaryButton(event)) {
29553                 return false;
29554             }
29555
29556             // Use alt as primary modifier key for mac OS
29557             if (isMac()) {
29558                 return originalEvent.altKey;
29559             } else {
29560                 return originalEvent.ctrlKey;
29561             }
29562         };
29563
29564
29565         module.exports.hasSecondaryModifier = function(event) {
29566             var originalEvent = getOriginalEvent(event) || event;
29567
29568             return isPrimaryButton(event) && originalEvent.shiftKey;
29569         };
29570
29571     }, {
29572         "./Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
29573         "./Platform": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js"
29574     }],
29575     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js": [function(require, module, exports) {
29576         'use strict';
29577
29578         module.exports.isMac = function isMac() {
29579             return (/mac/i).test(navigator.platform);
29580         };
29581     }, {}],
29582     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Text.js": [function(require, module, exports) {
29583         'use strict';
29584
29585         var isObject = require('lodash/lang/isObject'),
29586             assign = require('lodash/object/assign'),
29587             forEach = require('lodash/collection/forEach'),
29588             reduce = require('lodash/collection/reduce'),
29589             merge = require('lodash/object/merge');
29590
29591         var Snap = require('../../vendor/snapsvg');
29592
29593         var DEFAULT_BOX_PADDING = 0;
29594
29595         var DEFAULT_LABEL_SIZE = {
29596             width: 150,
29597             height: 50
29598         };
29599
29600
29601         function parseAlign(align) {
29602
29603             var parts = align.split('-');
29604
29605             return {
29606                 horizontal: parts[0] || 'center',
29607                 vertical: parts[1] || 'top'
29608             };
29609         }
29610
29611         function parsePadding(padding) {
29612
29613             if (isObject(padding)) {
29614                 return assign({
29615                     top: 0,
29616                     left: 0,
29617                     right: 0,
29618                     bottom: 0
29619                 }, padding);
29620             } else {
29621                 return {
29622                     top: padding,
29623                     left: padding,
29624                     right: padding,
29625                     bottom: padding
29626                 };
29627             }
29628         }
29629
29630         function getTextBBox(text, fakeText) {
29631             fakeText.textContent = text;
29632             return fakeText.getBBox();
29633         }
29634
29635
29636         /**
29637          * Layout the next line and return the layouted element.
29638          * 
29639          * Alters the lines passed.
29640          * 
29641          * @param {Array
29642          *            <String>} lines
29643          * @return {Object} the line descriptor, an object { width, height, text }
29644          */
29645         function layoutNext(lines, maxWidth, fakeText) {
29646
29647             var originalLine = lines.shift(),
29648                 fitLine = originalLine;
29649
29650             var textBBox;
29651
29652             while (true) {
29653                 textBBox = getTextBBox(fitLine, fakeText);
29654
29655                 textBBox.width = fitLine ? textBBox.width : 0;
29656
29657                 // try to fit
29658                 if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {
29659                     return fit(lines, fitLine, originalLine, textBBox);
29660                 }
29661
29662
29663                 fitLine = shortenLine(fitLine, textBBox.width, maxWidth);
29664             }
29665         }
29666
29667         function fit(lines, fitLine, originalLine, textBBox) {
29668             if (fitLine.length < originalLine.length) {
29669                 var nextLine = lines[0] || '',
29670                     remainder = originalLine.slice(fitLine.length).trim();
29671
29672                 if (/-\s*$/.test(remainder)) {
29673                     nextLine = remainder.replace(/-\s*$/, '') + nextLine.replace(/^\s+/, '');
29674                 } else {
29675                     nextLine = remainder + ' ' + nextLine;
29676                 }
29677
29678                 lines[0] = nextLine;
29679             }
29680             return {
29681                 width: textBBox.width,
29682                 height: textBBox.height,
29683                 text: fitLine
29684             };
29685         }
29686
29687
29688         /**
29689          * Shortens a line based on spacing and hyphens. Returns the shortened result on
29690          * success.
29691          * 
29692          * @param {String}
29693          *            line
29694          * @param {Number}
29695          *            maxLength the maximum characters of the string
29696          * @return {String} the shortened string
29697          */
29698         function semanticShorten(line, maxLength) {
29699             var parts = line.split(/(\s|-)/g),
29700                 part,
29701                 shortenedParts = [],
29702                 length = 0;
29703
29704             // try to shorten via spaces + hyphens
29705             if (parts.length > 1) {
29706                 while ((part = parts.shift())) {
29707                     if (part.length + length < maxLength) {
29708                         shortenedParts.push(part);
29709                         length += part.length;
29710                     } else {
29711                         // remove previous part, too if hyphen does not fit anymore
29712                         if (part === '-') {
29713                             shortenedParts.pop();
29714                         }
29715
29716                         break;
29717                     }
29718                 }
29719             }
29720
29721             return shortenedParts.join('');
29722         }
29723
29724
29725         function shortenLine(line, width, maxWidth) {
29726             var length = Math.max(line.length * (maxWidth / width), 1);
29727
29728             // try to shorten semantically (i.e. based on spaces and hyphens)
29729             var shortenedLine = semanticShorten(line, length);
29730
29731             if (!shortenedLine) {
29732
29733                 // force shorten by cutting the long word
29734                 shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));
29735             }
29736
29737             return shortenedLine;
29738         }
29739
29740
29741         /**
29742          * Creates a new label utility
29743          * 
29744          * @param {Object}
29745          *            config
29746          * @param {Dimensions}
29747          *            config.size
29748          * @param {Number}
29749          *            config.padding
29750          * @param {Object}
29751          *            config.style
29752          * @param {String}
29753          *            config.align
29754          */
29755         function Text(config) {
29756
29757             this._config = assign({}, {
29758                 size: DEFAULT_LABEL_SIZE,
29759                 padding: DEFAULT_BOX_PADDING,
29760                 style: {},
29761                 align: 'center-top'
29762             }, config || {});
29763         }
29764
29765
29766         /**
29767          * Create a label in the parent node.
29768          * 
29769          * @method Text#createText
29770          * 
29771          * @param {SVGElement}
29772          *            parent the parent to draw the label on
29773          * @param {String}
29774          *            text the text to render on the label
29775          * @param {Object}
29776          *            options
29777          * @param {String}
29778          *            options.align how to align in the bounding box. Any of {
29779          *            'center-middle', 'center-top' }, defaults to 'center-top'.
29780          * @param {String}
29781          *            options.style style to be applied to the text
29782          * 
29783          * @return {SVGText} the text element created
29784          */
29785         Text.prototype.createText = function(parent, text, options) {
29786
29787             var box = merge({}, this._config.size, options.box || {}),
29788                 style = merge({}, this._config.style, options.style || {}),
29789                 align = parseAlign(options.align || this._config.align),
29790                 padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);
29791
29792             var lines = text.split(/\r?\n/g),
29793                 layouted = [];
29794
29795             var maxWidth = box.width - padding.left - padding.right;
29796
29797             // FF regression: ensure text is shown during rendering
29798             // by attaching it directly to the body
29799             var fakeText = parent.paper.text(0, 0, '').attr(style).node;
29800
29801             while (lines.length) {
29802                 layouted.push(layoutNext(lines, maxWidth, fakeText));
29803             }
29804
29805             var totalHeight = reduce(layouted, function(sum, line, idx) {
29806                 return sum + line.height;
29807             }, 0);
29808
29809             // the y position of the next line
29810             var y, x;
29811
29812             switch (align.vertical) {
29813                 case 'middle':
29814                     y = (box.height - totalHeight) / 2 - layouted[0].height / 4;
29815                     break;
29816
29817                 default:
29818                     y = padding.top;
29819             }
29820
29821             var textElement = parent.text().attr(style);
29822
29823             forEach(layouted, function(line) {
29824                 y += line.height;
29825
29826                 switch (align.horizontal) {
29827                     case 'left':
29828                         x = padding.left;
29829                         break;
29830
29831                     case 'right':
29832                         x = (maxWidth - padding.right - line.width);
29833                         break;
29834
29835                     default:
29836                         // aka center
29837                         x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);
29838                 }
29839
29840
29841                 var tspan = Snap.create('tspan', {
29842                     x: x,
29843                     y: y
29844                 }).node;
29845                 tspan.textContent = line.text;
29846
29847                 textElement.append(tspan);
29848             });
29849
29850             // remove fake text
29851             fakeText.parentNode.removeChild(fakeText);
29852
29853             return textElement;
29854         };
29855
29856
29857         module.exports = Text;
29858     }, {
29859         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
29860         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
29861         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
29862         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
29863         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
29864         "lodash/object/merge": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\merge.js"
29865     }],
29866     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js": [function(require, module, exports) {
29867
29868         var isArray = function(obj) {
29869             return Object.prototype.toString.call(obj) === '[object Array]';
29870         };
29871
29872         var annotate = function() {
29873             var args = Array.prototype.slice.call(arguments);
29874
29875             if (args.length === 1 && isArray(args[0])) {
29876                 args = args[0];
29877             }
29878
29879             var fn = args.pop();
29880
29881             fn.$inject = args;
29882
29883             return fn;
29884         };
29885
29886
29887         // Current limitations:
29888         // - can't put into "function arg" comments
29889         // function /* (no parenthesis like this) */ (){}
29890         // function abc( /* xx (no parenthesis like this) */ a, b) {}
29891         //
29892         // Just put the comment before function or inside:
29893         // /* (((this is fine))) */ function(a, b) {}
29894         // function abc(a) { /* (((this is fine))) */}
29895
29896         var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
29897         var FN_ARG = /\/\*([^\*]*)\*\//m;
29898
29899         var parse = function(fn) {
29900             if (typeof fn !== 'function') {
29901                 throw new Error('Cannot annotate "' + fn + '". Expected a function!');
29902             }
29903
29904             var match = fn.toString().match(FN_ARGS);
29905             return match[1] && match[1].split(',').map(function(arg) {
29906                 match = arg.match(FN_ARG);
29907                 return match ? match[1].trim() : arg.trim();
29908             }) || [];
29909         };
29910
29911
29912         exports.annotate = annotate;
29913         exports.parse = parse;
29914         exports.isArray = isArray;
29915
29916     }, {}],
29917     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\index.js": [function(require, module, exports) {
29918         module.exports = {
29919             annotate: require('./annotation').annotate,
29920             Module: require('./module'),
29921             Injector: require('./injector')
29922         };
29923
29924     }, {
29925         "./annotation": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js",
29926         "./injector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\injector.js",
29927         "./module": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js"
29928     }],
29929     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\injector.js": [function(require, module, exports) {
29930         var Module = require('./module');
29931         var autoAnnotate = require('./annotation').parse;
29932         var annotate = require('./annotation').annotate;
29933         var isArray = require('./annotation').isArray;
29934
29935
29936         var Injector = function(modules, parent) {
29937             parent = parent || {
29938                 get: function(name) {
29939                     currentlyResolving.push(name);
29940                     throw error('No provider for "' + name + '"!');
29941                 }
29942             };
29943
29944             var currentlyResolving = [];
29945             var providers = this._providers = Object.create(parent._providers || null);
29946             var instances = this._instances = Object.create(null);
29947
29948             var self = instances.injector = this;
29949
29950             var error = function(msg) {
29951                 var stack = currentlyResolving.join(' -> ');
29952                 currentlyResolving.length = 0;
29953                 return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
29954             };
29955
29956             var get = function(name) {
29957                 if (!providers[name] && name.indexOf('.') !== -1) {
29958                     var parts = name.split('.');
29959                     var pivot = get(parts.shift());
29960
29961                     while (parts.length) {
29962                         pivot = pivot[parts.shift()];
29963                     }
29964
29965                     return pivot;
29966                 }
29967
29968                 if (Object.hasOwnProperty.call(instances, name)) {
29969                     return instances[name];
29970                 }
29971
29972                 if (Object.hasOwnProperty.call(providers, name)) {
29973                     if (currentlyResolving.indexOf(name) !== -1) {
29974                         currentlyResolving.push(name);
29975                         throw error('Cannot resolve circular dependency!');
29976                     }
29977
29978                     currentlyResolving.push(name);
29979                     instances[name] = providers[name][0](providers[name][1]);
29980                     currentlyResolving.pop();
29981
29982                     return instances[name];
29983                 }
29984
29985                 return parent.get(name);
29986             };
29987
29988             var instantiate = function(Type) {
29989                 var instance = Object.create(Type.prototype);
29990                 var returned = invoke(Type, instance);
29991
29992                 return typeof returned === 'object' ? returned : instance;
29993             };
29994
29995             var invoke = function(fn, context) {
29996                 if (typeof fn !== 'function') {
29997                     if (isArray(fn)) {
29998                         fn = annotate(fn.slice());
29999                     } else {
30000                         throw new Error('Cannot invoke "' + fn + '". Expected a function!');
30001                     }
30002                 }
30003
30004                 var inject = fn.$inject && fn.$inject || autoAnnotate(fn);
30005                 var dependencies = inject.map(function(dep) {
30006                     return get(dep);
30007                 });
30008
30009                 // TODO(vojta): optimize without apply
30010                 return fn.apply(context, dependencies);
30011             };
30012
30013
30014             var createPrivateInjectorFactory = function(privateChildInjector) {
30015                 return annotate(function(key) {
30016                     return privateChildInjector.get(key);
30017                 });
30018             };
30019
30020             var createChild = function(modules, forceNewInstances) {
30021                 if (forceNewInstances && forceNewInstances.length) {
30022                     var fromParentModule = Object.create(null);
30023                     var matchedScopes = Object.create(null);
30024
30025                     var privateInjectorsCache = [];
30026                     var privateChildInjectors = [];
30027                     var privateChildFactories = [];
30028
30029                     var provider;
30030                     var cacheIdx;
30031                     var privateChildInjector;
30032                     var privateChildInjectorFactory;
30033                     for (var name in providers) {
30034                         provider = providers[name];
30035
30036                         if (forceNewInstances.indexOf(name) !== -1) {
30037                             if (provider[2] === 'private') {
30038                                 cacheIdx = privateInjectorsCache.indexOf(provider[3]);
30039                                 if (cacheIdx === -1) {
30040                                     privateChildInjector = provider[3].createChild([], forceNewInstances);
30041                                     privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);
30042                                     privateInjectorsCache.push(provider[3]);
30043                                     privateChildInjectors.push(privateChildInjector);
30044                                     privateChildFactories.push(privateChildInjectorFactory);
30045                                     fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];
30046                                 } else {
30047                                     fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];
30048                                 }
30049                             } else {
30050                                 fromParentModule[name] = [provider[2], provider[1]];
30051                             }
30052                             matchedScopes[name] = true;
30053                         }
30054
30055                         if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
30056                             forceNewInstances.forEach(function(scope) {
30057                                 if (provider[1].$scope.indexOf(scope) !== -1) {
30058                                     fromParentModule[name] = [provider[2], provider[1]];
30059                                     matchedScopes[scope] = true;
30060                                 }
30061                             });
30062                         }
30063                     }
30064
30065                     forceNewInstances.forEach(function(scope) {
30066                         if (!matchedScopes[scope]) {
30067                             throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
30068                         }
30069                     });
30070
30071                     modules.unshift(fromParentModule);
30072                 }
30073
30074                 return new Injector(modules, self);
30075             };
30076
30077             var factoryMap = {
30078                 factory: invoke,
30079                 type: instantiate,
30080                 value: function(value) {
30081                     return value;
30082                 }
30083             };
30084
30085             modules.forEach(function(module) {
30086
30087                 function arrayUnwrap(type, value) {
30088                     if (type !== 'value' && isArray(value)) {
30089                         value = annotate(value.slice());
30090                     }
30091
30092                     return value;
30093                 }
30094
30095                 // TODO(vojta): handle wrong inputs (modules)
30096                 if (module instanceof Module) {
30097                     module.forEach(function(provider) {
30098                         var name = provider[0];
30099                         var type = provider[1];
30100                         var value = provider[2];
30101
30102                         providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
30103                     });
30104                 } else if (typeof module === 'object') {
30105                     if (module.__exports__) {
30106                         var clonedModule = Object.keys(module).reduce(function(m, key) {
30107                             if (key.substring(0, 2) !== '__') {
30108                                 m[key] = module[key];
30109                             }
30110                             return m;
30111                         }, Object.create(null));
30112
30113                         var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);
30114                         var getFromPrivateInjector = annotate(function(key) {
30115                             return privateInjector.get(key);
30116                         });
30117                         module.__exports__.forEach(function(key) {
30118                             providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
30119                         });
30120                     } else {
30121                         Object.keys(module).forEach(function(name) {
30122                             if (module[name][2] === 'private') {
30123                                 providers[name] = module[name];
30124                                 return;
30125                             }
30126
30127                             var type = module[name][0];
30128                             var value = module[name][1];
30129
30130                             providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
30131                         });
30132                     }
30133                 }
30134             });
30135
30136             // public API
30137             this.get = get;
30138             this.invoke = invoke;
30139             this.instantiate = instantiate;
30140             this.createChild = createChild;
30141         };
30142
30143         module.exports = Injector;
30144
30145     }, {
30146         "./annotation": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js",
30147         "./module": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js"
30148     }],
30149     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js": [function(require, module, exports) {
30150         var Module = function() {
30151             var providers = [];
30152
30153             this.factory = function(name, factory) {
30154                 providers.push([name, 'factory', factory]);
30155                 return this;
30156             };
30157
30158             this.value = function(name, value) {
30159                 providers.push([name, 'value', value]);
30160                 return this;
30161             };
30162
30163             this.type = function(name, type) {
30164                 providers.push([name, 'type', type]);
30165                 return this;
30166             };
30167
30168             this.forEach = function(iterator) {
30169                 providers.forEach(iterator);
30170             };
30171         };
30172
30173         module.exports = Module;
30174
30175     }, {}],
30176     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\eve\\eve.js": [function(require, module, exports) {
30177         // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
30178         // 
30179         // Licensed under the Apache License, Version 2.0 (the "License");
30180         // you may not use this file except in compliance with the License.
30181         // You may obtain a copy of the License at
30182         // 
30183         // http://www.apache.org/licenses/LICENSE-2.0
30184         // 
30185         // Unless required by applicable law or agreed to in writing, software
30186         // distributed under the License is distributed on an "AS IS" BASIS,
30187         // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30188         // See the License for the specific language governing permissions and
30189         // limitations under the License.
30190         // ÃƒÆ’¢â€�Ήâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�Â�
30191         // \\
30192         // ÃƒÆ’¢â€�‚ Eve 0.4.2 - JavaScript Events Library ÃƒÆ’¢â€�‚ \\
30193         // ÃƒÆ’¢â€�ωâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�¤
30194         // \\
30195         // ÃƒÆ’¢â€�‚ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) ÃƒÆ’¢â€�‚
30196         // \\
30197         // ÃƒÆ’¢â€�â€�ââ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�Ëœ
30198         // \\
30199
30200         (function(glob) {
30201             var version = "0.4.2",
30202                 has = "hasOwnProperty",
30203                 separator = /[\.\/]/,
30204                 comaseparator = /\s*,\s*/,
30205                 wildcard = "*",
30206                 fun = function() {},
30207                 numsort = function(a, b) {
30208                     return a - b;
30209                 },
30210                 current_event,
30211                 stop,
30212                 events = {
30213                     n: {}
30214                 },
30215                 firstDefined = function() {
30216                     for (var i = 0, ii = this.length; i < ii; i++) {
30217                         if (typeof this[i] != "undefined") {
30218                             return this[i];
30219                         }
30220                     }
30221                 },
30222                 lastDefined = function() {
30223                     var i = this.length;
30224                     while (--i) {
30225                         if (typeof this[i] != "undefined") {
30226                             return this[i];
30227                         }
30228                     }
30229                 },
30230                 /*
30231                  * \ eve [ method ]
30232                  * 
30233                  * Fires event with given `name`, given scope and other parameters.
30234                  *  > Arguments
30235                  *  - name (string) name of the *event*, dot (`.`) or slash (`/`) separated -
30236                  * scope (object) context for the event handlers - varargs (...) the rest of
30237                  * arguments will be sent to event handlers
30238                  *  = (object) array of returned values from the listeners. Array has two
30239                  * methods `.firstDefined()` and `.lastDefined()` to get first or last not
30240                  * `undefined` value. \
30241                  */
30242                 eve = function(name, scope) {
30243                     name = String(name);
30244                     var e = events,
30245                         oldstop = stop,
30246                         args = Array.prototype.slice.call(arguments, 2),
30247                         listeners = eve.listeners(name),
30248                         z = 0,
30249                         f = false,
30250                         l,
30251                         indexed = [],
30252                         queue = {},
30253                         out = [],
30254                         ce = current_event,
30255                         errors = [];
30256                     out.firstDefined = firstDefined;
30257                     out.lastDefined = lastDefined;
30258                     current_event = name;
30259                     stop = 0;
30260                     for (var i = 0, ii = listeners.length; i < ii; i++)
30261                         if ("zIndex" in listeners[i]) {
30262                             indexed.push(listeners[i].zIndex);
30263                             if (listeners[i].zIndex < 0) {
30264                                 queue[listeners[i].zIndex] = listeners[i];
30265                             }
30266                         }
30267                     indexed.sort(numsort);
30268                     while (indexed[z] < 0) {
30269                         l = queue[indexed[z++]];
30270                         out.push(l.apply(scope, args));
30271                         if (stop) {
30272                             stop = oldstop;
30273                             return out;
30274                         }
30275                     }
30276                     for (i = 0; i < ii; i++) {
30277                         l = listeners[i];
30278                         if ("zIndex" in l) {
30279                             if (l.zIndex == indexed[z]) {
30280                                 out.push(l.apply(scope, args));
30281                                 if (stop) {
30282                                     break;
30283                                 }
30284                                 do {
30285                                     z++;
30286                                     l = queue[indexed[z]];
30287                                     l && out.push(l.apply(scope, args));
30288                                     if (stop) {
30289                                         break;
30290                                     }
30291                                 } while (l)
30292                             } else {
30293                                 queue[l.zIndex] = l;
30294                             }
30295                         } else {
30296                             out.push(l.apply(scope, args));
30297                             if (stop) {
30298                                 break;
30299                             }
30300                         }
30301                     }
30302                     stop = oldstop;
30303                     current_event = ce;
30304                     return out;
30305                 };
30306             // Undocumented. Debug only.
30307             eve._events = events;
30308             /*
30309              * \ eve.listeners [ method ]
30310              * 
30311              * Internal method which gives you array of all event handlers that will be
30312              * triggered by the given `name`.
30313              *  > Arguments
30314              *  - name (string) name of the event, dot (`.`) or slash (`/`) separated
30315              *  = (array) array of event handlers \
30316              */
30317             eve.listeners = function(name) {
30318                 var names = name.split(separator),
30319                     e = events,
30320                     item,
30321                     items,
30322                     k,
30323                     i,
30324                     ii,
30325                     j,
30326                     jj,
30327                     nes,
30328                     es = [e],
30329                     out = [];
30330                 for (i = 0, ii = names.length; i < ii; i++) {
30331                     nes = [];
30332                     for (j = 0, jj = es.length; j < jj; j++) {
30333                         e = es[j].n;
30334                         items = [e[names[i]], e[wildcard]];
30335                         k = 2;
30336                         while (k--) {
30337                             item = items[k];
30338                             if (item) {
30339                                 nes.push(item);
30340                                 out = out.concat(item.f || []);
30341                             }
30342                         }
30343                     }
30344                     es = nes;
30345                 }
30346                 return out;
30347             };
30348
30349             /*
30350              * \ eve.on [ method ] * Binds given event handler with a given name. You
30351              * can use wildcards ÃƒÆ’¢â‚¬Å“`*`� for the names: | eve.on("*.under.*",
30352              * f); | eve("mouse.under.floor"); // triggers f Use @eve to trigger the
30353              * listener. * > Arguments * - name (string) name of the event, dot (`.`) or
30354              * slash (`/`) separated, with optional wildcards - f (function) event
30355              * handler function * = (function) returned function accepts a single
30356              * numeric parameter that represents z-index of the handler. It is an
30357              * optional feature and only used when you need to ensure that some subset
30358              * of handlers will be invoked in a given order, despite of the order of
30359              * assignment. > Example: | eve.on("mouse", eatIt)(2); | eve.on("mouse",
30360              * scream); | eve.on("mouse", catchIt)(1); This will ensure that `catchIt`
30361              * function will be called before `eatIt`.
30362              * 
30363              * If you want to put your handler before non-indexed handlers, specify a
30364              * negative value. Note: I assume most of the time you don’t need to
30365              * worry about z-index, but it’s nice to have this feature
30366              * ÃƒÆ’¢â‚¬Å“just in case�. \
30367              */
30368             eve.on = function(name, f) {
30369                 name = String(name);
30370                 if (typeof f != "function") {
30371                     return function() {};
30372                 }
30373                 var names = name.split(comaseparator);
30374                 for (var i = 0, ii = names.length; i < ii; i++) {
30375                     (function(name) {
30376                         var names = name.split(separator),
30377                             e = events,
30378                             exist;
30379                         for (var i = 0, ii = names.length; i < ii; i++) {
30380                             e = e.n;
30381                             e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {
30382                                 n: {}
30383                             });
30384                         }
30385                         e.f = e.f || [];
30386                         for (i = 0, ii = e.f.length; i < ii; i++)
30387                             if (e.f[i] == f) {
30388                                 exist = true;
30389                                 break;
30390                             }!exist && e.f.push(f);
30391                     }(names[i]));
30392                 }
30393                 return function(zIndex) {
30394                     if (+zIndex == +zIndex) {
30395                         f.zIndex = +zIndex;
30396                     }
30397                 };
30398             };
30399             /*
30400              * \ eve.f [ method ] * Returns function that will fire given event with
30401              * optional arguments. Arguments that will be passed to the result function
30402              * will be also concated to the list of final arguments. | el.onclick =
30403              * eve.f("click", 1, 2); | eve.on("click", function (a, b, c) { |
30404              * console.log(a, b, c); // 1, 2, [event object] | }); > Arguments - event
30405              * (string) event name - varargs (…) and any other arguments =
30406              * (function) possible event handler function \
30407              */
30408             eve.f = function(event) {
30409                 var attrs = [].slice.call(arguments, 1);
30410                 return function() {
30411                     eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
30412                 };
30413             };
30414             /*
30415              * \ eve.stop [ method ] * Is used inside an event handler to stop the
30416              * event, preventing any subsequent listeners from firing. \
30417              */
30418             eve.stop = function() {
30419                 stop = 1;
30420             };
30421             /*
30422              * \ eve.nt [ method ] * Could be used inside event handler to figure out
30423              * actual name of the event. * > Arguments * - subname (string) #optional
30424              * subname of the event * = (string) name of the event, if `subname` is not
30425              * specified or = (boolean) `true`, if current event’s name contains
30426              * `subname` \
30427              */
30428             eve.nt = function(subname) {
30429                 if (subname) {
30430                     return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
30431                 }
30432                 return current_event;
30433             };
30434             /*
30435              * \ eve.nts [ method ] * Could be used inside event handler to figure out
30436              * actual name of the event. * * = (array) names of the event \
30437              */
30438             eve.nts = function() {
30439                 return current_event.split(separator);
30440             };
30441             /*
30442              * \ eve.off [ method ] * Removes given function from the list of event
30443              * listeners assigned to given name. If no arguments specified all the
30444              * events will be cleared. * > Arguments * - name (string) name of the
30445              * event, dot (`.`) or slash (`/`) separated, with optional wildcards - f
30446              * (function) event handler function \
30447              */
30448             /*
30449              * \ eve.unbind [ method ] * See @eve.off \
30450              */
30451             eve.off = eve.unbind = function(name, f) {
30452                 if (!name) {
30453                     eve._events = events = {
30454                         n: {}
30455                     };
30456                     return;
30457                 }
30458                 var names = name.split(comaseparator);
30459                 if (names.length > 1) {
30460                     for (var i = 0, ii = names.length; i < ii; i++) {
30461                         eve.off(names[i], f);
30462                     }
30463                     return;
30464                 }
30465                 names = name.split(separator);
30466                 var e,
30467                     key,
30468                     splice,
30469                     i, ii, j, jj,
30470                     cur = [events];
30471                 for (i = 0, ii = names.length; i < ii; i++) {
30472                     for (j = 0; j < cur.length; j += splice.length - 2) {
30473                         splice = [j, 1];
30474                         e = cur[j].n;
30475                         if (names[i] != wildcard) {
30476                             if (e[names[i]]) {
30477                                 splice.push(e[names[i]]);
30478                             }
30479                         } else {
30480                             for (key in e)
30481                                 if (e[has](key)) {
30482                                     splice.push(e[key]);
30483                                 }
30484                         }
30485                         cur.splice.apply(cur, splice);
30486                     }
30487                 }
30488                 for (i = 0, ii = cur.length; i < ii; i++) {
30489                     e = cur[i];
30490                     while (e.n) {
30491                         if (f) {
30492                             if (e.f) {
30493                                 for (j = 0, jj = e.f.length; j < jj; j++)
30494                                     if (e.f[j] == f) {
30495                                         e.f.splice(j, 1);
30496                                         break;
30497                                     }!e.f.length && delete e.f;
30498                             }
30499                             for (key in e.n)
30500                                 if (e.n[has](key) && e.n[key].f) {
30501                                     var funcs = e.n[key].f;
30502                                     for (j = 0, jj = funcs.length; j < jj; j++)
30503                                         if (funcs[j] == f) {
30504                                             funcs.splice(j, 1);
30505                                             break;
30506                                         }!funcs.length && delete e.n[key].f;
30507                                 }
30508                         } else {
30509                             delete e.f;
30510                             for (key in e.n)
30511                                 if (e.n[has](key) && e.n[key].f) {
30512                                     delete e.n[key].f;
30513                                 }
30514                         }
30515                         e = e.n;
30516                     }
30517                 }
30518             };
30519             /*
30520              * \ eve.once [ method ] * Binds given event handler with a given name to
30521              * only run once then unbind itself. | eve.once("login", f); | eve("login"); //
30522              * triggers f | eve("login"); // no listeners Use @eve to trigger the
30523              * listener. * > Arguments * - name (string) name of the event, dot (`.`) or
30524              * slash (`/`) separated, with optional wildcards - f (function) event
30525              * handler function * = (function) same return function as @eve.on \
30526              */
30527             eve.once = function(name, f) {
30528                 var f2 = function() {
30529                     eve.unbind(name, f2);
30530                     return f.apply(this, arguments);
30531                 };
30532                 return eve.on(name, f2);
30533             };
30534             /*
30535              * \ eve.version [ property (string) ] * Current version of the library. \
30536              */
30537             eve.version = version;
30538             eve.toString = function() {
30539                 return "You are running Eve " + version;
30540             };
30541             (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (typeof define === "function" && define.amd ? (define("eve", [], function() {
30542                 return eve;
30543             })) : (glob.eve = eve));
30544         })(this);
30545
30546     }, {}],
30547     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\hammerjs\\hammer.js": [function(require, module, exports) {
30548         /*
30549          * ! Hammer.JS - v2.0.4 - 2014-09-28 http://hammerjs.github.io/
30550          * 
30551          * Copyright (c) 2014 Jorik Tangelder; Licensed under the MIT license
30552          */
30553         (function(window, document, exportName, undefined) {
30554             'use strict';
30555
30556             var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
30557             var TEST_ELEMENT = document.createElement('div');
30558
30559             var TYPE_FUNCTION = 'function';
30560
30561             var round = Math.round;
30562             var abs = Math.abs;
30563             var now = Date.now;
30564
30565             /**
30566              * set a timeout with a given scope
30567              * 
30568              * @param {Function}
30569              *            fn
30570              * @param {Number}
30571              *            timeout
30572              * @param {Object}
30573              *            context
30574              * @returns {number}
30575              */
30576             function setTimeoutContext(fn, timeout, context) {
30577                 return setTimeout(bindFn(fn, context), timeout);
30578             }
30579
30580             /**
30581              * if the argument is an array, we want to execute the fn on each entry if it
30582              * aint an array we don't want to do a thing. this is used by all the methods
30583              * that accept a single and array argument.
30584              * 
30585              * @param {*|Array}
30586              *            arg
30587              * @param {String}
30588              *            fn
30589              * @param {Object}
30590              *            [context]
30591              * @returns {Boolean}
30592              */
30593             function invokeArrayArg(arg, fn, context) {
30594                 if (Array.isArray(arg)) {
30595                     each(arg, context[fn], context);
30596                     return true;
30597                 }
30598                 return false;
30599             }
30600
30601             /**
30602              * walk objects and arrays
30603              * 
30604              * @param {Object}
30605              *            obj
30606              * @param {Function}
30607              *            iterator
30608              * @param {Object}
30609              *            context
30610              */
30611             function each(obj, iterator, context) {
30612                 var i;
30613
30614                 if (!obj) {
30615                     return;
30616                 }
30617
30618                 if (obj.forEach) {
30619                     obj.forEach(iterator, context);
30620                 } else if (obj.length !== undefined) {
30621                     i = 0;
30622                     while (i < obj.length) {
30623                         iterator.call(context, obj[i], i, obj);
30624                         i++;
30625                     }
30626                 } else {
30627                     for (i in obj) {
30628                         obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
30629                     }
30630                 }
30631             }
30632
30633             /**
30634              * extend object. means that properties in dest will be overwritten by the ones
30635              * in src.
30636              * 
30637              * @param {Object}
30638              *            dest
30639              * @param {Object}
30640              *            src
30641              * @param {Boolean}
30642              *            [merge]
30643              * @returns {Object} dest
30644              */
30645             function extend(dest, src, merge) {
30646                 var keys = Object.keys(src);
30647                 var i = 0;
30648                 while (i < keys.length) {
30649                     if (!merge || (merge && dest[keys[i]] === undefined)) {
30650                         dest[keys[i]] = src[keys[i]];
30651                     }
30652                     i++;
30653                 }
30654                 return dest;
30655             }
30656
30657             /**
30658              * merge the values from src in the dest. means that properties that exist in
30659              * dest will not be overwritten by src
30660              * 
30661              * @param {Object}
30662              *            dest
30663              * @param {Object}
30664              *            src
30665              * @returns {Object} dest
30666              */
30667             function merge(dest, src) {
30668                 return extend(dest, src, true);
30669             }
30670
30671             /**
30672              * simple class inheritance
30673              * 
30674              * @param {Function}
30675              *            child
30676              * @param {Function}
30677              *            base
30678              * @param {Object}
30679              *            [properties]
30680              */
30681             function inherit(child, base, properties) {
30682                 var baseP = base.prototype,
30683                     childP;
30684
30685                 childP = child.prototype = Object.create(baseP);
30686                 childP.constructor = child;
30687                 childP._super = baseP;
30688
30689                 if (properties) {
30690                     extend(childP, properties);
30691                 }
30692             }
30693
30694             /**
30695              * simple function bind
30696              * 
30697              * @param {Function}
30698              *            fn
30699              * @param {Object}
30700              *            context
30701              * @returns {Function}
30702              */
30703             function bindFn(fn, context) {
30704                 return function boundFn() {
30705                     return fn.apply(context, arguments);
30706                 };
30707             }
30708
30709             /**
30710              * let a boolean value also be a function that must return a boolean this first
30711              * item in args will be used as the context
30712              * 
30713              * @param {Boolean|Function}
30714              *            val
30715              * @param {Array}
30716              *            [args]
30717              * @returns {Boolean}
30718              */
30719             function boolOrFn(val, args) {
30720                 if (typeof val == TYPE_FUNCTION) {
30721                     return val.apply(args ? args[0] || undefined : undefined, args);
30722                 }
30723                 return val;
30724             }
30725
30726             /**
30727              * use the val2 when val1 is undefined
30728              * 
30729              * @param {*}
30730              *            val1
30731              * @param {*}
30732              *            val2
30733              * @returns {*}
30734              */
30735             function ifUndefined(val1, val2) {
30736                 return (val1 === undefined) ? val2 : val1;
30737             }
30738
30739             /**
30740              * addEventListener with multiple events at once
30741              * 
30742              * @param {EventTarget}
30743              *            target
30744              * @param {String}
30745              *            types
30746              * @param {Function}
30747              *            handler
30748              */
30749             function addEventListeners(target, types, handler) {
30750                 each(splitStr(types), function(type) {
30751                     target.addEventListener(type, handler, false);
30752                 });
30753             }
30754
30755             /**
30756              * removeEventListener with multiple events at once
30757              * 
30758              * @param {EventTarget}
30759              *            target
30760              * @param {String}
30761              *            types
30762              * @param {Function}
30763              *            handler
30764              */
30765             function removeEventListeners(target, types, handler) {
30766                 each(splitStr(types), function(type) {
30767                     target.removeEventListener(type, handler, false);
30768                 });
30769             }
30770
30771             /**
30772              * find if a node is in the given parent
30773              * 
30774              * @method hasParent
30775              * @param {HTMLElement}
30776              *            node
30777              * @param {HTMLElement}
30778              *            parent
30779              * @return {Boolean} found
30780              */
30781             function hasParent(node, parent) {
30782                 while (node) {
30783                     if (node == parent) {
30784                         return true;
30785                     }
30786                     node = node.parentNode;
30787                 }
30788                 return false;
30789             }
30790
30791             /**
30792              * small indexOf wrapper
30793              * 
30794              * @param {String}
30795              *            str
30796              * @param {String}
30797              *            find
30798              * @returns {Boolean} found
30799              */
30800             function inStr(str, find) {
30801                 return str.indexOf(find) > -1;
30802             }
30803
30804             /**
30805              * split string on whitespace
30806              * 
30807              * @param {String}
30808              *            str
30809              * @returns {Array} words
30810              */
30811             function splitStr(str) {
30812                 return str.trim().split(/\s+/g);
30813             }
30814
30815             /**
30816              * find if a array contains the object using indexOf or a simple polyFill
30817              * 
30818              * @param {Array}
30819              *            src
30820              * @param {String}
30821              *            find
30822              * @param {String}
30823              *            [findByKey]
30824              * @return {Boolean|Number} false when not found, or the index
30825              */
30826             function inArray(src, find, findByKey) {
30827                 if (src.indexOf && !findByKey) {
30828                     return src.indexOf(find);
30829                 } else {
30830                     var i = 0;
30831                     while (i < src.length) {
30832                         if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
30833                             return i;
30834                         }
30835                         i++;
30836                     }
30837                     return -1;
30838                 }
30839             }
30840
30841             /**
30842              * convert array-like objects to real arrays
30843              * 
30844              * @param {Object}
30845              *            obj
30846              * @returns {Array}
30847              */
30848             function toArray(obj) {
30849                 return Array.prototype.slice.call(obj, 0);
30850             }
30851
30852             /**
30853              * unique array with objects based on a key (like 'id') or just by the array's
30854              * value
30855              * 
30856              * @param {Array}
30857              *            src [{id:1},{id:2},{id:1}]
30858              * @param {String}
30859              *            [key]
30860              * @param {Boolean}
30861              *            [sort=False]
30862              * @returns {Array} [{id:1},{id:2}]
30863              */
30864             function uniqueArray(src, key, sort) {
30865                 var results = [];
30866                 var values = [];
30867                 var i = 0;
30868
30869                 while (i < src.length) {
30870                     var val = key ? src[i][key] : src[i];
30871                     if (inArray(values, val) < 0) {
30872                         results.push(src[i]);
30873                     }
30874                     values[i] = val;
30875                     i++;
30876                 }
30877
30878                 if (sort) {
30879                     if (!key) {
30880                         results = results.sort();
30881                     } else {
30882                         results = results.sort(function sortUniqueArray(a, b) {
30883                             return a[key] > b[key];
30884                         });
30885                     }
30886                 }
30887
30888                 return results;
30889             }
30890
30891             /**
30892              * get the prefixed property
30893              * 
30894              * @param {Object}
30895              *            obj
30896              * @param {String}
30897              *            property
30898              * @returns {String|Undefined} prefixed
30899              */
30900             function prefixed(obj, property) {
30901                 var prefix, prop;
30902                 var camelProp = property[0].toUpperCase() + property.slice(1);
30903
30904                 var i = 0;
30905                 while (i < VENDOR_PREFIXES.length) {
30906                     prefix = VENDOR_PREFIXES[i];
30907                     prop = (prefix) ? prefix + camelProp : property;
30908
30909                     if (prop in obj) {
30910                         return prop;
30911                     }
30912                     i++;
30913                 }
30914                 return undefined;
30915             }
30916
30917             /**
30918              * get a unique id
30919              * 
30920              * @returns {number} uniqueId
30921              */
30922             var _uniqueId = 1;
30923
30924             function uniqueId() {
30925                 return _uniqueId++;
30926             }
30927
30928             /**
30929              * get the window object of an element
30930              * 
30931              * @param {HTMLElement}
30932              *            element
30933              * @returns {DocumentView|Window}
30934              */
30935             function getWindowForElement(element) {
30936                 var doc = element.ownerDocument;
30937                 return (doc.defaultView || doc.parentWindow);
30938             }
30939
30940             var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
30941
30942             var SUPPORT_TOUCH = ('ontouchstart' in window);
30943             var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
30944             var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
30945
30946             var INPUT_TYPE_TOUCH = 'touch';
30947             var INPUT_TYPE_PEN = 'pen';
30948             var INPUT_TYPE_MOUSE = 'mouse';
30949             var INPUT_TYPE_KINECT = 'kinect';
30950
30951             var COMPUTE_INTERVAL = 25;
30952
30953             var INPUT_START = 1;
30954             var INPUT_MOVE = 2;
30955             var INPUT_END = 4;
30956             var INPUT_CANCEL = 8;
30957
30958             var DIRECTION_NONE = 1;
30959             var DIRECTION_LEFT = 2;
30960             var DIRECTION_RIGHT = 4;
30961             var DIRECTION_UP = 8;
30962             var DIRECTION_DOWN = 16;
30963
30964             var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
30965             var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
30966             var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
30967
30968             var PROPS_XY = ['x', 'y'];
30969             var PROPS_CLIENT_XY = ['clientX', 'clientY'];
30970
30971             /**
30972              * create new input type manager
30973              * 
30974              * @param {Manager}
30975              *            manager
30976              * @param {Function}
30977              *            callback
30978              * @returns {Input}
30979              * @constructor
30980              */
30981             function Input(manager, callback) {
30982                 var self = this;
30983                 this.manager = manager;
30984                 this.callback = callback;
30985                 this.element = manager.element;
30986                 this.target = manager.options.inputTarget;
30987
30988                 // smaller wrapper around the handler, for the scope and the enabled state
30989                 // of the manager,
30990                 // so when disabled the input events are completely bypassed.
30991                 this.domHandler = function(ev) {
30992                     if (boolOrFn(manager.options.enable, [manager])) {
30993                         self.handler(ev);
30994                     }
30995                 };
30996
30997                 this.init();
30998
30999             }
31000
31001             Input.prototype = {
31002                 /**
31003                  * should handle the inputEvent data and trigger the callback
31004                  * 
31005                  * @virtual
31006                  */
31007                 handler: function() {},
31008
31009                 /**
31010                  * bind the events
31011                  */
31012                 init: function() {
31013                     this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
31014                     this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
31015                     this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
31016                 },
31017
31018                 /**
31019                  * unbind the events
31020                  */
31021                 destroy: function() {
31022                     this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
31023                     this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
31024                     this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
31025                 }
31026             };
31027
31028             /**
31029              * create new input type manager called by the Manager constructor
31030              * 
31031              * @param {Hammer}
31032              *            manager
31033              * @returns {Input}
31034              */
31035             function createInputInstance(manager) {
31036                 var Type;
31037                 var inputClass = manager.options.inputClass;
31038
31039                 if (inputClass) {
31040                     Type = inputClass;
31041                 } else if (SUPPORT_POINTER_EVENTS) {
31042                     Type = PointerEventInput;
31043                 } else if (SUPPORT_ONLY_TOUCH) {
31044                     Type = TouchInput;
31045                 } else if (!SUPPORT_TOUCH) {
31046                     Type = MouseInput;
31047                 } else {
31048                     Type = TouchMouseInput;
31049                 }
31050                 return new(Type)(manager, inputHandler);
31051             }
31052
31053             /**
31054              * handle input events
31055              * 
31056              * @param {Manager}
31057              *            manager
31058              * @param {String}
31059              *            eventType
31060              * @param {Object}
31061              *            input
31062              */
31063             function inputHandler(manager, eventType, input) {
31064                 var pointersLen = input.pointers.length;
31065                 var changedPointersLen = input.changedPointers.length;
31066                 var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
31067                 var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
31068
31069                 input.isFirst = !!isFirst;
31070                 input.isFinal = !!isFinal;
31071
31072                 if (isFirst) {
31073                     manager.session = {};
31074                 }
31075
31076                 // source event is the normalized value of the domEvents
31077                 // like 'touchstart, mouseup, pointerdown'
31078                 input.eventType = eventType;
31079
31080                 // compute scale, rotation etc
31081                 computeInputData(manager, input);
31082
31083                 // emit secret event
31084                 manager.emit('hammer.input', input);
31085
31086                 manager.recognize(input);
31087                 manager.session.prevInput = input;
31088             }
31089
31090             /**
31091              * extend the data with some usable properties like scale, rotate, velocity etc
31092              * 
31093              * @param {Object}
31094              *            manager
31095              * @param {Object}
31096              *            input
31097              */
31098             function computeInputData(manager, input) {
31099                 var session = manager.session;
31100                 var pointers = input.pointers;
31101                 var pointersLength = pointers.length;
31102
31103                 // store the first input to calculate the distance and direction
31104                 if (!session.firstInput) {
31105                     session.firstInput = simpleCloneInputData(input);
31106                 }
31107
31108                 // to compute scale and rotation we need to store the multiple touches
31109                 if (pointersLength > 1 && !session.firstMultiple) {
31110                     session.firstMultiple = simpleCloneInputData(input);
31111                 } else if (pointersLength === 1) {
31112                     session.firstMultiple = false;
31113                 }
31114
31115                 var firstInput = session.firstInput;
31116                 var firstMultiple = session.firstMultiple;
31117                 var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
31118
31119                 var center = input.center = getCenter(pointers);
31120                 input.timeStamp = now();
31121                 input.deltaTime = input.timeStamp - firstInput.timeStamp;
31122
31123                 input.angle = getAngle(offsetCenter, center);
31124                 input.distance = getDistance(offsetCenter, center);
31125
31126                 computeDeltaXY(session, input);
31127                 input.offsetDirection = getDirection(input.deltaX, input.deltaY);
31128
31129                 input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
31130                 input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
31131
31132                 computeIntervalInputData(session, input);
31133
31134                 // find the correct target
31135                 var target = manager.element;
31136                 if (hasParent(input.srcEvent.target, target)) {
31137                     target = input.srcEvent.target;
31138                 }
31139                 input.target = target;
31140             }
31141
31142             function computeDeltaXY(session, input) {
31143                 var center = input.center;
31144                 var offset = session.offsetDelta || {};
31145                 var prevDelta = session.prevDelta || {};
31146                 var prevInput = session.prevInput || {};
31147
31148                 if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
31149                     prevDelta = session.prevDelta = {
31150                         x: prevInput.deltaX || 0,
31151                         y: prevInput.deltaY || 0
31152                     };
31153
31154                     offset = session.offsetDelta = {
31155                         x: center.x,
31156                         y: center.y
31157                     };
31158                 }
31159
31160                 input.deltaX = prevDelta.x + (center.x - offset.x);
31161                 input.deltaY = prevDelta.y + (center.y - offset.y);
31162             }
31163
31164             /**
31165              * velocity is calculated every x ms
31166              * 
31167              * @param {Object}
31168              *            session
31169              * @param {Object}
31170              *            input
31171              */
31172             function computeIntervalInputData(session, input) {
31173                 var last = session.lastInterval || input,
31174                     deltaTime = input.timeStamp - last.timeStamp,
31175                     velocity, velocityX, velocityY, direction;
31176
31177                 if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
31178                     var deltaX = last.deltaX - input.deltaX;
31179                     var deltaY = last.deltaY - input.deltaY;
31180
31181                     var v = getVelocity(deltaTime, deltaX, deltaY);
31182                     velocityX = v.x;
31183                     velocityY = v.y;
31184                     velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
31185                     direction = getDirection(deltaX, deltaY);
31186
31187                     session.lastInterval = input;
31188                 } else {
31189                     // use latest velocity info if it doesn't overtake a minimum period
31190                     velocity = last.velocity;
31191                     velocityX = last.velocityX;
31192                     velocityY = last.velocityY;
31193                     direction = last.direction;
31194                 }
31195
31196                 input.velocity = velocity;
31197                 input.velocityX = velocityX;
31198                 input.velocityY = velocityY;
31199                 input.direction = direction;
31200             }
31201
31202             /**
31203              * create a simple clone from the input used for storage of firstInput and
31204              * firstMultiple
31205              * 
31206              * @param {Object}
31207              *            input
31208              * @returns {Object} clonedInputData
31209              */
31210             function simpleCloneInputData(input) {
31211                 // make a simple copy of the pointers because we will get a reference if we
31212                 // don't
31213                 // we only need clientXY for the calculations
31214                 var pointers = [];
31215                 var i = 0;
31216                 while (i < input.pointers.length) {
31217                     pointers[i] = {
31218                         clientX: round(input.pointers[i].clientX),
31219                         clientY: round(input.pointers[i].clientY)
31220                     };
31221                     i++;
31222                 }
31223
31224                 return {
31225                     timeStamp: now(),
31226                     pointers: pointers,
31227                     center: getCenter(pointers),
31228                     deltaX: input.deltaX,
31229                     deltaY: input.deltaY
31230                 };
31231             }
31232
31233             /**
31234              * get the center of all the pointers
31235              * 
31236              * @param {Array}
31237              *            pointers
31238              * @return {Object} center contains `x` and `y` properties
31239              */
31240             function getCenter(pointers) {
31241                 var pointersLength = pointers.length;
31242
31243                 // no need to loop when only one touch
31244                 if (pointersLength === 1) {
31245                     return {
31246                         x: round(pointers[0].clientX),
31247                         y: round(pointers[0].clientY)
31248                     };
31249                 }
31250
31251                 var x = 0,
31252                     y = 0,
31253                     i = 0;
31254                 while (i < pointersLength) {
31255                     x += pointers[i].clientX;
31256                     y += pointers[i].clientY;
31257                     i++;
31258                 }
31259
31260                 return {
31261                     x: round(x / pointersLength),
31262                     y: round(y / pointersLength)
31263                 };
31264             }
31265
31266             /**
31267              * calculate the velocity between two points. unit is in px per ms.
31268              * 
31269              * @param {Number}
31270              *            deltaTime
31271              * @param {Number}
31272              *            x
31273              * @param {Number}
31274              *            y
31275              * @return {Object} velocity `x` and `y`
31276              */
31277             function getVelocity(deltaTime, x, y) {
31278                 return {
31279                     x: x / deltaTime || 0,
31280                     y: y / deltaTime || 0
31281                 };
31282             }
31283
31284             /**
31285              * get the direction between two points
31286              * 
31287              * @param {Number}
31288              *            x
31289              * @param {Number}
31290              *            y
31291              * @return {Number} direction
31292              */
31293             function getDirection(x, y) {
31294                 if (x === y) {
31295                     return DIRECTION_NONE;
31296                 }
31297
31298                 if (abs(x) >= abs(y)) {
31299                     return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
31300                 }
31301                 return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;
31302             }
31303
31304             /**
31305              * calculate the absolute distance between two points
31306              * 
31307              * @param {Object}
31308              *            p1 {x, y}
31309              * @param {Object}
31310              *            p2 {x, y}
31311              * @param {Array}
31312              *            [props] containing x and y keys
31313              * @return {Number} distance
31314              */
31315             function getDistance(p1, p2, props) {
31316                 if (!props) {
31317                     props = PROPS_XY;
31318                 }
31319                 var x = p2[props[0]] - p1[props[0]],
31320                     y = p2[props[1]] - p1[props[1]];
31321
31322                 return Math.sqrt((x * x) + (y * y));
31323             }
31324
31325             /**
31326              * calculate the angle between two coordinates
31327              * 
31328              * @param {Object}
31329              *            p1
31330              * @param {Object}
31331              *            p2
31332              * @param {Array}
31333              *            [props] containing x and y keys
31334              * @return {Number} angle
31335              */
31336             function getAngle(p1, p2, props) {
31337                 if (!props) {
31338                     props = PROPS_XY;
31339                 }
31340                 var x = p2[props[0]] - p1[props[0]],
31341                     y = p2[props[1]] - p1[props[1]];
31342                 return Math.atan2(y, x) * 180 / Math.PI;
31343             }
31344
31345             /**
31346              * calculate the rotation degrees between two pointersets
31347              * 
31348              * @param {Array}
31349              *            start array of pointers
31350              * @param {Array}
31351              *            end array of pointers
31352              * @return {Number} rotation
31353              */
31354             function getRotation(start, end) {
31355                 return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY);
31356             }
31357
31358             /**
31359              * calculate the scale factor between two pointersets no scale is 1, and goes
31360              * down to 0 when pinched together, and bigger when pinched out
31361              * 
31362              * @param {Array}
31363              *            start array of pointers
31364              * @param {Array}
31365              *            end array of pointers
31366              * @return {Number} scale
31367              */
31368             function getScale(start, end) {
31369                 return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
31370             }
31371
31372             var MOUSE_INPUT_MAP = {
31373                 mousedown: INPUT_START,
31374                 mousemove: INPUT_MOVE,
31375                 mouseup: INPUT_END
31376             };
31377
31378             var MOUSE_ELEMENT_EVENTS = 'mousedown';
31379             var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
31380
31381             /**
31382              * Mouse events input
31383              * 
31384              * @constructor
31385              * @extends Input
31386              */
31387             function MouseInput() {
31388                 this.evEl = MOUSE_ELEMENT_EVENTS;
31389                 this.evWin = MOUSE_WINDOW_EVENTS;
31390
31391                 this.allow = true; // used by Input.TouchMouse to disable mouse events
31392                 this.pressed = false; // mousedown state
31393
31394                 Input.apply(this, arguments);
31395             }
31396
31397             inherit(MouseInput, Input, {
31398                 /**
31399                  * handle mouse events
31400                  * 
31401                  * @param {Object}
31402                  *            ev
31403                  */
31404                 handler: function MEhandler(ev) {
31405                     var eventType = MOUSE_INPUT_MAP[ev.type];
31406
31407                     // on start we want to have the left mouse button down
31408                     if (eventType & INPUT_START && ev.button === 0) {
31409                         this.pressed = true;
31410                     }
31411
31412                     if (eventType & INPUT_MOVE && ev.which !== 1) {
31413                         eventType = INPUT_END;
31414                     }
31415
31416                     // mouse must be down, and mouse events are allowed (see the TouchMouse
31417                     // input)
31418                     if (!this.pressed || !this.allow) {
31419                         return;
31420                     }
31421
31422                     if (eventType & INPUT_END) {
31423                         this.pressed = false;
31424                     }
31425
31426                     this.callback(this.manager, eventType, {
31427                         pointers: [ev],
31428                         changedPointers: [ev],
31429                         pointerType: INPUT_TYPE_MOUSE,
31430                         srcEvent: ev
31431                     });
31432                 }
31433             });
31434
31435             var POINTER_INPUT_MAP = {
31436                 pointerdown: INPUT_START,
31437                 pointermove: INPUT_MOVE,
31438                 pointerup: INPUT_END,
31439                 pointercancel: INPUT_CANCEL,
31440                 pointerout: INPUT_CANCEL
31441             };
31442
31443             // in IE10 the pointer types is defined as an enum
31444             var IE10_POINTER_TYPE_ENUM = {
31445                 2: INPUT_TYPE_TOUCH,
31446                 3: INPUT_TYPE_PEN,
31447                 4: INPUT_TYPE_MOUSE,
31448                 5: INPUT_TYPE_KINECT // see
31449                     // https://twitter.com/jacobrossi/status/480596438489890816
31450             };
31451
31452             var POINTER_ELEMENT_EVENTS = 'pointerdown';
31453             var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
31454
31455             // IE10 has prefixed support, and case-sensitive
31456             if (window.MSPointerEvent) {
31457                 POINTER_ELEMENT_EVENTS = 'MSPointerDown';
31458                 POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
31459             }
31460
31461             /**
31462              * Pointer events input
31463              * 
31464              * @constructor
31465              * @extends Input
31466              */
31467             function PointerEventInput() {
31468                 this.evEl = POINTER_ELEMENT_EVENTS;
31469                 this.evWin = POINTER_WINDOW_EVENTS;
31470
31471                 Input.apply(this, arguments);
31472
31473                 this.store = (this.manager.session.pointerEvents = []);
31474             }
31475
31476             inherit(PointerEventInput, Input, {
31477                 /**
31478                  * handle mouse events
31479                  * 
31480                  * @param {Object}
31481                  *            ev
31482                  */
31483                 handler: function PEhandler(ev) {
31484                     var store = this.store;
31485                     var removePointer = false;
31486
31487                     var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
31488                     var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
31489                     var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
31490
31491                     var isTouch = (pointerType == INPUT_TYPE_TOUCH);
31492
31493                     // get index of the event in the store
31494                     var storeIndex = inArray(store, ev.pointerId, 'pointerId');
31495
31496                     // start and mouse must be down
31497                     if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
31498                         if (storeIndex < 0) {
31499                             store.push(ev);
31500                             storeIndex = store.length - 1;
31501                         }
31502                     } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
31503                         removePointer = true;
31504                     }
31505
31506                     // it not found, so the pointer hasn't been down (so it's probably a
31507                     // hover)
31508                     if (storeIndex < 0) {
31509                         return;
31510                     }
31511
31512                     // update the event in the store
31513                     store[storeIndex] = ev;
31514
31515                     this.callback(this.manager, eventType, {
31516                         pointers: store,
31517                         changedPointers: [ev],
31518                         pointerType: pointerType,
31519                         srcEvent: ev
31520                     });
31521
31522                     if (removePointer) {
31523                         // remove from the store
31524                         store.splice(storeIndex, 1);
31525                     }
31526                 }
31527             });
31528
31529             var SINGLE_TOUCH_INPUT_MAP = {
31530                 touchstart: INPUT_START,
31531                 touchmove: INPUT_MOVE,
31532                 touchend: INPUT_END,
31533                 touchcancel: INPUT_CANCEL
31534             };
31535
31536             var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
31537             var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
31538
31539             /**
31540              * Touch events input
31541              * 
31542              * @constructor
31543              * @extends Input
31544              */
31545             function SingleTouchInput() {
31546                 this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
31547                 this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
31548                 this.started = false;
31549
31550                 Input.apply(this, arguments);
31551             }
31552
31553             inherit(SingleTouchInput, Input, {
31554                 handler: function TEhandler(ev) {
31555                     var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
31556
31557                     // should we handle the touch events?
31558                     if (type === INPUT_START) {
31559                         this.started = true;
31560                     }
31561
31562                     if (!this.started) {
31563                         return;
31564                     }
31565
31566                     var touches = normalizeSingleTouches.call(this, ev, type);
31567
31568                     // when done, reset the started state
31569                     if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
31570                         this.started = false;
31571                     }
31572
31573                     this.callback(this.manager, type, {
31574                         pointers: touches[0],
31575                         changedPointers: touches[1],
31576                         pointerType: INPUT_TYPE_TOUCH,
31577                         srcEvent: ev
31578                     });
31579                 }
31580             });
31581
31582             /**
31583              * @this {TouchInput}
31584              * @param {Object}
31585              *            ev
31586              * @param {Number}
31587              *            type flag
31588              * @returns {undefined|Array} [all, changed]
31589              */
31590             function normalizeSingleTouches(ev, type) {
31591                 var all = toArray(ev.touches);
31592                 var changed = toArray(ev.changedTouches);
31593
31594                 if (type & (INPUT_END | INPUT_CANCEL)) {
31595                     all = uniqueArray(all.concat(changed), 'identifier', true);
31596                 }
31597
31598                 return [all, changed];
31599             }
31600
31601             var TOUCH_INPUT_MAP = {
31602                 touchstart: INPUT_START,
31603                 touchmove: INPUT_MOVE,
31604                 touchend: INPUT_END,
31605                 touchcancel: INPUT_CANCEL
31606             };
31607
31608             var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
31609
31610             /**
31611              * Multi-user touch events input
31612              * 
31613              * @constructor
31614              * @extends Input
31615              */
31616             function TouchInput() {
31617                 this.evTarget = TOUCH_TARGET_EVENTS;
31618                 this.targetIds = {};
31619
31620                 Input.apply(this, arguments);
31621             }
31622
31623             inherit(TouchInput, Input, {
31624                 handler: function MTEhandler(ev) {
31625                     var type = TOUCH_INPUT_MAP[ev.type];
31626                     var touches = getTouches.call(this, ev, type);
31627                     if (!touches) {
31628                         return;
31629                     }
31630
31631                     this.callback(this.manager, type, {
31632                         pointers: touches[0],
31633                         changedPointers: touches[1],
31634                         pointerType: INPUT_TYPE_TOUCH,
31635                         srcEvent: ev
31636                     });
31637                 }
31638             });
31639
31640             /**
31641              * @this {TouchInput}
31642              * @param {Object}
31643              *            ev
31644              * @param {Number}
31645              *            type flag
31646              * @returns {undefined|Array} [all, changed]
31647              */
31648             function getTouches(ev, type) {
31649                 var allTouches = toArray(ev.touches);
31650                 var targetIds = this.targetIds;
31651
31652                 // when there is only one touch, the process can be simplified
31653                 if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
31654                     targetIds[allTouches[0].identifier] = true;
31655                     return [allTouches, allTouches];
31656                 }
31657
31658                 var i,
31659                     targetTouches,
31660                     changedTouches = toArray(ev.changedTouches),
31661                     changedTargetTouches = [],
31662                     target = this.target;
31663
31664                 // get target touches from touches
31665                 targetTouches = allTouches.filter(function(touch) {
31666                     return hasParent(touch.target, target);
31667                 });
31668
31669                 // collect touches
31670                 if (type === INPUT_START) {
31671                     i = 0;
31672                     while (i < targetTouches.length) {
31673                         targetIds[targetTouches[i].identifier] = true;
31674                         i++;
31675                     }
31676                 }
31677
31678                 // filter changed touches to only contain touches that exist in the
31679                 // collected target ids
31680                 i = 0;
31681                 while (i < changedTouches.length) {
31682                     if (targetIds[changedTouches[i].identifier]) {
31683                         changedTargetTouches.push(changedTouches[i]);
31684                     }
31685
31686                     // cleanup removed touches
31687                     if (type & (INPUT_END | INPUT_CANCEL)) {
31688                         delete targetIds[changedTouches[i].identifier];
31689                     }
31690                     i++;
31691                 }
31692
31693                 if (!changedTargetTouches.length) {
31694                     return;
31695                 }
31696
31697                 return [
31698                     // merge targetTouches with changedTargetTouches so it contains ALL
31699                     // touches, including 'end' and 'cancel'
31700                     uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
31701                     changedTargetTouches
31702                 ];
31703             }
31704
31705             /**
31706              * Combined touch and mouse input
31707              * 
31708              * Touch has a higher priority then mouse, and while touching no mouse events
31709              * are allowed. This because touch devices also emit mouse events while doing a
31710              * touch.
31711              * 
31712              * @constructor
31713              * @extends Input
31714              */
31715             function TouchMouseInput() {
31716                 Input.apply(this, arguments);
31717
31718                 var handler = bindFn(this.handler, this);
31719                 this.touch = new TouchInput(this.manager, handler);
31720                 this.mouse = new MouseInput(this.manager, handler);
31721             }
31722
31723             inherit(TouchMouseInput, Input, {
31724                 /**
31725                  * handle mouse and touch events
31726                  * 
31727                  * @param {Hammer}
31728                  *            manager
31729                  * @param {String}
31730                  *            inputEvent
31731                  * @param {Object}
31732                  *            inputData
31733                  */
31734                 handler: function TMEhandler(manager, inputEvent, inputData) {
31735                     var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
31736                         isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
31737
31738                     // when we're in a touch event, so block all upcoming mouse events
31739                     // most mobile browser also emit mouseevents, right after touchstart
31740                     if (isTouch) {
31741                         this.mouse.allow = false;
31742                     } else if (isMouse && !this.mouse.allow) {
31743                         return;
31744                     }
31745
31746                     // reset the allowMouse when we're done
31747                     if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
31748                         this.mouse.allow = true;
31749                     }
31750
31751                     this.callback(manager, inputEvent, inputData);
31752                 },
31753
31754                 /**
31755                  * remove the event listeners
31756                  */
31757                 destroy: function destroy() {
31758                     this.touch.destroy();
31759                     this.mouse.destroy();
31760                 }
31761             });
31762
31763             var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
31764             var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
31765
31766             // magical touchAction value
31767             var TOUCH_ACTION_COMPUTE = 'compute';
31768             var TOUCH_ACTION_AUTO = 'auto';
31769             var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
31770             var TOUCH_ACTION_NONE = 'none';
31771             var TOUCH_ACTION_PAN_X = 'pan-x';
31772             var TOUCH_ACTION_PAN_Y = 'pan-y';
31773
31774             /**
31775              * Touch Action sets the touchAction property or uses the js alternative
31776              * 
31777              * @param {Manager}
31778              *            manager
31779              * @param {String}
31780              *            value
31781              * @constructor
31782              */
31783             function TouchAction(manager, value) {
31784                 this.manager = manager;
31785                 this.set(value);
31786             }
31787
31788             TouchAction.prototype = {
31789                 /**
31790                  * set the touchAction value on the element or enable the polyfill
31791                  * 
31792                  * @param {String}
31793                  *            value
31794                  */
31795                 set: function(value) {
31796                     // find out the touch-action by the event handlers
31797                     if (value == TOUCH_ACTION_COMPUTE) {
31798                         value = this.compute();
31799                     }
31800
31801                     if (NATIVE_TOUCH_ACTION) {
31802                         this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
31803                     }
31804                     this.actions = value.toLowerCase().trim();
31805                 },
31806
31807                 /**
31808                  * just re-set the touchAction value
31809                  */
31810                 update: function() {
31811                     this.set(this.manager.options.touchAction);
31812                 },
31813
31814                 /**
31815                  * compute the value for the touchAction property based on the recognizer's
31816                  * settings
31817                  * 
31818                  * @returns {String} value
31819                  */
31820                 compute: function() {
31821                     var actions = [];
31822                     each(this.manager.recognizers, function(recognizer) {
31823                         if (boolOrFn(recognizer.options.enable, [recognizer])) {
31824                             actions = actions.concat(recognizer.getTouchAction());
31825                         }
31826                     });
31827                     return cleanTouchActions(actions.join(' '));
31828                 },
31829
31830                 /**
31831                  * this method is called on each input cycle and provides the preventing of
31832                  * the browser behavior
31833                  * 
31834                  * @param {Object}
31835                  *            input
31836                  */
31837                 preventDefaults: function(input) {
31838                     // not needed with native support for the touchAction property
31839                     if (NATIVE_TOUCH_ACTION) {
31840                         return;
31841                     }
31842
31843                     var srcEvent = input.srcEvent;
31844                     var direction = input.offsetDirection;
31845
31846                     // if the touch action did prevented once this session
31847                     if (this.manager.session.prevented) {
31848                         srcEvent.preventDefault();
31849                         return;
31850                     }
31851
31852                     var actions = this.actions;
31853                     var hasNone = inStr(actions, TOUCH_ACTION_NONE);
31854                     var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
31855                     var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
31856
31857                     if (hasNone ||
31858                         (hasPanY && direction & DIRECTION_HORIZONTAL) ||
31859                         (hasPanX && direction & DIRECTION_VERTICAL)) {
31860                         return this.preventSrc(srcEvent);
31861                     }
31862                 },
31863
31864                 /**
31865                  * call preventDefault to prevent the browser's default behavior (scrolling
31866                  * in most cases)
31867                  * 
31868                  * @param {Object}
31869                  *            srcEvent
31870                  */
31871                 preventSrc: function(srcEvent) {
31872                     this.manager.session.prevented = true;
31873                     srcEvent.preventDefault();
31874                 }
31875             };
31876
31877             /**
31878              * when the touchActions are collected they are not a valid value, so we need to
31879              * clean things up. *
31880              * 
31881              * @param {String}
31882              *            actions
31883              * @returns {*}
31884              */
31885             function cleanTouchActions(actions) {
31886                 // none
31887                 if (inStr(actions, TOUCH_ACTION_NONE)) {
31888                     return TOUCH_ACTION_NONE;
31889                 }
31890
31891                 var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
31892                 var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
31893
31894                 // pan-x and pan-y can be combined
31895                 if (hasPanX && hasPanY) {
31896                     return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y;
31897                 }
31898
31899                 // pan-x OR pan-y
31900                 if (hasPanX || hasPanY) {
31901                     return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
31902                 }
31903
31904                 // manipulation
31905                 if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
31906                     return TOUCH_ACTION_MANIPULATION;
31907                 }
31908
31909                 return TOUCH_ACTION_AUTO;
31910             }
31911
31912             /**
31913              * Recognizer flow explained; * All recognizers have the initial state of
31914              * POSSIBLE when a input session starts. The definition of a input session is
31915              * from the first input until the last input, with all it's movement in it. *
31916              * Example session for mouse-input: mousedown -> mousemove -> mouseup
31917              * 
31918              * On each recognizing cycle (see Manager.recognize) the .recognize() method is
31919              * executed which determines with state it should be.
31920              * 
31921              * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals
31922              * ENDED), it is reset to POSSIBLE to give it another change on the next cycle.
31923              * 
31924              * Possible | +-----+---------------+ | | +-----+-----+ | | | | Failed Cancelled |
31925              * +-------+------+ | | Recognized Began | Changed | Ended/Recognized
31926              */
31927             var STATE_POSSIBLE = 1;
31928             var STATE_BEGAN = 2;
31929             var STATE_CHANGED = 4;
31930             var STATE_ENDED = 8;
31931             var STATE_RECOGNIZED = STATE_ENDED;
31932             var STATE_CANCELLED = 16;
31933             var STATE_FAILED = 32;
31934
31935             /**
31936              * Recognizer Every recognizer needs to extend from this class.
31937              * 
31938              * @constructor
31939              * @param {Object}
31940              *            options
31941              */
31942             function Recognizer(options) {
31943                 this.id = uniqueId();
31944
31945                 this.manager = null;
31946                 this.options = merge(options || {}, this.defaults);
31947
31948                 // default is enable true
31949                 this.options.enable = ifUndefined(this.options.enable, true);
31950
31951                 this.state = STATE_POSSIBLE;
31952
31953                 this.simultaneous = {};
31954                 this.requireFail = [];
31955             }
31956
31957             Recognizer.prototype = {
31958                 /**
31959                  * @virtual
31960                  * @type {Object}
31961                  */
31962                 defaults: {},
31963
31964                 /**
31965                  * set options
31966                  * 
31967                  * @param {Object}
31968                  *            options
31969                  * @return {Recognizer}
31970                  */
31971                 set: function(options) {
31972                     extend(this.options, options);
31973
31974                     // also update the touchAction, in case something changed about the
31975                     // directions/enabled state
31976                     this.manager && this.manager.touchAction.update();
31977                     return this;
31978                 },
31979
31980                 /**
31981                  * recognize simultaneous with an other recognizer.
31982                  * 
31983                  * @param {Recognizer}
31984                  *            otherRecognizer
31985                  * @returns {Recognizer} this
31986                  */
31987                 recognizeWith: function(otherRecognizer) {
31988                     if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
31989                         return this;
31990                     }
31991
31992                     var simultaneous = this.simultaneous;
31993                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31994                     if (!simultaneous[otherRecognizer.id]) {
31995                         simultaneous[otherRecognizer.id] = otherRecognizer;
31996                         otherRecognizer.recognizeWith(this);
31997                     }
31998                     return this;
31999                 },
32000
32001                 /**
32002                  * drop the simultaneous link. it doesnt remove the link on the other
32003                  * recognizer.
32004                  * 
32005                  * @param {Recognizer}
32006                  *            otherRecognizer
32007                  * @returns {Recognizer} this
32008                  */
32009                 dropRecognizeWith: function(otherRecognizer) {
32010                     if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
32011                         return this;
32012                     }
32013
32014                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
32015                     delete this.simultaneous[otherRecognizer.id];
32016                     return this;
32017                 },
32018
32019                 /**
32020                  * recognizer can only run when an other is failing
32021                  * 
32022                  * @param {Recognizer}
32023                  *            otherRecognizer
32024                  * @returns {Recognizer} this
32025                  */
32026                 requireFailure: function(otherRecognizer) {
32027                     if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
32028                         return this;
32029                     }
32030
32031                     var requireFail = this.requireFail;
32032                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
32033                     if (inArray(requireFail, otherRecognizer) === -1) {
32034                         requireFail.push(otherRecognizer);
32035                         otherRecognizer.requireFailure(this);
32036                     }
32037                     return this;
32038                 },
32039
32040                 /**
32041                  * drop the requireFailure link. it does not remove the link on the other
32042                  * recognizer.
32043                  * 
32044                  * @param {Recognizer}
32045                  *            otherRecognizer
32046                  * @returns {Recognizer} this
32047                  */
32048                 dropRequireFailure: function(otherRecognizer) {
32049                     if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
32050                         return this;
32051                     }
32052
32053                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
32054                     var index = inArray(this.requireFail, otherRecognizer);
32055                     if (index > -1) {
32056                         this.requireFail.splice(index, 1);
32057                     }
32058                     return this;
32059                 },
32060
32061                 /**
32062                  * has require failures boolean
32063                  * 
32064                  * @returns {boolean}
32065                  */
32066                 hasRequireFailures: function() {
32067                     return this.requireFail.length > 0;
32068                 },
32069
32070                 /**
32071                  * if the recognizer can recognize simultaneous with an other recognizer
32072                  * 
32073                  * @param {Recognizer}
32074                  *            otherRecognizer
32075                  * @returns {Boolean}
32076                  */
32077                 canRecognizeWith: function(otherRecognizer) {
32078                     return !!this.simultaneous[otherRecognizer.id];
32079                 },
32080
32081                 /**
32082                  * You should use `tryEmit` instead of `emit` directly to check that all the
32083                  * needed recognizers has failed before emitting.
32084                  * 
32085                  * @param {Object}
32086                  *            input
32087                  */
32088                 emit: function(input) {
32089                     var self = this;
32090                     var state = this.state;
32091
32092                     function emit(withState) {
32093                         self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input);
32094                     }
32095
32096                     // 'panstart' and 'panmove'
32097                     if (state < STATE_ENDED) {
32098                         emit(true);
32099                     }
32100
32101                     emit(); // simple 'eventName' events
32102
32103                     // panend and pancancel
32104                     if (state >= STATE_ENDED) {
32105                         emit(true);
32106                     }
32107                 },
32108
32109                 /**
32110                  * Check that all the require failure recognizers has failed, if true, it
32111                  * emits a gesture event, otherwise, setup the state to FAILED.
32112                  * 
32113                  * @param {Object}
32114                  *            input
32115                  */
32116                 tryEmit: function(input) {
32117                     if (this.canEmit()) {
32118                         return this.emit(input);
32119                     }
32120                     // it's failing anyway
32121                     this.state = STATE_FAILED;
32122                 },
32123
32124                 /**
32125                  * can we emit?
32126                  * 
32127                  * @returns {boolean}
32128                  */
32129                 canEmit: function() {
32130                     var i = 0;
32131                     while (i < this.requireFail.length) {
32132                         if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
32133                             return false;
32134                         }
32135                         i++;
32136                     }
32137                     return true;
32138                 },
32139
32140                 /**
32141                  * update the recognizer
32142                  * 
32143                  * @param {Object}
32144                  *            inputData
32145                  */
32146                 recognize: function(inputData) {
32147                     // make a new copy of the inputData
32148                     // so we can change the inputData without messing up the other
32149                     // recognizers
32150                     var inputDataClone = extend({}, inputData);
32151
32152                     // is is enabled and allow recognizing?
32153                     if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
32154                         this.reset();
32155                         this.state = STATE_FAILED;
32156                         return;
32157                     }
32158
32159                     // reset when we've reached the end
32160                     if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
32161                         this.state = STATE_POSSIBLE;
32162                     }
32163
32164                     this.state = this.process(inputDataClone);
32165
32166                     // the recognizer has recognized a gesture
32167                     // so trigger an event
32168                     if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
32169                         this.tryEmit(inputDataClone);
32170                     }
32171                 },
32172
32173                 /**
32174                  * return the state of the recognizer the actual recognizing happens in this
32175                  * method
32176                  * 
32177                  * @virtual
32178                  * @param {Object}
32179                  *            inputData
32180                  * @returns {Const} STATE
32181                  */
32182                 process: function(inputData) {}, // jshint ignore:line
32183
32184                 /**
32185                  * return the preferred touch-action
32186                  * 
32187                  * @virtual
32188                  * @returns {Array}
32189                  */
32190                 getTouchAction: function() {},
32191
32192                 /**
32193                  * called when the gesture isn't allowed to recognize like when another is
32194                  * being recognized or it is disabled
32195                  * 
32196                  * @virtual
32197                  */
32198                 reset: function() {}
32199             };
32200
32201             /**
32202              * get a usable string, used as event postfix
32203              * 
32204              * @param {Const}
32205              *            state
32206              * @returns {String} state
32207              */
32208             function stateStr(state) {
32209                 if (state & STATE_CANCELLED) {
32210                     return 'cancel';
32211                 } else if (state & STATE_ENDED) {
32212                     return 'end';
32213                 } else if (state & STATE_CHANGED) {
32214                     return 'move';
32215                 } else if (state & STATE_BEGAN) {
32216                     return 'start';
32217                 }
32218                 return '';
32219             }
32220
32221             /**
32222              * direction cons to string
32223              * 
32224              * @param {Const}
32225              *            direction
32226              * @returns {String}
32227              */
32228             function directionStr(direction) {
32229                 if (direction == DIRECTION_DOWN) {
32230                     return 'down';
32231                 } else if (direction == DIRECTION_UP) {
32232                     return 'up';
32233                 } else if (direction == DIRECTION_LEFT) {
32234                     return 'left';
32235                 } else if (direction == DIRECTION_RIGHT) {
32236                     return 'right';
32237                 }
32238                 return '';
32239             }
32240
32241             /**
32242              * get a recognizer by name if it is bound to a manager
32243              * 
32244              * @param {Recognizer|String}
32245              *            otherRecognizer
32246              * @param {Recognizer}
32247              *            recognizer
32248              * @returns {Recognizer}
32249              */
32250             function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
32251                 var manager = recognizer.manager;
32252                 if (manager) {
32253                     return manager.get(otherRecognizer);
32254                 }
32255                 return otherRecognizer;
32256             }
32257
32258             /**
32259              * This recognizer is just used as a base for the simple attribute recognizers.
32260              * 
32261              * @constructor
32262              * @extends Recognizer
32263              */
32264             function AttrRecognizer() {
32265                 Recognizer.apply(this, arguments);
32266             }
32267
32268             inherit(AttrRecognizer, Recognizer, {
32269                 /**
32270                  * @namespace
32271                  * @memberof AttrRecognizer
32272                  */
32273                 defaults: {
32274                     /**
32275                      * @type {Number}
32276                      * @default 1
32277                      */
32278                     pointers: 1
32279                 },
32280
32281                 /**
32282                  * Used to check if it the recognizer receives valid input, like
32283                  * input.distance > 10.
32284                  * 
32285                  * @memberof AttrRecognizer
32286                  * @param {Object}
32287                  *            input
32288                  * @returns {Boolean} recognized
32289                  */
32290                 attrTest: function(input) {
32291                     var optionPointers = this.options.pointers;
32292                     return optionPointers === 0 || input.pointers.length === optionPointers;
32293                 },
32294
32295                 /**
32296                  * Process the input and return the state for the recognizer
32297                  * 
32298                  * @memberof AttrRecognizer
32299                  * @param {Object}
32300                  *            input
32301                  * @returns {*} State
32302                  */
32303                 process: function(input) {
32304                     var state = this.state;
32305                     var eventType = input.eventType;
32306
32307                     var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
32308                     var isValid = this.attrTest(input);
32309
32310                     // on cancel input and we've recognized before, return STATE_CANCELLED
32311                     if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
32312                         return state | STATE_CANCELLED;
32313                     } else if (isRecognized || isValid) {
32314                         if (eventType & INPUT_END) {
32315                             return state | STATE_ENDED;
32316                         } else if (!(state & STATE_BEGAN)) {
32317                             return STATE_BEGAN;
32318                         }
32319                         return state | STATE_CHANGED;
32320                     }
32321                     return STATE_FAILED;
32322                 }
32323             });
32324
32325             /**
32326              * Pan Recognized when the pointer is down and moved in the allowed direction.
32327              * 
32328              * @constructor
32329              * @extends AttrRecognizer
32330              */
32331             function PanRecognizer() {
32332                 AttrRecognizer.apply(this, arguments);
32333
32334                 this.pX = null;
32335                 this.pY = null;
32336             }
32337
32338             inherit(PanRecognizer, AttrRecognizer, {
32339                 /**
32340                  * @namespace
32341                  * @memberof PanRecognizer
32342                  */
32343                 defaults: {
32344                     event: 'pan',
32345                     threshold: 10,
32346                     pointers: 1,
32347                     direction: DIRECTION_ALL
32348                 },
32349
32350                 getTouchAction: function() {
32351                     var direction = this.options.direction;
32352                     var actions = [];
32353                     if (direction & DIRECTION_HORIZONTAL) {
32354                         actions.push(TOUCH_ACTION_PAN_Y);
32355                     }
32356                     if (direction & DIRECTION_VERTICAL) {
32357                         actions.push(TOUCH_ACTION_PAN_X);
32358                     }
32359                     return actions;
32360                 },
32361
32362                 directionTest: function(input) {
32363                     var options = this.options;
32364                     var hasMoved = true;
32365                     var distance = input.distance;
32366                     var direction = input.direction;
32367                     var x = input.deltaX;
32368                     var y = input.deltaY;
32369
32370                     // lock to axis?
32371                     if (!(direction & options.direction)) {
32372                         if (options.direction & DIRECTION_HORIZONTAL) {
32373                             direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
32374                             hasMoved = x != this.pX;
32375                             distance = Math.abs(input.deltaX);
32376                         } else {
32377                             direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
32378                             hasMoved = y != this.pY;
32379                             distance = Math.abs(input.deltaY);
32380                         }
32381                     }
32382                     input.direction = direction;
32383                     return hasMoved && distance > options.threshold && direction & options.direction;
32384                 },
32385
32386                 attrTest: function(input) {
32387                     return AttrRecognizer.prototype.attrTest.call(this, input) &&
32388                         (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
32389                 },
32390
32391                 emit: function(input) {
32392                     this.pX = input.deltaX;
32393                     this.pY = input.deltaY;
32394
32395                     var direction = directionStr(input.direction);
32396                     if (direction) {
32397                         this.manager.emit(this.options.event + direction, input);
32398                     }
32399
32400                     this._super.emit.call(this, input);
32401                 }
32402             });
32403
32404             /**
32405              * Pinch Recognized when two or more pointers are moving toward (zoom-in) or
32406              * away from each other (zoom-out).
32407              * 
32408              * @constructor
32409              * @extends AttrRecognizer
32410              */
32411             function PinchRecognizer() {
32412                 AttrRecognizer.apply(this, arguments);
32413             }
32414
32415             inherit(PinchRecognizer, AttrRecognizer, {
32416                 /**
32417                  * @namespace
32418                  * @memberof PinchRecognizer
32419                  */
32420                 defaults: {
32421                     event: 'pinch',
32422                     threshold: 0,
32423                     pointers: 2
32424                 },
32425
32426                 getTouchAction: function() {
32427                     return [TOUCH_ACTION_NONE];
32428                 },
32429
32430                 attrTest: function(input) {
32431                     return this._super.attrTest.call(this, input) &&
32432                         (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
32433                 },
32434
32435                 emit: function(input) {
32436                     this._super.emit.call(this, input);
32437                     if (input.scale !== 1) {
32438                         var inOut = input.scale < 1 ? 'in' : 'out';
32439                         this.manager.emit(this.options.event + inOut, input);
32440                     }
32441                 }
32442             });
32443
32444             /**
32445              * Press Recognized when the pointer is down for x ms without any movement.
32446              * 
32447              * @constructor
32448              * @extends Recognizer
32449              */
32450             function PressRecognizer() {
32451                 Recognizer.apply(this, arguments);
32452
32453                 this._timer = null;
32454                 this._input = null;
32455             }
32456
32457             inherit(PressRecognizer, Recognizer, {
32458                 /**
32459                  * @namespace
32460                  * @memberof PressRecognizer
32461                  */
32462                 defaults: {
32463                     event: 'press',
32464                     pointers: 1,
32465                     time: 500, // minimal time of the pointer to be pressed
32466                     threshold: 5 // a minimal movement is ok, but keep it low
32467                 },
32468
32469                 getTouchAction: function() {
32470                     return [TOUCH_ACTION_AUTO];
32471                 },
32472
32473                 process: function(input) {
32474                     var options = this.options;
32475                     var validPointers = input.pointers.length === options.pointers;
32476                     var validMovement = input.distance < options.threshold;
32477                     var validTime = input.deltaTime > options.time;
32478
32479                     this._input = input;
32480
32481                     // we only allow little movement
32482                     // and we've reached an end event, so a tap is possible
32483                     if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
32484                         this.reset();
32485                     } else if (input.eventType & INPUT_START) {
32486                         this.reset();
32487                         this._timer = setTimeoutContext(function() {
32488                             this.state = STATE_RECOGNIZED;
32489                             this.tryEmit();
32490                         }, options.time, this);
32491                     } else if (input.eventType & INPUT_END) {
32492                         return STATE_RECOGNIZED;
32493                     }
32494                     return STATE_FAILED;
32495                 },
32496
32497                 reset: function() {
32498                     clearTimeout(this._timer);
32499                 },
32500
32501                 emit: function(input) {
32502                     if (this.state !== STATE_RECOGNIZED) {
32503                         return;
32504                     }
32505
32506                     if (input && (input.eventType & INPUT_END)) {
32507                         this.manager.emit(this.options.event + 'up', input);
32508                     } else {
32509                         this._input.timeStamp = now();
32510                         this.manager.emit(this.options.event, this._input);
32511                     }
32512                 }
32513             });
32514
32515             /**
32516              * Rotate Recognized when two or more pointer are moving in a circular motion.
32517              * 
32518              * @constructor
32519              * @extends AttrRecognizer
32520              */
32521             function RotateRecognizer() {
32522                 AttrRecognizer.apply(this, arguments);
32523             }
32524
32525             inherit(RotateRecognizer, AttrRecognizer, {
32526                 /**
32527                  * @namespace
32528                  * @memberof RotateRecognizer
32529                  */
32530                 defaults: {
32531                     event: 'rotate',
32532                     threshold: 0,
32533                     pointers: 2
32534                 },
32535
32536                 getTouchAction: function() {
32537                     return [TOUCH_ACTION_NONE];
32538                 },
32539
32540                 attrTest: function(input) {
32541                     return this._super.attrTest.call(this, input) &&
32542                         (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
32543                 }
32544             });
32545
32546             /**
32547              * Swipe Recognized when the pointer is moving fast (velocity), with enough
32548              * distance in the allowed direction.
32549              * 
32550              * @constructor
32551              * @extends AttrRecognizer
32552              */
32553             function SwipeRecognizer() {
32554                 AttrRecognizer.apply(this, arguments);
32555             }
32556
32557             inherit(SwipeRecognizer, AttrRecognizer, {
32558                 /**
32559                  * @namespace
32560                  * @memberof SwipeRecognizer
32561                  */
32562                 defaults: {
32563                     event: 'swipe',
32564                     threshold: 10,
32565                     velocity: 0.65,
32566                     direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
32567                     pointers: 1
32568                 },
32569
32570                 getTouchAction: function() {
32571                     return PanRecognizer.prototype.getTouchAction.call(this);
32572                 },
32573
32574                 attrTest: function(input) {
32575                     var direction = this.options.direction;
32576                     var velocity;
32577
32578                     if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
32579                         velocity = input.velocity;
32580                     } else if (direction & DIRECTION_HORIZONTAL) {
32581                         velocity = input.velocityX;
32582                     } else if (direction & DIRECTION_VERTICAL) {
32583                         velocity = input.velocityY;
32584                     }
32585
32586                     return this._super.attrTest.call(this, input) &&
32587                         direction & input.direction &&
32588                         input.distance > this.options.threshold &&
32589                         abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
32590                 },
32591
32592                 emit: function(input) {
32593                     var direction = directionStr(input.direction);
32594                     if (direction) {
32595                         this.manager.emit(this.options.event + direction, input);
32596                     }
32597
32598                     this.manager.emit(this.options.event, input);
32599                 }
32600             });
32601
32602             /**
32603              * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps
32604              * are recognized if they occur between the given interval and position. The
32605              * delay option can be used to recognize multi-taps without firing a single tap.
32606              * 
32607              * The eventData from the emitted event contains the property `tapCount`, which
32608              * contains the amount of multi-taps being recognized.
32609              * 
32610              * @constructor
32611              * @extends Recognizer
32612              */
32613             function TapRecognizer() {
32614                 Recognizer.apply(this, arguments);
32615
32616                 // previous time and center,
32617                 // used for tap counting
32618                 this.pTime = false;
32619                 this.pCenter = false;
32620
32621                 this._timer = null;
32622                 this._input = null;
32623                 this.count = 0;
32624             }
32625
32626             inherit(TapRecognizer, Recognizer, {
32627                 /**
32628                  * @namespace
32629                  * @memberof PinchRecognizer
32630                  */
32631                 defaults: {
32632                     event: 'tap',
32633                     pointers: 1,
32634                     taps: 1,
32635                     interval: 300, // max time between the multi-tap taps
32636                     time: 250, // max time of the pointer to be down (like finger on the
32637                     // screen)
32638                     threshold: 2, // a minimal movement is ok, but keep it low
32639                     posThreshold: 10 // a multi-tap can be a bit off the initial position
32640                 },
32641
32642                 getTouchAction: function() {
32643                     return [TOUCH_ACTION_MANIPULATION];
32644                 },
32645
32646                 process: function(input) {
32647                     var options = this.options;
32648
32649                     var validPointers = input.pointers.length === options.pointers;
32650                     var validMovement = input.distance < options.threshold;
32651                     var validTouchTime = input.deltaTime < options.time;
32652
32653                     this.reset();
32654
32655                     if ((input.eventType & INPUT_START) && (this.count === 0)) {
32656                         return this.failTimeout();
32657                     }
32658
32659                     // we only allow little movement
32660                     // and we've reached an end event, so a tap is possible
32661                     if (validMovement && validTouchTime && validPointers) {
32662                         if (input.eventType != INPUT_END) {
32663                             return this.failTimeout();
32664                         }
32665
32666                         var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
32667                         var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
32668
32669                         this.pTime = input.timeStamp;
32670                         this.pCenter = input.center;
32671
32672                         if (!validMultiTap || !validInterval) {
32673                             this.count = 1;
32674                         } else {
32675                             this.count += 1;
32676                         }
32677
32678                         this._input = input;
32679
32680                         // if tap count matches we have recognized it,
32681                         // else it has began recognizing...
32682                         var tapCount = this.count % options.taps;
32683                         if (tapCount === 0) {
32684                             // no failing requirements, immediately trigger the tap event
32685                             // or wait as long as the multitap interval to trigger
32686                             if (!this.hasRequireFailures()) {
32687                                 return STATE_RECOGNIZED;
32688                             } else {
32689                                 this._timer = setTimeoutContext(function() {
32690                                     this.state = STATE_RECOGNIZED;
32691                                     this.tryEmit();
32692                                 }, options.interval, this);
32693                                 return STATE_BEGAN;
32694                             }
32695                         }
32696                     }
32697                     return STATE_FAILED;
32698                 },
32699
32700                 failTimeout: function() {
32701                     this._timer = setTimeoutContext(function() {
32702                         this.state = STATE_FAILED;
32703                     }, this.options.interval, this);
32704                     return STATE_FAILED;
32705                 },
32706
32707                 reset: function() {
32708                     clearTimeout(this._timer);
32709                 },
32710
32711                 emit: function() {
32712                     if (this.state == STATE_RECOGNIZED) {
32713                         this._input.tapCount = this.count;
32714                         this.manager.emit(this.options.event, this._input);
32715                     }
32716                 }
32717             });
32718
32719             /**
32720              * Simple way to create an manager with a default set of recognizers.
32721              * 
32722              * @param {HTMLElement}
32723              *            element
32724              * @param {Object}
32725              *            [options]
32726              * @constructor
32727              */
32728             function Hammer(element, options) {
32729                 options = options || {};
32730                 options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
32731                 return new Manager(element, options);
32732             }
32733
32734             /**
32735              * @const {string}
32736              */
32737             Hammer.VERSION = '2.0.4';
32738
32739             /**
32740              * default settings
32741              * 
32742              * @namespace
32743              */
32744             Hammer.defaults = {
32745                 /**
32746                  * set if DOM events are being triggered. But this is slower and unused by
32747                  * simple implementations, so disabled by default.
32748                  * 
32749                  * @type {Boolean}
32750                  * @default false
32751                  */
32752                 domEvents: false,
32753
32754                 /**
32755                  * The value for the touchAction property/fallback. When set to `compute` it
32756                  * will magically set the correct value based on the added recognizers.
32757                  * 
32758                  * @type {String}
32759                  * @default compute
32760                  */
32761                 touchAction: TOUCH_ACTION_COMPUTE,
32762
32763                 /**
32764                  * @type {Boolean}
32765                  * @default true
32766                  */
32767                 enable: true,
32768
32769                 /**
32770                  * EXPERIMENTAL FEATURE -- can be removed/changed Change the parent input
32771                  * target element. If Null, then it is being set the to main element.
32772                  * 
32773                  * @type {Null|EventTarget}
32774                  * @default null
32775                  */
32776                 inputTarget: null,
32777
32778                 /**
32779                  * force an input class
32780                  * 
32781                  * @type {Null|Function}
32782                  * @default null
32783                  */
32784                 inputClass: null,
32785
32786                 /**
32787                  * Default recognizer setup when calling `Hammer()` When creating a new
32788                  * Manager these will be skipped.
32789                  * 
32790                  * @type {Array}
32791                  */
32792                 preset: [
32793                     // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
32794                     [RotateRecognizer, {
32795                         enable: false
32796                     }],
32797                     [PinchRecognizer, {
32798                             enable: false
32799                         },
32800                         ['rotate']
32801                     ],
32802                     [SwipeRecognizer, {
32803                         direction: DIRECTION_HORIZONTAL
32804                     }],
32805                     [PanRecognizer, {
32806                             direction: DIRECTION_HORIZONTAL
32807                         },
32808                         ['swipe']
32809                     ],
32810                     [TapRecognizer],
32811                     [TapRecognizer, {
32812                             event: 'doubletap',
32813                             taps: 2
32814                         },
32815                         ['tap']
32816                     ],
32817                     [PressRecognizer]
32818                 ],
32819
32820                 /**
32821                  * Some CSS properties can be used to improve the working of Hammer. Add
32822                  * them to this method and they will be set when creating a new Manager.
32823                  * 
32824                  * @namespace
32825                  */
32826                 cssProps: {
32827                     /**
32828                      * Disables text selection to improve the dragging gesture. Mainly for
32829                      * desktop browsers.
32830                      * 
32831                      * @type {String}
32832                      * @default 'none'
32833                      */
32834                     userSelect: 'none',
32835
32836                     /**
32837                      * Disable the Windows Phone grippers when pressing an element.
32838                      * 
32839                      * @type {String}
32840                      * @default 'none'
32841                      */
32842                     touchSelect: 'none',
32843
32844                     /**
32845                      * Disables the default callout shown when you touch and hold a touch
32846                      * target. On iOS, when you touch and hold a touch target such as a
32847                      * link, Safari displays a callout containing information about the
32848                      * link. This property allows you to disable that callout.
32849                      * 
32850                      * @type {String}
32851                      * @default 'none'
32852                      */
32853                     touchCallout: 'none',
32854
32855                     /**
32856                      * Specifies whether zooming is enabled. Used by IE10>
32857                      * 
32858                      * @type {String}
32859                      * @default 'none'
32860                      */
32861                     contentZooming: 'none',
32862
32863                     /**
32864                      * Specifies that an entire element should be draggable instead of its
32865                      * contents. Mainly for desktop browsers.
32866                      * 
32867                      * @type {String}
32868                      * @default 'none'
32869                      */
32870                     userDrag: 'none',
32871
32872                     /**
32873                      * Overrides the highlight color shown when the user taps a link or a
32874                      * JavaScript clickable element in iOS. This property obeys the alpha
32875                      * value, if specified.
32876                      * 
32877                      * @type {String}
32878                      * @default 'rgba(0,0,0,0)'
32879                      */
32880                     tapHighlightColor: 'rgba(0,0,0,0)'
32881                 }
32882             };
32883
32884             var STOP = 1;
32885             var FORCED_STOP = 2;
32886
32887             /**
32888              * Manager
32889              * 
32890              * @param {HTMLElement}
32891              *            element
32892              * @param {Object}
32893              *            [options]
32894              * @constructor
32895              */
32896             function Manager(element, options) {
32897                 options = options || {};
32898
32899                 this.options = merge(options, Hammer.defaults);
32900                 this.options.inputTarget = this.options.inputTarget || element;
32901
32902                 this.handlers = {};
32903                 this.session = {};
32904                 this.recognizers = [];
32905
32906                 this.element = element;
32907                 this.input = createInputInstance(this);
32908                 this.touchAction = new TouchAction(this, this.options.touchAction);
32909
32910                 toggleCssProps(this, true);
32911
32912                 each(options.recognizers, function(item) {
32913                     var recognizer = this.add(new(item[0])(item[1]));
32914                     item[2] && recognizer.recognizeWith(item[2]);
32915                     item[3] && recognizer.requireFailure(item[3]);
32916                 }, this);
32917             }
32918
32919             Manager.prototype = {
32920                 /**
32921                  * set options
32922                  * 
32923                  * @param {Object}
32924                  *            options
32925                  * @returns {Manager}
32926                  */
32927                 set: function(options) {
32928                     extend(this.options, options);
32929
32930                     // Options that need a little more setup
32931                     if (options.touchAction) {
32932                         this.touchAction.update();
32933                     }
32934                     if (options.inputTarget) {
32935                         // Clean up existing event listeners and reinitialize
32936                         this.input.destroy();
32937                         this.input.target = options.inputTarget;
32938                         this.input.init();
32939                     }
32940                     return this;
32941                 },
32942
32943                 /**
32944                  * stop recognizing for this session. This session will be discarded, when a
32945                  * new [input]start event is fired. When forced, the recognizer cycle is
32946                  * stopped immediately.
32947                  * 
32948                  * @param {Boolean}
32949                  *            [force]
32950                  */
32951                 stop: function(force) {
32952                     this.session.stopped = force ? FORCED_STOP : STOP;
32953                 },
32954
32955                 /**
32956                  * run the recognizers! called by the inputHandler function on every
32957                  * movement of the pointers (touches) it walks through all the recognizers
32958                  * and tries to detect the gesture that is being made
32959                  * 
32960                  * @param {Object}
32961                  *            inputData
32962                  */
32963                 recognize: function(inputData) {
32964                     var session = this.session;
32965                     if (session.stopped) {
32966                         return;
32967                     }
32968
32969                     // run the touch-action polyfill
32970                     this.touchAction.preventDefaults(inputData);
32971
32972                     var recognizer;
32973                     var recognizers = this.recognizers;
32974
32975                     // this holds the recognizer that is being recognized.
32976                     // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or
32977                     // RECOGNIZED
32978                     // if no recognizer is detecting a thing, it is set to `null`
32979                     var curRecognizer = session.curRecognizer;
32980
32981                     // reset when the last recognizer is recognized
32982                     // or when we're in a new session
32983                     if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
32984                         curRecognizer = session.curRecognizer = null;
32985                     }
32986
32987                     var i = 0;
32988                     while (i < recognizers.length) {
32989                         recognizer = recognizers[i];
32990
32991                         // find out if we are allowed try to recognize the input for this
32992                         // one.
32993                         // 1. allow if the session is NOT forced stopped (see the .stop()
32994                         // method)
32995                         // 2. allow if we still haven't recognized a gesture in this
32996                         // session, or the this recognizer is the one
32997                         // that is being recognized.
32998                         // 3. allow if the recognizer is allowed to run simultaneous with
32999                         // the current recognized recognizer.
33000                         // this can be setup with the `recognizeWith()` method on the
33001                         // recognizer.
33002                         if (session.stopped !== FORCED_STOP && ( // 1
33003                                 !curRecognizer || recognizer == curRecognizer || // 2
33004                                 recognizer.canRecognizeWith(curRecognizer))) { // 3
33005                             recognizer.recognize(inputData);
33006                         } else {
33007                             recognizer.reset();
33008                         }
33009
33010                         // if the recognizer has been recognizing the input as a valid
33011                         // gesture, we want to store this one as the
33012                         // current active recognizer. but only if we don't already have an
33013                         // active recognizer
33014                         if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
33015                             curRecognizer = session.curRecognizer = recognizer;
33016                         }
33017                         i++;
33018                     }
33019                 },
33020
33021                 /**
33022                  * get a recognizer by its event name.
33023                  * 
33024                  * @param {Recognizer|String}
33025                  *            recognizer
33026                  * @returns {Recognizer|Null}
33027                  */
33028                 get: function(recognizer) {
33029                     if (recognizer instanceof Recognizer) {
33030                         return recognizer;
33031                     }
33032
33033                     var recognizers = this.recognizers;
33034                     for (var i = 0; i < recognizers.length; i++) {
33035                         if (recognizers[i].options.event == recognizer) {
33036                             return recognizers[i];
33037                         }
33038                     }
33039                     return null;
33040                 },
33041
33042                 /**
33043                  * add a recognizer to the manager existing recognizers with the same event
33044                  * name will be removed
33045                  * 
33046                  * @param {Recognizer}
33047                  *            recognizer
33048                  * @returns {Recognizer|Manager}
33049                  */
33050                 add: function(recognizer) {
33051                     if (invokeArrayArg(recognizer, 'add', this)) {
33052                         return this;
33053                     }
33054
33055                     // remove existing
33056                     var existing = this.get(recognizer.options.event);
33057                     if (existing) {
33058                         this.remove(existing);
33059                     }
33060
33061                     this.recognizers.push(recognizer);
33062                     recognizer.manager = this;
33063
33064                     this.touchAction.update();
33065                     return recognizer;
33066                 },
33067
33068                 /**
33069                  * remove a recognizer by name or instance
33070                  * 
33071                  * @param {Recognizer|String}
33072                  *            recognizer
33073                  * @returns {Manager}
33074                  */
33075                 remove: function(recognizer) {
33076                     if (invokeArrayArg(recognizer, 'remove', this)) {
33077                         return this;
33078                     }
33079
33080                     var recognizers = this.recognizers;
33081                     recognizer = this.get(recognizer);
33082                     recognizers.splice(inArray(recognizers, recognizer), 1);
33083
33084                     this.touchAction.update();
33085                     return this;
33086                 },
33087
33088                 /**
33089                  * bind event
33090                  * 
33091                  * @param {String}
33092                  *            events
33093                  * @param {Function}
33094                  *            handler
33095                  * @returns {EventEmitter} this
33096                  */
33097                 on: function(events, handler) {
33098                     var handlers = this.handlers;
33099                     each(splitStr(events), function(event) {
33100                         handlers[event] = handlers[event] || [];
33101                         handlers[event].push(handler);
33102                     });
33103                     return this;
33104                 },
33105
33106                 /**
33107                  * unbind event, leave emit blank to remove all handlers
33108                  * 
33109                  * @param {String}
33110                  *            events
33111                  * @param {Function}
33112                  *            [handler]
33113                  * @returns {EventEmitter} this
33114                  */
33115                 off: function(events, handler) {
33116                     var handlers = this.handlers;
33117                     each(splitStr(events), function(event) {
33118                         if (!handler) {
33119                             delete handlers[event];
33120                         } else {
33121                             handlers[event].splice(inArray(handlers[event], handler), 1);
33122                         }
33123                     });
33124                     return this;
33125                 },
33126
33127                 /**
33128                  * emit event to the listeners
33129                  * 
33130                  * @param {String}
33131                  *            event
33132                  * @param {Object}
33133                  *            data
33134                  */
33135                 emit: function(event, data) {
33136                     // we also want to trigger dom events
33137                     if (this.options.domEvents) {
33138                         triggerDomEvent(event, data);
33139                     }
33140
33141                     // no handlers, so skip it all
33142                     var handlers = this.handlers[event] && this.handlers[event].slice();
33143                     if (!handlers || !handlers.length) {
33144                         return;
33145                     }
33146
33147                     data.type = event;
33148                     data.preventDefault = function() {
33149                         data.srcEvent.preventDefault();
33150                     };
33151
33152                     var i = 0;
33153                     while (i < handlers.length) {
33154                         handlers[i](data);
33155                         i++;
33156                     }
33157                 },
33158
33159                 /**
33160                  * destroy the manager and unbinds all events it doesn't unbind dom events,
33161                  * that is the user own responsibility
33162                  */
33163                 destroy: function() {
33164                     this.element && toggleCssProps(this, false);
33165
33166                     this.handlers = {};
33167                     this.session = {};
33168                     this.input.destroy();
33169                     this.element = null;
33170                 }
33171             };
33172
33173             /**
33174              * add/remove the css properties as defined in manager.options.cssProps
33175              * 
33176              * @param {Manager}
33177              *            manager
33178              * @param {Boolean}
33179              *            add
33180              */
33181             function toggleCssProps(manager, add) {
33182                 var element = manager.element;
33183                 each(manager.options.cssProps, function(value, name) {
33184                     element.style[prefixed(element.style, name)] = add ? value : '';
33185                 });
33186             }
33187
33188             /**
33189              * trigger dom event
33190              * 
33191              * @param {String}
33192              *            event
33193              * @param {Object}
33194              *            data
33195              */
33196             function triggerDomEvent(event, data) {
33197                 var gestureEvent = document.createEvent('Event');
33198                 gestureEvent.initEvent(event, true, true);
33199                 gestureEvent.gesture = data;
33200                 data.target.dispatchEvent(gestureEvent);
33201             }
33202
33203             extend(Hammer, {
33204                 INPUT_START: INPUT_START,
33205                 INPUT_MOVE: INPUT_MOVE,
33206                 INPUT_END: INPUT_END,
33207                 INPUT_CANCEL: INPUT_CANCEL,
33208
33209                 STATE_POSSIBLE: STATE_POSSIBLE,
33210                 STATE_BEGAN: STATE_BEGAN,
33211                 STATE_CHANGED: STATE_CHANGED,
33212                 STATE_ENDED: STATE_ENDED,
33213                 STATE_RECOGNIZED: STATE_RECOGNIZED,
33214                 STATE_CANCELLED: STATE_CANCELLED,
33215                 STATE_FAILED: STATE_FAILED,
33216
33217                 DIRECTION_NONE: DIRECTION_NONE,
33218                 DIRECTION_LEFT: DIRECTION_LEFT,
33219                 DIRECTION_RIGHT: DIRECTION_RIGHT,
33220                 DIRECTION_UP: DIRECTION_UP,
33221                 DIRECTION_DOWN: DIRECTION_DOWN,
33222                 DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
33223                 DIRECTION_VERTICAL: DIRECTION_VERTICAL,
33224                 DIRECTION_ALL: DIRECTION_ALL,
33225
33226                 Manager: Manager,
33227                 Input: Input,
33228                 TouchAction: TouchAction,
33229
33230                 TouchInput: TouchInput,
33231                 MouseInput: MouseInput,
33232                 PointerEventInput: PointerEventInput,
33233                 TouchMouseInput: TouchMouseInput,
33234                 SingleTouchInput: SingleTouchInput,
33235
33236                 Recognizer: Recognizer,
33237                 AttrRecognizer: AttrRecognizer,
33238                 Tap: TapRecognizer,
33239                 Pan: PanRecognizer,
33240                 Swipe: SwipeRecognizer,
33241                 Pinch: PinchRecognizer,
33242                 Rotate: RotateRecognizer,
33243                 Press: PressRecognizer,
33244
33245                 on: addEventListeners,
33246                 off: removeEventListeners,
33247                 each: each,
33248                 merge: merge,
33249                 extend: extend,
33250                 inherit: inherit,
33251                 bindFn: bindFn,
33252                 prefixed: prefixed
33253             });
33254
33255             if (typeof define == TYPE_FUNCTION && define.amd) {
33256                 define(function() {
33257                     return Hammer;
33258                 });
33259             } else if (typeof module != 'undefined' && module.exports) {
33260                 module.exports = Hammer;
33261             } else {
33262                 window[exportName] = Hammer;
33263             }
33264
33265         })(window, document, 'Hammer');
33266
33267     }, {}],
33268     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js": [function(require, module, exports) {
33269         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"][0].apply(exports, arguments)
33270     }, {}],
33271     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js": [function(require, module, exports) {
33272         /**
33273          * Set attribute `name` to `val`, or get attr `name`.
33274          * 
33275          * @param {Element}
33276          *            el
33277          * @param {String}
33278          *            name
33279          * @param {String}
33280          *            [val]
33281          * @api public
33282          */
33283
33284         module.exports = function(el, name, val) {
33285             // get
33286             if (arguments.length == 2) {
33287                 return el.getAttribute(name);
33288             }
33289
33290             // remove
33291             if (val === null) {
33292                 return el.removeAttribute(name);
33293             }
33294
33295             // set
33296             el.setAttribute(name, val);
33297
33298             return el;
33299         };
33300     }, {}],
33301     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js": [function(require, module, exports) {
33302         module.exports = require('component-classes');
33303     }, {
33304         "component-classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\index.js"
33305     }],
33306     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js": [function(require, module, exports) {
33307         module.exports = function(el) {
33308
33309             var c;
33310
33311             while (el.childNodes.length) {
33312                 c = el.childNodes[0];
33313                 el.removeChild(c);
33314             }
33315
33316             return el;
33317         };
33318     }, {}],
33319     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\closest.js": [function(require, module, exports) {
33320         module.exports = require('component-closest');
33321     }, {
33322         "component-closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js"
33323     }],
33324     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js": [function(require, module, exports) {
33325         module.exports = require('component-delegate');
33326     }, {
33327         "component-delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-delegate\\index.js"
33328     }],
33329     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js": [function(require, module, exports) {
33330         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js"][0].apply(exports, arguments)
33331     }, {
33332         "domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"
33333     }],
33334     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js": [function(require, module, exports) {
33335         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js"][0].apply(exports, arguments)
33336     }, {
33337         "component-event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
33338     }],
33339     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js": [function(require, module, exports) {
33340         module.exports = require('component-matches-selector');
33341     }, {
33342         "component-matches-selector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js"
33343     }],
33344     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js": [function(require, module, exports) {
33345         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js"][0].apply(exports, arguments)
33346     }, {
33347         "component-query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
33348     }],
33349     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js": [function(require, module, exports) {
33350         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"][0].apply(exports, arguments)
33351     }, {}],
33352     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\index.js": [function(require, module, exports) {
33353         /**
33354          * Module dependencies.
33355          */
33356
33357         var index = require('indexof');
33358
33359         /**
33360          * Whitespace regexp.
33361          */
33362
33363         var re = /\s+/;
33364
33365         /**
33366          * toString reference.
33367          */
33368
33369         var toString = Object.prototype.toString;
33370
33371         /**
33372          * Wrap `el` in a `ClassList`.
33373          * 
33374          * @param {Element}
33375          *            el
33376          * @return {ClassList}
33377          * @api public
33378          */
33379
33380         module.exports = function(el) {
33381             return new ClassList(el);
33382         };
33383
33384         /**
33385          * Initialize a new ClassList for `el`.
33386          * 
33387          * @param {Element}
33388          *            el
33389          * @api private
33390          */
33391
33392         function ClassList(el) {
33393             if (!el || !el.nodeType) {
33394                 throw new Error('A DOM element reference is required');
33395             }
33396             this.el = el;
33397             this.list = el.classList;
33398         }
33399
33400         /**
33401          * Add class `name` if not already present.
33402          * 
33403          * @param {String}
33404          *            name
33405          * @return {ClassList}
33406          * @api public
33407          */
33408
33409         ClassList.prototype.add = function(name) {
33410             // classList
33411             if (this.list) {
33412                 this.list.add(name);
33413                 return this;
33414             }
33415
33416             // fallback
33417             var arr = this.array();
33418             var i = index(arr, name);
33419             if (!~i) arr.push(name);
33420             this.el.className = arr.join(' ');
33421             return this;
33422         };
33423
33424         /**
33425          * Remove class `name` when present, or pass a regular expression to remove any
33426          * which match.
33427          * 
33428          * @param {String|RegExp}
33429          *            name
33430          * @return {ClassList}
33431          * @api public
33432          */
33433
33434         ClassList.prototype.remove = function(name) {
33435             if ('[object RegExp]' == toString.call(name)) {
33436                 return this.removeMatching(name);
33437             }
33438
33439             // classList
33440             if (this.list) {
33441                 this.list.remove(name);
33442                 return this;
33443             }
33444
33445             // fallback
33446             var arr = this.array();
33447             var i = index(arr, name);
33448             if (~i) arr.splice(i, 1);
33449             this.el.className = arr.join(' ');
33450             return this;
33451         };
33452
33453         /**
33454          * Remove all classes matching `re`.
33455          * 
33456          * @param {RegExp}
33457          *            re
33458          * @return {ClassList}
33459          * @api private
33460          */
33461
33462         ClassList.prototype.removeMatching = function(re) {
33463             var arr = this.array();
33464             for (var i = 0; i < arr.length; i++) {
33465                 if (re.test(arr[i])) {
33466                     this.remove(arr[i]);
33467                 }
33468             }
33469             return this;
33470         };
33471
33472         /**
33473          * Toggle class `name`, can force state via `force`.
33474          * 
33475          * For browsers that support classList, but do not support `force` yet, the
33476          * mistake will be detected and corrected.
33477          * 
33478          * @param {String}
33479          *            name
33480          * @param {Boolean}
33481          *            force
33482          * @return {ClassList}
33483          * @api public
33484          */
33485
33486         ClassList.prototype.toggle = function(name, force) {
33487             // classList
33488             if (this.list) {
33489                 if ("undefined" !== typeof force) {
33490                     if (force !== this.list.toggle(name, force)) {
33491                         this.list.toggle(name); // toggle again to correct
33492                     }
33493                 } else {
33494                     this.list.toggle(name);
33495                 }
33496                 return this;
33497             }
33498
33499             // fallback
33500             if ("undefined" !== typeof force) {
33501                 if (!force) {
33502                     this.remove(name);
33503                 } else {
33504                     this.add(name);
33505                 }
33506             } else {
33507                 if (this.has(name)) {
33508                     this.remove(name);
33509                 } else {
33510                     this.add(name);
33511                 }
33512             }
33513
33514             return this;
33515         };
33516
33517         /**
33518          * Return an array of classes.
33519          * 
33520          * @return {Array}
33521          * @api public
33522          */
33523
33524         ClassList.prototype.array = function() {
33525             var className = this.el.getAttribute('class') || '';
33526             var str = className.replace(/^\s+|\s+$/g, '');
33527             var arr = str.split(re);
33528             if ('' === arr[0]) arr.shift();
33529             return arr;
33530         };
33531
33532         /**
33533          * Check if class `name` is present.
33534          * 
33535          * @param {String}
33536          *            name
33537          * @return {ClassList}
33538          * @api public
33539          */
33540
33541         ClassList.prototype.has =
33542             ClassList.prototype.contains = function(name) {
33543                 return this.list ? this.list.contains(name) : !!~index(this.array(), name);
33544             };
33545
33546     }, {
33547         "indexof": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\node_modules\\component-indexof\\index.js"
33548     }],
33549     "\\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) {
33550         module.exports = function(arr, obj) {
33551             if (arr.indexOf) return arr.indexOf(obj);
33552             for (var i = 0; i < arr.length; ++i) {
33553                 if (arr[i] === obj) return i;
33554             }
33555             return -1;
33556         };
33557     }, {}],
33558     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js": [function(require, module, exports) {
33559         var matches = require('matches-selector')
33560
33561         module.exports = function(element, selector, checkYoSelf, root) {
33562             element = checkYoSelf ? {
33563                 parentNode: element
33564             } : element
33565
33566             root = root || document
33567
33568             // Make sure `element !== document` and `element != null`
33569             // otherwise we get an illegal invocation
33570             while ((element = element.parentNode) && element !== document) {
33571                 if (matches(element, selector))
33572                     return element
33573                         // After `matches` on the edge case that
33574                         // the selector matches the root
33575                         // (when the root is not the document)
33576                 if (element === root)
33577                     return
33578             }
33579         }
33580
33581     }, {
33582         "matches-selector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js"
33583     }],
33584     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-delegate\\index.js": [function(require, module, exports) {
33585         /**
33586          * Module dependencies.
33587          */
33588
33589         var closest = require('closest'),
33590             event = require('event');
33591
33592         /**
33593          * Delegate event `type` to `selector` and invoke `fn(e)`. A callback function
33594          * is returned which may be passed to `.unbind()`.
33595          * 
33596          * @param {Element}
33597          *            el
33598          * @param {String}
33599          *            selector
33600          * @param {String}
33601          *            type
33602          * @param {Function}
33603          *            fn
33604          * @param {Boolean}
33605          *            capture
33606          * @return {Function}
33607          * @api public
33608          */
33609
33610         exports.bind = function(el, selector, type, fn, capture) {
33611             return event.bind(el, type, function(e) {
33612                 var target = e.target || e.srcElement;
33613                 e.delegateTarget = closest(target, selector, true, el);
33614                 if (e.delegateTarget) fn.call(el, e);
33615             }, capture);
33616         };
33617
33618         /**
33619          * Unbind event `type`'s callback `fn`.
33620          * 
33621          * @param {Element}
33622          *            el
33623          * @param {String}
33624          *            type
33625          * @param {Function}
33626          *            fn
33627          * @param {Boolean}
33628          *            capture
33629          * @api public
33630          */
33631
33632         exports.unbind = function(el, type, fn, capture) {
33633             event.unbind(el, type, fn, capture);
33634         };
33635
33636     }, {
33637         "closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js",
33638         "event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
33639     }],
33640     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js": [function(require, module, exports) {
33641         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)
33642     }, {}],
33643     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js": [function(require, module, exports) {
33644         /**
33645          * Module dependencies.
33646          */
33647
33648         var query = require('query');
33649
33650         /**
33651          * Element prototype.
33652          */
33653
33654         var proto = Element.prototype;
33655
33656         /**
33657          * Vendor function.
33658          */
33659
33660         var vendor = proto.matches || proto.webkitMatchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector;
33661
33662         /**
33663          * Expose `match()`.
33664          */
33665
33666         module.exports = match;
33667
33668         /**
33669          * Match `el` to `selector`.
33670          * 
33671          * @param {Element}
33672          *            el
33673          * @param {String}
33674          *            selector
33675          * @return {Boolean}
33676          * @api public
33677          */
33678
33679         function match(el, selector) {
33680             if (!el || el.nodeType !== 1) return false;
33681             if (vendor) return vendor.call(el, selector);
33682             var nodes = query.all(selector, el.parentNode);
33683             for (var i = 0; i < nodes.length; ++i) {
33684                 if (nodes[i] == el) return true;
33685             }
33686             return false;
33687         }
33688
33689     }, {
33690         "query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
33691     }],
33692     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js": [function(require, module, exports) {
33693         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)
33694     }, {}],
33695     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\domify\\index.js": [function(require, module, exports) {
33696         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"][0].apply(exports, arguments)
33697     }, {}],
33698     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\index.js": [function(require, module, exports) {
33699         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js"][0].apply(exports, arguments)
33700     }, {
33701         "./lib/collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js",
33702         "./lib/refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\refs.js"
33703     }],
33704     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js": [function(require, module, exports) {
33705         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js"][0].apply(exports, arguments)
33706     }, {}],
33707     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\refs.js": [function(require, module, exports) {
33708         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js"][0].apply(exports, arguments)
33709     }, {
33710         "./collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js"
33711     }],
33712     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\snapsvg\\dist\\snap.svg.js": [function(require, module, exports) {
33713         // Snap.svg 0.3.0
33714         // 
33715         // Copyright (c) 2013 ÃƒÆ’¢â‚¬â€œ 2014 Adobe Systems Incorporated. All rights
33716         // reserved.
33717         // 
33718         // Licensed under the Apache License, Version 2.0 (the "License");
33719         // you may not use this file except in compliance with the License.
33720         // You may obtain a copy of the License at
33721         // 
33722         // http://www.apache.org/licenses/LICENSE-2.0
33723         // 
33724         // Unless required by applicable law or agreed to in writing, software
33725         // distributed under the License is distributed on an "AS IS" BASIS,
33726         // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33727         // See the License for the specific language governing permissions and
33728         // limitations under the License.
33729         // 
33730         // build: 2014-09-08
33731
33732         (function(glob, factory) {
33733             // AMD support
33734             if (typeof define === "function" && define.amd) {
33735                 // Define as an anonymous module
33736                 define(["eve"], function(eve) {
33737                     return factory(glob, eve);
33738                 });
33739             } else if (typeof exports !== 'undefined') {
33740                 // Next for Node.js or CommonJS
33741                 var eve = require('eve');
33742                 module.exports = factory(glob, eve);
33743             } else {
33744                 // Browser globals (glob is window)
33745                 // Snap adds itself to window
33746                 factory(glob, glob.eve);
33747             }
33748         }(window || this, function(window, eve) {
33749
33750             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
33751             // 
33752             // Licensed under the Apache License, Version 2.0 (the "License");
33753             // you may not use this file except in compliance with the License.
33754             // You may obtain a copy of the License at
33755             // 
33756             // http://www.apache.org/licenses/LICENSE-2.0
33757             // 
33758             // Unless required by applicable law or agreed to in writing, software
33759             // distributed under the License is distributed on an "AS IS" BASIS,
33760             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33761             // See the License for the specific language governing permissions and
33762             // limitations under the License.
33763             var mina = (function(eve) {
33764                 var animations = {},
33765                     requestAnimFrame = window.requestAnimationFrame ||
33766                     window.webkitRequestAnimationFrame ||
33767                     window.mozRequestAnimationFrame ||
33768                     window.oRequestAnimationFrame ||
33769                     window.msRequestAnimationFrame ||
33770                     function(callback) {
33771                         setTimeout(callback, 16);
33772                     },
33773                     isArray = Array.isArray || function(a) {
33774                         return a instanceof Array ||
33775                             Object.prototype.toString.call(a) == "[object Array]";
33776                     },
33777                     idgen = 0,
33778                     idprefix = "M" + (+new Date).toString(36),
33779                     ID = function() {
33780                         return idprefix + (idgen++).toString(36);
33781                     },
33782                     diff = function(a, b, A, B) {
33783                         if (isArray(a)) {
33784                             res = [];
33785                             for (var i = 0, ii = a.length; i < ii; i++) {
33786                                 res[i] = diff(a[i], b, A[i], B);
33787                             }
33788                             return res;
33789                         }
33790                         var dif = (A - a) / (B - b);
33791                         return function(bb) {
33792                             return a + dif * (bb - b);
33793                         };
33794                     },
33795                     timer = Date.now || function() {
33796                         return +new Date;
33797                     },
33798                     sta = function(val) {
33799                         var a = this;
33800                         if (val == null) {
33801                             return a.s;
33802                         }
33803                         var ds = a.s - val;
33804                         a.b += a.dur * ds;
33805                         a.B += a.dur * ds;
33806                         a.s = val;
33807                     },
33808                     speed = function(val) {
33809                         var a = this;
33810                         if (val == null) {
33811                             return a.spd;
33812                         }
33813                         a.spd = val;
33814                     },
33815                     duration = function(val) {
33816                         var a = this;
33817                         if (val == null) {
33818                             return a.dur;
33819                         }
33820                         a.s = a.s * val / a.dur;
33821                         a.dur = val;
33822                     },
33823                     stopit = function() {
33824                         var a = this;
33825                         delete animations[a.id];
33826                         a.update();
33827                         eve("mina.stop." + a.id, a);
33828                     },
33829                     pause = function() {
33830                         var a = this;
33831                         if (a.pdif) {
33832                             return;
33833                         }
33834                         delete animations[a.id];
33835                         a.update();
33836                         a.pdif = a.get() - a.b;
33837                     },
33838                     resume = function() {
33839                         var a = this;
33840                         if (!a.pdif) {
33841                             return;
33842                         }
33843                         a.b = a.get() - a.pdif;
33844                         delete a.pdif;
33845                         animations[a.id] = a;
33846                     },
33847                     update = function() {
33848                         var a = this,
33849                             res;
33850                         if (isArray(a.start)) {
33851                             res = [];
33852                             for (var j = 0, jj = a.start.length; j < jj; j++) {
33853                                 res[j] = +a.start[j] +
33854                                     (a.end[j] - a.start[j]) * a.easing(a.s);
33855                             }
33856                         } else {
33857                             res = +a.start + (a.end - a.start) * a.easing(a.s);
33858                         }
33859                         a.set(res);
33860                     },
33861                     frame = function() {
33862                         var len = 0;
33863                         for (var i in animations)
33864                             if (animations.hasOwnProperty(i)) {
33865                                 var a = animations[i],
33866                                     b = a.get(),
33867                                     res;
33868                                 len++;
33869                                 a.s = (b - a.b) / (a.dur / a.spd);
33870                                 if (a.s >= 1) {
33871                                     delete animations[i];
33872                                     a.s = 1;
33873                                     len--;
33874                                     (function(a) {
33875                                         setTimeout(function() {
33876                                             eve("mina.finish." + a.id, a);
33877                                         });
33878                                     }(a));
33879                                 }
33880                                 a.update();
33881                             }
33882                         len && requestAnimFrame(frame);
33883                     },
33884                     /*
33885                      * \ mina [ method ] * Generic animation of numbers * - a (number) start
33886                      * _slave_ number - A (number) end _slave_ number - b (number) start
33887                      * _master_ number (start time in general case) - B (number) end _master_
33888                      * number (end time in gereal case) - get (function) getter of _master_
33889                      * number (see @mina.time) - set (function) setter of _slave_ number -
33890                      * easing (function) #optional easing function, default is @mina.linear =
33891                      * (object) animation descriptor o { o id (string) animation id, o start
33892                      * (number) start _slave_ number, o end (number) end _slave_ number, o b
33893                      * (number) start _master_ number, o s (number) animation status (0..1), o
33894                      * dur (number) animation duration, o spd (number) animation speed, o get
33895                      * (function) getter of _master_ number (see @mina.time), o set (function)
33896                      * setter of _slave_ number, o easing (function) easing function, default is
33897                      * @mina.linear, o status (function) status getter/setter, o speed
33898                      * (function) speed getter/setter, o duration (function) duration
33899                      * getter/setter, o stop (function) animation stopper o pause (function)
33900                      * pauses the animation o resume (function) resumes the animation o update
33901                      * (function) calles setter with the right value of the animation o } \
33902                      */
33903                     mina = function(a, A, b, B, get, set, easing) {
33904                         var anim = {
33905                             id: ID(),
33906                             start: a,
33907                             end: A,
33908                             b: b,
33909                             s: 0,
33910                             dur: B - b,
33911                             spd: 1,
33912                             get: get,
33913                             set: set,
33914                             easing: easing || mina.linear,
33915                             status: sta,
33916                             speed: speed,
33917                             duration: duration,
33918                             stop: stopit,
33919                             pause: pause,
33920                             resume: resume,
33921                             update: update
33922                         };
33923                         animations[anim.id] = anim;
33924                         var len = 0,
33925                             i;
33926                         for (i in animations)
33927                             if (animations.hasOwnProperty(i)) {
33928                                 len++;
33929                                 if (len == 2) {
33930                                     break;
33931                                 }
33932                             }
33933                         len == 1 && requestAnimFrame(frame);
33934                         return anim;
33935                     };
33936                 /*
33937                  * \ mina.time [ method ] * Returns the current time. Equivalent to: |
33938                  * function () { | return (new Date).getTime(); | } \
33939                  */
33940                 mina.time = timer;
33941                 /*
33942                  * \ mina.getById [ method ] * Returns an animation by its id - id (string)
33943                  * animation's id = (object) See @mina \
33944                  */
33945                 mina.getById = function(id) {
33946                     return animations[id] || null;
33947                 };
33948
33949                 /*
33950                  * \ mina.linear [ method ] * Default linear easing - n (number) input 0..1 =
33951                  * (number) output 0..1 \
33952                  */
33953                 mina.linear = function(n) {
33954                     return n;
33955                 };
33956                 /*
33957                  * \ mina.easeout [ method ] * Easeout easing - n (number) input 0..1 =
33958                  * (number) output 0..1 \
33959                  */
33960                 mina.easeout = function(n) {
33961                     return Math.pow(n, 1.7);
33962                 };
33963                 /*
33964                  * \ mina.easein [ method ] * Easein easing - n (number) input 0..1 =
33965                  * (number) output 0..1 \
33966                  */
33967                 mina.easein = function(n) {
33968                     return Math.pow(n, .48);
33969                 };
33970                 /*
33971                  * \ mina.easeinout [ method ] * Easeinout easing - n (number) input 0..1 =
33972                  * (number) output 0..1 \
33973                  */
33974                 mina.easeinout = function(n) {
33975                     if (n == 1) {
33976                         return 1;
33977                     }
33978                     if (n == 0) {
33979                         return 0;
33980                     }
33981                     var q = .48 - n / 1.04,
33982                         Q = Math.sqrt(.1734 + q * q),
33983                         x = Q - q,
33984                         X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),
33985                         y = -Q - q,
33986                         Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),
33987                         t = X + Y + .5;
33988                     return (1 - t) * 3 * t * t + t * t * t;
33989                 };
33990                 /*
33991                  * \ mina.backin [ method ] * Backin easing - n (number) input 0..1 =
33992                  * (number) output 0..1 \
33993                  */
33994                 mina.backin = function(n) {
33995                     if (n == 1) {
33996                         return 1;
33997                     }
33998                     var s = 1.70158;
33999                     return n * n * ((s + 1) * n - s);
34000                 };
34001                 /*
34002                  * \ mina.backout [ method ] * Backout easing - n (number) input 0..1 =
34003                  * (number) output 0..1 \
34004                  */
34005                 mina.backout = function(n) {
34006                     if (n == 0) {
34007                         return 0;
34008                     }
34009                     n = n - 1;
34010                     var s = 1.70158;
34011                     return n * n * ((s + 1) * n + s) + 1;
34012                 };
34013                 /*
34014                  * \ mina.elastic [ method ] * Elastic easing - n (number) input 0..1 =
34015                  * (number) output 0..1 \
34016                  */
34017                 mina.elastic = function(n) {
34018                     if (n == !!n) {
34019                         return n;
34020                     }
34021                     return Math.pow(2, -10 * n) * Math.sin((n - .075) *
34022                         (2 * Math.PI) / .3) + 1;
34023                 };
34024                 /*
34025                  * \ mina.bounce [ method ] * Bounce easing - n (number) input 0..1 =
34026                  * (number) output 0..1 \
34027                  */
34028                 mina.bounce = function(n) {
34029                     var s = 7.5625,
34030                         p = 2.75,
34031                         l;
34032                     if (n < (1 / p)) {
34033                         l = s * n * n;
34034                     } else {
34035                         if (n < (2 / p)) {
34036                             n -= (1.5 / p);
34037                             l = s * n * n + .75;
34038                         } else {
34039                             if (n < (2.5 / p)) {
34040                                 n -= (2.25 / p);
34041                                 l = s * n * n + .9375;
34042                             } else {
34043                                 n -= (2.625 / p);
34044                                 l = s * n * n + .984375;
34045                             }
34046                         }
34047                     }
34048                     return l;
34049                 };
34050                 window.mina = mina;
34051                 return mina;
34052             })(typeof eve == "undefined" ? function() {} : eve);
34053             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
34054             //
34055             // Licensed under the Apache License, Version 2.0 (the "License");
34056             // you may not use this file except in compliance with the License.
34057             // You may obtain a copy of the License at
34058             //
34059             // http://www.apache.org/licenses/LICENSE-2.0
34060             //
34061             // Unless required by applicable law or agreed to in writing, software
34062             // distributed under the License is distributed on an "AS IS" BASIS,
34063             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34064             // See the License for the specific language governing permissions and
34065             // limitations under the License.
34066
34067             var Snap = (function(root) {
34068                 Snap.version = "0.3.0";
34069                 /*
34070                  * \ Snap [ method ] * Creates a drawing surface or wraps existing SVG element. * -
34071                  * width (number|string) width of surface - height (number|string) height of
34072                  * surface or - DOM (SVGElement) element to be wrapped into Snap structure or -
34073                  * array (array) array of elements (will return set of elements) or - query
34074                  * (string) CSS query selector = (object) @Element \
34075                  */
34076                 function Snap(w, h) {
34077                     if (w) {
34078                         if (w.tagName) {
34079                             return wrap(w);
34080                         }
34081                         if (is(w, "array") && Snap.set) {
34082                             return Snap.set.apply(Snap, w);
34083                         }
34084                         if (w instanceof Element) {
34085                             return w;
34086                         }
34087                         if (h == null) {
34088                             w = glob.doc.querySelector(w);
34089                             return wrap(w);
34090                         }
34091                     }
34092                     w = w == null ? "100%" : w;
34093                     h = h == null ? "100%" : h;
34094                     return new Paper(w, h);
34095                 }
34096                 Snap.toString = function() {
34097                     return "Snap v" + this.version;
34098                 };
34099                 Snap._ = {};
34100                 var glob = {
34101                     win: root.window,
34102                     doc: root.window.document
34103                 };
34104                 Snap._.glob = glob;
34105                 var has = "hasOwnProperty",
34106                     Str = String,
34107                     toFloat = parseFloat,
34108                     toInt = parseInt,
34109                     math = Math,
34110                     mmax = math.max,
34111                     mmin = math.min,
34112                     abs = math.abs,
34113                     pow = math.pow,
34114                     PI = math.PI,
34115                     round = math.round,
34116                     E = "",
34117                     S = " ",
34118                     objectToString = Object.prototype.toString,
34119                     ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
34120                     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,
34121                     bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
34122                     reURLValue = /^url\(#?([^)]+)\)$/,
34123                     separator = Snap._.separator = /[,\s]+/,
34124                     whitespace = /[\s]/g,
34125                     commaSpaces = /[\s]*,[\s]*/,
34126                     hsrg = {
34127                         hs: 1,
34128                         rg: 1
34129                     },
34130                     pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
34131                     tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
34132                     pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
34133                     idgen = 0,
34134                     idprefix = "S" + (+new Date).toString(36),
34135                     ID = function(el) {
34136                         return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);
34137                     },
34138                     xlink = "http://www.w3.org/1999/xlink",
34139                     xmlns = "http://www.w3.org/2000/svg",
34140                     hub = {},
34141                     URL = Snap.url = function(url) {
34142                         return "url('#" + url + "')";
34143                     };
34144
34145                 function $(el, attr) {
34146                     if (attr) {
34147                         if (el == "#text") {
34148                             el = glob.doc.createTextNode(attr.text || "");
34149                         }
34150                         if (typeof el == "string") {
34151                             el = $(el);
34152                         }
34153                         if (typeof attr == "string") {
34154                             if (attr.substring(0, 6) == "xlink:") {
34155                                 return el.getAttributeNS(xlink, attr.substring(6));
34156                             }
34157                             if (attr.substring(0, 4) == "xml:") {
34158                                 return el.getAttributeNS(xmlns, attr.substring(4));
34159                             }
34160                             return el.getAttribute(attr);
34161                         }
34162                         for (var key in attr)
34163                             if (attr[has](key)) {
34164                                 var val = Str(attr[key]);
34165                                 if (val) {
34166                                     if (key.substring(0, 6) == "xlink:") {
34167                                         el.setAttributeNS(xlink, key.substring(6), val);
34168                                     } else if (key.substring(0, 4) == "xml:") {
34169                                         el.setAttributeNS(xmlns, key.substring(4), val);
34170                                     } else {
34171                                         el.setAttribute(key, val);
34172                                     }
34173                                 } else {
34174                                     el.removeAttribute(key);
34175                                 }
34176                             }
34177                     } else {
34178                         el = glob.doc.createElementNS(xmlns, el);
34179                     }
34180                     return el;
34181                 }
34182                 Snap._.$ = $;
34183                 Snap._.id = ID;
34184
34185                 function getAttrs(el) {
34186                     var attrs = el.attributes,
34187                         name,
34188                         out = {};
34189                     for (var i = 0; i < attrs.length; i++) {
34190                         if (attrs[i].namespaceURI == xlink) {
34191                             name = "xlink:";
34192                         } else {
34193                             name = "";
34194                         }
34195                         name += attrs[i].name;
34196                         out[name] = attrs[i].textContent;
34197                     }
34198                     return out;
34199                 }
34200
34201                 function is(o, type) {
34202                     type = Str.prototype.toLowerCase.call(type);
34203                     if (type == "finite") {
34204                         return isFinite(o);
34205                     }
34206                     if (type == "array" &&
34207                         (o instanceof Array || Array.isArray && Array.isArray(o))) {
34208                         return true;
34209                     }
34210                     return (type == "null" && o === null) ||
34211                         (type == typeof o && o !== null) ||
34212                         (type == "object" && o === Object(o)) ||
34213                         objectToString.call(o).slice(8, -1).toLowerCase() == type;
34214                 }
34215                 /*
34216                  * \ Snap.format [ method ] * Replaces construction of type `{<name>}` to the
34217                  * corresponding argument * - token (string) string to format - json (object)
34218                  * object which properties are used as a replacement = (string) formatted string >
34219                  * Usage | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z" |
34220                  * paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative
34221                  * width']}z", { | x: 10, | y: 20, | dim: { | width: 40, | height: 50, |
34222                  * "negative width": -40 | } | })); \
34223                  */
34224                 Snap.format = (function() {
34225                     var tokenRegex = /\{([^\}]+)\}/g,
34226                         objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches
34227                         // .xxxxx
34228                         // or
34229                         // ["xxxxx"]
34230                         // to
34231                         // run
34232                         // over
34233                         // object
34234                         // properties
34235                         replacer = function(all, key, obj) {
34236                             var res = obj;
34237                             key.replace(objNotationRegex, function(all, name, quote, quotedName, isFunc) {
34238                                 name = name || quotedName;
34239                                 if (res) {
34240                                     if (name in res) {
34241                                         res = res[name];
34242                                     }
34243                                     typeof res == "function" && isFunc && (res = res());
34244                                 }
34245                             });
34246                             res = (res == null || res == obj ? all : res) + "";
34247                             return res;
34248                         };
34249                     return function(str, obj) {
34250                         return Str(str).replace(tokenRegex, function(all, key) {
34251                             return replacer(all, key, obj);
34252                         });
34253                     };
34254                 })();
34255
34256                 function clone(obj) {
34257                     if (typeof obj == "function" || Object(obj) !== obj) {
34258                         return obj;
34259                     }
34260                     var res = new obj.constructor;
34261                     for (var key in obj)
34262                         if (obj[has](key)) {
34263                             res[key] = clone(obj[key]);
34264                         }
34265                     return res;
34266                 }
34267                 Snap._.clone = clone;
34268
34269                 function repush(array, item) {
34270                     for (var i = 0, ii = array.length; i < ii; i++)
34271                         if (array[i] === item) {
34272                             return array.push(array.splice(i, 1)[0]);
34273                         }
34274                 }
34275
34276                 function cacher(f, scope, postprocessor) {
34277                     function newf() {
34278                         var arg = Array.prototype.slice.call(arguments, 0),
34279                             args = arg.join("\u2400"),
34280                             cache = newf.cache = newf.cache || {},
34281                             count = newf.count = newf.count || [];
34282                         if (cache[has](args)) {
34283                             repush(count, args);
34284                             return postprocessor ? postprocessor(cache[args]) : cache[args];
34285                         }
34286                         count.length >= 1e3 && delete cache[count.shift()];
34287                         count.push(args);
34288                         cache[args] = f.apply(scope, arg);
34289                         return postprocessor ? postprocessor(cache[args]) : cache[args];
34290                     }
34291                     return newf;
34292                 }
34293                 Snap._.cacher = cacher;
34294
34295                 function angle(x1, y1, x2, y2, x3, y3) {
34296                     if (x3 == null) {
34297                         var x = x1 - x2,
34298                             y = y1 - y2;
34299                         if (!x && !y) {
34300                             return 0;
34301                         }
34302                         return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
34303                     } else {
34304                         return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);
34305                     }
34306                 }
34307
34308                 function rad(deg) {
34309                     return deg % 360 * PI / 180;
34310                 }
34311
34312                 function deg(rad) {
34313                     return rad * 180 / PI % 360;
34314                 }
34315
34316                 function x_y() {
34317                     return this.x + S + this.y;
34318                 }
34319
34320                 function x_y_w_h() {
34321                     return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
34322                 }
34323
34324                 /*
34325                  * \ Snap.rad [ method ] * Transform angle to radians - deg (number) angle in
34326                  * degrees = (number) angle in radians \
34327                  */
34328                 Snap.rad = rad;
34329                 /*
34330                  * \ Snap.deg [ method ] * Transform angle to degrees - rad (number) angle in
34331                  * radians = (number) angle in degrees \
34332                  */
34333                 Snap.deg = deg;
34334                 /*
34335                  * \ Snap.angle [ method ] * Returns an angle between two or three points >
34336                  * Parameters - x1 (number) x coord of first point - y1 (number) y coord of
34337                  * first point - x2 (number) x coord of second point - y2 (number) y coord of
34338                  * second point - x3 (number) #optional x coord of third point - y3 (number)
34339                  * #optional y coord of third point = (number) angle in degrees \
34340                  */
34341                 Snap.angle = angle;
34342                 /*
34343                  * \ Snap.is [ method ] * Handy replacement for the `typeof` operator - o
34344                  * (…) any object or primitive - type (string) name of the type, e.g.,
34345                  * `string`, `function`, `number`, etc. = (boolean) `true` if given value is of
34346                  * given type \
34347                  */
34348                 Snap.is = is;
34349                 /*
34350                  * \ Snap.snapTo [ method ] * Snaps given value to given grid - values
34351                  * (array|number) given array of values or step of the grid - value (number)
34352                  * value to adjust - tolerance (number) #optional maximum distance to the target
34353                  * value that would trigger the snap. Default is `10`. = (number) adjusted value \
34354                  */
34355                 Snap.snapTo = function(values, value, tolerance) {
34356                     tolerance = is(tolerance, "finite") ? tolerance : 10;
34357                     if (is(values, "array")) {
34358                         var i = values.length;
34359                         while (i--)
34360                             if (abs(values[i] - value) <= tolerance) {
34361                                 return values[i];
34362                             }
34363                     } else {
34364                         values = +values;
34365                         var rem = value % values;
34366                         if (rem < tolerance) {
34367                             return value - rem;
34368                         }
34369                         if (rem > values - tolerance) {
34370                             return value - rem + values;
34371                         }
34372                     }
34373                     return value;
34374                 };
34375                 // Colour
34376                 /*
34377                  * \ Snap.getRGB [ method ] * Parses color string as RGB object - color (string)
34378                  * color string in one of the following formats: # <ul> # <li>Color name (<code>red</code>,
34379                  * <code>green</code>, <code>cornflowerblue</code>, etc)</li> # <li>#•••
34380                  * ÃƒÆ’¢â‚¬â€� shortened HTML color: (<code>#000</code>, <code>#fc0</code>,
34381                  * etc.)</li> # <li>#•••••• ÃƒÆ’¢â‚¬â€� full
34382                  * length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li> #
34383                  * <li>rgb(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢)
34384                  * ÃƒÆ’¢â‚¬â€� red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li> #
34385                  * <li>rgba(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34386                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34387                  * <li>rgb(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34388                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li> #
34389                  * <li>rgba(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34390                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34391                  * <li>hsb(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢)
34392                  * ÃƒÆ’¢â‚¬â€� hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li> #
34393                  * <li>hsba(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34394                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34395                  * <li>hsb(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34396                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %</li> # <li>hsba(•••%,
34397                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%)
34398                  * ÃƒÆ’¢â‚¬â€� also with opacity</li> # <li>hsl(•••,
34399                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� hue, saturation and
34400                  * luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li> #
34401                  * <li>hsla(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34402                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34403                  * <li>hsl(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34404                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %</li> # <li>hsla(•••%,
34405                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%)
34406                  * ÃƒÆ’¢â‚¬â€� also with opacity</li> # </ul> Note that `%` can be used any time:
34407                  * `rgb(20%, 255, 50%)`. = (object) RGB object in the following format: o { o r
34408                  * (number) red, o g (number) green, o b (number) blue, o hex (string) color in
34409                  * HTML/CSS format: #••••••, o error
34410                  * (boolean) true if string can't be parsed o } \
34411                  */
34412                 Snap.getRGB = cacher(function(colour) {
34413                     if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
34414                         return {
34415                             r: -1,
34416                             g: -1,
34417                             b: -1,
34418                             hex: "none",
34419                             error: 1,
34420                             toString: rgbtoString
34421                         };
34422                     }
34423                     if (colour == "none") {
34424                         return {
34425                             r: -1,
34426                             g: -1,
34427                             b: -1,
34428                             hex: "none",
34429                             toString: rgbtoString
34430                         };
34431                     }!(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
34432                     if (!colour) {
34433                         return {
34434                             r: -1,
34435                             g: -1,
34436                             b: -1,
34437                             hex: "none",
34438                             error: 1,
34439                             toString: rgbtoString
34440                         };
34441                     }
34442                     var res,
34443                         red,
34444                         green,
34445                         blue,
34446                         opacity,
34447                         t,
34448                         values,
34449                         rgb = colour.match(colourRegExp);
34450                     if (rgb) {
34451                         if (rgb[2]) {
34452                             blue = toInt(rgb[2].substring(5), 16);
34453                             green = toInt(rgb[2].substring(3, 5), 16);
34454                             red = toInt(rgb[2].substring(1, 3), 16);
34455                         }
34456                         if (rgb[3]) {
34457                             blue = toInt((t = rgb[3].charAt(3)) + t, 16);
34458                             green = toInt((t = rgb[3].charAt(2)) + t, 16);
34459                             red = toInt((t = rgb[3].charAt(1)) + t, 16);
34460                         }
34461                         if (rgb[4]) {
34462                             values = rgb[4].split(commaSpaces);
34463                             red = toFloat(values[0]);
34464                             values[0].slice(-1) == "%" && (red *= 2.55);
34465                             green = toFloat(values[1]);
34466                             values[1].slice(-1) == "%" && (green *= 2.55);
34467                             blue = toFloat(values[2]);
34468                             values[2].slice(-1) == "%" && (blue *= 2.55);
34469                             rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
34470                             values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34471                         }
34472                         if (rgb[5]) {
34473                             values = rgb[5].split(commaSpaces);
34474                             red = toFloat(values[0]);
34475                             values[0].slice(-1) == "%" && (red /= 100);
34476                             green = toFloat(values[1]);
34477                             values[1].slice(-1) == "%" && (green /= 100);
34478                             blue = toFloat(values[2]);
34479                             values[2].slice(-1) == "%" && (blue /= 100);
34480                             (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
34481                             rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
34482                             values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34483                             return Snap.hsb2rgb(red, green, blue, opacity);
34484                         }
34485                         if (rgb[6]) {
34486                             values = rgb[6].split(commaSpaces);
34487                             red = toFloat(values[0]);
34488                             values[0].slice(-1) == "%" && (red /= 100);
34489                             green = toFloat(values[1]);
34490                             values[1].slice(-1) == "%" && (green /= 100);
34491                             blue = toFloat(values[2]);
34492                             values[2].slice(-1) == "%" && (blue /= 100);
34493                             (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
34494                             rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
34495                             values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34496                             return Snap.hsl2rgb(red, green, blue, opacity);
34497                         }
34498                         red = mmin(math.round(red), 255);
34499                         green = mmin(math.round(green), 255);
34500                         blue = mmin(math.round(blue), 255);
34501                         opacity = mmin(mmax(opacity, 0), 1);
34502                         rgb = {
34503                             r: red,
34504                             g: green,
34505                             b: blue,
34506                             toString: rgbtoString
34507                         };
34508                         rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
34509                         rgb.opacity = is(opacity, "finite") ? opacity : 1;
34510                         return rgb;
34511                     }
34512                     return {
34513                         r: -1,
34514                         g: -1,
34515                         b: -1,
34516                         hex: "none",
34517                         error: 1,
34518                         toString: rgbtoString
34519                     };
34520                 }, Snap);
34521                 // SIERRA It seems odd that the following 3 conversion methods are not expressed
34522                 // as .this2that(), like the others.
34523                 /*
34524                  * \ Snap.hsb [ method ] * Converts HSB values to a hex representation of the
34525                  * color - h (number) hue - s (number) saturation - b (number) value or
34526                  * brightness = (string) hex representation of the color \
34527                  */
34528                 Snap.hsb = cacher(function(h, s, b) {
34529                     return Snap.hsb2rgb(h, s, b).hex;
34530                 });
34531                 /*
34532                  * \ Snap.hsl [ method ] * Converts HSL values to a hex representation of the
34533                  * color - h (number) hue - s (number) saturation - l (number) luminosity =
34534                  * (string) hex representation of the color \
34535                  */
34536                 Snap.hsl = cacher(function(h, s, l) {
34537                     return Snap.hsl2rgb(h, s, l).hex;
34538                 });
34539                 /*
34540                  * \ Snap.rgb [ method ] * Converts RGB values to a hex representation of the
34541                  * color - r (number) red - g (number) green - b (number) blue = (string) hex
34542                  * representation of the color \
34543                  */
34544                 Snap.rgb = cacher(function(r, g, b, o) {
34545                     if (is(o, "finite")) {
34546                         var round = math.round;
34547                         return "rgba(" + [round(r), round(g), round(b), +o.toFixed(2)] + ")";
34548                     }
34549                     return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
34550                 });
34551                 var toHex = function(color) {
34552                         var i = glob.doc.getElementsByTagName("head")[0] || glob.doc.getElementsByTagName("svg")[0],
34553                             red = "rgb(255, 0, 0)";
34554                         toHex = cacher(function(color) {
34555                             if (color.toLowerCase() == "red") {
34556                                 return red;
34557                             }
34558                             i.style.color = red;
34559                             i.style.color = color;
34560                             var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
34561                             return out == red ? null : out;
34562                         });
34563                         return toHex(color);
34564                     },
34565                     hsbtoString = function() {
34566                         return "hsb(" + [this.h, this.s, this.b] + ")";
34567                     },
34568                     hsltoString = function() {
34569                         return "hsl(" + [this.h, this.s, this.l] + ")";
34570                     },
34571                     rgbtoString = function() {
34572                         return this.opacity == 1 || this.opacity == null ?
34573                             this.hex :
34574                             "rgba(" + [this.r, this.g, this.b, this.opacity] + ")";
34575                     },
34576                     prepareRGB = function(r, g, b) {
34577                         if (g == null && is(r, "object") && "r" in r && "g" in r && "b" in r) {
34578                             b = r.b;
34579                             g = r.g;
34580                             r = r.r;
34581                         }
34582                         if (g == null && is(r, string)) {
34583                             var clr = Snap.getRGB(r);
34584                             r = clr.r;
34585                             g = clr.g;
34586                             b = clr.b;
34587                         }
34588                         if (r > 1 || g > 1 || b > 1) {
34589                             r /= 255;
34590                             g /= 255;
34591                             b /= 255;
34592                         }
34593
34594                         return [r, g, b];
34595                     },
34596                     packageRGB = function(r, g, b, o) {
34597                         r = math.round(r * 255);
34598                         g = math.round(g * 255);
34599                         b = math.round(b * 255);
34600                         var rgb = {
34601                             r: r,
34602                             g: g,
34603                             b: b,
34604                             opacity: is(o, "finite") ? o : 1,
34605                             hex: Snap.rgb(r, g, b),
34606                             toString: rgbtoString
34607                         };
34608                         is(o, "finite") && (rgb.opacity = o);
34609                         return rgb;
34610                     };
34611                 // SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g.,
34612                 // can you specify a semi-transparent value for Snap.filter.shadow()?
34613                 /*
34614                  * \ Snap.color [ method ] * Parses the color string and returns an object
34615                  * featuring the color's component values - clr (string) color string in one of
34616                  * the supported formats (see @Snap.getRGB) = (object) Combined RGB/HSB object
34617                  * in the following format: o { o r (number) red, o g (number) green, o b
34618                  * (number) blue, o hex (string) color in HTML/CSS format:
34619                  * #••••••, o error (boolean) `true` if
34620                  * string can't be parsed, o h (number) hue, o s (number) saturation, o v
34621                  * (number) value (brightness), o l (number) lightness o } \
34622                  */
34623                 Snap.color = function(clr) {
34624                     var rgb;
34625                     if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
34626                         rgb = Snap.hsb2rgb(clr);
34627                         clr.r = rgb.r;
34628                         clr.g = rgb.g;
34629                         clr.b = rgb.b;
34630                         clr.opacity = 1;
34631                         clr.hex = rgb.hex;
34632                     } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
34633                         rgb = Snap.hsl2rgb(clr);
34634                         clr.r = rgb.r;
34635                         clr.g = rgb.g;
34636                         clr.b = rgb.b;
34637                         clr.opacity = 1;
34638                         clr.hex = rgb.hex;
34639                     } else {
34640                         if (is(clr, "string")) {
34641                             clr = Snap.getRGB(clr);
34642                         }
34643                         if (is(clr, "object") && "r" in clr && "g" in clr && "b" in clr && !("error" in clr)) {
34644                             rgb = Snap.rgb2hsl(clr);
34645                             clr.h = rgb.h;
34646                             clr.s = rgb.s;
34647                             clr.l = rgb.l;
34648                             rgb = Snap.rgb2hsb(clr);
34649                             clr.v = rgb.b;
34650                         } else {
34651                             clr = {
34652                                 hex: "none"
34653                             };
34654                             clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
34655                             clr.error = 1;
34656                         }
34657                     }
34658                     clr.toString = rgbtoString;
34659                     return clr;
34660                 };
34661                 /*
34662                  * \ Snap.hsb2rgb [ method ] * Converts HSB values to an RGB object - h (number)
34663                  * hue - s (number) saturation - v (number) value or brightness = (object) RGB
34664                  * object in the following format: o { o r (number) red, o g (number) green, o b
34665                  * (number) blue, o hex (string) color in HTML/CSS format:
34666                  * #•••••• o } \
34667                  */
34668                 Snap.hsb2rgb = function(h, s, v, o) {
34669                     if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
34670                         v = h.b;
34671                         s = h.s;
34672                         h = h.h;
34673                         o = h.o;
34674                     }
34675                     h *= 360;
34676                     var R, G, B, X, C;
34677                     h = (h % 360) / 60;
34678                     C = v * s;
34679                     X = C * (1 - abs(h % 2 - 1));
34680                     R = G = B = v - C;
34681
34682                     h = ~~h;
34683                     R += [C, X, 0, 0, X, C][h];
34684                     G += [X, C, C, X, 0, 0][h];
34685                     B += [0, 0, X, C, C, X][h];
34686                     return packageRGB(R, G, B, o);
34687                 };
34688                 /*
34689                  * \ Snap.hsl2rgb [ method ] * Converts HSL values to an RGB object - h (number)
34690                  * hue - s (number) saturation - l (number) luminosity = (object) RGB object in
34691                  * the following format: o { o r (number) red, o g (number) green, o b (number)
34692                  * blue, o hex (string) color in HTML/CSS format:
34693                  * #•••••• o } \
34694                  */
34695                 Snap.hsl2rgb = function(h, s, l, o) {
34696                     if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
34697                         l = h.l;
34698                         s = h.s;
34699                         h = h.h;
34700                     }
34701                     if (h > 1 || s > 1 || l > 1) {
34702                         h /= 360;
34703                         s /= 100;
34704                         l /= 100;
34705                     }
34706                     h *= 360;
34707                     var R, G, B, X, C;
34708                     h = (h % 360) / 60;
34709                     C = 2 * s * (l < .5 ? l : 1 - l);
34710                     X = C * (1 - abs(h % 2 - 1));
34711                     R = G = B = l - C / 2;
34712
34713                     h = ~~h;
34714                     R += [C, X, 0, 0, X, C][h];
34715                     G += [X, C, C, X, 0, 0][h];
34716                     B += [0, 0, X, C, C, X][h];
34717                     return packageRGB(R, G, B, o);
34718                 };
34719                 /*
34720                  * \ Snap.rgb2hsb [ method ] * Converts RGB values to an HSB object - r (number)
34721                  * red - g (number) green - b (number) blue = (object) HSB object in the
34722                  * following format: o { o h (number) hue, o s (number) saturation, o b (number)
34723                  * brightness o } \
34724                  */
34725                 Snap.rgb2hsb = function(r, g, b) {
34726                     b = prepareRGB(r, g, b);
34727                     r = b[0];
34728                     g = b[1];
34729                     b = b[2];
34730
34731                     var H, S, V, C;
34732                     V = mmax(r, g, b);
34733                     C = V - mmin(r, g, b);
34734                     H = (C == 0 ? null :
34735                         V == r ? (g - b) / C :
34736                         V == g ? (b - r) / C + 2 :
34737                         (r - g) / C + 4
34738                     );
34739                     H = ((H + 360) % 6) * 60 / 360;
34740                     S = C == 0 ? 0 : C / V;
34741                     return {
34742                         h: H,
34743                         s: S,
34744                         b: V,
34745                         toString: hsbtoString
34746                     };
34747                 };
34748                 /*
34749                  * \ Snap.rgb2hsl [ method ] * Converts RGB values to an HSL object - r (number)
34750                  * red - g (number) green - b (number) blue = (object) HSL object in the
34751                  * following format: o { o h (number) hue, o s (number) saturation, o l (number)
34752                  * luminosity o } \
34753                  */
34754                 Snap.rgb2hsl = function(r, g, b) {
34755                     b = prepareRGB(r, g, b);
34756                     r = b[0];
34757                     g = b[1];
34758                     b = b[2];
34759
34760                     var H, S, L, M, m, C;
34761                     M = mmax(r, g, b);
34762                     m = mmin(r, g, b);
34763                     C = M - m;
34764                     H = (C == 0 ? null :
34765                         M == r ? (g - b) / C :
34766                         M == g ? (b - r) / C + 2 :
34767                         (r - g) / C + 4);
34768                     H = ((H + 360) % 6) * 60 / 360;
34769                     L = (M + m) / 2;
34770                     S = (C == 0 ? 0 :
34771                         L < .5 ? C / (2 * L) :
34772                         C / (2 - 2 * L));
34773                     return {
34774                         h: H,
34775                         s: S,
34776                         l: L,
34777                         toString: hsltoString
34778                     };
34779                 };
34780
34781                 // Transformations
34782                 // SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a
34783                 // format like this for two separate segments? [ ["M10,10","L90,90"],
34784                 // ["M90,10","L10,90"] ] Otherwise how is each command structured?
34785                 /*
34786                  * \ Snap.parsePathString [ method ] * Utility method * Parses given path string
34787                  * into an array of arrays of path segments - pathString (string|array) path
34788                  * string or array of segments (in the last case it is returned straight away) =
34789                  * (array) array of segments \
34790                  */
34791                 Snap.parsePathString = function(pathString) {
34792                     if (!pathString) {
34793                         return null;
34794                     }
34795                     var pth = Snap.path(pathString);
34796                     if (pth.arr) {
34797                         return Snap.path.clone(pth.arr);
34798                     }
34799
34800                     var paramCounts = {
34801                             a: 7,
34802                             c: 6,
34803                             o: 2,
34804                             h: 1,
34805                             l: 2,
34806                             m: 2,
34807                             r: 4,
34808                             q: 4,
34809                             s: 4,
34810                             t: 2,
34811                             v: 1,
34812                             u: 3,
34813                             z: 0
34814                         },
34815                         data = [];
34816                     if (is(pathString, "array") && is(pathString[0], "array")) { // rough
34817                         // assumption
34818                         data = Snap.path.clone(pathString);
34819                     }
34820                     if (!data.length) {
34821                         Str(pathString).replace(pathCommand, function(a, b, c) {
34822                             var params = [],
34823                                 name = b.toLowerCase();
34824                             c.replace(pathValues, function(a, b) {
34825                                 b && params.push(+b);
34826                             });
34827                             if (name == "m" && params.length > 2) {
34828                                 data.push([b].concat(params.splice(0, 2)));
34829                                 name = "l";
34830                                 b = b == "m" ? "l" : "L";
34831                             }
34832                             if (name == "o" && params.length == 1) {
34833                                 data.push([b, params[0]]);
34834                             }
34835                             if (name == "r") {
34836                                 data.push([b].concat(params));
34837                             } else
34838                                 while (params.length >= paramCounts[name]) {
34839                                     data.push([b].concat(params.splice(0, paramCounts[name])));
34840                                     if (!paramCounts[name]) {
34841                                         break;
34842                                     }
34843                                 }
34844                         });
34845                     }
34846                     data.toString = Snap.path.toString;
34847                     pth.arr = Snap.path.clone(data);
34848                     return data;
34849                 };
34850                 /*
34851                  * \ Snap.parseTransformString [ method ] * Utility method * Parses given
34852                  * transform string into an array of transformations - TString (string|array)
34853                  * transform string or array of transformations (in the last case it is returned
34854                  * straight away) = (array) array of transformations \
34855                  */
34856                 var parseTransformString = Snap.parseTransformString = function(TString) {
34857                     if (!TString) {
34858                         return null;
34859                     }
34860                     var paramCounts = {
34861                             r: 3,
34862                             s: 4,
34863                             t: 2,
34864                             m: 6
34865                         },
34866                         data = [];
34867                     if (is(TString, "array") && is(TString[0], "array")) { // rough assumption
34868                         data = Snap.path.clone(TString);
34869                     }
34870                     if (!data.length) {
34871                         Str(TString).replace(tCommand, function(a, b, c) {
34872                             var params = [],
34873                                 name = b.toLowerCase();
34874                             c.replace(pathValues, function(a, b) {
34875                                 b && params.push(+b);
34876                             });
34877                             data.push([b].concat(params));
34878                         });
34879                     }
34880                     data.toString = Snap.path.toString;
34881                     return data;
34882                 };
34883
34884                 function svgTransform2string(tstr) {
34885                     var res = [];
34886                     tstr = tstr.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g, function(all, name, params) {
34887                         params = params.split(/\s*,\s*|\s+/);
34888                         if (name == "rotate" && params.length == 1) {
34889                             params.push(0, 0);
34890                         }
34891                         if (name == "scale") {
34892                             if (params.length > 2) {
34893                                 params = params.slice(0, 2);
34894                             } else if (params.length == 2) {
34895                                 params.push(0, 0);
34896                             }
34897                             if (params.length == 1) {
34898                                 params.push(params[0], 0, 0);
34899                             }
34900                         }
34901                         if (name == "skewX") {
34902                             res.push(["m", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);
34903                         } else if (name == "skewY") {
34904                             res.push(["m", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);
34905                         } else {
34906                             res.push([name.charAt(0)].concat(params));
34907                         }
34908                         return all;
34909                     });
34910                     return res;
34911                 }
34912                 Snap._.svgTransform2string = svgTransform2string;
34913                 Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
34914
34915                 function transform2matrix(tstr, bbox) {
34916                     var tdata = parseTransformString(tstr),
34917                         m = new Snap.Matrix;
34918                     if (tdata) {
34919                         for (var i = 0, ii = tdata.length; i < ii; i++) {
34920                             var t = tdata[i],
34921                                 tlen = t.length,
34922                                 command = Str(t[0]).toLowerCase(),
34923                                 absolute = t[0] != command,
34924                                 inver = absolute ? m.invert() : 0,
34925                                 x1,
34926                                 y1,
34927                                 x2,
34928                                 y2,
34929                                 bb;
34930                             if (command == "t" && tlen == 2) {
34931                                 m.translate(t[1], 0);
34932                             } else if (command == "t" && tlen == 3) {
34933                                 if (absolute) {
34934                                     x1 = inver.x(0, 0);
34935                                     y1 = inver.y(0, 0);
34936                                     x2 = inver.x(t[1], t[2]);
34937                                     y2 = inver.y(t[1], t[2]);
34938                                     m.translate(x2 - x1, y2 - y1);
34939                                 } else {
34940                                     m.translate(t[1], t[2]);
34941                                 }
34942                             } else if (command == "r") {
34943                                 if (tlen == 2) {
34944                                     bb = bb || bbox;
34945                                     m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
34946                                 } else if (tlen == 4) {
34947                                     if (absolute) {
34948                                         x2 = inver.x(t[2], t[3]);
34949                                         y2 = inver.y(t[2], t[3]);
34950                                         m.rotate(t[1], x2, y2);
34951                                     } else {
34952                                         m.rotate(t[1], t[2], t[3]);
34953                                     }
34954                                 }
34955                             } else if (command == "s") {
34956                                 if (tlen == 2 || tlen == 3) {
34957                                     bb = bb || bbox;
34958                                     m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
34959                                 } else if (tlen == 4) {
34960                                     if (absolute) {
34961                                         x2 = inver.x(t[2], t[3]);
34962                                         y2 = inver.y(t[2], t[3]);
34963                                         m.scale(t[1], t[1], x2, y2);
34964                                     } else {
34965                                         m.scale(t[1], t[1], t[2], t[3]);
34966                                     }
34967                                 } else if (tlen == 5) {
34968                                     if (absolute) {
34969                                         x2 = inver.x(t[3], t[4]);
34970                                         y2 = inver.y(t[3], t[4]);
34971                                         m.scale(t[1], t[2], x2, y2);
34972                                     } else {
34973                                         m.scale(t[1], t[2], t[3], t[4]);
34974                                     }
34975                                 }
34976                             } else if (command == "m" && tlen == 7) {
34977                                 m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
34978                             }
34979                         }
34980                     }
34981                     return m;
34982                 }
34983                 Snap._.transform2matrix = transform2matrix;
34984                 Snap._unit2px = unit2px;
34985                 var contains = glob.doc.contains || glob.doc.compareDocumentPosition ?
34986                     function(a, b) {
34987                         var adown = a.nodeType == 9 ? a.documentElement : a,
34988                             bup = b && b.parentNode;
34989                         return a == bup || !!(bup && bup.nodeType == 1 && (
34990                             adown.contains ?
34991                             adown.contains(bup) :
34992                             a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
34993                         ));
34994                     } :
34995                     function(a, b) {
34996                         if (b) {
34997                             while (b) {
34998                                 b = b.parentNode;
34999                                 if (b == a) {
35000                                     return true;
35001                                 }
35002                             }
35003                         }
35004                         return false;
35005                     };
35006
35007                 function getSomeDefs(el) {
35008                     var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
35009                         (el.node.parentNode && wrap(el.node.parentNode)) ||
35010                         Snap.select("svg") ||
35011                         Snap(0, 0),
35012                         pdefs = p.select("defs"),
35013                         defs = pdefs == null ? false : pdefs.node;
35014                     if (!defs) {
35015                         defs = make("defs", p.node).node;
35016                     }
35017                     return defs;
35018                 }
35019
35020                 function getSomeSVG(el) {
35021                     return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select("svg");
35022                 }
35023                 Snap._.getSomeDefs = getSomeDefs;
35024                 Snap._.getSomeSVG = getSomeSVG;
35025
35026                 function unit2px(el, name, value) {
35027                     var svg = getSomeSVG(el).node,
35028                         out = {},
35029                         mgr = svg.querySelector(".svg---mgr");
35030                     if (!mgr) {
35031                         mgr = $("rect");
35032                         $(mgr, {
35033                             x: -9e9,
35034                             y: -9e9,
35035                             width: 10,
35036                             height: 10,
35037                             "class": "svg---mgr",
35038                             fill: "none"
35039                         });
35040                         svg.appendChild(mgr);
35041                     }
35042
35043                     function getW(val) {
35044                         if (val == null) {
35045                             return E;
35046                         }
35047                         if (val == +val) {
35048                             return val;
35049                         }
35050                         $(mgr, {
35051                             width: val
35052                         });
35053                         try {
35054                             return mgr.getBBox().width;
35055                         } catch (e) {
35056                             return 0;
35057                         }
35058                     }
35059
35060                     function getH(val) {
35061                         if (val == null) {
35062                             return E;
35063                         }
35064                         if (val == +val) {
35065                             return val;
35066                         }
35067                         $(mgr, {
35068                             height: val
35069                         });
35070                         try {
35071                             return mgr.getBBox().height;
35072                         } catch (e) {
35073                             return 0;
35074                         }
35075                     }
35076
35077                     function set(nam, f) {
35078                         if (name == null) {
35079                             out[nam] = f(el.attr(nam) || 0);
35080                         } else if (nam == name) {
35081                             out = f(value == null ? el.attr(nam) || 0 : value);
35082                         }
35083                     }
35084                     switch (el.type) {
35085                         case "rect":
35086                             set("rx", getW);
35087                             set("ry", getH);
35088                         case "image":
35089                             set("width", getW);
35090                             set("height", getH);
35091                         case "text":
35092                             set("x", getW);
35093                             set("y", getH);
35094                             break;
35095                         case "circle":
35096                             set("cx", getW);
35097                             set("cy", getH);
35098                             set("r", getW);
35099                             break;
35100                         case "ellipse":
35101                             set("cx", getW);
35102                             set("cy", getH);
35103                             set("rx", getW);
35104                             set("ry", getH);
35105                             break;
35106                         case "line":
35107                             set("x1", getW);
35108                             set("x2", getW);
35109                             set("y1", getH);
35110                             set("y2", getH);
35111                             break;
35112                         case "marker":
35113                             set("refX", getW);
35114                             set("markerWidth", getW);
35115                             set("refY", getH);
35116                             set("markerHeight", getH);
35117                             break;
35118                         case "radialGradient":
35119                             set("fx", getW);
35120                             set("fy", getH);
35121                             break;
35122                         case "tspan":
35123                             set("dx", getW);
35124                             set("dy", getH);
35125                             break;
35126                         default:
35127                             set(name, getW);
35128                     }
35129                     svg.removeChild(mgr);
35130                     return out;
35131                 }
35132                 /*
35133                  * \ Snap.select [ method ] * Wraps a DOM element specified by CSS selector as
35134                  * @Element - query (string) CSS selector of the element = (Element) the current
35135                  * element \
35136                  */
35137                 Snap.select = function(query) {
35138                     query = Str(query).replace(/([^\\]):/g, "$1\\:");
35139                     return wrap(glob.doc.querySelector(query));
35140                 };
35141                 /*
35142                  * \ Snap.selectAll [ method ] * Wraps DOM elements specified by CSS selector as
35143                  * set or array of @Element - query (string) CSS selector of the element =
35144                  * (Element) the current element \
35145                  */
35146                 Snap.selectAll = function(query) {
35147                     var nodelist = glob.doc.querySelectorAll(query),
35148                         set = (Snap.set || Array)();
35149                     for (var i = 0; i < nodelist.length; i++) {
35150                         set.push(wrap(nodelist[i]));
35151                     }
35152                     return set;
35153                 };
35154
35155                 function add2group(list) {
35156                     if (!is(list, "array")) {
35157                         list = Array.prototype.slice.call(arguments, 0);
35158                     }
35159                     var i = 0,
35160                         j = 0,
35161                         node = this.node;
35162                     while (this[i]) delete this[i++];
35163                     for (i = 0; i < list.length; i++) {
35164                         if (list[i].type == "set") {
35165                             list[i].forEach(function(el) {
35166                                 node.appendChild(el.node);
35167                             });
35168                         } else {
35169                             node.appendChild(list[i].node);
35170                         }
35171                     }
35172                     var children = node.childNodes;
35173                     for (i = 0; i < children.length; i++) {
35174                         this[j++] = wrap(children[i]);
35175                     }
35176                     return this;
35177                 }
35178                 // Hub garbage collector every 10s
35179                 setInterval(function() {
35180                     for (var key in hub)
35181                         if (hub[has](key)) {
35182                             var el = hub[key],
35183                                 node = el.node;
35184                             if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement)) {
35185                                 delete hub[key];
35186                             }
35187                         }
35188                 }, 1e4);
35189
35190                 function Element(el) {
35191                     if (el.snap in hub) {
35192                         return hub[el.snap];
35193                     }
35194                     var svg;
35195                     try {
35196                         svg = el.ownerSVGElement;
35197                     } catch (e) {}
35198                     /*
35199                      * \ Element.node [ property (object) ] * Gives you a reference to the DOM
35200                      * object, so you can assign event handlers or just mess around. > Usage | //
35201                      * draw a circle at coordinate 10,10 with radius of 10 | var c =
35202                      * paper.circle(10, 10, 10); | c.node.onclick = function () { |
35203                      * c.attr("fill", "red"); | }; \
35204                      */
35205                     this.node = el;
35206                     if (svg) {
35207                         this.paper = new Paper(svg);
35208                     }
35209                     /*
35210                      * \ Element.type [ property (string) ] * SVG tag name of the given element. \
35211                      */
35212                     this.type = el.tagName;
35213                     var id = this.id = ID(this);
35214                     this.anims = {};
35215                     this._ = {
35216                         transform: []
35217                     };
35218                     el.snap = id;
35219                     hub[id] = this;
35220                     if (this.type == "g") {
35221                         this.add = add2group;
35222                     }
35223                     if (this.type in {
35224                             g: 1,
35225                             mask: 1,
35226                             pattern: 1,
35227                             symbol: 1
35228                         }) {
35229                         for (var method in Paper.prototype)
35230                             if (Paper.prototype[has](method)) {
35231                                 this[method] = Paper.prototype[method];
35232                             }
35233                     }
35234                 }
35235                 /*
35236                  * \ Element.attr [ method ] * Gets or sets given attributes of the element. * -
35237                  * params (object) contains key-value pairs of attributes you want to set or -
35238                  * param (string) name of the attribute = (Element) the current element or =
35239                  * (string) value of attribute > Usage | el.attr({ | fill: "#fc0", | stroke:
35240                  * "#000", | strokeWidth: 2, // CamelCase... | "fill-opacity": 0.5, // or
35241                  * dash-separated names | width: "*=2" // prefixed values | }); |
35242                  * console.log(el.attr("fill")); // #fc0 Prefixed values in format `"+=10"`
35243                  * supported. All four operations (`+`, `-`, `*` and `/`) could be used.
35244                  * Optionally you can use units for `+` and `-`: `"+=2em"`. \
35245                  */
35246                 Element.prototype.attr = function(params, value) {
35247                     var el = this,
35248                         node = el.node;
35249                     if (!params) {
35250                         return el;
35251                     }
35252                     if (is(params, "string")) {
35253                         if (arguments.length > 1) {
35254                             var json = {};
35255                             json[params] = value;
35256                             params = json;
35257                         } else {
35258                             return eve("snap.util.getattr." + params, el).firstDefined();
35259                         }
35260                     }
35261                     for (var att in params) {
35262                         if (params[has](att)) {
35263                             eve("snap.util.attr." + att, el, params[att]);
35264                         }
35265                     }
35266                     return el;
35267                 };
35268                 /*
35269                  * \ Snap.parse [ method ] * Parses SVG fragment and converts it into a
35270                  * @Fragment * - svg (string) SVG string = (Fragment) the @Fragment \
35271                  */
35272                 Snap.parse = function(svg) {
35273                     var f = glob.doc.createDocumentFragment(),
35274                         full = true,
35275                         div = glob.doc.createElement("div");
35276                     svg = Str(svg);
35277                     if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
35278                         svg = "<svg>" + svg + "</svg>";
35279                         full = false;
35280                     }
35281                     div.innerHTML = svg;
35282                     svg = div.getElementsByTagName("svg")[0];
35283                     if (svg) {
35284                         if (full) {
35285                             f = svg;
35286                         } else {
35287                             while (svg.firstChild) {
35288                                 f.appendChild(svg.firstChild);
35289                             }
35290                             div.innerHTML = E;
35291                         }
35292                     }
35293                     return new Fragment(f);
35294                 };
35295
35296                 function Fragment(frag) {
35297                     this.node = frag;
35298                 }
35299                 // SIERRA Snap.fragment() could especially use a code example
35300                 /*
35301                  * \ Snap.fragment [ method ] * Creates a DOM fragment from a given list of
35302                  * elements or strings * - varargs (…) SVG string = (Fragment) the
35303                  * @Fragment \
35304                  */
35305                 Snap.fragment = function() {
35306                     var args = Array.prototype.slice.call(arguments, 0),
35307                         f = glob.doc.createDocumentFragment();
35308                     for (var i = 0, ii = args.length; i < ii; i++) {
35309                         var item = args[i];
35310                         if (item.node && item.node.nodeType) {
35311                             f.appendChild(item.node);
35312                         }
35313                         if (item.nodeType) {
35314                             f.appendChild(item);
35315                         }
35316                         if (typeof item == "string") {
35317                             f.appendChild(Snap.parse(item).node);
35318                         }
35319                     }
35320                     return new Fragment(f);
35321                 };
35322
35323                 function make(name, parent) {
35324                     var res = $(name);
35325                     parent.appendChild(res);
35326                     var el = wrap(res);
35327                     return el;
35328                 }
35329
35330                 function Paper(w, h) {
35331                     var res,
35332                         desc,
35333                         defs,
35334                         proto = Paper.prototype;
35335                     if (w && w.tagName == "svg") {
35336                         if (w.snap in hub) {
35337                             return hub[w.snap];
35338                         }
35339                         var doc = w.ownerDocument;
35340                         res = new Element(w);
35341                         desc = w.getElementsByTagName("desc")[0];
35342                         defs = w.getElementsByTagName("defs")[0];
35343                         if (!desc) {
35344                             desc = $("desc");
35345                             desc.appendChild(doc.createTextNode("Created with Snap"));
35346                             res.node.appendChild(desc);
35347                         }
35348                         if (!defs) {
35349                             defs = $("defs");
35350                             res.node.appendChild(defs);
35351                         }
35352                         res.defs = defs;
35353                         for (var key in proto)
35354                             if (proto[has](key)) {
35355                                 res[key] = proto[key];
35356                             }
35357                         res.paper = res.root = res;
35358                     } else {
35359                         res = make("svg", glob.doc.body);
35360                         $(res.node, {
35361                             height: h,
35362                             version: 1.1,
35363                             width: w,
35364                             xmlns: xmlns
35365                         });
35366                     }
35367                     return res;
35368                 }
35369
35370                 function wrap(dom) {
35371                     if (!dom) {
35372                         return dom;
35373                     }
35374                     if (dom instanceof Element || dom instanceof Fragment) {
35375                         return dom;
35376                     }
35377                     if (dom.tagName && dom.tagName.toLowerCase() == "svg") {
35378                         return new Paper(dom);
35379                     }
35380                     if (dom.tagName && dom.tagName.toLowerCase() == "object" && dom.type == "image/svg+xml") {
35381                         return new Paper(dom.contentDocument.getElementsByTagName("svg")[0]);
35382                     }
35383                     return new Element(dom);
35384                 }
35385
35386                 Snap._.make = make;
35387                 Snap._.wrap = wrap;
35388                 /*
35389                  * \ Paper.el [ method ] * Creates an element on paper with a given name and no
35390                  * attributes * - name (string) tag name - attr (object) attributes = (Element)
35391                  * the current element > Usage | var c = paper.circle(10, 10, 10); // is the
35392                  * same as... | var c = paper.el("circle").attr({ | cx: 10, | cy: 10, | r: 10 |
35393                  * }); | // and the same as | var c = paper.el("circle", { | cx: 10, | cy: 10, |
35394                  * r: 10 | }); \
35395                  */
35396                 Paper.prototype.el = function(name, attr) {
35397                     var el = make(name, this.node);
35398                     attr && el.attr(attr);
35399                     return el;
35400                 };
35401                 // default
35402                 eve.on("snap.util.getattr", function() {
35403                     var att = eve.nt();
35404                     att = att.substring(att.lastIndexOf(".") + 1);
35405                     var css = att.replace(/[A-Z]/g, function(letter) {
35406                         return "-" + letter.toLowerCase();
35407                     });
35408                     if (cssAttr[has](css)) {
35409                         return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);
35410                     } else {
35411                         return $(this.node, att);
35412                     }
35413                 });
35414                 var cssAttr = {
35415                     "alignment-baseline": 0,
35416                     "baseline-shift": 0,
35417                     "clip": 0,
35418                     "clip-path": 0,
35419                     "clip-rule": 0,
35420                     "color": 0,
35421                     "color-interpolation": 0,
35422                     "color-interpolation-filters": 0,
35423                     "color-profile": 0,
35424                     "color-rendering": 0,
35425                     "cursor": 0,
35426                     "direction": 0,
35427                     "display": 0,
35428                     "dominant-baseline": 0,
35429                     "enable-background": 0,
35430                     "fill": 0,
35431                     "fill-opacity": 0,
35432                     "fill-rule": 0,
35433                     "filter": 0,
35434                     "flood-color": 0,
35435                     "flood-opacity": 0,
35436                     "font": 0,
35437                     "font-family": 0,
35438                     "font-size": 0,
35439                     "font-size-adjust": 0,
35440                     "font-stretch": 0,
35441                     "font-style": 0,
35442                     "font-variant": 0,
35443                     "font-weight": 0,
35444                     "glyph-orientation-horizontal": 0,
35445                     "glyph-orientation-vertical": 0,
35446                     "image-rendering": 0,
35447                     "kerning": 0,
35448                     "letter-spacing": 0,
35449                     "lighting-color": 0,
35450                     "marker": 0,
35451                     "marker-end": 0,
35452                     "marker-mid": 0,
35453                     "marker-start": 0,
35454                     "mask": 0,
35455                     "opacity": 0,
35456                     "overflow": 0,
35457                     "pointer-events": 0,
35458                     "shape-rendering": 0,
35459                     "stop-color": 0,
35460                     "stop-opacity": 0,
35461                     "stroke": 0,
35462                     "stroke-dasharray": 0,
35463                     "stroke-dashoffset": 0,
35464                     "stroke-linecap": 0,
35465                     "stroke-linejoin": 0,
35466                     "stroke-miterlimit": 0,
35467                     "stroke-opacity": 0,
35468                     "stroke-width": 0,
35469                     "text-anchor": 0,
35470                     "text-decoration": 0,
35471                     "text-rendering": 0,
35472                     "unicode-bidi": 0,
35473                     "visibility": 0,
35474                     "word-spacing": 0,
35475                     "writing-mode": 0
35476                 };
35477
35478                 eve.on("snap.util.attr", function(value) {
35479                     var att = eve.nt(),
35480                         attr = {};
35481                     att = att.substring(att.lastIndexOf(".") + 1);
35482                     attr[att] = value;
35483                     var style = att.replace(/-(\w)/gi, function(all, letter) {
35484                             return letter.toUpperCase();
35485                         }),
35486                         css = att.replace(/[A-Z]/g, function(letter) {
35487                             return "-" + letter.toLowerCase();
35488                         });
35489                     if (cssAttr[has](css)) {
35490                         this.node.style[style] = value == null ? E : value;
35491                     } else {
35492                         $(this.node, attr);
35493                     }
35494                 });
35495                 (function(proto) {}(Paper.prototype));
35496
35497                 // simple ajax
35498                 /*
35499                  * \ Snap.ajax [ method ] * Simple implementation of Ajax * - url (string) URL -
35500                  * postData (object|string) data for post request - callback (function) callback -
35501                  * scope (object) #optional scope of callback or - url (string) URL - callback
35502                  * (function) callback - scope (object) #optional scope of callback =
35503                  * (XMLHttpRequest) the XMLHttpRequest object, just in case \
35504                  */
35505                 Snap.ajax = function(url, postData, callback, scope) {
35506                     var req = new XMLHttpRequest,
35507                         id = ID();
35508                     if (req) {
35509                         if (is(postData, "function")) {
35510                             scope = callback;
35511                             callback = postData;
35512                             postData = null;
35513                         } else if (is(postData, "object")) {
35514                             var pd = [];
35515                             for (var key in postData)
35516                                 if (postData.hasOwnProperty(key)) {
35517                                     pd.push(encodeURIComponent(key) + "=" + encodeURIComponent(postData[key]));
35518                                 }
35519                             postData = pd.join("&");
35520                         }
35521                         req.open((postData ? "POST" : "GET"), url, true);
35522                         if (postData) {
35523                             req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
35524                             req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
35525                         }
35526                         if (callback) {
35527                             eve.once("snap.ajax." + id + ".0", callback);
35528                             eve.once("snap.ajax." + id + ".200", callback);
35529                             eve.once("snap.ajax." + id + ".304", callback);
35530                         }
35531                         req.onreadystatechange = function() {
35532                             if (req.readyState != 4) return;
35533                             eve("snap.ajax." + id + "." + req.status, scope, req);
35534                         };
35535                         if (req.readyState == 4) {
35536                             return req;
35537                         }
35538                         req.send(postData);
35539                         return req;
35540                     }
35541                 };
35542                 /*
35543                  * \ Snap.load [ method ] * Loads external SVG file as a @Fragment (see
35544                  * @Snap.ajax for more advanced AJAX) * - url (string) URL - callback (function)
35545                  * callback - scope (object) #optional scope of callback \
35546                  */
35547                 Snap.load = function(url, callback, scope) {
35548                     Snap.ajax(url, function(req) {
35549                         var f = Snap.parse(req.responseText);
35550                         scope ? callback.call(scope, f) : callback(f);
35551                     });
35552                 };
35553                 var getOffset = function(elem) {
35554                     var box = elem.getBoundingClientRect(),
35555                         doc = elem.ownerDocument,
35556                         body = doc.body,
35557                         docElem = doc.documentElement,
35558                         clientTop = docElem.clientTop || body.clientTop || 0,
35559                         clientLeft = docElem.clientLeft || body.clientLeft || 0,
35560                         top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop) - clientTop,
35561                         left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
35562                     return {
35563                         y: top,
35564                         x: left
35565                     };
35566                 };
35567                 /*
35568                  * \ Snap.getElementByPoint [ method ] * Returns you topmost element under given
35569                  * point. * = (object) Snap element object - x (number) x coordinate from the
35570                  * top left corner of the window - y (number) y coordinate from the top left
35571                  * corner of the window > Usage | Snap.getElementByPoint(mouseX,
35572                  * mouseY).attr({stroke: "#f00"}); \
35573                  */
35574                 Snap.getElementByPoint = function(x, y) {
35575                     var paper = this,
35576                         svg = paper.canvas,
35577                         target = glob.doc.elementFromPoint(x, y);
35578                     if (glob.win.opera && target.tagName == "svg") {
35579                         var so = getOffset(target),
35580                             sr = target.createSVGRect();
35581                         sr.x = x - so.x;
35582                         sr.y = y - so.y;
35583                         sr.width = sr.height = 1;
35584                         var hits = target.getIntersectionList(sr, null);
35585                         if (hits.length) {
35586                             target = hits[hits.length - 1];
35587                         }
35588                     }
35589                     if (!target) {
35590                         return null;
35591                     }
35592                     return wrap(target);
35593                 };
35594                 /*
35595                  * \ Snap.plugin [ method ] * Let you write plugins. You pass in a function with
35596                  * four arguments, like this: | Snap.plugin(function (Snap, Element, Paper,
35597                  * global, Fragment) { | Snap.newmethod = function () {}; |
35598                  * Element.prototype.newmethod = function () {}; | Paper.prototype.newmethod =
35599                  * function () {}; | }); Inside the function you have access to all main objects
35600                  * (and their prototypes). This allow you to extend anything you want. * - f
35601                  * (function) your plugin body \
35602                  */
35603                 Snap.plugin = function(f) {
35604                     f(Snap, Element, Paper, glob, Fragment);
35605                 };
35606                 glob.win.Snap = Snap;
35607                 return Snap;
35608             }(window || this));
35609             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
35610             //
35611             // Licensed under the Apache License, Version 2.0 (the "License");
35612             // you may not use this file except in compliance with the License.
35613             // You may obtain a copy of the License at
35614             //
35615             // http://www.apache.org/licenses/LICENSE-2.0
35616             //
35617             // Unless required by applicable law or agreed to in writing, software
35618             // distributed under the License is distributed on an "AS IS" BASIS,
35619             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35620             // See the License for the specific language governing permissions and
35621             // limitations under the License.
35622             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
35623                 var elproto = Element.prototype,
35624                     is = Snap.is,
35625                     Str = String,
35626                     unit2px = Snap._unit2px,
35627                     $ = Snap._.$,
35628                     make = Snap._.make,
35629                     getSomeDefs = Snap._.getSomeDefs,
35630                     has = "hasOwnProperty",
35631                     wrap = Snap._.wrap;
35632                 /*
35633                  * \ Element.getBBox [ method ] * Returns the bounding box descriptor for
35634                  * the given element * = (object) bounding box descriptor: o { o cx:
35635                  * (number) x of the center, o cy: (number) x of the center, o h: (number)
35636                  * height, o height: (number) height, o path: (string) path command for the
35637                  * box, o r0: (number) radius of a circle that fully encloses the box, o r1:
35638                  * (number) radius of the smallest circle that can be enclosed, o r2:
35639                  * (number) radius of the largest circle that can be enclosed, o vb:
35640                  * (string) box as a viewbox command, o w: (number) width, o width: (number)
35641                  * width, o x2: (number) x of the right side, o x: (number) x of the left
35642                  * side, o y2: (number) y of the bottom edge, o y: (number) y of the top
35643                  * edge o } \
35644                  */
35645                 elproto.getBBox = function(isWithoutTransform) {
35646                     if (!Snap.Matrix || !Snap.path) {
35647                         return this.node.getBBox();
35648                     }
35649                     var el = this,
35650                         m = new Snap.Matrix;
35651                     if (el.removed) {
35652                         return Snap._.box();
35653                     }
35654                     while (el.type == "use") {
35655                         if (!isWithoutTransform) {
35656                             m = m.add(el.transform().localMatrix.translate(el.attr("x") || 0, el.attr("y") || 0));
35657                         }
35658                         if (el.original) {
35659                             el = el.original;
35660                         } else {
35661                             var href = el.attr("xlink:href");
35662                             el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf("#") + 1));
35663                         }
35664                     }
35665                     var _ = el._,
35666                         pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;
35667                     try {
35668                         if (isWithoutTransform) {
35669                             _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());
35670                             return Snap._.box(_.bboxwt);
35671                         } else {
35672                             el.realPath = pathfinder(el);
35673                             el.matrix = el.transform().localMatrix;
35674                             _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));
35675                             return Snap._.box(_.bbox);
35676                         }
35677                     } catch (e) {
35678                         // Firefox doesn’t give you bbox of hidden element
35679                         return Snap._.box();
35680                     }
35681                 };
35682                 var propString = function() {
35683                     return this.string;
35684                 };
35685
35686                 function extractTransform(el, tstr) {
35687                     if (tstr == null) {
35688                         var doReturn = true;
35689                         if (el.type == "linearGradient" || el.type == "radialGradient") {
35690                             tstr = el.node.getAttribute("gradientTransform");
35691                         } else if (el.type == "pattern") {
35692                             tstr = el.node.getAttribute("patternTransform");
35693                         } else {
35694                             tstr = el.node.getAttribute("transform");
35695                         }
35696                         if (!tstr) {
35697                             return new Snap.Matrix;
35698                         }
35699                         tstr = Snap._.svgTransform2string(tstr);
35700                     } else {
35701                         if (!Snap._.rgTransform.test(tstr)) {
35702                             tstr = Snap._.svgTransform2string(tstr);
35703                         } else {
35704                             tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E);
35705                         }
35706                         if (is(tstr, "array")) {
35707                             tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);
35708                         }
35709                         el._.transform = tstr;
35710                     }
35711                     var m = Snap._.transform2matrix(tstr, el.getBBox(1));
35712                     if (doReturn) {
35713                         return m;
35714                     } else {
35715                         el.matrix = m;
35716                     }
35717                 }
35718                 /*
35719                  * \ Element.transform [ method ] * Gets or sets transformation of the
35720                  * element * - tstr (string) transform string in Snap or SVG format =
35721                  * (Element) the current element or = (object) transformation descriptor: o {
35722                  * o string (string) transform string, o globalMatrix (Matrix) matrix of all
35723                  * transformations applied to element or its parents, o localMatrix (Matrix)
35724                  * matrix of transformations applied only to the element, o diffMatrix
35725                  * (Matrix) matrix of difference between global and local transformations, o
35726                  * global (string) global transformation as string, o local (string) local
35727                  * transformation as string, o toString (function) returns `string` property
35728                  * o } \
35729                  */
35730                 elproto.transform = function(tstr) {
35731                     var _ = this._;
35732                     if (tstr == null) {
35733                         var papa = this,
35734                             global = new Snap.Matrix(this.node.getCTM()),
35735                             local = extractTransform(this),
35736                             ms = [local],
35737                             m = new Snap.Matrix,
35738                             i,
35739                             localString = local.toTransformString(),
35740                             string = Str(local) == Str(this.matrix) ?
35741                             Str(_.transform) : localString;
35742                         while (papa.type != "svg" && (papa = papa.parent())) {
35743                             ms.push(extractTransform(papa));
35744                         }
35745                         i = ms.length;
35746                         while (i--) {
35747                             m.add(ms[i]);
35748                         }
35749                         return {
35750                             string: string,
35751                             globalMatrix: global,
35752                             totalMatrix: m,
35753                             localMatrix: local,
35754                             diffMatrix: global.clone().add(local.invert()),
35755                             global: global.toTransformString(),
35756                             total: m.toTransformString(),
35757                             local: localString,
35758                             toString: propString
35759                         };
35760                     }
35761                     if (tstr instanceof Snap.Matrix) {
35762                         this.matrix = tstr;
35763                         this._.transform = tstr.toTransformString();
35764                     } else {
35765                         extractTransform(this, tstr);
35766                     }
35767
35768                     if (this.node) {
35769                         if (this.type == "linearGradient" || this.type == "radialGradient") {
35770                             $(this.node, {
35771                                 gradientTransform: this.matrix
35772                             });
35773                         } else if (this.type == "pattern") {
35774                             $(this.node, {
35775                                 patternTransform: this.matrix
35776                             });
35777                         } else {
35778                             $(this.node, {
35779                                 transform: this.matrix
35780                             });
35781                         }
35782                     }
35783
35784                     return this;
35785                 };
35786                 /*
35787                  * \ Element.parent [ method ] * Returns the element's parent * = (Element)
35788                  * the parent element \
35789                  */
35790                 elproto.parent = function() {
35791                     return wrap(this.node.parentNode);
35792                 };
35793                 /*
35794                  * \ Element.append [ method ] * Appends the given element to current one * -
35795                  * el (Element|Set) element to append = (Element) the parent element \
35796                  */
35797                 /*
35798                  * \ Element.add [ method ] * See @Element.append \
35799                  */
35800                 elproto.append = elproto.add = function(el) {
35801                     if (el) {
35802                         if (el.type == "set") {
35803                             var it = this;
35804                             el.forEach(function(el) {
35805                                 it.add(el);
35806                             });
35807                             return this;
35808                         }
35809                         el = wrap(el);
35810                         this.node.appendChild(el.node);
35811                         el.paper = this.paper;
35812                     }
35813                     return this;
35814                 };
35815                 /*
35816                  * \ Element.appendTo [ method ] * Appends the current element to the given
35817                  * one * - el (Element) parent element to append to = (Element) the child
35818                  * element \
35819                  */
35820                 elproto.appendTo = function(el) {
35821                     if (el) {
35822                         el = wrap(el);
35823                         el.append(this);
35824                     }
35825                     return this;
35826                 };
35827                 /*
35828                  * \ Element.prepend [ method ] * Prepends the given element to the current
35829                  * one * - el (Element) element to prepend = (Element) the parent element \
35830                  */
35831                 elproto.prepend = function(el) {
35832                     if (el) {
35833                         if (el.type == "set") {
35834                             var it = this,
35835                                 first;
35836                             el.forEach(function(el) {
35837                                 if (first) {
35838                                     first.after(el);
35839                                 } else {
35840                                     it.prepend(el);
35841                                 }
35842                                 first = el;
35843                             });
35844                             return this;
35845                         }
35846                         el = wrap(el);
35847                         var parent = el.parent();
35848                         this.node.insertBefore(el.node, this.node.firstChild);
35849                         this.add && this.add();
35850                         el.paper = this.paper;
35851                         this.parent() && this.parent().add();
35852                         parent && parent.add();
35853                     }
35854                     return this;
35855                 };
35856                 /*
35857                  * \ Element.prependTo [ method ] * Prepends the current element to the
35858                  * given one * - el (Element) parent element to prepend to = (Element) the
35859                  * child element \
35860                  */
35861                 elproto.prependTo = function(el) {
35862                     el = wrap(el);
35863                     el.prepend(this);
35864                     return this;
35865                 };
35866                 /*
35867                  * \ Element.before [ method ] * Inserts given element before the current
35868                  * one * - el (Element) element to insert = (Element) the parent element \
35869                  */
35870                 elproto.before = function(el) {
35871                     if (el.type == "set") {
35872                         var it = this;
35873                         el.forEach(function(el) {
35874                             var parent = el.parent();
35875                             it.node.parentNode.insertBefore(el.node, it.node);
35876                             parent && parent.add();
35877                         });
35878                         this.parent().add();
35879                         return this;
35880                     }
35881                     el = wrap(el);
35882                     var parent = el.parent();
35883                     this.node.parentNode.insertBefore(el.node, this.node);
35884                     this.parent() && this.parent().add();
35885                     parent && parent.add();
35886                     el.paper = this.paper;
35887                     return this;
35888                 };
35889                 /*
35890                  * \ Element.after [ method ] * Inserts given element after the current one * -
35891                  * el (Element) element to insert = (Element) the parent element \
35892                  */
35893                 elproto.after = function(el) {
35894                     el = wrap(el);
35895                     var parent = el.parent();
35896                     if (this.node.nextSibling) {
35897                         this.node.parentNode.insertBefore(el.node, this.node.nextSibling);
35898                     } else {
35899                         this.node.parentNode.appendChild(el.node);
35900                     }
35901                     this.parent() && this.parent().add();
35902                     parent && parent.add();
35903                     el.paper = this.paper;
35904                     return this;
35905                 };
35906                 /*
35907                  * \ Element.insertBefore [ method ] * Inserts the element after the given
35908                  * one * - el (Element) element next to whom insert to = (Element) the
35909                  * parent element \
35910                  */
35911                 elproto.insertBefore = function(el) {
35912                     el = wrap(el);
35913                     var parent = this.parent();
35914                     el.node.parentNode.insertBefore(this.node, el.node);
35915                     this.paper = el.paper;
35916                     parent && parent.add();
35917                     el.parent() && el.parent().add();
35918                     return this;
35919                 };
35920                 /*
35921                  * \ Element.insertAfter [ method ] * Inserts the element after the given
35922                  * one * - el (Element) element next to whom insert to = (Element) the
35923                  * parent element \
35924                  */
35925                 elproto.insertAfter = function(el) {
35926                     el = wrap(el);
35927                     var parent = this.parent();
35928                     el.node.parentNode.insertBefore(this.node, el.node.nextSibling);
35929                     this.paper = el.paper;
35930                     parent && parent.add();
35931                     el.parent() && el.parent().add();
35932                     return this;
35933                 };
35934                 /*
35935                  * \ Element.remove [ method ] * Removes element from the DOM = (Element)
35936                  * the detached element \
35937                  */
35938                 elproto.remove = function() {
35939                     var parent = this.parent();
35940                     this.node.parentNode && this.node.parentNode.removeChild(this.node);
35941                     delete this.paper;
35942                     this.removed = true;
35943                     parent && parent.add();
35944                     return this;
35945                 };
35946                 /*
35947                  * \ Element.select [ method ] * Gathers the nested @Element matching the
35948                  * given set of CSS selectors * - query (string) CSS selector = (Element)
35949                  * result of query selection \
35950                  */
35951                 elproto.select = function(query) {
35952                     query = Str(query).replace(/([^\\]):/g, "$1\\:");
35953                     return wrap(this.node.querySelector(query));
35954                 };
35955                 /*
35956                  * \ Element.selectAll [ method ] * Gathers nested @Element objects matching
35957                  * the given set of CSS selectors * - query (string) CSS selector =
35958                  * (Set|array) result of query selection \
35959                  */
35960                 elproto.selectAll = function(query) {
35961                     var nodelist = this.node.querySelectorAll(query),
35962                         set = (Snap.set || Array)();
35963                     for (var i = 0; i < nodelist.length; i++) {
35964                         set.push(wrap(nodelist[i]));
35965                     }
35966                     return set;
35967                 };
35968                 /*
35969                  * \ Element.asPX [ method ] * Returns given attribute of the element as a
35970                  * `px` value (not %, em, etc.) * - attr (string) attribute name - value
35971                  * (string) #optional attribute value = (Element) result of query selection \
35972                  */
35973                 elproto.asPX = function(attr, value) {
35974                     if (value == null) {
35975                         value = this.attr(attr);
35976                     }
35977                     return +unit2px(this, attr, value);
35978                 };
35979                 // SIERRA Element.use(): I suggest adding a note about how to access the
35980                 // original element the returned <use> instantiates. It's a part of SVG with
35981                 // which ordinary web developers may be least familiar.
35982                 /*
35983                  * \ Element.use [ method ] * Creates a `<use>` element linked to the
35984                  * current element * = (Element) the `<use>` element \
35985                  */
35986                 elproto.use = function() {
35987                     var use,
35988                         id = this.node.id;
35989                     if (!id) {
35990                         id = this.id;
35991                         $(this.node, {
35992                             id: id
35993                         });
35994                     }
35995                     if (this.type == "linearGradient" || this.type == "radialGradient" ||
35996                         this.type == "pattern") {
35997                         use = make(this.type, this.node.parentNode);
35998                     } else {
35999                         use = make("use", this.node.parentNode);
36000                     }
36001                     $(use.node, {
36002                         "xlink:href": "#" + id
36003                     });
36004                     use.original = this;
36005                     return use;
36006                 };
36007
36008                 function fixids(el) {
36009                     var els = el.selectAll("*"),
36010                         it,
36011                         url = /^\s*url\(("|'|)(.*)\1\)\s*$/,
36012                         ids = [],
36013                         uses = {};
36014
36015                     function urltest(it, name) {
36016                         var val = $(it.node, name);
36017                         val = val && val.match(url);
36018                         val = val && val[2];
36019                         if (val && val.charAt() == "#") {
36020                             val = val.substring(1);
36021                         } else {
36022                             return;
36023                         }
36024                         if (val) {
36025                             uses[val] = (uses[val] || []).concat(function(id) {
36026                                 var attr = {};
36027                                 attr[name] = URL(id);
36028                                 $(it.node, attr);
36029                             });
36030                         }
36031                     }
36032
36033                     function linktest(it) {
36034                         var val = $(it.node, "xlink:href");
36035                         if (val && val.charAt() == "#") {
36036                             val = val.substring(1);
36037                         } else {
36038                             return;
36039                         }
36040                         if (val) {
36041                             uses[val] = (uses[val] || []).concat(function(id) {
36042                                 it.attr("xlink:href", "#" + id);
36043                             });
36044                         }
36045                     }
36046                     for (var i = 0, ii = els.length; i < ii; i++) {
36047                         it = els[i];
36048                         urltest(it, "fill");
36049                         urltest(it, "stroke");
36050                         urltest(it, "filter");
36051                         urltest(it, "mask");
36052                         urltest(it, "clip-path");
36053                         linktest(it);
36054                         var oldid = $(it.node, "id");
36055                         if (oldid) {
36056                             $(it.node, {
36057                                 id: it.id
36058                             });
36059                             ids.push({
36060                                 old: oldid,
36061                                 id: it.id
36062                             });
36063                         }
36064                     }
36065                     for (i = 0, ii = ids.length; i < ii; i++) {
36066                         var fs = uses[ids[i].old];
36067                         if (fs) {
36068                             for (var j = 0, jj = fs.length; j < jj; j++) {
36069                                 fs[j](ids[i].id);
36070                             }
36071                         }
36072                     }
36073                 }
36074                 /*
36075                  * \ Element.clone [ method ] * Creates a clone of the element and inserts
36076                  * it after the element * = (Element) the clone \
36077                  */
36078                 elproto.clone = function() {
36079                     var clone = wrap(this.node.cloneNode(true));
36080                     if ($(clone.node, "id")) {
36081                         $(clone.node, {
36082                             id: clone.id
36083                         });
36084                     }
36085                     fixids(clone);
36086                     clone.insertAfter(this);
36087                     return clone;
36088                 };
36089                 /*
36090                  * \ Element.toDefs [ method ] * Moves element to the shared `<defs>` area * =
36091                  * (Element) the element \
36092                  */
36093                 elproto.toDefs = function() {
36094                     var defs = getSomeDefs(this);
36095                     defs.appendChild(this.node);
36096                     return this;
36097                 };
36098                 /*
36099                  * \ Element.toPattern [ method ] * Creates a `<pattern>` element from the
36100                  * current element * To create a pattern you have to specify the pattern
36101                  * rect: - x (string|number) - y (string|number) - width (string|number) -
36102                  * height (string|number) = (Element) the `<pattern>` element You can use
36103                  * pattern later on as an argument for `fill` attribute: | var p =
36104                  * paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({ | fill: "none", |
36105                  * stroke: "#bada55", | strokeWidth: 5 | }).pattern(0, 0, 10, 10), | c =
36106                  * paper.circle(200, 200, 100); | c.attr({ | fill: p | }); \
36107                  */
36108                 elproto.pattern = elproto.toPattern = function(x, y, width, height) {
36109                     var p = make("pattern", getSomeDefs(this));
36110                     if (x == null) {
36111                         x = this.getBBox();
36112                     }
36113                     if (is(x, "object") && "x" in x) {
36114                         y = x.y;
36115                         width = x.width;
36116                         height = x.height;
36117                         x = x.x;
36118                     }
36119                     $(p.node, {
36120                         x: x,
36121                         y: y,
36122                         width: width,
36123                         height: height,
36124                         patternUnits: "userSpaceOnUse",
36125                         id: p.id,
36126                         viewBox: [x, y, width, height].join(" ")
36127                     });
36128                     p.node.appendChild(this.node);
36129                     return p;
36130                 };
36131                 // SIERRA Element.marker(): clarify what a reference point is. E.g., helps you
36132                 // offset the object from its edge such as when centering it over a path.
36133                 // SIERRA Element.marker(): I suggest the method should accept default reference
36134                 // point values. Perhaps centered with (refX = width/2) and (refY = height/2)?
36135                 // Also, couldn't it assume the element's current _width_ and _height_? And
36136                 // please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't
36137                 // they also be assigned default values?
36138                 /*
36139                  * \ Element.marker [ method ] * Creates a `<marker>` element from the
36140                  * current element * To create a marker you have to specify the bounding
36141                  * rect and reference point: - x (number) - y (number) - width (number) -
36142                  * height (number) - refX (number) - refY (number) = (Element) the `<marker>`
36143                  * element You can specify the marker later as an argument for
36144                  * `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The
36145                  * `marker` attribute places the marker at every point along the path, and
36146                  * `marker-mid` places them at every point except the start and end. \
36147                  */
36148                 // TODO add usage for markers
36149                 elproto.marker = function(x, y, width, height, refX, refY) {
36150                     var p = make("marker", getSomeDefs(this));
36151                     if (x == null) {
36152                         x = this.getBBox();
36153                     }
36154                     if (is(x, "object") && "x" in x) {
36155                         y = x.y;
36156                         width = x.width;
36157                         height = x.height;
36158                         refX = x.refX || x.cx;
36159                         refY = x.refY || x.cy;
36160                         x = x.x;
36161                     }
36162                     $(p.node, {
36163                         viewBox: [x, y, width, height].join(" "),
36164                         markerWidth: width,
36165                         markerHeight: height,
36166                         orient: "auto",
36167                         refX: refX || 0,
36168                         refY: refY || 0,
36169                         id: p.id
36170                     });
36171                     p.node.appendChild(this.node);
36172                     return p;
36173                 };
36174                 // animation
36175                 function slice(from, to, f) {
36176                     return function(arr) {
36177                         var res = arr.slice(from, to);
36178                         if (res.length == 1) {
36179                             res = res[0];
36180                         }
36181                         return f ? f(res) : res;
36182                     };
36183                 }
36184                 var Animation = function(attr, ms, easing, callback) {
36185                     if (typeof easing == "function" && !easing.length) {
36186                         callback = easing;
36187                         easing = mina.linear;
36188                     }
36189                     this.attr = attr;
36190                     this.dur = ms;
36191                     easing && (this.easing = easing);
36192                     callback && (this.callback = callback);
36193                 };
36194                 Snap._.Animation = Animation;
36195                 /*
36196                  * \ Snap.animation [ method ] * Creates an animation object * - attr
36197                  * (object) attributes of final destination - duration (number) duration of
36198                  * the animation, in milliseconds - easing (function) #optional one of
36199                  * easing functions of @mina or custom one - callback (function) #optional
36200                  * callback function that fires when animation ends = (object) animation
36201                  * object \
36202                  */
36203                 Snap.animation = function(attr, ms, easing, callback) {
36204                     return new Animation(attr, ms, easing, callback);
36205                 };
36206                 /*
36207                  * \ Element.inAnim [ method ] * Returns a set of animations that may be
36208                  * able to manipulate the current element * = (object) in format: o { o anim
36209                  * (object) animation object, o mina (object) @mina object, o curStatus
36210                  * (number) 0..1 ÃƒÆ’¢â‚¬â€� status of the animation: 0 ÃƒÆ’¢â‚¬â€� just started,
36211                  * 1 ÃƒÆ’¢â‚¬â€� just finished, o status (function) gets or sets the status of
36212                  * the animation, o stop (function) stops the animation o } \
36213                  */
36214                 elproto.inAnim = function() {
36215                     var el = this,
36216                         res = [];
36217                     for (var id in el.anims)
36218                         if (el.anims[has](id)) {
36219                             (function(a) {
36220                                 res.push({
36221                                     anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
36222                                     mina: a,
36223                                     curStatus: a.status(),
36224                                     status: function(val) {
36225                                         return a.status(val);
36226                                     },
36227                                     stop: function() {
36228                                         a.stop();
36229                                     }
36230                                 });
36231                             }(el.anims[id]));
36232                         }
36233                     return res;
36234                 };
36235                 /*
36236                  * \ Snap.animate [ method ] * Runs generic animation of one number into
36237                  * another with a caring function * - from (number|array) number or array of
36238                  * numbers - to (number|array) number or array of numbers - setter
36239                  * (function) caring function that accepts one number argument - duration
36240                  * (number) duration, in milliseconds - easing (function) #optional easing
36241                  * function from @mina or custom - callback (function) #optional callback
36242                  * function to execute when animation ends = (object) animation object in
36243                  * @mina format o { o id (string) animation id, consider it read-only, o
36244                  * duration (function) gets or sets the duration of the animation, o easing
36245                  * (function) easing, o speed (function) gets or sets the speed of the
36246                  * animation, o status (function) gets or sets the status of the animation,
36247                  * o stop (function) stops the animation o } | var rect = Snap().rect(0, 0,
36248                  * 10, 10); | Snap.animate(0, 10, function (val) { | rect.attr({ | x: val |
36249                  * }); | }, 1000); | // in given context is equivalent to | rect.animate({x:
36250                  * 10}, 1000); \
36251                  */
36252                 Snap.animate = function(from, to, setter, ms, easing, callback) {
36253                     if (typeof easing == "function" && !easing.length) {
36254                         callback = easing;
36255                         easing = mina.linear;
36256                     }
36257                     var now = mina.time(),
36258                         anim = mina(from, to, now, now + ms, mina.time, setter, easing);
36259                     callback && eve.once("mina.finish." + anim.id, callback);
36260                     return anim;
36261                 };
36262                 /*
36263                  * \ Element.stop [ method ] * Stops all the animations for the current
36264                  * element * = (Element) the current element \
36265                  */
36266                 elproto.stop = function() {
36267                     var anims = this.inAnim();
36268                     for (var i = 0, ii = anims.length; i < ii; i++) {
36269                         anims[i].stop();
36270                     }
36271                     return this;
36272                 };
36273                 /*
36274                  * \ Element.animate [ method ] * Animates the given attributes of the
36275                  * element * - attrs (object) key-value pairs of destination attributes -
36276                  * duration (number) duration of the animation in milliseconds - easing
36277                  * (function) #optional easing function from @mina or custom - callback
36278                  * (function) #optional callback function that executes when the animation
36279                  * ends = (Element) the current element \
36280                  */
36281                 elproto.animate = function(attrs, ms, easing, callback) {
36282                     if (typeof easing == "function" && !easing.length) {
36283                         callback = easing;
36284                         easing = mina.linear;
36285                     }
36286                     if (attrs instanceof Animation) {
36287                         callback = attrs.callback;
36288                         easing = attrs.easing;
36289                         ms = easing.dur;
36290                         attrs = attrs.attr;
36291                     }
36292                     var fkeys = [],
36293                         tkeys = [],
36294                         keys = {},
36295                         from, to, f, eq,
36296                         el = this;
36297                     for (var key in attrs)
36298                         if (attrs[has](key)) {
36299                             if (el.equal) {
36300                                 eq = el.equal(key, Str(attrs[key]));
36301                                 from = eq.from;
36302                                 to = eq.to;
36303                                 f = eq.f;
36304                             } else {
36305                                 from = +el.attr(key);
36306                                 to = +attrs[key];
36307                             }
36308                             var len = is(from, "array") ? from.length : 1;
36309                             keys[key] = slice(fkeys.length, fkeys.length + len, f);
36310                             fkeys = fkeys.concat(from);
36311                             tkeys = tkeys.concat(to);
36312                         }
36313                     var now = mina.time(),
36314                         anim = mina(fkeys, tkeys, now, now + ms, mina.time, function(val) {
36315                             var attr = {};
36316                             for (var key in keys)
36317                                 if (keys[has](key)) {
36318                                     attr[key] = keys[key](val);
36319                                 }
36320                             el.attr(attr);
36321                         }, easing);
36322                     el.anims[anim.id] = anim;
36323                     anim._attrs = attrs;
36324                     anim._callback = callback;
36325                     eve("snap.animcreated." + el.id, anim);
36326                     eve.once("mina.finish." + anim.id, function() {
36327                         delete el.anims[anim.id];
36328                         callback && callback.call(el);
36329                     });
36330                     eve.once("mina.stop." + anim.id, function() {
36331                         delete el.anims[anim.id];
36332                     });
36333                     return el;
36334                 };
36335                 var eldata = {};
36336                 /*
36337                  * \ Element.data [ method ] * Adds or retrieves given value associated with
36338                  * given key. (Don’t confuse with `data-` attributes)
36339                  * 
36340                  * See also @Element.removeData - key (string) key to store data - value
36341                  * (any) #optional value to store = (object) @Element or, if value is not
36342                  * specified: = (any) value > Usage | for (var i = 0, i < 5, i++) { |
36343                  * paper.circle(10 + 15 * i, 10, 10) | .attr({fill: "#000"}) | .data("i", i) |
36344                  * .click(function () { | alert(this.data("i")); | }); | } \
36345                  */
36346                 elproto.data = function(key, value) {
36347                     var data = eldata[this.id] = eldata[this.id] || {};
36348                     if (arguments.length == 0) {
36349                         eve("snap.data.get." + this.id, this, data, null);
36350                         return data;
36351                     }
36352                     if (arguments.length == 1) {
36353                         if (Snap.is(key, "object")) {
36354                             for (var i in key)
36355                                 if (key[has](i)) {
36356                                     this.data(i, key[i]);
36357                                 }
36358                             return this;
36359                         }
36360                         eve("snap.data.get." + this.id, this, data[key], key);
36361                         return data[key];
36362                     }
36363                     data[key] = value;
36364                     eve("snap.data.set." + this.id, this, value, key);
36365                     return this;
36366                 };
36367                 /*
36368                  * \ Element.removeData [ method ] * Removes value associated with an
36369                  * element by given key. If key is not provided, removes all the data of the
36370                  * element. - key (string) #optional key = (object) @Element \
36371                  */
36372                 elproto.removeData = function(key) {
36373                     if (key == null) {
36374                         eldata[this.id] = {};
36375                     } else {
36376                         eldata[this.id] && delete eldata[this.id][key];
36377                     }
36378                     return this;
36379                 };
36380                 /*
36381                  * \ Element.outerSVG [ method ] * Returns SVG code for the element,
36382                  * equivalent to HTML's `outerHTML`.
36383                  * 
36384                  * See also @Element.innerSVG = (string) SVG code for the element \
36385                  */
36386                 /*
36387                  * \ Element.toString [ method ] * See @Element.outerSVG \
36388                  */
36389                 elproto.outerSVG = elproto.toString = toString(1);
36390                 /*
36391                  * \ Element.innerSVG [ method ] * Returns SVG code for the element's
36392                  * contents, equivalent to HTML's `innerHTML` = (string) SVG code for the
36393                  * element \
36394                  */
36395                 elproto.innerSVG = toString();
36396
36397                 function toString(type) {
36398                     return function() {
36399                         var res = type ? "<" + this.type : "",
36400                             attr = this.node.attributes,
36401                             chld = this.node.childNodes;
36402                         if (type) {
36403                             for (var i = 0, ii = attr.length; i < ii; i++) {
36404                                 res += " " + attr[i].name + '="' +
36405                                     attr[i].value.replace(/"/g, '\\"') + '"';
36406                             }
36407                         }
36408                         if (chld.length) {
36409                             type && (res += ">");
36410                             for (i = 0, ii = chld.length; i < ii; i++) {
36411                                 if (chld[i].nodeType == 3) {
36412                                     res += chld[i].nodeValue;
36413                                 } else if (chld[i].nodeType == 1) {
36414                                     res += wrap(chld[i]).toString();
36415                                 }
36416                             }
36417                             type && (res += "</" + this.type + ">");
36418                         } else {
36419                             type && (res += "/>");
36420                         }
36421                         return res;
36422                     };
36423                 }
36424                 elproto.toDataURL = function() {
36425                     if (window && window.btoa) {
36426                         var bb = this.getBBox(),
36427                             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>', {
36428                                 x: +bb.x.toFixed(3),
36429                                 y: +bb.y.toFixed(3),
36430                                 width: +bb.width.toFixed(3),
36431                                 height: +bb.height.toFixed(3),
36432                                 contents: this.outerSVG()
36433                             });
36434                         return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svg)));
36435                     }
36436                 };
36437                 /*
36438                  * \ Fragment.select [ method ] * See @Element.select \
36439                  */
36440                 Fragment.prototype.select = elproto.select;
36441                 /*
36442                  * \ Fragment.selectAll [ method ] * See @Element.selectAll \
36443                  */
36444                 Fragment.prototype.selectAll = elproto.selectAll;
36445             });
36446
36447             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
36448             // 
36449             // Licensed under the Apache License, Version 2.0 (the "License");
36450             // you may not use this file except in compliance with the License.
36451             // You may obtain a copy of the License at
36452             // 
36453             // http://www.apache.org/licenses/LICENSE-2.0
36454             // 
36455             // Unless required by applicable law or agreed to in writing, software
36456             // distributed under the License is distributed on an "AS IS" BASIS,
36457             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36458             // See the License for the specific language governing permissions and
36459             // limitations under the License.
36460             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
36461                 var objectToString = Object.prototype.toString,
36462                     Str = String,
36463                     math = Math,
36464                     E = "";
36465
36466                 function Matrix(a, b, c, d, e, f) {
36467                     if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
36468                         this.a = a.a;
36469                         this.b = a.b;
36470                         this.c = a.c;
36471                         this.d = a.d;
36472                         this.e = a.e;
36473                         this.f = a.f;
36474                         return;
36475                     }
36476                     if (a != null) {
36477                         this.a = +a;
36478                         this.b = +b;
36479                         this.c = +c;
36480                         this.d = +d;
36481                         this.e = +e;
36482                         this.f = +f;
36483                     } else {
36484                         this.a = 1;
36485                         this.b = 0;
36486                         this.c = 0;
36487                         this.d = 1;
36488                         this.e = 0;
36489                         this.f = 0;
36490                     }
36491                 }
36492                 (function(matrixproto) {
36493                     /*
36494                      * \ Matrix.add [ method ] * Adds the given matrix to existing one - a
36495                      * (number) - b (number) - c (number) - d (number) - e (number) - f
36496                      * (number) or - matrix (object) @Matrix \
36497                      */
36498                     matrixproto.add = function(a, b, c, d, e, f) {
36499                         var out = [
36500                                 [],
36501                                 [],
36502                                 []
36503                             ],
36504                             m = [
36505                                 [this.a, this.c, this.e],
36506                                 [this.b, this.d, this.f],
36507                                 [0, 0, 1]
36508                             ],
36509                             matrix = [
36510                                 [a, c, e],
36511                                 [b, d, f],
36512                                 [0, 0, 1]
36513                             ],
36514                             x, y, z, res;
36515
36516                         if (a && a instanceof Matrix) {
36517                             matrix = [
36518                                 [a.a, a.c, a.e],
36519                                 [a.b, a.d, a.f],
36520                                 [0, 0, 1]
36521                             ];
36522                         }
36523
36524                         for (x = 0; x < 3; x++) {
36525                             for (y = 0; y < 3; y++) {
36526                                 res = 0;
36527                                 for (z = 0; z < 3; z++) {
36528                                     res += m[x][z] * matrix[z][y];
36529                                 }
36530                                 out[x][y] = res;
36531                             }
36532                         }
36533                         this.a = out[0][0];
36534                         this.b = out[1][0];
36535                         this.c = out[0][1];
36536                         this.d = out[1][1];
36537                         this.e = out[0][2];
36538                         this.f = out[1][2];
36539                         return this;
36540                     };
36541                     /*
36542                      * \ Matrix.invert [ method ] * Returns an inverted version of the
36543                      * matrix = (object) @Matrix \
36544                      */
36545                     matrixproto.invert = function() {
36546                         var me = this,
36547                             x = me.a * me.d - me.b * me.c;
36548                         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);
36549                     };
36550                     /*
36551                      * \ Matrix.clone [ method ] * Returns a copy of the matrix = (object)
36552                      * @Matrix \
36553                      */
36554                     matrixproto.clone = function() {
36555                         return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
36556                     };
36557                     /*
36558                      * \ Matrix.translate [ method ] * Translate the matrix - x (number)
36559                      * horizontal offset distance - y (number) vertical offset distance \
36560                      */
36561                     matrixproto.translate = function(x, y) {
36562                         return this.add(1, 0, 0, 1, x, y);
36563                     };
36564                     /*
36565                      * \ Matrix.scale [ method ] * Scales the matrix - x (number) amount to
36566                      * be scaled, with `1` resulting in no change - y (number) #optional
36567                      * amount to scale along the vertical axis. (Otherwise `x` applies to
36568                      * both axes.) - cx (number) #optional horizontal origin point from
36569                      * which to scale - cy (number) #optional vertical origin point from
36570                      * which to scale Default cx, cy is the middle point of the element. \
36571                      */
36572                     matrixproto.scale = function(x, y, cx, cy) {
36573                         y == null && (y = x);
36574                         (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
36575                         this.add(x, 0, 0, y, 0, 0);
36576                         (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
36577                         return this;
36578                     };
36579                     /*
36580                      * \ Matrix.rotate [ method ] * Rotates the matrix - a (number) angle of
36581                      * rotation, in degrees - x (number) horizontal origin point from which
36582                      * to rotate - y (number) vertical origin point from which to rotate \
36583                      */
36584                     matrixproto.rotate = function(a, x, y) {
36585                         a = Snap.rad(a);
36586                         x = x || 0;
36587                         y = y || 0;
36588                         var cos = +math.cos(a).toFixed(9),
36589                             sin = +math.sin(a).toFixed(9);
36590                         this.add(cos, sin, -sin, cos, x, y);
36591                         return this.add(1, 0, 0, 1, -x, -y);
36592                     };
36593                     /*
36594                      * \ Matrix.x [ method ] * Returns x coordinate for given point after
36595                      * transformation described by the matrix. See also @Matrix.y - x
36596                      * (number) - y (number) = (number) x \
36597                      */
36598                     matrixproto.x = function(x, y) {
36599                         return x * this.a + y * this.c + this.e;
36600                     };
36601                     /*
36602                      * \ Matrix.y [ method ] * Returns y coordinate for given point after
36603                      * transformation described by the matrix. See also @Matrix.x - x
36604                      * (number) - y (number) = (number) y \
36605                      */
36606                     matrixproto.y = function(x, y) {
36607                         return x * this.b + y * this.d + this.f;
36608                     };
36609                     matrixproto.get = function(i) {
36610                         return +this[Str.fromCharCode(97 + i)].toFixed(4);
36611                     };
36612                     matrixproto.toString = function() {
36613                         return "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")";
36614                     };
36615                     matrixproto.offset = function() {
36616                         return [this.e.toFixed(4), this.f.toFixed(4)];
36617                     };
36618
36619                     function norm(a) {
36620                         return a[0] * a[0] + a[1] * a[1];
36621                     }
36622
36623                     function normalize(a) {
36624                         var mag = math.sqrt(norm(a));
36625                         a[0] && (a[0] /= mag);
36626                         a[1] && (a[1] /= mag);
36627                     }
36628                     /*
36629                      * \ Matrix.determinant [ method ] * Finds determinant of the given
36630                      * matrix. = (number) determinant \
36631                      */
36632                     matrixproto.determinant = function() {
36633                         return this.a * this.d - this.b * this.c;
36634                     };
36635                     /*
36636                      * \ Matrix.split [ method ] * Splits matrix into primitive
36637                      * transformations = (object) in format: o dx (number) translation by x
36638                      * o dy (number) translation by y o scalex (number) scale by x o scaley
36639                      * (number) scale by y o shear (number) shear o rotate (number) rotation
36640                      * in deg o isSimple (boolean) could it be represented via simple
36641                      * transformations \
36642                      */
36643                     matrixproto.split = function() {
36644                         var out = {};
36645                         // translation
36646                         out.dx = this.e;
36647                         out.dy = this.f;
36648
36649                         // scale and shear
36650                         var row = [
36651                             [this.a, this.c],
36652                             [this.b, this.d]
36653                         ];
36654                         out.scalex = math.sqrt(norm(row[0]));
36655                         normalize(row[0]);
36656
36657                         out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
36658                         row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
36659
36660                         out.scaley = math.sqrt(norm(row[1]));
36661                         normalize(row[1]);
36662                         out.shear /= out.scaley;
36663
36664                         if (this.determinant() < 0) {
36665                             out.scalex = -out.scalex;
36666                         }
36667
36668                         // rotation
36669                         var sin = -row[0][1],
36670                             cos = row[1][1];
36671                         if (cos < 0) {
36672                             out.rotate = Snap.deg(math.acos(cos));
36673                             if (sin < 0) {
36674                                 out.rotate = 360 - out.rotate;
36675                             }
36676                         } else {
36677                             out.rotate = Snap.deg(math.asin(sin));
36678                         }
36679
36680                         out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
36681                         out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
36682                         out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
36683                         return out;
36684                     };
36685                     /*
36686                      * \ Matrix.toTransformString [ method ] * Returns transform string that
36687                      * represents given matrix = (string) transform string \
36688                      */
36689                     matrixproto.toTransformString = function(shorter) {
36690                         var s = shorter || this.split();
36691                         if (!+s.shear.toFixed(9)) {
36692                             s.scalex = +s.scalex.toFixed(4);
36693                             s.scaley = +s.scaley.toFixed(4);
36694                             s.rotate = +s.rotate.toFixed(4);
36695                             return (s.dx || s.dy ? "t" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) +
36696                                 (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
36697                                 (s.rotate ? "r" + [+s.rotate.toFixed(4), 0, 0] : E);
36698                         } else {
36699                             return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
36700                         }
36701                     };
36702                 })(Matrix.prototype);
36703                 /*
36704                  * \ Snap.Matrix [ method ] * Matrix constructor, extend on your own risk.
36705                  * To create matrices use @Snap.matrix. \
36706                  */
36707                 Snap.Matrix = Matrix;
36708                 /*
36709                  * \ Snap.matrix [ method ] * Utility method * Returns a matrix based on the
36710                  * given parameters - a (number) - b (number) - c (number) - d (number) - e
36711                  * (number) - f (number) or - svgMatrix (SVGMatrix) = (object) @Matrix \
36712                  */
36713                 Snap.matrix = function(a, b, c, d, e, f) {
36714                     return new Matrix(a, b, c, d, e, f);
36715                 };
36716             });
36717             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
36718             // 
36719             // Licensed under the Apache License, Version 2.0 (the "License");
36720             // you may not use this file except in compliance with the License.
36721             // You may obtain a copy of the License at
36722             // 
36723             // http://www.apache.org/licenses/LICENSE-2.0
36724             // 
36725             // Unless required by applicable law or agreed to in writing, software
36726             // distributed under the License is distributed on an "AS IS" BASIS,
36727             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36728             // See the License for the specific language governing permissions and
36729             // limitations under the License.
36730             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
36731                 var has = "hasOwnProperty",
36732                     make = Snap._.make,
36733                     wrap = Snap._.wrap,
36734                     is = Snap.is,
36735                     getSomeDefs = Snap._.getSomeDefs,
36736                     reURLValue = /^url\(#?([^)]+)\)$/,
36737                     $ = Snap._.$,
36738                     URL = Snap.url,
36739                     Str = String,
36740                     separator = Snap._.separator,
36741                     E = "";
36742                 // Attributes event handlers
36743                 eve.on("snap.util.attr.mask", function(value) {
36744                     if (value instanceof Element || value instanceof Fragment) {
36745                         eve.stop();
36746                         if (value instanceof Fragment && value.node.childNodes.length == 1) {
36747                             value = value.node.firstChild;
36748                             getSomeDefs(this).appendChild(value);
36749                             value = wrap(value);
36750                         }
36751                         if (value.type == "mask") {
36752                             var mask = value;
36753                         } else {
36754                             mask = make("mask", getSomeDefs(this));
36755                             mask.node.appendChild(value.node);
36756                         }!mask.node.id && $(mask.node, {
36757                             id: mask.id
36758                         });
36759                         $(this.node, {
36760                             mask: URL(mask.id)
36761                         });
36762                     }
36763                 });
36764                 (function(clipIt) {
36765                     eve.on("snap.util.attr.clip", clipIt);
36766                     eve.on("snap.util.attr.clip-path", clipIt);
36767                     eve.on("snap.util.attr.clipPath", clipIt);
36768                 }(function(value) {
36769                     if (value instanceof Element || value instanceof Fragment) {
36770                         eve.stop();
36771                         if (value.type == "clipPath") {
36772                             var clip = value;
36773                         } else {
36774                             clip = make("clipPath", getSomeDefs(this));
36775                             clip.node.appendChild(value.node);
36776                             !clip.node.id && $(clip.node, {
36777                                 id: clip.id
36778                             });
36779                         }
36780                         $(this.node, {
36781                             "clip-path": URL(clip.node.id || clip.id)
36782                         });
36783                     }
36784                 }));
36785
36786                 function fillStroke(name) {
36787                     return function(value) {
36788                         eve.stop();
36789                         if (value instanceof Fragment && value.node.childNodes.length == 1 &&
36790                             (value.node.firstChild.tagName == "radialGradient" ||
36791                                 value.node.firstChild.tagName == "linearGradient" ||
36792                                 value.node.firstChild.tagName == "pattern")) {
36793                             value = value.node.firstChild;
36794                             getSomeDefs(this).appendChild(value);
36795                             value = wrap(value);
36796                         }
36797                         if (value instanceof Element) {
36798                             if (value.type == "radialGradient" || value.type == "linearGradient" || value.type == "pattern") {
36799                                 if (!value.node.id) {
36800                                     $(value.node, {
36801                                         id: value.id
36802                                     });
36803                                 }
36804                                 var fill = URL(value.node.id);
36805                             } else {
36806                                 fill = value.attr(name);
36807                             }
36808                         } else {
36809                             fill = Snap.color(value);
36810                             if (fill.error) {
36811                                 var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);
36812                                 if (grad) {
36813                                     if (!grad.node.id) {
36814                                         $(grad.node, {
36815                                             id: grad.id
36816                                         });
36817                                     }
36818                                     fill = URL(grad.node.id);
36819                                 } else {
36820                                     fill = value;
36821                                 }
36822                             } else {
36823                                 fill = Str(fill);
36824                             }
36825                         }
36826                         var attrs = {};
36827                         attrs[name] = fill;
36828                         $(this.node, attrs);
36829                         this.node.style[name] = E;
36830                     };
36831                 }
36832                 eve.on("snap.util.attr.fill", fillStroke("fill"));
36833                 eve.on("snap.util.attr.stroke", fillStroke("stroke"));
36834                 var gradrg = /^([lr])(?:\(([^)]*)\))?(.*)$/i;
36835                 eve.on("snap.util.grad.parse", function parseGrad(string) {
36836                     string = Str(string);
36837                     var tokens = string.match(gradrg);
36838                     if (!tokens) {
36839                         return null;
36840                     }
36841                     var type = tokens[1],
36842                         params = tokens[2],
36843                         stops = tokens[3];
36844                     params = params.split(/\s*,\s*/).map(function(el) {
36845                         return +el == el ? +el : el;
36846                     });
36847                     if (params.length == 1 && params[0] == 0) {
36848                         params = [];
36849                     }
36850                     stops = stops.split("-");
36851                     stops = stops.map(function(el) {
36852                         el = el.split(":");
36853                         var out = {
36854                             color: el[0]
36855                         };
36856                         if (el[1]) {
36857                             out.offset = parseFloat(el[1]);
36858                         }
36859                         return out;
36860                     });
36861                     return {
36862                         type: type,
36863                         params: params,
36864                         stops: stops
36865                     };
36866                 });
36867
36868                 eve.on("snap.util.attr.d", function(value) {
36869                     eve.stop();
36870                     if (is(value, "array") && is(value[0], "array")) {
36871                         value = Snap.path.toString.call(value);
36872                     }
36873                     value = Str(value);
36874                     if (value.match(/[ruo]/i)) {
36875                         value = Snap.path.toAbsolute(value);
36876                     }
36877                     $(this.node, {
36878                         d: value
36879                     });
36880                 })(-1);
36881                 eve.on("snap.util.attr.#text", function(value) {
36882                     eve.stop();
36883                     value = Str(value);
36884                     var txt = glob.doc.createTextNode(value);
36885                     while (this.node.firstChild) {
36886                         this.node.removeChild(this.node.firstChild);
36887                     }
36888                     this.node.appendChild(txt);
36889                 })(-1);
36890                 eve.on("snap.util.attr.path", function(value) {
36891                     eve.stop();
36892                     this.attr({
36893                         d: value
36894                     });
36895                 })(-1);
36896                 eve.on("snap.util.attr.class", function(value) {
36897                     eve.stop();
36898                     this.node.className.baseVal = value;
36899                 })(-1);
36900                 eve.on("snap.util.attr.viewBox", function(value) {
36901                     var vb;
36902                     if (is(value, "object") && "x" in value) {
36903                         vb = [value.x, value.y, value.width, value.height].join(" ");
36904                     } else if (is(value, "array")) {
36905                         vb = value.join(" ");
36906                     } else {
36907                         vb = value;
36908                     }
36909                     $(this.node, {
36910                         viewBox: vb
36911                     });
36912                     eve.stop();
36913                 })(-1);
36914                 eve.on("snap.util.attr.transform", function(value) {
36915                     this.transform(value);
36916                     eve.stop();
36917                 })(-1);
36918                 eve.on("snap.util.attr.r", function(value) {
36919                     if (this.type == "rect") {
36920                         eve.stop();
36921                         $(this.node, {
36922                             rx: value,
36923                             ry: value
36924                         });
36925                     }
36926                 })(-1);
36927                 eve.on("snap.util.attr.textpath", function(value) {
36928                     eve.stop();
36929                     if (this.type == "text") {
36930                         var id, tp, node;
36931                         if (!value && this.textPath) {
36932                             tp = this.textPath;
36933                             while (tp.node.firstChild) {
36934                                 this.node.appendChild(tp.node.firstChild);
36935                             }
36936                             tp.remove();
36937                             delete this.textPath;
36938                             return;
36939                         }
36940                         if (is(value, "string")) {
36941                             var defs = getSomeDefs(this),
36942                                 path = wrap(defs.parentNode).path(value);
36943                             defs.appendChild(path.node);
36944                             id = path.id;
36945                             path.attr({
36946                                 id: id
36947                             });
36948                         } else {
36949                             value = wrap(value);
36950                             if (value instanceof Element) {
36951                                 id = value.attr("id");
36952                                 if (!id) {
36953                                     id = value.id;
36954                                     value.attr({
36955                                         id: id
36956                                     });
36957                                 }
36958                             }
36959                         }
36960                         if (id) {
36961                             tp = this.textPath;
36962                             node = this.node;
36963                             if (tp) {
36964                                 tp.attr({
36965                                     "xlink:href": "#" + id
36966                                 });
36967                             } else {
36968                                 tp = $("textPath", {
36969                                     "xlink:href": "#" + id
36970                                 });
36971                                 while (node.firstChild) {
36972                                     tp.appendChild(node.firstChild);
36973                                 }
36974                                 node.appendChild(tp);
36975                                 this.textPath = wrap(tp);
36976                             }
36977                         }
36978                     }
36979                 })(-1);
36980                 eve.on("snap.util.attr.text", function(value) {
36981                     if (this.type == "text") {
36982                         var i = 0,
36983                             node = this.node,
36984                             tuner = function(chunk) {
36985                                 var out = $("tspan");
36986                                 if (is(chunk, "array")) {
36987                                     for (var i = 0; i < chunk.length; i++) {
36988                                         out.appendChild(tuner(chunk[i]));
36989                                     }
36990                                 } else {
36991                                     out.appendChild(glob.doc.createTextNode(chunk));
36992                                 }
36993                                 out.normalize && out.normalize();
36994                                 return out;
36995                             };
36996                         while (node.firstChild) {
36997                             node.removeChild(node.firstChild);
36998                         }
36999                         var tuned = tuner(value);
37000                         while (tuned.firstChild) {
37001                             node.appendChild(tuned.firstChild);
37002                         }
37003                     }
37004                     eve.stop();
37005                 })(-1);
37006
37007                 function setFontSize(value) {
37008                     eve.stop();
37009                     if (value == +value) {
37010                         value += "px";
37011                     }
37012                     this.node.style.fontSize = value;
37013                 }
37014                 eve.on("snap.util.attr.fontSize", setFontSize)(-1);
37015                 eve.on("snap.util.attr.font-size", setFontSize)(-1);
37016
37017
37018                 eve.on("snap.util.getattr.transform", function() {
37019                     eve.stop();
37020                     return this.transform();
37021                 })(-1);
37022                 eve.on("snap.util.getattr.textpath", function() {
37023                     eve.stop();
37024                     return this.textPath;
37025                 })(-1);
37026                 // Markers
37027                 (function() {
37028                     function getter(end) {
37029                         return function() {
37030                             eve.stop();
37031                             var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue("marker-" + end);
37032                             if (style == "none") {
37033                                 return style;
37034                             } else {
37035                                 return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));
37036                             }
37037                         };
37038                     }
37039
37040                     function setter(end) {
37041                         return function(value) {
37042                             eve.stop();
37043                             var name = "marker" + end.charAt(0).toUpperCase() + end.substring(1);
37044                             if (value == "" || !value) {
37045                                 this.node.style[name] = "none";
37046                                 return;
37047                             }
37048                             if (value.type == "marker") {
37049                                 var id = value.node.id;
37050                                 if (!id) {
37051                                     $(value.node, {
37052                                         id: value.id
37053                                     });
37054                                 }
37055                                 this.node.style[name] = URL(id);
37056                                 return;
37057                             }
37058                         };
37059                     }
37060                     eve.on("snap.util.getattr.marker-end", getter("end"))(-1);
37061                     eve.on("snap.util.getattr.markerEnd", getter("end"))(-1);
37062                     eve.on("snap.util.getattr.marker-start", getter("start"))(-1);
37063                     eve.on("snap.util.getattr.markerStart", getter("start"))(-1);
37064                     eve.on("snap.util.getattr.marker-mid", getter("mid"))(-1);
37065                     eve.on("snap.util.getattr.markerMid", getter("mid"))(-1);
37066                     eve.on("snap.util.attr.marker-end", setter("end"))(-1);
37067                     eve.on("snap.util.attr.markerEnd", setter("end"))(-1);
37068                     eve.on("snap.util.attr.marker-start", setter("start"))(-1);
37069                     eve.on("snap.util.attr.markerStart", setter("start"))(-1);
37070                     eve.on("snap.util.attr.marker-mid", setter("mid"))(-1);
37071                     eve.on("snap.util.attr.markerMid", setter("mid"))(-1);
37072                 }());
37073                 eve.on("snap.util.getattr.r", function() {
37074                     if (this.type == "rect" && $(this.node, "rx") == $(this.node, "ry")) {
37075                         eve.stop();
37076                         return $(this.node, "rx");
37077                     }
37078                 })(-1);
37079
37080                 function textExtract(node) {
37081                     var out = [];
37082                     var children = node.childNodes;
37083                     for (var i = 0, ii = children.length; i < ii; i++) {
37084                         var chi = children[i];
37085                         if (chi.nodeType == 3) {
37086                             out.push(chi.nodeValue);
37087                         }
37088                         if (chi.tagName == "tspan") {
37089                             if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {
37090                                 out.push(chi.firstChild.nodeValue);
37091                             } else {
37092                                 out.push(textExtract(chi));
37093                             }
37094                         }
37095                     }
37096                     return out;
37097                 }
37098                 eve.on("snap.util.getattr.text", function() {
37099                     if (this.type == "text" || this.type == "tspan") {
37100                         eve.stop();
37101                         var out = textExtract(this.node);
37102                         return out.length == 1 ? out[0] : out;
37103                     }
37104                 })(-1);
37105                 eve.on("snap.util.getattr.#text", function() {
37106                     return this.node.textContent;
37107                 })(-1);
37108                 eve.on("snap.util.getattr.viewBox", function() {
37109                     eve.stop();
37110                     var vb = $(this.node, "viewBox");
37111                     if (vb) {
37112                         vb = vb.split(separator);
37113                         return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);
37114                     } else {
37115                         return;
37116                     }
37117                 })(-1);
37118                 eve.on("snap.util.getattr.points", function() {
37119                     var p = $(this.node, "points");
37120                     eve.stop();
37121                     if (p) {
37122                         return p.split(separator);
37123                     } else {
37124                         return;
37125                     }
37126                 })(-1);
37127                 eve.on("snap.util.getattr.path", function() {
37128                     var p = $(this.node, "d");
37129                     eve.stop();
37130                     return p;
37131                 })(-1);
37132                 eve.on("snap.util.getattr.class", function() {
37133                     return this.node.className.baseVal;
37134                 })(-1);
37135
37136                 function getFontSize() {
37137                     eve.stop();
37138                     return this.node.style.fontSize;
37139                 }
37140                 eve.on("snap.util.getattr.fontSize", getFontSize)(-1);
37141                 eve.on("snap.util.getattr.font-size", getFontSize)(-1);
37142             });
37143
37144             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
37145             // 
37146             // Licensed under the Apache License, Version 2.0 (the "License");
37147             // you may not use this file except in compliance with the License.
37148             // You may obtain a copy of the License at
37149             // 
37150             // http://www.apache.org/licenses/LICENSE-2.0
37151             // 
37152             // Unless required by applicable law or agreed to in writing, software
37153             // distributed under the License is distributed on an "AS IS" BASIS,
37154             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37155             // See the License for the specific language governing permissions and
37156             // limitations under the License.
37157             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
37158                 var proto = Paper.prototype,
37159                     is = Snap.is;
37160                 /*
37161                  * \ Paper.rect [ method ]
37162                  * 
37163                  * Draws a rectangle * - x (number) x coordinate of the top left corner - y
37164                  * (number) y coordinate of the top left corner - width (number) width -
37165                  * height (number) height - rx (number) #optional horizontal radius for
37166                  * rounded corners, default is 0 - ry (number) #optional vertical radius for
37167                  * rounded corners, default is rx or 0 = (object) the `rect` element * >
37168                  * Usage | // regular rectangle | var c = paper.rect(10, 10, 50, 50); | //
37169                  * rectangle with rounded corners | var c = paper.rect(40, 40, 50, 50, 10); \
37170                  */
37171                 proto.rect = function(x, y, w, h, rx, ry) {
37172                     var attr;
37173                     if (ry == null) {
37174                         ry = rx;
37175                     }
37176                     if (is(x, "object") && x == "[object Object]") {
37177                         attr = x;
37178                     } else if (x != null) {
37179                         attr = {
37180                             x: x,
37181                             y: y,
37182                             width: w,
37183                             height: h
37184                         };
37185                         if (rx != null) {
37186                             attr.rx = rx;
37187                             attr.ry = ry;
37188                         }
37189                     }
37190                     return this.el("rect", attr);
37191                 };
37192                 /*
37193                  * \ Paper.circle [ method ] * Draws a circle * - x (number) x coordinate of
37194                  * the centre - y (number) y coordinate of the centre - r (number) radius =
37195                  * (object) the `circle` element * > Usage | var c = paper.circle(50, 50,
37196                  * 40); \
37197                  */
37198                 proto.circle = function(cx, cy, r) {
37199                     var attr;
37200                     if (is(cx, "object") && cx == "[object Object]") {
37201                         attr = cx;
37202                     } else if (cx != null) {
37203                         attr = {
37204                             cx: cx,
37205                             cy: cy,
37206                             r: r
37207                         };
37208                     }
37209                     return this.el("circle", attr);
37210                 };
37211
37212                 var preload = (function() {
37213                     function onerror() {
37214                         this.parentNode.removeChild(this);
37215                     }
37216                     return function(src, f) {
37217                         var img = glob.doc.createElement("img"),
37218                             body = glob.doc.body;
37219                         img.style.cssText = "position:absolute;left:-9999em;top:-9999em";
37220                         img.onload = function() {
37221                             f.call(img);
37222                             img.onload = img.onerror = null;
37223                             body.removeChild(img);
37224                         };
37225                         img.onerror = onerror;
37226                         body.appendChild(img);
37227                         img.src = src;
37228                     };
37229                 }());
37230
37231                 /*
37232                  * \ Paper.image [ method ] * Places an image on the surface * - src
37233                  * (string) URI of the source image - x (number) x offset position - y
37234                  * (number) y offset position - width (number) width of the image - height
37235                  * (number) height of the image = (object) the `image` element or = (object)
37236                  * Snap element object with type `image` * > Usage | var c =
37237                  * paper.image("apple.png", 10, 10, 80, 80); \
37238                  */
37239                 proto.image = function(src, x, y, width, height) {
37240                     var el = this.el("image");
37241                     if (is(src, "object") && "src" in src) {
37242                         el.attr(src);
37243                     } else if (src != null) {
37244                         var set = {
37245                             "xlink:href": src,
37246                             preserveAspectRatio: "none"
37247                         };
37248                         if (x != null && y != null) {
37249                             set.x = x;
37250                             set.y = y;
37251                         }
37252                         if (width != null && height != null) {
37253                             set.width = width;
37254                             set.height = height;
37255                         } else {
37256                             preload(src, function() {
37257                                 Snap._.$(el.node, {
37258                                     width: this.offsetWidth,
37259                                     height: this.offsetHeight
37260                                 });
37261                             });
37262                         }
37263                         Snap._.$(el.node, set);
37264                     }
37265                     return el;
37266                 };
37267                 /*
37268                  * \ Paper.ellipse [ method ] * Draws an ellipse * - x (number) x coordinate
37269                  * of the centre - y (number) y coordinate of the centre - rx (number)
37270                  * horizontal radius - ry (number) vertical radius = (object) the `ellipse`
37271                  * element * > Usage | var c = paper.ellipse(50, 50, 40, 20); \
37272                  */
37273                 proto.ellipse = function(cx, cy, rx, ry) {
37274                     var attr;
37275                     if (is(cx, "object") && cx == "[object Object]") {
37276                         attr = cx;
37277                     } else if (cx != null) {
37278                         attr = {
37279                             cx: cx,
37280                             cy: cy,
37281                             rx: rx,
37282                             ry: ry
37283                         };
37284                     }
37285                     return this.el("ellipse", attr);
37286                 };
37287                 // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is,
37288                 // and why it would make life any easier.
37289                 /*
37290                  * \ Paper.path [ method ] * Creates a `<path>` element using the given
37291                  * string as the path's definition - pathString (string) #optional path
37292                  * string in SVG format Path string consists of one-letter commands,
37293                  * followed by comma seprarated arguments in numerical form. Example: |
37294                  * "M10,20L30,40" This example features two commands: `M`, with arguments
37295                  * `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands
37296                  * express coordinates in absolute terms, while lowercase commands express
37297                  * them in relative terms from the most recently declared coordinates.
37298                  *  # <p>Here is short list of commands available, for more details see <a
37299                  * href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a
37300                  * path's data attribute's format are described in the SVG
37301                  * specification.">SVG path string format</a> or <a
37302                  * href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about
37303                  * path strings at MDN</a>.</p> # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody> #
37304                  * <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr> # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr> #
37305                  * <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr> # <tr><td>H</td><td>horizontal
37306                  * lineto</td><td>x+</td></tr> # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr> #
37307                  * <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr> #
37308                  * <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr> #
37309                  * <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x
37310                  * y)+</td></tr> # <tr><td>T</td><td>smooth quadratic Bézier
37311                  * curveto</td><td>(x y)+</td></tr> # <tr><td>A</td><td>elliptical
37312                  * arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr> #
37313                  * <tr><td>R</td><td><a
37314                  * href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom
37315                  * curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table> *
37316                  * _Catmull-Rom curveto_ is a not standard SVG command and added to make
37317                  * life easier. Note: there is a special case when a path consists of only
37318                  * three commands: `M10,10R…z`. In this case the path connects back to
37319                  * its starting point. > Usage | var c = paper.path("M10 10L90 90"); | //
37320                  * draw a diagonal line: | // move to 10,10, line to 90,90 \
37321                  */
37322                 proto.path = function(d) {
37323                     var attr;
37324                     if (is(d, "object") && !is(d, "array")) {
37325                         attr = d;
37326                     } else if (d) {
37327                         attr = {
37328                             d: d
37329                         };
37330                     }
37331                     return this.el("path", attr);
37332                 };
37333                 /*
37334                  * \ Paper.g [ method ] * Creates a group element * - varargs (…)
37335                  * #optional elements to nest within the group = (object) the `g` element * >
37336                  * Usage | var c1 = paper.circle(), | c2 = paper.rect(), | g = paper.g(c2,
37337                  * c1); // note that the order of elements is different or | var c1 =
37338                  * paper.circle(), | c2 = paper.rect(), | g = paper.g(); | g.add(c2, c1); \
37339                  */
37340                 /*
37341                  * \ Paper.group [ method ] * See @Paper.g \
37342                  */
37343                 proto.group = proto.g = function(first) {
37344                     var attr,
37345                         el = this.el("g");
37346                     if (arguments.length == 1 && first && !first.type) {
37347                         el.attr(first);
37348                     } else if (arguments.length) {
37349                         el.add(Array.prototype.slice.call(arguments, 0));
37350                     }
37351                     return el;
37352                 };
37353                 /*
37354                  * \ Paper.svg [ method ] * Creates a nested SVG element. - x (number)
37355                  * @optional X of the element - y (number) @optional Y of the element -
37356                  * width (number) @optional width of the element - height (number) @optional
37357                  * height of the element - vbx (number) @optional viewbox X - vby (number)
37358                  * @optional viewbox Y - vbw (number) @optional viewbox width - vbh (number)
37359                  * @optional viewbox height * = (object) the `svg` element * \
37360                  */
37361                 proto.svg = function(x, y, width, height, vbx, vby, vbw, vbh) {
37362                     var attrs = {};
37363                     if (is(x, "object") && y == null) {
37364                         attrs = x;
37365                     } else {
37366                         if (x != null) {
37367                             attrs.x = x;
37368                         }
37369                         if (y != null) {
37370                             attrs.y = y;
37371                         }
37372                         if (width != null) {
37373                             attrs.width = width;
37374                         }
37375                         if (height != null) {
37376                             attrs.height = height;
37377                         }
37378                         if (vbx != null && vby != null && vbw != null && vbh != null) {
37379                             attrs.viewBox = [vbx, vby, vbw, vbh];
37380                         }
37381                     }
37382                     return this.el("svg", attrs);
37383                 };
37384                 /*
37385                  * \ Paper.mask [ method ] * Equivalent in behaviour to @Paper.g, except
37386                  * it’s a mask. * = (object) the `mask` element * \
37387                  */
37388                 proto.mask = function(first) {
37389                     var attr,
37390                         el = this.el("mask");
37391                     if (arguments.length == 1 && first && !first.type) {
37392                         el.attr(first);
37393                     } else if (arguments.length) {
37394                         el.add(Array.prototype.slice.call(arguments, 0));
37395                     }
37396                     return el;
37397                 };
37398                 /*
37399                  * \ Paper.ptrn [ method ] * Equivalent in behaviour to @Paper.g, except
37400                  * it’s a pattern. - x (number) @optional X of the element - y
37401                  * (number) @optional Y of the element - width (number) @optional width of
37402                  * the element - height (number) @optional height of the element - vbx
37403                  * (number) @optional viewbox X - vby (number) @optional viewbox Y - vbw
37404                  * (number) @optional viewbox width - vbh (number) @optional viewbox height * =
37405                  * (object) the `pattern` element * \
37406                  */
37407                 proto.ptrn = function(x, y, width, height, vx, vy, vw, vh) {
37408                     if (is(x, "object")) {
37409                         var attr = x;
37410                     } else {
37411                         attr = {
37412                             patternUnits: "userSpaceOnUse"
37413                         };
37414                         if (x) {
37415                             attr.x = x;
37416                         }
37417                         if (y) {
37418                             attr.y = y;
37419                         }
37420                         if (width != null) {
37421                             attr.width = width;
37422                         }
37423                         if (height != null) {
37424                             attr.height = height;
37425                         }
37426                         if (vx != null && vy != null && vw != null && vh != null) {
37427                             attr.viewBox = [vx, vy, vw, vh];
37428                         }
37429                     }
37430                     return this.el("pattern", attr);
37431                 };
37432                 /*
37433                  * \ Paper.use [ method ] * Creates a <use> element. - id (string) @optional
37434                  * id of element to link or - id (Element) @optional element to link * =
37435                  * (object) the `use` element * \
37436                  */
37437                 proto.use = function(id) {
37438                     if (id != null) {
37439                         if (id instanceof Element) {
37440                             if (!id.attr("id")) {
37441                                 id.attr({
37442                                     id: Snap._.id(id)
37443                                 });
37444                             }
37445                             id = id.attr("id");
37446                         }
37447                         if (String(id).charAt() == "#") {
37448                             id = id.substring(1);
37449                         }
37450                         return this.el("use", {
37451                             "xlink:href": "#" + id
37452                         });
37453                     } else {
37454                         return Element.prototype.use.call(this);
37455                     }
37456                 };
37457                 /*
37458                  * \ Paper.symbol [ method ] * Creates a <symbol> element. - vbx (number)
37459                  * @optional viewbox X - vby (number) @optional viewbox Y - vbw (number)
37460                  * @optional viewbox width - vbh (number) @optional viewbox height =
37461                  * (object) the `symbol` element * \
37462                  */
37463                 proto.symbol = function(vx, vy, vw, vh) {
37464                     var attr = {};
37465                     if (vx != null && vy != null && vw != null && vh != null) {
37466                         attr.viewBox = [vx, vy, vw, vh];
37467                     }
37468
37469                     return this.el("symbol", attr);
37470                 };
37471                 /*
37472                  * \ Paper.text [ method ] * Draws a text string * - x (number) x coordinate
37473                  * position - y (number) y coordinate position - text (string|array) The
37474                  * text string to draw or array of strings to nest within separate `<tspan>`
37475                  * elements = (object) the `text` element * > Usage | var t1 =
37476                  * paper.text(50, 50, "Snap"); | var t2 = paper.text(50, 50,
37477                  * ["S","n","a","p"]); | // Text path usage | t1.attr({textpath:
37478                  * "M10,10L100,100"}); | // or | var pth = paper.path("M10,10L100,100"); |
37479                  * t1.attr({textpath: pth}); \
37480                  */
37481                 proto.text = function(x, y, text) {
37482                     var attr = {};
37483                     if (is(x, "object")) {
37484                         attr = x;
37485                     } else if (x != null) {
37486                         attr = {
37487                             x: x,
37488                             y: y,
37489                             text: text || ""
37490                         };
37491                     }
37492                     return this.el("text", attr);
37493                 };
37494                 /*
37495                  * \ Paper.line [ method ] * Draws a line * - x1 (number) x coordinate
37496                  * position of the start - y1 (number) y coordinate position of the start -
37497                  * x2 (number) x coordinate position of the end - y2 (number) y coordinate
37498                  * position of the end = (object) the `line` element * > Usage | var t1 =
37499                  * paper.line(50, 50, 100, 100); \
37500                  */
37501                 proto.line = function(x1, y1, x2, y2) {
37502                     var attr = {};
37503                     if (is(x1, "object")) {
37504                         attr = x1;
37505                     } else if (x1 != null) {
37506                         attr = {
37507                             x1: x1,
37508                             x2: x2,
37509                             y1: y1,
37510                             y2: y2
37511                         };
37512                     }
37513                     return this.el("line", attr);
37514                 };
37515                 /*
37516                  * \ Paper.polyline [ method ] * Draws a polyline * - points (array) array
37517                  * of points or - varargs (…) points = (object) the `polyline` element * >
37518                  * Usage | var p1 = paper.polyline([10, 10, 100, 100]); | var p2 =
37519                  * paper.polyline(10, 10, 100, 100); \
37520                  */
37521                 proto.polyline = function(points) {
37522                     if (arguments.length > 1) {
37523                         points = Array.prototype.slice.call(arguments, 0);
37524                     }
37525                     var attr = {};
37526                     if (is(points, "object") && !is(points, "array")) {
37527                         attr = points;
37528                     } else if (points != null) {
37529                         attr = {
37530                             points: points
37531                         };
37532                     }
37533                     return this.el("polyline", attr);
37534                 };
37535                 /*
37536                  * \ Paper.polygon [ method ] * Draws a polygon. See @Paper.polyline \
37537                  */
37538                 proto.polygon = function(points) {
37539                     if (arguments.length > 1) {
37540                         points = Array.prototype.slice.call(arguments, 0);
37541                     }
37542                     var attr = {};
37543                     if (is(points, "object") && !is(points, "array")) {
37544                         attr = points;
37545                     } else if (points != null) {
37546                         attr = {
37547                             points: points
37548                         };
37549                     }
37550                     return this.el("polygon", attr);
37551                 };
37552                 // gradients
37553                 (function() {
37554                     var $ = Snap._.$;
37555                     // gradients' helpers
37556                     function Gstops() {
37557                         return this.selectAll("stop");
37558                     }
37559
37560                     function GaddStop(color, offset) {
37561                         var stop = $("stop"),
37562                             attr = {
37563                                 offset: +offset + "%"
37564                             };
37565                         color = Snap.color(color);
37566                         attr["stop-color"] = color.hex;
37567                         if (color.opacity < 1) {
37568                             attr["stop-opacity"] = color.opacity;
37569                         }
37570                         $(stop, attr);
37571                         this.node.appendChild(stop);
37572                         return this;
37573                     }
37574
37575                     function GgetBBox() {
37576                         if (this.type == "linearGradient") {
37577                             var x1 = $(this.node, "x1") || 0,
37578                                 x2 = $(this.node, "x2") || 1,
37579                                 y1 = $(this.node, "y1") || 0,
37580                                 y2 = $(this.node, "y2") || 0;
37581                             return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
37582                         } else {
37583                             var cx = this.node.cx || .5,
37584                                 cy = this.node.cy || .5,
37585                                 r = this.node.r || 0;
37586                             return Snap._.box(cx - r, cy - r, r * 2, r * 2);
37587                         }
37588                     }
37589
37590                     function gradient(defs, str) {
37591                         var grad = eve("snap.util.grad.parse", null, str).firstDefined(),
37592                             el;
37593                         if (!grad) {
37594                             return null;
37595                         }
37596                         grad.params.unshift(defs);
37597                         if (grad.type.toLowerCase() == "l") {
37598                             el = gradientLinear.apply(0, grad.params);
37599                         } else {
37600                             el = gradientRadial.apply(0, grad.params);
37601                         }
37602                         if (grad.type != grad.type.toLowerCase()) {
37603                             $(el.node, {
37604                                 gradientUnits: "userSpaceOnUse"
37605                             });
37606                         }
37607                         var stops = grad.stops,
37608                             len = stops.length,
37609                             start = 0,
37610                             j = 0;
37611
37612                         function seed(i, end) {
37613                             var step = (end - start) / (i - j);
37614                             for (var k = j; k < i; k++) {
37615                                 stops[k].offset = +(+start + step * (k - j)).toFixed(2);
37616                             }
37617                             j = i;
37618                             start = end;
37619                         }
37620                         len--;
37621                         for (var i = 0; i < len; i++)
37622                             if ("offset" in stops[i]) {
37623                                 seed(i, stops[i].offset);
37624                             }
37625                         stops[len].offset = stops[len].offset || 100;
37626                         seed(len, stops[len].offset);
37627                         for (i = 0; i <= len; i++) {
37628                             var stop = stops[i];
37629                             el.addStop(stop.color, stop.offset);
37630                         }
37631                         return el;
37632                     }
37633
37634                     function gradientLinear(defs, x1, y1, x2, y2) {
37635                         var el = Snap._.make("linearGradient", defs);
37636                         el.stops = Gstops;
37637                         el.addStop = GaddStop;
37638                         el.getBBox = GgetBBox;
37639                         if (x1 != null) {
37640                             $(el.node, {
37641                                 x1: x1,
37642                                 y1: y1,
37643                                 x2: x2,
37644                                 y2: y2
37645                             });
37646                         }
37647                         return el;
37648                     }
37649
37650                     function gradientRadial(defs, cx, cy, r, fx, fy) {
37651                         var el = Snap._.make("radialGradient", defs);
37652                         el.stops = Gstops;
37653                         el.addStop = GaddStop;
37654                         el.getBBox = GgetBBox;
37655                         if (cx != null) {
37656                             $(el.node, {
37657                                 cx: cx,
37658                                 cy: cy,
37659                                 r: r
37660                             });
37661                         }
37662                         if (fx != null && fy != null) {
37663                             $(el.node, {
37664                                 fx: fx,
37665                                 fy: fy
37666                             });
37667                         }
37668                         return el;
37669                     }
37670                     /*
37671                      * \ Paper.gradient [ method ] * Creates a gradient element * - gradient
37672                      * (string) gradient descriptor > Gradient Descriptor The gradient
37673                      * descriptor is an expression formatted as follows: `<type>(<coords>)<colors>`.
37674                      * The `<type>` can be either linear or radial. The uppercase `L` or
37675                      * `R` letters indicate absolute coordinates offset from the SVG
37676                      * surface. Lowercase `l` or `r` letters indicate coordinates calculated
37677                      * relative to the element to which the gradient is applied. Coordinates
37678                      * specify a linear gradient vector as `x1`, `y1`, `x2`, `y2`, or a
37679                      * radial gradient as `cx`, `cy`, `r` and optional `fx`, `fy` specifying
37680                      * a focal point away from the center of the circle. Specify `<colors>`
37681                      * as a list of dash-separated CSS color values. Each color may be
37682                      * followed by a custom offset value, separated with a colon character. >
37683                      * Examples Linear gradient, relative from top-left corner to
37684                      * bottom-right corner, from black through red to white: | var g =
37685                      * paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff"); Linear gradient,
37686                      * absolute from (0, 0) to (100, 100), from black through red at 25% to
37687                      * white: | var g = paper.gradient("L(0, 0, 100,
37688                      * 100)#000-#f00:25-#fff"); Radial gradient, relative from the center of
37689                      * the element with radius half the width, from black to white: | var g =
37690                      * paper.gradient("r(0.5, 0.5, 0.5)#000-#fff"); To apply the gradient: |
37691                      * paper.circle(50, 50, 40).attr({ | fill: g | }); = (object) the
37692                      * `gradient` element \
37693                      */
37694                     proto.gradient = function(str) {
37695                         return gradient(this.defs, str);
37696                     };
37697                     proto.gradientLinear = function(x1, y1, x2, y2) {
37698                         return gradientLinear(this.defs, x1, y1, x2, y2);
37699                     };
37700                     proto.gradientRadial = function(cx, cy, r, fx, fy) {
37701                         return gradientRadial(this.defs, cx, cy, r, fx, fy);
37702                     };
37703                     /*
37704                      * \ Paper.toString [ method ] * Returns SVG code for the @Paper =
37705                      * (string) SVG code for the @Paper \
37706                      */
37707                     proto.toString = function() {
37708                         var doc = this.node.ownerDocument,
37709                             f = doc.createDocumentFragment(),
37710                             d = doc.createElement("div"),
37711                             svg = this.node.cloneNode(true),
37712                             res;
37713                         f.appendChild(d);
37714                         d.appendChild(svg);
37715                         Snap._.$(svg, {
37716                             xmlns: "http://www.w3.org/2000/svg"
37717                         });
37718                         res = d.innerHTML;
37719                         f.removeChild(f.firstChild);
37720                         return res;
37721                     };
37722                     /*
37723                      * \ Paper.toDataURL [ method ] * Returns SVG code for the @Paper as
37724                      * Data URI string. = (string) Data URI string \
37725                      */
37726                     proto.toDataURL = function() {
37727                         if (window && window.btoa) {
37728                             return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(this)));
37729                         }
37730                     };
37731                     /*
37732                      * \ Paper.clear [ method ] * Removes all child nodes of the paper,
37733                      * except <defs>. \
37734                      */
37735                     proto.clear = function() {
37736                         var node = this.node.firstChild,
37737                             next;
37738                         while (node) {
37739                             next = node.nextSibling;
37740                             if (node.tagName != "defs") {
37741                                 node.parentNode.removeChild(node);
37742                             } else {
37743                                 proto.clear.call({
37744                                     node: node
37745                                 });
37746                             }
37747                             node = next;
37748                         }
37749                     };
37750                 }());
37751             });
37752
37753             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
37754             // 
37755             // Licensed under the Apache License, Version 2.0 (the "License");
37756             // you may not use this file except in compliance with the License.
37757             // You may obtain a copy of the License at
37758             // 
37759             // http://www.apache.org/licenses/LICENSE-2.0
37760             // 
37761             // Unless required by applicable law or agreed to in writing, software
37762             // distributed under the License is distributed on an "AS IS" BASIS,
37763             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37764             // See the License for the specific language governing permissions and
37765             // limitations under the License.
37766             Snap.plugin(function(Snap, Element, Paper, glob) {
37767                 var elproto = Element.prototype,
37768                     is = Snap.is,
37769                     clone = Snap._.clone,
37770                     has = "hasOwnProperty",
37771                     p2s = /,?([a-z]),?/gi,
37772                     toFloat = parseFloat,
37773                     math = Math,
37774                     PI = math.PI,
37775                     mmin = math.min,
37776                     mmax = math.max,
37777                     pow = math.pow,
37778                     abs = math.abs;
37779
37780                 function paths(ps) {
37781                     var p = paths.ps = paths.ps || {};
37782                     if (p[ps]) {
37783                         p[ps].sleep = 100;
37784                     } else {
37785                         p[ps] = {
37786                             sleep: 100
37787                         };
37788                     }
37789                     setTimeout(function() {
37790                         for (var key in p)
37791                             if (p[has](key) && key != ps) {
37792                                 p[key].sleep--;
37793                                 !p[key].sleep && delete p[key];
37794                             }
37795                     });
37796                     return p[ps];
37797                 }
37798
37799                 function box(x, y, width, height) {
37800                     if (x == null) {
37801                         x = y = width = height = 0;
37802                     }
37803                     if (y == null) {
37804                         y = x.y;
37805                         width = x.width;
37806                         height = x.height;
37807                         x = x.x;
37808                     }
37809                     return {
37810                         x: x,
37811                         y: y,
37812                         width: width,
37813                         w: width,
37814                         height: height,
37815                         h: height,
37816                         x2: x + width,
37817                         y2: y + height,
37818                         cx: x + width / 2,
37819                         cy: y + height / 2,
37820                         r1: math.min(width, height) / 2,
37821                         r2: math.max(width, height) / 2,
37822                         r0: math.sqrt(width * width + height * height) / 2,
37823                         path: rectPath(x, y, width, height),
37824                         vb: [x, y, width, height].join(" ")
37825                     };
37826                 }
37827
37828                 function toString() {
37829                     return this.join(",").replace(p2s, "$1");
37830                 }
37831
37832                 function pathClone(pathArray) {
37833                     var res = clone(pathArray);
37834                     res.toString = toString;
37835                     return res;
37836                 }
37837
37838                 function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
37839                     if (length == null) {
37840                         return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
37841                     } else {
37842                         return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,
37843                             getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
37844                     }
37845                 }
37846
37847                 function getLengthFactory(istotal, subpath) {
37848                     function O(val) {
37849                         return +(+val).toFixed(3);
37850                     }
37851                     return Snap._.cacher(function(path, length, onlystart) {
37852                         if (path instanceof Element) {
37853                             path = path.attr("d");
37854                         }
37855                         path = path2curve(path);
37856                         var x, y, p, l, sp = "",
37857                             subpaths = {},
37858                             point,
37859                             len = 0;
37860                         for (var i = 0, ii = path.length; i < ii; i++) {
37861                             p = path[i];
37862                             if (p[0] == "M") {
37863                                 x = +p[1];
37864                                 y = +p[2];
37865                             } else {
37866                                 l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
37867                                 if (len + l > length) {
37868                                     if (subpath && !subpaths.start) {
37869                                         point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
37870                                         sp += [
37871                                             "C" + O(point.start.x),
37872                                             O(point.start.y),
37873                                             O(point.m.x),
37874                                             O(point.m.y),
37875                                             O(point.x),
37876                                             O(point.y)
37877                                         ];
37878                                         if (onlystart) {
37879                                             return sp;
37880                                         }
37881                                         subpaths.start = sp;
37882                                         sp = [
37883                                             "M" + O(point.x),
37884                                             O(point.y) + "C" + O(point.n.x),
37885                                             O(point.n.y),
37886                                             O(point.end.x),
37887                                             O(point.end.y),
37888                                             O(p[5]),
37889                                             O(p[6])
37890                                         ].join();
37891                                         len += l;
37892                                         x = +p[5];
37893                                         y = +p[6];
37894                                         continue;
37895                                     }
37896                                     if (!istotal && !subpath) {
37897                                         point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
37898                                         return point;
37899                                     }
37900                                 }
37901                                 len += l;
37902                                 x = +p[5];
37903                                 y = +p[6];
37904                             }
37905                             sp += p.shift() + p;
37906                         }
37907                         subpaths.end = sp;
37908                         point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
37909                         return point;
37910                     }, null, Snap._.clone);
37911                 }
37912                 var getTotalLength = getLengthFactory(1),
37913                     getPointAtLength = getLengthFactory(),
37914                     getSubpathsAtLength = getLengthFactory(0, 1);
37915
37916                 function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
37917                     var t1 = 1 - t,
37918                         t13 = pow(t1, 3),
37919                         t12 = pow(t1, 2),
37920                         t2 = t * t,
37921                         t3 = t2 * t,
37922                         x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
37923                         y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
37924                         mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
37925                         my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
37926                         nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
37927                         ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
37928                         ax = t1 * p1x + t * c1x,
37929                         ay = t1 * p1y + t * c1y,
37930                         cx = t1 * c2x + t * p2x,
37931                         cy = t1 * c2y + t * p2y,
37932                         alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
37933                     // (mx > nx || my < ny) && (alpha += 180);
37934                     return {
37935                         x: x,
37936                         y: y,
37937                         m: {
37938                             x: mx,
37939                             y: my
37940                         },
37941                         n: {
37942                             x: nx,
37943                             y: ny
37944                         },
37945                         start: {
37946                             x: ax,
37947                             y: ay
37948                         },
37949                         end: {
37950                             x: cx,
37951                             y: cy
37952                         },
37953                         alpha: alpha
37954                     };
37955                 }
37956
37957                 function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
37958                     if (!Snap.is(p1x, "array")) {
37959                         p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
37960                     }
37961                     var bbox = curveDim.apply(null, p1x);
37962                     return box(
37963                         bbox.min.x,
37964                         bbox.min.y,
37965                         bbox.max.x - bbox.min.x,
37966                         bbox.max.y - bbox.min.y
37967                     );
37968                 }
37969
37970                 function isPointInsideBBox(bbox, x, y) {
37971                     return x >= bbox.x &&
37972                         x <= bbox.x + bbox.width &&
37973                         y >= bbox.y &&
37974                         y <= bbox.y + bbox.height;
37975                 }
37976
37977                 function isBBoxIntersect(bbox1, bbox2) {
37978                     bbox1 = box(bbox1);
37979                     bbox2 = box(bbox2);
37980                     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);
37981                 }
37982
37983                 function base3(t, p1, p2, p3, p4) {
37984                     var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
37985                         t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
37986                     return t * t2 - 3 * p1 + 3 * p2;
37987                 }
37988
37989                 function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
37990                     if (z == null) {
37991                         z = 1;
37992                     }
37993                     z = z > 1 ? 1 : z < 0 ? 0 : z;
37994                     var z2 = z / 2,
37995                         n = 12,
37996                         Tvalues = [-.1252, .1252, -.3678, .3678, -.5873, .5873, -.7699, .7699, -.9041, .9041, -.9816, .9816],
37997                         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],
37998                         sum = 0;
37999                     for (var i = 0; i < n; i++) {
38000                         var ct = z2 * Tvalues[i] + z2,
38001                             xbase = base3(ct, x1, x2, x3, x4),
38002                             ybase = base3(ct, y1, y2, y3, y4),
38003                             comb = xbase * xbase + ybase * ybase;
38004                         sum += Cvalues[i] * math.sqrt(comb);
38005                     }
38006                     return z2 * sum;
38007                 }
38008
38009                 function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
38010                     if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
38011                         return;
38012                     }
38013                     var t = 1,
38014                         step = t / 2,
38015                         t2 = t - step,
38016                         l,
38017                         e = .01;
38018                     l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
38019                     while (abs(l - ll) > e) {
38020                         step /= 2;
38021                         t2 += (l < ll ? 1 : -1) * step;
38022                         l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
38023                     }
38024                     return t2;
38025                 }
38026
38027                 function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
38028                     if (
38029                         mmax(x1, x2) < mmin(x3, x4) ||
38030                         mmin(x1, x2) > mmax(x3, x4) ||
38031                         mmax(y1, y2) < mmin(y3, y4) ||
38032                         mmin(y1, y2) > mmax(y3, y4)
38033                     ) {
38034                         return;
38035                     }
38036                     var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
38037                         ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
38038                         denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
38039
38040                     if (!denominator) {
38041                         return;
38042                     }
38043                     var px = nx / denominator,
38044                         py = ny / denominator,
38045                         px2 = +px.toFixed(2),
38046                         py2 = +py.toFixed(2);
38047                     if (
38048                         px2 < +mmin(x1, x2).toFixed(2) ||
38049                         px2 > +mmax(x1, x2).toFixed(2) ||
38050                         px2 < +mmin(x3, x4).toFixed(2) ||
38051                         px2 > +mmax(x3, x4).toFixed(2) ||
38052                         py2 < +mmin(y1, y2).toFixed(2) ||
38053                         py2 > +mmax(y1, y2).toFixed(2) ||
38054                         py2 < +mmin(y3, y4).toFixed(2) ||
38055                         py2 > +mmax(y3, y4).toFixed(2)
38056                     ) {
38057                         return;
38058                     }
38059                     return {
38060                         x: px,
38061                         y: py
38062                     };
38063                 }
38064
38065                 function inter(bez1, bez2) {
38066                     return interHelper(bez1, bez2);
38067                 }
38068
38069                 function interCount(bez1, bez2) {
38070                     return interHelper(bez1, bez2, 1);
38071                 }
38072
38073                 function interHelper(bez1, bez2, justCount) {
38074                     var bbox1 = bezierBBox(bez1),
38075                         bbox2 = bezierBBox(bez2);
38076                     if (!isBBoxIntersect(bbox1, bbox2)) {
38077                         return justCount ? 0 : [];
38078                     }
38079                     var l1 = bezlen.apply(0, bez1),
38080                         l2 = bezlen.apply(0, bez2),
38081                         n1 = ~~(l1 / 8),
38082                         n2 = ~~(l2 / 8),
38083                         dots1 = [],
38084                         dots2 = [],
38085                         xy = {},
38086                         res = justCount ? 0 : [];
38087                     for (var i = 0; i < n1 + 1; i++) {
38088                         var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
38089                         dots1.push({
38090                             x: p.x,
38091                             y: p.y,
38092                             t: i / n1
38093                         });
38094                     }
38095                     for (i = 0; i < n2 + 1; i++) {
38096                         p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
38097                         dots2.push({
38098                             x: p.x,
38099                             y: p.y,
38100                             t: i / n2
38101                         });
38102                     }
38103                     for (i = 0; i < n1; i++) {
38104                         for (var j = 0; j < n2; j++) {
38105                             var di = dots1[i],
38106                                 di1 = dots1[i + 1],
38107                                 dj = dots2[j],
38108                                 dj1 = dots2[j + 1],
38109                                 ci = abs(di1.x - di.x) < .001 ? "y" : "x",
38110                                 cj = abs(dj1.x - dj.x) < .001 ? "y" : "x",
38111                                 is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
38112                             if (is) {
38113                                 if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {
38114                                     continue;
38115                                 }
38116                                 xy[is.x.toFixed(4)] = is.y.toFixed(4);
38117                                 var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
38118                                     t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
38119                                 if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
38120                                     if (justCount) {
38121                                         res++;
38122                                     } else {
38123                                         res.push({
38124                                             x: is.x,
38125                                             y: is.y,
38126                                             t1: t1,
38127                                             t2: t2
38128                                         });
38129                                     }
38130                                 }
38131                             }
38132                         }
38133                     }
38134                     return res;
38135                 }
38136
38137                 function pathIntersection(path1, path2) {
38138                     return interPathHelper(path1, path2);
38139                 }
38140
38141                 function pathIntersectionNumber(path1, path2) {
38142                     return interPathHelper(path1, path2, 1);
38143                 }
38144
38145                 function interPathHelper(path1, path2, justCount) {
38146                     path1 = path2curve(path1);
38147                     path2 = path2curve(path2);
38148                     var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
38149                         res = justCount ? 0 : [];
38150                     for (var i = 0, ii = path1.length; i < ii; i++) {
38151                         var pi = path1[i];
38152                         if (pi[0] == "M") {
38153                             x1 = x1m = pi[1];
38154                             y1 = y1m = pi[2];
38155                         } else {
38156                             if (pi[0] == "C") {
38157                                 bez1 = [x1, y1].concat(pi.slice(1));
38158                                 x1 = bez1[6];
38159                                 y1 = bez1[7];
38160                             } else {
38161                                 bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
38162                                 x1 = x1m;
38163                                 y1 = y1m;
38164                             }
38165                             for (var j = 0, jj = path2.length; j < jj; j++) {
38166                                 var pj = path2[j];
38167                                 if (pj[0] == "M") {
38168                                     x2 = x2m = pj[1];
38169                                     y2 = y2m = pj[2];
38170                                 } else {
38171                                     if (pj[0] == "C") {
38172                                         bez2 = [x2, y2].concat(pj.slice(1));
38173                                         x2 = bez2[6];
38174                                         y2 = bez2[7];
38175                                     } else {
38176                                         bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
38177                                         x2 = x2m;
38178                                         y2 = y2m;
38179                                     }
38180                                     var intr = interHelper(bez1, bez2, justCount);
38181                                     if (justCount) {
38182                                         res += intr;
38183                                     } else {
38184                                         for (var k = 0, kk = intr.length; k < kk; k++) {
38185                                             intr[k].segment1 = i;
38186                                             intr[k].segment2 = j;
38187                                             intr[k].bez1 = bez1;
38188                                             intr[k].bez2 = bez2;
38189                                         }
38190                                         res = res.concat(intr);
38191                                     }
38192                                 }
38193                             }
38194                         }
38195                     }
38196                     return res;
38197                 }
38198
38199                 function isPointInsidePath(path, x, y) {
38200                     var bbox = pathBBox(path);
38201                     return isPointInsideBBox(bbox, x, y) &&
38202                         interPathHelper(path, [
38203                             ["M", x, y],
38204                             ["H", bbox.x2 + 10]
38205                         ], 1) % 2 == 1;
38206                 }
38207
38208                 function pathBBox(path) {
38209                     var pth = paths(path);
38210                     if (pth.bbox) {
38211                         return clone(pth.bbox);
38212                     }
38213                     if (!path) {
38214                         return box();
38215                     }
38216                     path = path2curve(path);
38217                     var x = 0,
38218                         y = 0,
38219                         X = [],
38220                         Y = [],
38221                         p;
38222                     for (var i = 0, ii = path.length; i < ii; i++) {
38223                         p = path[i];
38224                         if (p[0] == "M") {
38225                             x = p[1];
38226                             y = p[2];
38227                             X.push(x);
38228                             Y.push(y);
38229                         } else {
38230                             var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
38231                             X = X.concat(dim.min.x, dim.max.x);
38232                             Y = Y.concat(dim.min.y, dim.max.y);
38233                             x = p[5];
38234                             y = p[6];
38235                         }
38236                     }
38237                     var xmin = mmin.apply(0, X),
38238                         ymin = mmin.apply(0, Y),
38239                         xmax = mmax.apply(0, X),
38240                         ymax = mmax.apply(0, Y),
38241                         bb = box(xmin, ymin, xmax - xmin, ymax - ymin);
38242                     pth.bbox = clone(bb);
38243                     return bb;
38244                 }
38245
38246                 function rectPath(x, y, w, h, r) {
38247                     if (r) {
38248                         return [
38249                             ["M", +x + (+r), y],
38250                             ["l", w - r * 2, 0],
38251                             ["a", r, r, 0, 0, 1, r, r],
38252                             ["l", 0, h - r * 2],
38253                             ["a", r, r, 0, 0, 1, -r, r],
38254                             ["l", r * 2 - w, 0],
38255                             ["a", r, r, 0, 0, 1, -r, -r],
38256                             ["l", 0, r * 2 - h],
38257                             ["a", r, r, 0, 0, 1, r, -r],
38258                             ["z"]
38259                         ];
38260                     }
38261                     var res = [
38262                         ["M", x, y],
38263                         ["l", w, 0],
38264                         ["l", 0, h],
38265                         ["l", -w, 0],
38266                         ["z"]
38267                     ];
38268                     res.toString = toString;
38269                     return res;
38270                 }
38271
38272                 function ellipsePath(x, y, rx, ry, a) {
38273                     if (a == null && ry == null) {
38274                         ry = rx;
38275                     }
38276                     x = +x;
38277                     y = +y;
38278                     rx = +rx;
38279                     ry = +ry;
38280                     if (a != null) {
38281                         var rad = Math.PI / 180,
38282                             x1 = x + rx * Math.cos(-ry * rad),
38283                             x2 = x + rx * Math.cos(-a * rad),
38284                             y1 = y + rx * Math.sin(-ry * rad),
38285                             y2 = y + rx * Math.sin(-a * rad),
38286                             res = [
38287                                 ["M", x1, y1],
38288                                 ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]
38289                             ];
38290                     } else {
38291                         res = [
38292                             ["M", x, y],
38293                             ["m", 0, -ry],
38294                             ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
38295                             ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
38296                             ["z"]
38297                         ];
38298                     }
38299                     res.toString = toString;
38300                     return res;
38301                 }
38302                 var unit2px = Snap._unit2px,
38303                     getPath = {
38304                         path: function(el) {
38305                             return el.attr("path");
38306                         },
38307                         circle: function(el) {
38308                             var attr = unit2px(el);
38309                             return ellipsePath(attr.cx, attr.cy, attr.r);
38310                         },
38311                         ellipse: function(el) {
38312                             var attr = unit2px(el);
38313                             return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);
38314                         },
38315                         rect: function(el) {
38316                             var attr = unit2px(el);
38317                             return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);
38318                         },
38319                         image: function(el) {
38320                             var attr = unit2px(el);
38321                             return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);
38322                         },
38323                         line: function(el) {
38324                             return "M" + [el.attr("x1") || 0, el.attr("y1") || 0, el.attr("x2"), el.attr("y2")];
38325                         },
38326                         polyline: function(el) {
38327                             return "M" + el.attr("points");
38328                         },
38329                         polygon: function(el) {
38330                             return "M" + el.attr("points") + "z";
38331                         },
38332                         deflt: function(el) {
38333                             var bbox = el.node.getBBox();
38334                             return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
38335                         }
38336                     };
38337
38338                 function pathToRelative(pathArray) {
38339                     var pth = paths(pathArray),
38340                         lowerCase = String.prototype.toLowerCase;
38341                     if (pth.rel) {
38342                         return pathClone(pth.rel);
38343                     }
38344                     if (!Snap.is(pathArray, "array") || !Snap.is(pathArray && pathArray[0], "array")) {
38345                         pathArray = Snap.parsePathString(pathArray);
38346                     }
38347                     var res = [],
38348                         x = 0,
38349                         y = 0,
38350                         mx = 0,
38351                         my = 0,
38352                         start = 0;
38353                     if (pathArray[0][0] == "M") {
38354                         x = pathArray[0][1];
38355                         y = pathArray[0][2];
38356                         mx = x;
38357                         my = y;
38358                         start++;
38359                         res.push(["M", x, y]);
38360                     }
38361                     for (var i = start, ii = pathArray.length; i < ii; i++) {
38362                         var r = res[i] = [],
38363                             pa = pathArray[i];
38364                         if (pa[0] != lowerCase.call(pa[0])) {
38365                             r[0] = lowerCase.call(pa[0]);
38366                             switch (r[0]) {
38367                                 case "a":
38368                                     r[1] = pa[1];
38369                                     r[2] = pa[2];
38370                                     r[3] = pa[3];
38371                                     r[4] = pa[4];
38372                                     r[5] = pa[5];
38373                                     r[6] = +(pa[6] - x).toFixed(3);
38374                                     r[7] = +(pa[7] - y).toFixed(3);
38375                                     break;
38376                                 case "v":
38377                                     r[1] = +(pa[1] - y).toFixed(3);
38378                                     break;
38379                                 case "m":
38380                                     mx = pa[1];
38381                                     my = pa[2];
38382                                 default:
38383                                     for (var j = 1, jj = pa.length; j < jj; j++) {
38384                                         r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
38385                                     }
38386                             }
38387                         } else {
38388                             r = res[i] = [];
38389                             if (pa[0] == "m") {
38390                                 mx = pa[1] + x;
38391                                 my = pa[2] + y;
38392                             }
38393                             for (var k = 0, kk = pa.length; k < kk; k++) {
38394                                 res[i][k] = pa[k];
38395                             }
38396                         }
38397                         var len = res[i].length;
38398                         switch (res[i][0]) {
38399                             case "z":
38400                                 x = mx;
38401                                 y = my;
38402                                 break;
38403                             case "h":
38404                                 x += +res[i][len - 1];
38405                                 break;
38406                             case "v":
38407                                 y += +res[i][len - 1];
38408                                 break;
38409                             default:
38410                                 x += +res[i][len - 2];
38411                                 y += +res[i][len - 1];
38412                         }
38413                     }
38414                     res.toString = toString;
38415                     pth.rel = pathClone(res);
38416                     return res;
38417                 }
38418
38419                 function pathToAbsolute(pathArray) {
38420                     var pth = paths(pathArray);
38421                     if (pth.abs) {
38422                         return pathClone(pth.abs);
38423                     }
38424                     if (!is(pathArray, "array") || !is(pathArray && pathArray[0], "array")) { // rough
38425                         // assumption
38426                         pathArray = Snap.parsePathString(pathArray);
38427                     }
38428                     if (!pathArray || !pathArray.length) {
38429                         return [
38430                             ["M", 0, 0]
38431                         ];
38432                     }
38433                     var res = [],
38434                         x = 0,
38435                         y = 0,
38436                         mx = 0,
38437                         my = 0,
38438                         start = 0,
38439                         pa0;
38440                     if (pathArray[0][0] == "M") {
38441                         x = +pathArray[0][1];
38442                         y = +pathArray[0][2];
38443                         mx = x;
38444                         my = y;
38445                         start++;
38446                         res[0] = ["M", x, y];
38447                     }
38448                     var crz = pathArray.length == 3 &&
38449                         pathArray[0][0] == "M" &&
38450                         pathArray[1][0].toUpperCase() == "R" &&
38451                         pathArray[2][0].toUpperCase() == "Z";
38452                     for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
38453                         res.push(r = []);
38454                         pa = pathArray[i];
38455                         pa0 = pa[0];
38456                         if (pa0 != pa0.toUpperCase()) {
38457                             r[0] = pa0.toUpperCase();
38458                             switch (r[0]) {
38459                                 case "A":
38460                                     r[1] = pa[1];
38461                                     r[2] = pa[2];
38462                                     r[3] = pa[3];
38463                                     r[4] = pa[4];
38464                                     r[5] = pa[5];
38465                                     r[6] = +pa[6] + x;
38466                                     r[7] = +pa[7] + y;
38467                                     break;
38468                                 case "V":
38469                                     r[1] = +pa[1] + y;
38470                                     break;
38471                                 case "H":
38472                                     r[1] = +pa[1] + x;
38473                                     break;
38474                                 case "R":
38475                                     var dots = [x, y].concat(pa.slice(1));
38476                                     for (var j = 2, jj = dots.length; j < jj; j++) {
38477                                         dots[j] = +dots[j] + x;
38478                                         dots[++j] = +dots[j] + y;
38479                                     }
38480                                     res.pop();
38481                                     res = res.concat(catmullRom2bezier(dots, crz));
38482                                     break;
38483                                 case "O":
38484                                     res.pop();
38485                                     dots = ellipsePath(x, y, pa[1], pa[2]);
38486                                     dots.push(dots[0]);
38487                                     res = res.concat(dots);
38488                                     break;
38489                                 case "U":
38490                                     res.pop();
38491                                     res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
38492                                     r = ["U"].concat(res[res.length - 1].slice(-2));
38493                                     break;
38494                                 case "M":
38495                                     mx = +pa[1] + x;
38496                                     my = +pa[2] + y;
38497                                 default:
38498                                     for (j = 1, jj = pa.length; j < jj; j++) {
38499                                         r[j] = +pa[j] + ((j % 2) ? x : y);
38500                                     }
38501                             }
38502                         } else if (pa0 == "R") {
38503                             dots = [x, y].concat(pa.slice(1));
38504                             res.pop();
38505                             res = res.concat(catmullRom2bezier(dots, crz));
38506                             r = ["R"].concat(pa.slice(-2));
38507                         } else if (pa0 == "O") {
38508                             res.pop();
38509                             dots = ellipsePath(x, y, pa[1], pa[2]);
38510                             dots.push(dots[0]);
38511                             res = res.concat(dots);
38512                         } else if (pa0 == "U") {
38513                             res.pop();
38514                             res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
38515                             r = ["U"].concat(res[res.length - 1].slice(-2));
38516                         } else {
38517                             for (var k = 0, kk = pa.length; k < kk; k++) {
38518                                 r[k] = pa[k];
38519                             }
38520                         }
38521                         pa0 = pa0.toUpperCase();
38522                         if (pa0 != "O") {
38523                             switch (r[0]) {
38524                                 case "Z":
38525                                     x = +mx;
38526                                     y = +my;
38527                                     break;
38528                                 case "H":
38529                                     x = r[1];
38530                                     break;
38531                                 case "V":
38532                                     y = r[1];
38533                                     break;
38534                                 case "M":
38535                                     mx = r[r.length - 2];
38536                                     my = r[r.length - 1];
38537                                 default:
38538                                     x = r[r.length - 2];
38539                                     y = r[r.length - 1];
38540                             }
38541                         }
38542                     }
38543                     res.toString = toString;
38544                     pth.abs = pathClone(res);
38545                     return res;
38546                 }
38547
38548                 function l2c(x1, y1, x2, y2) {
38549                     return [x1, y1, x2, y2, x2, y2];
38550                 }
38551
38552                 function q2c(x1, y1, ax, ay, x2, y2) {
38553                     var _13 = 1 / 3,
38554                         _23 = 2 / 3;
38555                     return [
38556                         _13 * x1 + _23 * ax,
38557                         _13 * y1 + _23 * ay,
38558                         _13 * x2 + _23 * ax,
38559                         _13 * y2 + _23 * ay,
38560                         x2,
38561                         y2
38562                     ];
38563                 }
38564
38565                 function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
38566                     // for more information of where this math came from visit:
38567                     // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
38568                     var _120 = PI * 120 / 180,
38569                         rad = PI / 180 * (+angle || 0),
38570                         res = [],
38571                         xy,
38572                         rotate = Snap._.cacher(function(x, y, rad) {
38573                             var X = x * math.cos(rad) - y * math.sin(rad),
38574                                 Y = x * math.sin(rad) + y * math.cos(rad);
38575                             return {
38576                                 x: X,
38577                                 y: Y
38578                             };
38579                         });
38580                     if (!recursive) {
38581                         xy = rotate(x1, y1, -rad);
38582                         x1 = xy.x;
38583                         y1 = xy.y;
38584                         xy = rotate(x2, y2, -rad);
38585                         x2 = xy.x;
38586                         y2 = xy.y;
38587                         var cos = math.cos(PI / 180 * angle),
38588                             sin = math.sin(PI / 180 * angle),
38589                             x = (x1 - x2) / 2,
38590                             y = (y1 - y2) / 2;
38591                         var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
38592                         if (h > 1) {
38593                             h = math.sqrt(h);
38594                             rx = h * rx;
38595                             ry = h * ry;
38596                         }
38597                         var rx2 = rx * rx,
38598                             ry2 = ry * ry,
38599                             k = (large_arc_flag == sweep_flag ? -1 : 1) *
38600                             math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
38601                             cx = k * rx * y / ry + (x1 + x2) / 2,
38602                             cy = k * -ry * x / rx + (y1 + y2) / 2,
38603                             f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
38604                             f2 = math.asin(((y2 - cy) / ry).toFixed(9));
38605
38606                         f1 = x1 < cx ? PI - f1 : f1;
38607                         f2 = x2 < cx ? PI - f2 : f2;
38608                         f1 < 0 && (f1 = PI * 2 + f1);
38609                         f2 < 0 && (f2 = PI * 2 + f2);
38610                         if (sweep_flag && f1 > f2) {
38611                             f1 = f1 - PI * 2;
38612                         }
38613                         if (!sweep_flag && f2 > f1) {
38614                             f2 = f2 - PI * 2;
38615                         }
38616                     } else {
38617                         f1 = recursive[0];
38618                         f2 = recursive[1];
38619                         cx = recursive[2];
38620                         cy = recursive[3];
38621                     }
38622                     var df = f2 - f1;
38623                     if (abs(df) > _120) {
38624                         var f2old = f2,
38625                             x2old = x2,
38626                             y2old = y2;
38627                         f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
38628                         x2 = cx + rx * math.cos(f2);
38629                         y2 = cy + ry * math.sin(f2);
38630                         res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
38631                     }
38632                     df = f2 - f1;
38633                     var c1 = math.cos(f1),
38634                         s1 = math.sin(f1),
38635                         c2 = math.cos(f2),
38636                         s2 = math.sin(f2),
38637                         t = math.tan(df / 4),
38638                         hx = 4 / 3 * rx * t,
38639                         hy = 4 / 3 * ry * t,
38640                         m1 = [x1, y1],
38641                         m2 = [x1 + hx * s1, y1 - hy * c1],
38642                         m3 = [x2 + hx * s2, y2 - hy * c2],
38643                         m4 = [x2, y2];
38644                     m2[0] = 2 * m1[0] - m2[0];
38645                     m2[1] = 2 * m1[1] - m2[1];
38646                     if (recursive) {
38647                         return [m2, m3, m4].concat(res);
38648                     } else {
38649                         res = [m2, m3, m4].concat(res).join().split(",");
38650                         var newres = [];
38651                         for (var i = 0, ii = res.length; i < ii; i++) {
38652                             newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
38653                         }
38654                         return newres;
38655                     }
38656                 }
38657
38658                 function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
38659                     var t1 = 1 - t;
38660                     return {
38661                         x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
38662                         y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
38663                     };
38664                 }
38665
38666                 // Returns bounding box of cubic bezier curve.
38667                 // Source:
38668                 // http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
38669                 // Original version: NISHIO Hirokazu
38670                 // Modifications: https://github.com/timo22345
38671                 function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {
38672                     var tvalues = [],
38673                         bounds = [
38674                             [],
38675                             []
38676                         ],
38677                         a, b, c, t, t1, t2, b2ac, sqrtb2ac;
38678                     for (var i = 0; i < 2; ++i) {
38679                         if (i == 0) {
38680                             b = 6 * x0 - 12 * x1 + 6 * x2;
38681                             a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
38682                             c = 3 * x1 - 3 * x0;
38683                         } else {
38684                             b = 6 * y0 - 12 * y1 + 6 * y2;
38685                             a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
38686                             c = 3 * y1 - 3 * y0;
38687                         }
38688                         if (abs(a) < 1e-12) {
38689                             if (abs(b) < 1e-12) {
38690                                 continue;
38691                             }
38692                             t = -c / b;
38693                             if (0 < t && t < 1) {
38694                                 tvalues.push(t);
38695                             }
38696                             continue;
38697                         }
38698                         b2ac = b * b - 4 * c * a;
38699                         sqrtb2ac = math.sqrt(b2ac);
38700                         if (b2ac < 0) {
38701                             continue;
38702                         }
38703                         t1 = (-b + sqrtb2ac) / (2 * a);
38704                         if (0 < t1 && t1 < 1) {
38705                             tvalues.push(t1);
38706                         }
38707                         t2 = (-b - sqrtb2ac) / (2 * a);
38708                         if (0 < t2 && t2 < 1) {
38709                             tvalues.push(t2);
38710                         }
38711                     }
38712
38713                     var x, y, j = tvalues.length,
38714                         jlen = j,
38715                         mt;
38716                     while (j--) {
38717                         t = tvalues[j];
38718                         mt = 1 - t;
38719                         bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);
38720                         bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);
38721                     }
38722
38723                     bounds[0][jlen] = x0;
38724                     bounds[1][jlen] = y0;
38725                     bounds[0][jlen + 1] = x3;
38726                     bounds[1][jlen + 1] = y3;
38727                     bounds[0].length = bounds[1].length = jlen + 2;
38728
38729
38730                     return {
38731                         min: {
38732                             x: mmin.apply(0, bounds[0]),
38733                             y: mmin.apply(0, bounds[1])
38734                         },
38735                         max: {
38736                             x: mmax.apply(0, bounds[0]),
38737                             y: mmax.apply(0, bounds[1])
38738                         }
38739                     };
38740                 }
38741
38742                 function path2curve(path, path2) {
38743                     var pth = !path2 && paths(path);
38744                     if (!path2 && pth.curve) {
38745                         return pathClone(pth.curve);
38746                     }
38747                     var p = pathToAbsolute(path),
38748                         p2 = path2 && pathToAbsolute(path2),
38749                         attrs = {
38750                             x: 0,
38751                             y: 0,
38752                             bx: 0,
38753                             by: 0,
38754                             X: 0,
38755                             Y: 0,
38756                             qx: null,
38757                             qy: null
38758                         },
38759                         attrs2 = {
38760                             x: 0,
38761                             y: 0,
38762                             bx: 0,
38763                             by: 0,
38764                             X: 0,
38765                             Y: 0,
38766                             qx: null,
38767                             qy: null
38768                         },
38769                         processPath = function(path, d, pcom) {
38770                             var nx, ny;
38771                             if (!path) {
38772                                 return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
38773                             }!(path[0] in {
38774                                 T: 1,
38775                                 Q: 1
38776                             }) && (d.qx = d.qy = null);
38777                             switch (path[0]) {
38778                                 case "M":
38779                                     d.X = path[1];
38780                                     d.Y = path[2];
38781                                     break;
38782                                 case "A":
38783                                     path = ["C"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
38784                                     break;
38785                                 case "S":
38786                                     if (pcom == "C" || pcom == "S") { // In "S" case we
38787                                         // have to take into
38788                                         // account, if the
38789                                         // previous command
38790                                         // is C/S.
38791                                         nx = d.x * 2 - d.bx; // And reflect the
38792                                         // previous
38793                                         ny = d.y * 2 - d.by; // command's control
38794                                         // point relative to
38795                                         // the current
38796                                         // point.
38797                                     } else { // or some else or
38798                                         // nothing
38799                                         nx = d.x;
38800                                         ny = d.y;
38801                                     }
38802                                     path = ["C", nx, ny].concat(path.slice(1));
38803                                     break;
38804                                 case "T":
38805                                     if (pcom == "Q" || pcom == "T") { // In "T" case we
38806                                         // have to take into
38807                                         // account, if the
38808                                         // previous command
38809                                         // is Q/T.
38810                                         d.qx = d.x * 2 - d.qx; // And make a
38811                                         // reflection
38812                                         // similar
38813                                         d.qy = d.y * 2 - d.qy; // to case "S".
38814                                     } else { // or something else
38815                                         // or nothing
38816                                         d.qx = d.x;
38817                                         d.qy = d.y;
38818                                     }
38819                                     path = ["C"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
38820                                     break;
38821                                 case "Q":
38822                                     d.qx = path[1];
38823                                     d.qy = path[2];
38824                                     path = ["C"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
38825                                     break;
38826                                 case "L":
38827                                     path = ["C"].concat(l2c(d.x, d.y, path[1], path[2]));
38828                                     break;
38829                                 case "H":
38830                                     path = ["C"].concat(l2c(d.x, d.y, path[1], d.y));
38831                                     break;
38832                                 case "V":
38833                                     path = ["C"].concat(l2c(d.x, d.y, d.x, path[1]));
38834                                     break;
38835                                 case "Z":
38836                                     path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y));
38837                                     break;
38838                             }
38839                             return path;
38840                         },
38841                         fixArc = function(pp, i) {
38842                             if (pp[i].length > 7) {
38843                                 pp[i].shift();
38844                                 var pi = pp[i];
38845                                 while (pi.length) {
38846                                     pcoms1[i] = "A"; // if created multiple C:s, their
38847                                     // original seg is saved
38848                                     p2 && (pcoms2[i] = "A"); // the same as above
38849                                     pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6)));
38850                                 }
38851                                 pp.splice(i, 1);
38852                                 ii = mmax(p.length, p2 && p2.length || 0);
38853                             }
38854                         },
38855                         fixM = function(path1, path2, a1, a2, i) {
38856                             if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
38857                                 path2.splice(i, 0, ["M", a2.x, a2.y]);
38858                                 a1.bx = 0;
38859                                 a1.by = 0;
38860                                 a1.x = path1[i][1];
38861                                 a1.y = path1[i][2];
38862                                 ii = mmax(p.length, p2 && p2.length || 0);
38863                             }
38864                         },
38865                         pcoms1 = [], // path commands of original path p
38866                         pcoms2 = [], // path commands of original path p2
38867                         pfirst = "", // temporary holder for original path command
38868                         pcom = ""; // holder for previous path command of original path
38869                     for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
38870                         p[i] && (pfirst = p[i][0]); // save current path command
38871
38872                         if (pfirst != "C") // C is not saved yet, because it may be result
38873                         // of conversion
38874                         {
38875                             pcoms1[i] = pfirst; // Save current path command
38876                             i && (pcom = pcoms1[i - 1]); // Get previous path command
38877                             // pcom
38878                         }
38879                         p[i] = processPath(p[i], attrs, pcom); // Previous path command is
38880                         // inputted to processPath
38881
38882                         if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the
38883                         // only
38884                         // command
38885                         // which may produce multiple C:s
38886                         // so we have to make sure that C is also C in original path
38887
38888                         fixArc(p, i); // fixArc adds also the right amount of A:s to
38889                         // pcoms1
38890
38891                         if (p2) { // the same procedures is done to p2
38892                             p2[i] && (pfirst = p2[i][0]);
38893                             if (pfirst != "C") {
38894                                 pcoms2[i] = pfirst;
38895                                 i && (pcom = pcoms2[i - 1]);
38896                             }
38897                             p2[i] = processPath(p2[i], attrs2, pcom);
38898
38899                             if (pcoms2[i] != "A" && pfirst == "C") {
38900                                 pcoms2[i] = "C";
38901                             }
38902
38903                             fixArc(p2, i);
38904                         }
38905                         fixM(p, p2, attrs, attrs2, i);
38906                         fixM(p2, p, attrs2, attrs, i);
38907                         var seg = p[i],
38908                             seg2 = p2 && p2[i],
38909                             seglen = seg.length,
38910                             seg2len = p2 && seg2.length;
38911                         attrs.x = seg[seglen - 2];
38912                         attrs.y = seg[seglen - 1];
38913                         attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
38914                         attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
38915                         attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
38916                         attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
38917                         attrs2.x = p2 && seg2[seg2len - 2];
38918                         attrs2.y = p2 && seg2[seg2len - 1];
38919                     }
38920                     if (!p2) {
38921                         pth.curve = pathClone(p);
38922                     }
38923                     return p2 ? [p, p2] : p;
38924                 }
38925
38926                 function mapPath(path, matrix) {
38927                     if (!matrix) {
38928                         return path;
38929                     }
38930                     var x, y, i, j, ii, jj, pathi;
38931                     path = path2curve(path);
38932                     for (i = 0, ii = path.length; i < ii; i++) {
38933                         pathi = path[i];
38934                         for (j = 1, jj = pathi.length; j < jj; j += 2) {
38935                             x = matrix.x(pathi[j], pathi[j + 1]);
38936                             y = matrix.y(pathi[j], pathi[j + 1]);
38937                             pathi[j] = x;
38938                             pathi[j + 1] = y;
38939                         }
38940                     }
38941                     return path;
38942                 }
38943
38944                 // http://schepers.cc/getting-to-the-point
38945                 function catmullRom2bezier(crp, z) {
38946                     var d = [];
38947                     for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
38948                         var p = [{
38949                             x: +crp[i - 2],
38950                             y: +crp[i - 1]
38951                         }, {
38952                             x: +crp[i],
38953                             y: +crp[i + 1]
38954                         }, {
38955                             x: +crp[i + 2],
38956                             y: +crp[i + 3]
38957                         }, {
38958                             x: +crp[i + 4],
38959                             y: +crp[i + 5]
38960                         }];
38961                         if (z) {
38962                             if (!i) {
38963                                 p[0] = {
38964                                     x: +crp[iLen - 2],
38965                                     y: +crp[iLen - 1]
38966                                 };
38967                             } else if (iLen - 4 == i) {
38968                                 p[3] = {
38969                                     x: +crp[0],
38970                                     y: +crp[1]
38971                                 };
38972                             } else if (iLen - 2 == i) {
38973                                 p[2] = {
38974                                     x: +crp[0],
38975                                     y: +crp[1]
38976                                 };
38977                                 p[3] = {
38978                                     x: +crp[2],
38979                                     y: +crp[3]
38980                                 };
38981                             }
38982                         } else {
38983                             if (iLen - 4 == i) {
38984                                 p[3] = p[2];
38985                             } else if (!i) {
38986                                 p[0] = {
38987                                     x: +crp[i],
38988                                     y: +crp[i + 1]
38989                                 };
38990                             }
38991                         }
38992                         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,
38993                             p[2].x,
38994                             p[2].y
38995                         ]);
38996                     }
38997
38998                     return d;
38999                 }
39000
39001                 // export
39002                 Snap.path = paths;
39003
39004                 /*
39005                  * \ Snap.path.getTotalLength [ method ] * Returns the length of the given
39006                  * path in pixels * - path (string) SVG path string * = (number) length \
39007                  */
39008                 Snap.path.getTotalLength = getTotalLength;
39009                 /*
39010                  * \ Snap.path.getPointAtLength [ method ] * Returns the coordinates of the
39011                  * point located at the given length along the given path * - path (string)
39012                  * SVG path string - length (number) length, in pixels, from the start of
39013                  * the path, excluding non-rendering jumps * = (object) representation of
39014                  * the point: o { o x: (number) x coordinate, o y: (number) y coordinate, o
39015                  * alpha: (number) angle of derivative o } \
39016                  */
39017                 Snap.path.getPointAtLength = getPointAtLength;
39018                 /*
39019                  * \ Snap.path.getSubpath [ method ] * Returns the subpath of a given path
39020                  * between given start and end lengths * - path (string) SVG path string -
39021                  * from (number) length, in pixels, from the start of the path to the start
39022                  * of the segment - to (number) length, in pixels, from the start of the
39023                  * path to the end of the segment * = (string) path string definition for
39024                  * the segment \
39025                  */
39026                 Snap.path.getSubpath = function(path, from, to) {
39027                     if (this.getTotalLength(path) - to < 1e-6) {
39028                         return getSubpathsAtLength(path, from).end;
39029                     }
39030                     var a = getSubpathsAtLength(path, to, 1);
39031                     return from ? getSubpathsAtLength(a, from).end : a;
39032                 };
39033                 /*
39034                  * \ Element.getTotalLength [ method ] * Returns the length of the path in
39035                  * pixels (only works for `path` elements) = (number) length \
39036                  */
39037                 elproto.getTotalLength = function() {
39038                     if (this.node.getTotalLength) {
39039                         return this.node.getTotalLength();
39040                     }
39041                 };
39042                 // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path>
39043                 // is broken into different segments, is the jump distance to the new
39044                 // coordinates set by the _M_ or _m_ commands calculated as part of the
39045                 // path's total length?
39046                 /*
39047                  * \ Element.getPointAtLength [ method ] * Returns coordinates of the point
39048                  * located at the given length on the given path (only works for `path`
39049                  * elements) * - length (number) length, in pixels, from the start of the
39050                  * path, excluding non-rendering jumps * = (object) representation of the
39051                  * point: o { o x: (number) x coordinate, o y: (number) y coordinate, o
39052                  * alpha: (number) angle of derivative o } \
39053                  */
39054                 elproto.getPointAtLength = function(length) {
39055                     return getPointAtLength(this.attr("d"), length);
39056                 };
39057                 // SIERRA Element.getSubpath(): Similar to the problem for
39058                 // Element.getPointAtLength(). Unclear how this would work for a segmented
39059                 // path. Overall, the concept of _subpath_ and what I'm calling a _segment_
39060                 // (series of non-_M_ or _Z_ commands) is unclear.
39061                 /*
39062                  * \ Element.getSubpath [ method ] * Returns subpath of a given element from
39063                  * given start and end lengths (only works for `path` elements) * - from
39064                  * (number) length, in pixels, from the start of the path to the start of
39065                  * the segment - to (number) length, in pixels, from the start of the path
39066                  * to the end of the segment * = (string) path string definition for the
39067                  * segment \
39068                  */
39069                 elproto.getSubpath = function(from, to) {
39070                     return Snap.path.getSubpath(this.attr("d"), from, to);
39071                 };
39072                 Snap._.box = box;
39073                 /*
39074                  * \ Snap.path.findDotsAtSegment [ method ] * Utility method * Finds dot
39075                  * coordinates on the given cubic beziér curve at the given t - p1x
39076                  * (number) x of the first point of the curve - p1y (number) y of the first
39077                  * point of the curve - c1x (number) x of the first anchor of the curve -
39078                  * c1y (number) y of the first anchor of the curve - c2x (number) x of the
39079                  * second anchor of the curve - c2y (number) y of the second anchor of the
39080                  * curve - p2x (number) x of the second point of the curve - p2y (number) y
39081                  * of the second point of the curve - t (number) position on the curve
39082                  * (0..1) = (object) point information in format: o { o x: (number) x
39083                  * coordinate of the point, o y: (number) y coordinate of the point, o m: {
39084                  * o x: (number) x coordinate of the left anchor, o y: (number) y coordinate
39085                  * of the left anchor o }, o n: { o x: (number) x coordinate of the right
39086                  * anchor, o y: (number) y coordinate of the right anchor o }, o start: { o
39087                  * x: (number) x coordinate of the start of the curve, o y: (number) y
39088                  * coordinate of the start of the curve o }, o end: { o x: (number) x
39089                  * coordinate of the end of the curve, o y: (number) y coordinate of the end
39090                  * of the curve o }, o alpha: (number) angle of the curve derivative at the
39091                  * point o } \
39092                  */
39093                 Snap.path.findDotsAtSegment = findDotsAtSegment;
39094                 /*
39095                  * \ Snap.path.bezierBBox [ method ] * Utility method * Returns the bounding
39096                  * box of a given cubic beziér curve - p1x (number) x of the first point
39097                  * of the curve - p1y (number) y of the first point of the curve - c1x
39098                  * (number) x of the first anchor of the curve - c1y (number) y of the first
39099                  * anchor of the curve - c2x (number) x of the second anchor of the curve -
39100                  * c2y (number) y of the second anchor of the curve - p2x (number) x of the
39101                  * second point of the curve - p2y (number) y of the second point of the
39102                  * curve or - bez (array) array of six points for beziér curve = (object)
39103                  * bounding box o { o x: (number) x coordinate of the left top point of the
39104                  * box, o y: (number) y coordinate of the left top point of the box, o x2:
39105                  * (number) x coordinate of the right bottom point of the box, o y2:
39106                  * (number) y coordinate of the right bottom point of the box, o width:
39107                  * (number) width of the box, o height: (number) height of the box o } \
39108                  */
39109                 Snap.path.bezierBBox = bezierBBox;
39110                 /*
39111                  * \ Snap.path.isPointInsideBBox [ method ] * Utility method * Returns
39112                  * `true` if given point is inside bounding box - bbox (string) bounding box -
39113                  * x (string) x coordinate of the point - y (string) y coordinate of the
39114                  * point = (boolean) `true` if point is inside \
39115                  */
39116                 Snap.path.isPointInsideBBox = isPointInsideBBox;
39117                 /*
39118                  * \ Snap.path.isBBoxIntersect [ method ] * Utility method * Returns `true`
39119                  * if two bounding boxes intersect - bbox1 (string) first bounding box -
39120                  * bbox2 (string) second bounding box = (boolean) `true` if bounding boxes
39121                  * intersect \
39122                  */
39123                 Snap.path.isBBoxIntersect = isBBoxIntersect;
39124                 /*
39125                  * \ Snap.path.intersection [ method ] * Utility method * Finds
39126                  * intersections of two paths - path1 (string) path string - path2 (string)
39127                  * path string = (array) dots of intersection o [ o { o x: (number) x
39128                  * coordinate of the point, o y: (number) y coordinate of the point, o t1:
39129                  * (number) t value for segment of path1, o t2: (number) t value for segment
39130                  * of path2, o segment1: (number) order number for segment of path1, o
39131                  * segment2: (number) order number for segment of path2, o bez1: (array)
39132                  * eight coordinates representing beziér curve for the segment of path1,
39133                  * o bez2: (array) eight coordinates representing beziér curve for the
39134                  * segment of path2 o } o ] \
39135                  */
39136                 Snap.path.intersection = pathIntersection;
39137                 Snap.path.intersectionNumber = pathIntersectionNumber;
39138                 /*
39139                  * \ Snap.path.isPointInside [ method ] * Utility method * Returns `true` if
39140                  * given point is inside a given closed path.
39141                  * 
39142                  * Note: fill mode doesn’t affect the result of this method. - path
39143                  * (string) path string - x (number) x of the point - y (number) y of the
39144                  * point = (boolean) `true` if point is inside the path \
39145                  */
39146                 Snap.path.isPointInside = isPointInsidePath;
39147                 /*
39148                  * \ Snap.path.getBBox [ method ] * Utility method * Returns the bounding
39149                  * box of a given path - path (string) path string = (object) bounding box o {
39150                  * o x: (number) x coordinate of the left top point of the box, o y:
39151                  * (number) y coordinate of the left top point of the box, o x2: (number) x
39152                  * coordinate of the right bottom point of the box, o y2: (number) y
39153                  * coordinate of the right bottom point of the box, o width: (number) width
39154                  * of the box, o height: (number) height of the box o } \
39155                  */
39156                 Snap.path.getBBox = pathBBox;
39157                 Snap.path.get = getPath;
39158                 /*
39159                  * \ Snap.path.toRelative [ method ] * Utility method * Converts path
39160                  * coordinates into relative values - path (string) path string = (array)
39161                  * path string \
39162                  */
39163                 Snap.path.toRelative = pathToRelative;
39164                 /*
39165                  * \ Snap.path.toAbsolute [ method ] * Utility method * Converts path
39166                  * coordinates into absolute values - path (string) path string = (array)
39167                  * path string \
39168                  */
39169                 Snap.path.toAbsolute = pathToAbsolute;
39170                 /*
39171                  * \ Snap.path.toCubic [ method ] * Utility method * Converts path to a new
39172                  * path where all segments are cubic beziér curves - pathString
39173                  * (string|array) path string or array of segments = (array) array of
39174                  * segments \
39175                  */
39176                 Snap.path.toCubic = path2curve;
39177                 /*
39178                  * \ Snap.path.map [ method ] * Transform the path string with the given
39179                  * matrix - path (string) path string - matrix (object) see @Matrix =
39180                  * (string) transformed path string \
39181                  */
39182                 Snap.path.map = mapPath;
39183                 Snap.path.toString = toString;
39184                 Snap.path.clone = pathClone;
39185             });
39186             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
39187             // 
39188             // Licensed under the Apache License, Version 2.0 (the "License");
39189             // you may not use this file except in compliance with the License.
39190             // You may obtain a copy of the License at
39191             // 
39192             // http://www.apache.org/licenses/LICENSE-2.0
39193             // 
39194             // Unless required by applicable law or agreed to in writing, software
39195             // distributed under the License is distributed on an "AS IS" BASIS,
39196             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39197             // See the License for the specific language governing permissions and
39198             // limitations under the License.
39199             Snap.plugin(function(Snap, Element, Paper, glob) {
39200                 var elproto = Element.prototype,
39201                     has = "hasOwnProperty",
39202                     supportsTouch = "createTouch" in glob.doc,
39203                     events = [
39204                         "click", "dblclick", "mousedown", "mousemove", "mouseout",
39205                         "mouseover", "mouseup", "touchstart", "touchmove", "touchend",
39206                         "touchcancel", "keyup"
39207                     ],
39208                     touchMap = {
39209                         mousedown: "touchstart",
39210                         mousemove: "touchmove",
39211                         mouseup: "touchend"
39212                     },
39213                     getScroll = function(xy, el) {
39214                         var name = xy == "y" ? "scrollTop" : "scrollLeft",
39215                             doc = el && el.node ? el.node.ownerDocument : glob.doc;
39216                         return doc[name in doc.documentElement ? "documentElement" : "body"][name];
39217                     },
39218                     preventDefault = function() {
39219                         this.returnValue = false;
39220                     },
39221                     preventTouch = function() {
39222                         return this.originalEvent.preventDefault();
39223                     },
39224                     stopPropagation = function() {
39225                         this.cancelBubble = true;
39226                     },
39227                     stopTouch = function() {
39228                         return this.originalEvent.stopPropagation();
39229                     },
39230                     addEvent = (function() {
39231                         if (glob.doc.addEventListener) {
39232                             return function(obj, type, fn, element) {
39233                                 var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
39234                                     f = function(e) {
39235                                         var scrollY = getScroll("y", element),
39236                                             scrollX = getScroll("x", element);
39237                                         if (supportsTouch && touchMap[has](type)) {
39238                                             for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
39239                                                 if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {
39240                                                     var olde = e;
39241                                                     e = e.targetTouches[i];
39242                                                     e.originalEvent = olde;
39243                                                     e.preventDefault = preventTouch;
39244                                                     e.stopPropagation = stopTouch;
39245                                                     break;
39246                                                 }
39247                                             }
39248                                         }
39249                                         var x = e.clientX + scrollX,
39250                                             y = e.clientY + scrollY;
39251                                         return fn.call(element, e, x, y);
39252                                     };
39253
39254                                 if (type !== realName) {
39255                                     obj.addEventListener(type, f, false);
39256                                 }
39257
39258                                 obj.addEventListener(realName, f, false);
39259
39260                                 return function() {
39261                                     if (type !== realName) {
39262                                         obj.removeEventListener(type, f, false);
39263                                     }
39264
39265                                     obj.removeEventListener(realName, f, false);
39266                                     return true;
39267                                 };
39268                             };
39269                         } else if (glob.doc.attachEvent) {
39270                             return function(obj, type, fn, element) {
39271                                 var f = function(e) {
39272                                     e = e || element.node.ownerDocument.window.event;
39273                                     var scrollY = getScroll("y", element),
39274                                         scrollX = getScroll("x", element),
39275                                         x = e.clientX + scrollX,
39276                                         y = e.clientY + scrollY;
39277                                     e.preventDefault = e.preventDefault || preventDefault;
39278                                     e.stopPropagation = e.stopPropagation || stopPropagation;
39279                                     return fn.call(element, e, x, y);
39280                                 };
39281                                 obj.attachEvent("on" + type, f);
39282                                 var detacher = function() {
39283                                     obj.detachEvent("on" + type, f);
39284                                     return true;
39285                                 };
39286                                 return detacher;
39287                             };
39288                         }
39289                     })(),
39290                     drag = [],
39291                     dragMove = function(e) {
39292                         var x = e.clientX,
39293                             y = e.clientY,
39294                             scrollY = getScroll("y"),
39295                             scrollX = getScroll("x"),
39296                             dragi,
39297                             j = drag.length;
39298                         while (j--) {
39299                             dragi = drag[j];
39300                             if (supportsTouch) {
39301                                 var i = e.touches && e.touches.length,
39302                                     touch;
39303                                 while (i--) {
39304                                     touch = e.touches[i];
39305                                     if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
39306                                         x = touch.clientX;
39307                                         y = touch.clientY;
39308                                         (e.originalEvent ? e.originalEvent : e).preventDefault();
39309                                         break;
39310                                     }
39311                                 }
39312                             } else {
39313                                 e.preventDefault();
39314                             }
39315                             var node = dragi.el.node,
39316                                 o,
39317                                 next = node.nextSibling,
39318                                 parent = node.parentNode,
39319                                 display = node.style.display;
39320                             // glob.win.opera && parent.removeChild(node);
39321                             // node.style.display = "none";
39322                             // o = dragi.el.paper.getElementByPoint(x, y);
39323                             // node.style.display = display;
39324                             // glob.win.opera && (next ? parent.insertBefore(node, next) :
39325                             // parent.appendChild(node));
39326                             // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
39327                             x += scrollX;
39328                             y += scrollY;
39329                             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);
39330                         }
39331                     },
39332                     dragUp = function(e) {
39333                         Snap.unmousemove(dragMove).unmouseup(dragUp);
39334                         var i = drag.length,
39335                             dragi;
39336                         while (i--) {
39337                             dragi = drag[i];
39338                             dragi.el._drag = {};
39339                             eve("snap.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
39340                         }
39341                         drag = [];
39342                     };
39343                 /*
39344                  * \ Element.click [ method ] * Adds a click event handler to the element -
39345                  * handler (function) handler for the event = (object) @Element \
39346                  */
39347                 /*
39348                  * \ Element.unclick [ method ] * Removes a click event handler from the
39349                  * element - handler (function) handler for the event = (object) @Element \
39350                  */
39351
39352                 /*
39353                  * \ Element.dblclick [ method ] * Adds a double click event handler to the
39354                  * element - handler (function) handler for the event = (object) @Element \
39355                  */
39356                 /*
39357                  * \ Element.undblclick [ method ] * Removes a double click event handler
39358                  * from the element - handler (function) handler for the event = (object)
39359                  * @Element \
39360                  */
39361
39362                 /*
39363                  * \ Element.mousedown [ method ] * Adds a mousedown event handler to the
39364                  * element - handler (function) handler for the event = (object) @Element \
39365                  */
39366                 /*
39367                  * \ Element.unmousedown [ method ] * Removes a mousedown event handler from
39368                  * the element - handler (function) handler for the event = (object)
39369                  * @Element \
39370                  */
39371
39372                 /*
39373                  * \ Element.mousemove [ method ] * Adds a mousemove event handler to the
39374                  * element - handler (function) handler for the event = (object) @Element \
39375                  */
39376                 /*
39377                  * \ Element.unmousemove [ method ] * Removes a mousemove event handler from
39378                  * the element - handler (function) handler for the event = (object)
39379                  * @Element \
39380                  */
39381
39382                 /*
39383                  * \ Element.mouseout [ method ] * Adds a mouseout event handler to the
39384                  * element - handler (function) handler for the event = (object) @Element \
39385                  */
39386                 /*
39387                  * \ Element.unmouseout [ method ] * Removes a mouseout event handler from
39388                  * the element - handler (function) handler for the event = (object)
39389                  * @Element \
39390                  */
39391
39392                 /*
39393                  * \ Element.mouseover [ method ] * Adds a mouseover event handler to the
39394                  * element - handler (function) handler for the event = (object) @Element \
39395                  */
39396                 /*
39397                  * \ Element.unmouseover [ method ] * Removes a mouseover event handler from
39398                  * the element - handler (function) handler for the event = (object)
39399                  * @Element \
39400                  */
39401
39402                 /*
39403                  * \ Element.mouseup [ method ] * Adds a mouseup event handler to the
39404                  * element - handler (function) handler for the event = (object) @Element \
39405                  */
39406                 /*
39407                  * \ Element.unmouseup [ method ] * Removes a mouseup event handler from the
39408                  * element - handler (function) handler for the event = (object) @Element \
39409                  */
39410
39411                 /*
39412                  * \ Element.touchstart [ method ] * Adds a touchstart event handler to the
39413                  * element - handler (function) handler for the event = (object) @Element \
39414                  */
39415                 /*
39416                  * \ Element.untouchstart [ method ] * Removes a touchstart event handler
39417                  * from the element - handler (function) handler for the event = (object)
39418                  * @Element \
39419                  */
39420
39421                 /*
39422                  * \ Element.touchmove [ method ] * Adds a touchmove event handler to the
39423                  * element - handler (function) handler for the event = (object) @Element \
39424                  */
39425                 /*
39426                  * \ Element.untouchmove [ method ] * Removes a touchmove event handler from
39427                  * the element - handler (function) handler for the event = (object)
39428                  * @Element \
39429                  */
39430
39431                 /*
39432                  * \ Element.touchend [ method ] * Adds a touchend event handler to the
39433                  * element - handler (function) handler for the event = (object) @Element \
39434                  */
39435                 /*
39436                  * \ Element.untouchend [ method ] * Removes a touchend event handler from
39437                  * the element - handler (function) handler for the event = (object)
39438                  * @Element \
39439                  */
39440
39441                 /*
39442                  * \ Element.touchcancel [ method ] * Adds a touchcancel event handler to
39443                  * the element - handler (function) handler for the event = (object)
39444                  * @Element \
39445                  */
39446                 /*
39447                  * \ Element.untouchcancel [ method ] * Removes a touchcancel event handler
39448                  * from the element - handler (function) handler for the event = (object)
39449                  * @Element \
39450                  */
39451                 for (var i = events.length; i--;) {
39452                     (function(eventName) {
39453                         Snap[eventName] = elproto[eventName] = function(fn, scope) {
39454                             if (Snap.is(fn, "function")) {
39455                                 this.events = this.events || [];
39456                                 this.events.push({
39457                                     name: eventName,
39458                                     f: fn,
39459                                     unbind: addEvent(this.node || document, eventName, fn, scope || this)
39460                                 });
39461                             }
39462                             return this;
39463                         };
39464                         Snap["un" + eventName] =
39465                             elproto["un" + eventName] = function(fn) {
39466                                 var events = this.events || [],
39467                                     l = events.length;
39468                                 while (l--)
39469                                     if (events[l].name == eventName &&
39470                                         (events[l].f == fn || !fn)) {
39471                                         events[l].unbind();
39472                                         events.splice(l, 1);
39473                                         !events.length && delete this.events;
39474                                         return this;
39475                                     }
39476                                 return this;
39477                             };
39478                     })(events[i]);
39479                 }
39480                 /*
39481                  * \ Element.hover [ method ] * Adds hover event handlers to the element -
39482                  * f_in (function) handler for hover in - f_out (function) handler for hover
39483                  * out - icontext (object) #optional context for hover in handler - ocontext
39484                  * (object) #optional context for hover out handler = (object) @Element \
39485                  */
39486                 elproto.hover = function(f_in, f_out, scope_in, scope_out) {
39487                     return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
39488                 };
39489                 /*
39490                  * \ Element.unhover [ method ] * Removes hover event handlers from the
39491                  * element - f_in (function) handler for hover in - f_out (function) handler
39492                  * for hover out = (object) @Element \
39493                  */
39494                 elproto.unhover = function(f_in, f_out) {
39495                     return this.unmouseover(f_in).unmouseout(f_out);
39496                 };
39497                 var draggable = [];
39498                 // SIERRA unclear what _context_ refers to for starting, ending, moving the
39499                 // drag gesture.
39500                 // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y
39501                 // values offset from?
39502                 // SIERRA Element.drag(): much of this member's doc appears to be duplicated
39503                 // for some reason.
39504                 // SIERRA Unclear about this sentence: _Additionally following drag events
39505                 // will be triggered: drag.start.<id> on start, drag.end.<id> on end and
39506                 // drag.move.<id> on every move._ Is there a global _drag_ object to which
39507                 // you can assign handlers keyed by an element's ID?
39508                 /*
39509                  * \ Element.drag [ method ] * Adds event handlers for an element's drag
39510                  * gesture * - onmove (function) handler for moving - onstart (function)
39511                  * handler for drag start - onend (function) handler for drag end - mcontext
39512                  * (object) #optional context for moving handler - scontext (object)
39513                  * #optional context for drag start handler - econtext (object) #optional
39514                  * context for drag end handler Additionaly following `drag` events are
39515                  * triggered: `drag.start.<id>` on start, `drag.end.<id>` on end and
39516                  * `drag.move.<id>` on every move. When element is dragged over another
39517                  * element `drag.over.<id>` fires as well.
39518                  * 
39519                  * Start event and start handler are called in specified context or in
39520                  * context of the element with following parameters: o x (number) x position
39521                  * of the mouse o y (number) y position of the mouse o event (object) DOM
39522                  * event object Move event and move handler are called in specified context
39523                  * or in context of the element with following parameters: o dx (number)
39524                  * shift by x from the start point o dy (number) shift by y from the start
39525                  * point o x (number) x position of the mouse o y (number) y position of the
39526                  * mouse o event (object) DOM event object End event and end handler are
39527                  * called in specified context or in context of the element with following
39528                  * parameters: o event (object) DOM event object = (object) @Element \
39529                  */
39530                 elproto.drag = function(onmove, onstart, onend, move_scope, start_scope, end_scope) {
39531                     if (!arguments.length) {
39532                         var origTransform;
39533                         return this.drag(function(dx, dy) {
39534                             this.attr({
39535                                 transform: origTransform + (origTransform ? "T" : "t") + [dx, dy]
39536                             });
39537                         }, function() {
39538                             origTransform = this.transform().local;
39539                         });
39540                     }
39541
39542                     function start(e, x, y) {
39543                         (e.originalEvent || e).preventDefault();
39544                         this._drag.x = x;
39545                         this._drag.y = y;
39546                         this._drag.id = e.identifier;
39547                         !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);
39548                         drag.push({
39549                             el: this,
39550                             move_scope: move_scope,
39551                             start_scope: start_scope,
39552                             end_scope: end_scope
39553                         });
39554                         onstart && eve.on("snap.drag.start." + this.id, onstart);
39555                         onmove && eve.on("snap.drag.move." + this.id, onmove);
39556                         onend && eve.on("snap.drag.end." + this.id, onend);
39557                         eve("snap.drag.start." + this.id, start_scope || move_scope || this, x, y, e);
39558                     }
39559                     this._drag = {};
39560                     draggable.push({
39561                         el: this,
39562                         start: start
39563                     });
39564                     this.mousedown(start);
39565                     return this;
39566                 };
39567                 /*
39568                  * Element.onDragOver [ method ] * Shortcut to assign event handler for
39569                  * `drag.over.<id>` event, where `id` is the element's `id` (see
39570                  * @Element.id) - f (function) handler for event, first argument would be
39571                  * the element you are dragging over \
39572                  */
39573                 // elproto.onDragOver = function (f) {
39574                 // f ? eve.on("snap.drag.over." + this.id, f) : eve.unbind("snap.drag.over."
39575                 // + this.id);
39576                 // };
39577                 /*
39578                  * \ Element.undrag [ method ] * Removes all drag event handlers from the
39579                  * given element \
39580                  */
39581                 elproto.undrag = function() {
39582                     var i = draggable.length;
39583                     while (i--)
39584                         if (draggable[i].el == this) {
39585                             this.unmousedown(draggable[i].start);
39586                             draggable.splice(i, 1);
39587                             eve.unbind("snap.drag.*." + this.id);
39588                         }!draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);
39589                     return this;
39590                 };
39591             });
39592             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
39593             // 
39594             // Licensed under the Apache License, Version 2.0 (the "License");
39595             // you may not use this file except in compliance with the License.
39596             // You may obtain a copy of the License at
39597             // 
39598             // http://www.apache.org/licenses/LICENSE-2.0
39599             // 
39600             // Unless required by applicable law or agreed to in writing, software
39601             // distributed under the License is distributed on an "AS IS" BASIS,
39602             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39603             // See the License for the specific language governing permissions and
39604             // limitations under the License.
39605             Snap.plugin(function(Snap, Element, Paper, glob) {
39606                 var elproto = Element.prototype,
39607                     pproto = Paper.prototype,
39608                     rgurl = /^\s*url\((.+)\)/,
39609                     Str = String,
39610                     $ = Snap._.$;
39611                 Snap.filter = {};
39612                 /*
39613                  * \ Paper.filter [ method ] * Creates a `<filter>` element * - filstr
39614                  * (string) SVG fragment of filter provided as a string = (object) @Element
39615                  * Note: It is recommended to use filters embedded into the page inside an
39616                  * empty SVG element. > Usage | var f = paper.filter('<feGaussianBlur
39617                  * stdDeviation="2"/>'), | c = paper.circle(10, 10, 10).attr({ | filter: f |
39618                  * }); \
39619                  */
39620                 pproto.filter = function(filstr) {
39621                     var paper = this;
39622                     if (paper.type != "svg") {
39623                         paper = paper.paper;
39624                     }
39625                     var f = Snap.parse(Str(filstr)),
39626                         id = Snap._.id(),
39627                         width = paper.node.offsetWidth,
39628                         height = paper.node.offsetHeight,
39629                         filter = $("filter");
39630                     $(filter, {
39631                         id: id,
39632                         filterUnits: "userSpaceOnUse"
39633                     });
39634                     filter.appendChild(f.node);
39635                     paper.defs.appendChild(filter);
39636                     return new Element(filter);
39637                 };
39638
39639                 eve.on("snap.util.getattr.filter", function() {
39640                     eve.stop();
39641                     var p = $(this.node, "filter");
39642                     if (p) {
39643                         var match = Str(p).match(rgurl);
39644                         return match && Snap.select(match[1]);
39645                     }
39646                 });
39647                 eve.on("snap.util.attr.filter", function(value) {
39648                     if (value instanceof Element && value.type == "filter") {
39649                         eve.stop();
39650                         var id = value.node.id;
39651                         if (!id) {
39652                             $(value.node, {
39653                                 id: value.id
39654                             });
39655                             id = value.id;
39656                         }
39657                         $(this.node, {
39658                             filter: Snap.url(id)
39659                         });
39660                     }
39661                     if (!value || value == "none") {
39662                         eve.stop();
39663                         this.node.removeAttribute("filter");
39664                     }
39665                 });
39666                 /*
39667                  * \ Snap.filter.blur [ method ] * Returns an SVG markup string for the blur
39668                  * filter * - x (number) amount of horizontal blur, in pixels - y (number)
39669                  * #optional amount of vertical blur, in pixels = (string) filter
39670                  * representation > Usage | var f = paper.filter(Snap.filter.blur(5, 10)), |
39671                  * c = paper.circle(10, 10, 10).attr({ | filter: f | }); \
39672                  */
39673                 Snap.filter.blur = function(x, y) {
39674                     if (x == null) {
39675                         x = 2;
39676                     }
39677                     var def = y == null ? x : [x, y];
39678                     return Snap.format('\<feGaussianBlur stdDeviation="{def}"/>', {
39679                         def: def
39680                     });
39681                 };
39682                 Snap.filter.blur.toString = function() {
39683                     return this();
39684                 };
39685                 /*
39686                  * \ Snap.filter.shadow [ method ] * Returns an SVG markup string for the
39687                  * shadow filter * - dx (number) #optional horizontal shift of the shadow,
39688                  * in pixels - dy (number) #optional vertical shift of the shadow, in pixels -
39689                  * blur (number) #optional amount of blur - color (string) #optional color
39690                  * of the shadow - opacity (number) #optional `0..1` opacity of the shadow
39691                  * or - dx (number) #optional horizontal shift of the shadow, in pixels - dy
39692                  * (number) #optional vertical shift of the shadow, in pixels - color
39693                  * (string) #optional color of the shadow - opacity (number) #optional
39694                  * `0..1` opacity of the shadow which makes blur default to `4`. Or - dx
39695                  * (number) #optional horizontal shift of the shadow, in pixels - dy
39696                  * (number) #optional vertical shift of the shadow, in pixels - opacity
39697                  * (number) #optional `0..1` opacity of the shadow = (string) filter
39698                  * representation > Usage | var f = paper.filter(Snap.filter.shadow(0, 2,
39699                  * 3)), | c = paper.circle(10, 10, 10).attr({ | filter: f | }); \
39700                  */
39701                 Snap.filter.shadow = function(dx, dy, blur, color, opacity) {
39702                     if (typeof blur == "string") {
39703                         color = blur;
39704                         opacity = color;
39705                         blur = 4;
39706                     }
39707                     if (typeof color != "string") {
39708                         opacity = color;
39709                         color = "#000";
39710                     }
39711                     color = color || "#000";
39712                     if (blur == null) {
39713                         blur = 4;
39714                     }
39715                     if (opacity == null) {
39716                         opacity = 1;
39717                     }
39718                     if (dx == null) {
39719                         dx = 0;
39720                         dy = 2;
39721                     }
39722                     if (dy == null) {
39723                         dy = dx;
39724                     }
39725                     color = Snap.color(color);
39726                     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>', {
39727                         color: color,
39728                         dx: dx,
39729                         dy: dy,
39730                         blur: blur,
39731                         opacity: opacity
39732                     });
39733                 };
39734                 Snap.filter.shadow.toString = function() {
39735                     return this();
39736                 };
39737                 /*
39738                  * \ Snap.filter.grayscale [ method ] * Returns an SVG markup string for the
39739                  * grayscale filter * - amount (number) amount of filter (`0..1`) = (string)
39740                  * filter representation \
39741                  */
39742                 Snap.filter.grayscale = function(amount) {
39743                     if (amount == null) {
39744                         amount = 1;
39745                     }
39746                     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"/>', {
39747                         a: 0.2126 + 0.7874 * (1 - amount),
39748                         b: 0.7152 - 0.7152 * (1 - amount),
39749                         c: 0.0722 - 0.0722 * (1 - amount),
39750                         d: 0.2126 - 0.2126 * (1 - amount),
39751                         e: 0.7152 + 0.2848 * (1 - amount),
39752                         f: 0.0722 - 0.0722 * (1 - amount),
39753                         g: 0.2126 - 0.2126 * (1 - amount),
39754                         h: 0.0722 + 0.9278 * (1 - amount)
39755                     });
39756                 };
39757                 Snap.filter.grayscale.toString = function() {
39758                     return this();
39759                 };
39760                 /*
39761                  * \ Snap.filter.sepia [ method ] * Returns an SVG markup string for the
39762                  * sepia filter * - amount (number) amount of filter (`0..1`) = (string)
39763                  * filter representation \
39764                  */
39765                 Snap.filter.sepia = function(amount) {
39766                     if (amount == null) {
39767                         amount = 1;
39768                     }
39769                     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"/>', {
39770                         a: 0.393 + 0.607 * (1 - amount),
39771                         b: 0.769 - 0.769 * (1 - amount),
39772                         c: 0.189 - 0.189 * (1 - amount),
39773                         d: 0.349 - 0.349 * (1 - amount),
39774                         e: 0.686 + 0.314 * (1 - amount),
39775                         f: 0.168 - 0.168 * (1 - amount),
39776                         g: 0.272 - 0.272 * (1 - amount),
39777                         h: 0.534 - 0.534 * (1 - amount),
39778                         i: 0.131 + 0.869 * (1 - amount)
39779                     });
39780                 };
39781                 Snap.filter.sepia.toString = function() {
39782                     return this();
39783                 };
39784                 /*
39785                  * \ Snap.filter.saturate [ method ] * Returns an SVG markup string for the
39786                  * saturate filter * - amount (number) amount of filter (`0..1`) = (string)
39787                  * filter representation \
39788                  */
39789                 Snap.filter.saturate = function(amount) {
39790                     if (amount == null) {
39791                         amount = 1;
39792                     }
39793                     return Snap.format('<feColorMatrix type="saturate" values="{amount}"/>', {
39794                         amount: 1 - amount
39795                     });
39796                 };
39797                 Snap.filter.saturate.toString = function() {
39798                     return this();
39799                 };
39800                 /*
39801                  * \ Snap.filter.hueRotate [ method ] * Returns an SVG markup string for the
39802                  * hue-rotate filter * - angle (number) angle of rotation = (string) filter
39803                  * representation \
39804                  */
39805                 Snap.filter.hueRotate = function(angle) {
39806                     angle = angle || 0;
39807                     return Snap.format('<feColorMatrix type="hueRotate" values="{angle}"/>', {
39808                         angle: angle
39809                     });
39810                 };
39811                 Snap.filter.hueRotate.toString = function() {
39812                     return this();
39813                 };
39814                 /*
39815                  * \ Snap.filter.invert [ method ] * Returns an SVG markup string for the
39816                  * invert filter * - amount (number) amount of filter (`0..1`) = (string)
39817                  * filter representation \
39818                  */
39819                 Snap.filter.invert = function(amount) {
39820                     if (amount == null) {
39821                         amount = 1;
39822                     }
39823                     return Snap.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>', {
39824                         amount: amount,
39825                         amount2: 1 - amount
39826                     });
39827                 };
39828                 Snap.filter.invert.toString = function() {
39829                     return this();
39830                 };
39831                 /*
39832                  * \ Snap.filter.brightness [ method ] * Returns an SVG markup string for
39833                  * the brightness filter * - amount (number) amount of filter (`0..1`) =
39834                  * (string) filter representation \
39835                  */
39836                 Snap.filter.brightness = function(amount) {
39837                     if (amount == null) {
39838                         amount = 1;
39839                     }
39840                     return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>', {
39841                         amount: amount
39842                     });
39843                 };
39844                 Snap.filter.brightness.toString = function() {
39845                     return this();
39846                 };
39847                 /*
39848                  * \ Snap.filter.contrast [ method ] * Returns an SVG markup string for the
39849                  * contrast filter * - amount (number) amount of filter (`0..1`) = (string)
39850                  * filter representation \
39851                  */
39852                 Snap.filter.contrast = function(amount) {
39853                     if (amount == null) {
39854                         amount = 1;
39855                     }
39856                     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>', {
39857                         amount: amount,
39858                         amount2: .5 - amount / 2
39859                     });
39860                 };
39861                 Snap.filter.contrast.toString = function() {
39862                     return this();
39863                 };
39864             });
39865
39866             return Snap;
39867         }));
39868     }, {
39869         "eve": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\eve\\eve.js"
39870     }],
39871     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js": [function(require, module, exports) {
39872         'use strict';
39873
39874         var snapsvg = module.exports = require('snapsvg');
39875
39876         snapsvg.plugin(function(Snap, Element) {
39877
39878             /*
39879              * \ Element.children [ method ] * Returns array of all the children of the
39880              * element. = (array) array of Elements \
39881              */
39882             Element.prototype.children = function() {
39883                 var out = [],
39884                     ch = this.node.childNodes;
39885                 for (var i = 0, ii = ch.length; i < ii; i++) {
39886                     out[i] = new Snap(ch[i]);
39887                 }
39888                 return out;
39889             };
39890         });
39891
39892
39893         /**
39894          * @class ClassPlugin
39895          * 
39896          * Extends snapsvg with methods to add and remove classes
39897          */
39898         snapsvg.plugin(function(Snap, Element, Paper, global) {
39899
39900             function split(str) {
39901                 return str.split(/\s+/);
39902             }
39903
39904             function join(array) {
39905                 return array.join(' ');
39906             }
39907
39908             function getClasses(e) {
39909                 return split(e.attr('class') || '');
39910             }
39911
39912             function setClasses(e, classes) {
39913                 e.attr('class', join(classes));
39914             }
39915
39916             /**
39917              * @method snapsvg.Element#addClass
39918              * 
39919              * @example
39920              * 
39921              * e.attr('class', 'selector');
39922              * 
39923              * e.addClass('foo bar'); // adds classes foo and bar e.attr('class'); // ->
39924              * 'selector foo bar'
39925              * 
39926              * e.addClass('fooBar'); e.attr('class'); // -> 'selector foo bar fooBar'
39927              * 
39928              * @param {String}
39929              *            cls classes to be added to the element
39930              * 
39931              * @return {snapsvg.Element} the element (this)
39932              */
39933             Element.prototype.addClass = function(cls) {
39934                 var current = getClasses(this),
39935                     add = split(cls),
39936                     i, e;
39937
39938                 for (i = 0, e; !!(e = add[i]); i++) {
39939                     if (current.indexOf(e) === -1) {
39940                         current.push(e);
39941                     }
39942                 }
39943
39944                 setClasses(this, current);
39945
39946                 return this;
39947             };
39948
39949             /**
39950              * @method snapsvg.Element#hasClass
39951              * 
39952              * @param {String}
39953              *            cls the class to query for
39954              * @return {Boolean} returns true if the element has the given class
39955              */
39956             Element.prototype.hasClass = function(cls) {
39957                 if (!cls) {
39958                     throw new Error('[snapsvg] syntax: hasClass(clsStr)');
39959                 }
39960
39961                 return getClasses(this).indexOf(cls) !== -1;
39962             };
39963
39964             /**
39965              * @method snapsvg.Element#removeClass
39966              * 
39967              * @example
39968              * 
39969              * e.attr('class', 'foo bar');
39970              * 
39971              * e.removeClass('foo'); e.attr('class'); // -> 'bar'
39972              * 
39973              * e.removeClass('foo bar'); // removes classes foo and bar e.attr('class'); // -> ''
39974              * 
39975              * @param {String}
39976              *            cls classes to be removed from element
39977              * 
39978              * @return {snapsvg.Element} the element (this)
39979              */
39980             Element.prototype.removeClass = function(cls) {
39981                 var current = getClasses(this),
39982                     remove = split(cls),
39983                     i, e, idx;
39984
39985                 for (i = 0, e; !!(e = remove[i]); i++) {
39986                     idx = current.indexOf(e);
39987
39988                     if (idx !== -1) {
39989                         // remove element from array
39990                         current.splice(idx, 1);
39991                     }
39992                 }
39993
39994                 setClasses(this, current);
39995
39996                 return this;
39997             };
39998
39999         });
40000
40001         /**
40002          * @class TranslatePlugin
40003          * 
40004          * Extends snapsvg with methods to translate elements
40005          */
40006         snapsvg.plugin(function(Snap, Element, Paper, global) {
40007
40008             /*
40009              * @method snapsvg.Element#translate
40010              * 
40011              * @example
40012              * 
40013              * e.translate(10, 20);
40014              *  // sets transform matrix to translate(10, 20)
40015              * 
40016              * @param {Number} x translation @param {Number} y translation
40017              * 
40018              * @return {snapsvg.Element} the element (this)
40019              */
40020             Element.prototype.translate = function(x, y) {
40021                 var matrix = new Snap.Matrix();
40022                 matrix.translate(x, y);
40023                 return this.transform(matrix);
40024             };
40025         });
40026
40027
40028         /**
40029          * @class CreatePlugin
40030          * 
40031          * Create an svg element without attaching it to the dom
40032          */
40033         snapsvg.plugin(function(Snap) {
40034
40035             Snap.create = function(name, attrs) {
40036                 return Snap._.wrap(Snap._.$(name, attrs));
40037             };
40038         });
40039
40040
40041         /**
40042          * @class CreatSnapAtPlugin
40043          * 
40044          * Extends snap.svg with a method to create a SVG element at a specific position
40045          * in the DOM.
40046          */
40047         snapsvg.plugin(function(Snap, Element, Paper, global) {
40048
40049             /*
40050              * @method snapsvg.createSnapAt
40051              * 
40052              * @example
40053              * 
40054              * snapsvg.createSnapAt(parentNode, 200, 200);
40055              * 
40056              * @param {Number} width of svg @param {Number} height of svg @param
40057              * {Object} parentNode svg Element will be child of this
40058              * 
40059              * @return {snapsvg.Element} the newly created wrapped SVG element instance
40060              */
40061             Snap.createSnapAt = function(width, height, parentNode) {
40062
40063                 var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
40064                 svg.setAttribute('width', width);
40065                 svg.setAttribute('height', height);
40066                 if (!parentNode) {
40067                     parentNode = document.body;
40068                 }
40069                 parentNode.appendChild(svg);
40070
40071                 return new Snap(svg);
40072             };
40073         });
40074     }, {
40075         "snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\snapsvg\\dist\\snap.svg.js"
40076     }],
40077     "\\bpmn-js-examples-master\\modeler\\node_modules\\jquery\\dist\\jquery.js": [function(require, module, exports) {
40078         /*
40079          * ! jQuery JavaScript Library v2.1.4 http://jquery.com/
40080          * 
40081          * Includes Sizzle.js http://sizzlejs.com/
40082          * 
40083          * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors Released
40084          * under the MIT license http://jquery.org/license
40085          * 
40086          * Date: 2015-04-28T16:01Z
40087          */
40088
40089         (function(global, factory) {
40090
40091             if (typeof module === "object" && typeof module.exports === "object") {
40092                 // For CommonJS and CommonJS-like environments where a proper `window`
40093                 // is present, execute the factory and get jQuery.
40094                 // For environments that do not have a `window` with a `document`
40095                 // (such as Node.js), expose a factory as module.exports.
40096                 // This accentuates the need for the creation of a real `window`.
40097                 // e.g. var jQuery = require("jquery")(window);
40098                 // See ticket #14549 for more info.
40099                 module.exports = global.document ?
40100                     factory(global, true) :
40101                     function(w) {
40102                         if (!w.document) {
40103                             throw new Error("jQuery requires a window with a document");
40104                         }
40105                         return factory(w);
40106                     };
40107             } else {
40108                 factory(global);
40109             }
40110
40111             // Pass this if window is not defined yet
40112         }(typeof window !== "undefined" ? window : this, function(window, noGlobal) {
40113
40114             // Support: Firefox 18+
40115             // Can't be in strict mode, several libs including ASP.NET trace
40116             // the stack via arguments.caller.callee and Firefox dies if
40117             // you try to trace through "use strict" call chains. (#13335)
40118             //
40119
40120             var arr = [];
40121
40122             var slice = arr.slice;
40123
40124             var concat = arr.concat;
40125
40126             var push = arr.push;
40127
40128             var indexOf = arr.indexOf;
40129
40130             var class2type = {};
40131
40132             var toString = class2type.toString;
40133
40134             var hasOwn = class2type.hasOwnProperty;
40135
40136             var support = {};
40137
40138
40139
40140             var
40141             // Use the correct document accordingly with window argument (sandbox)
40142                 document = window.document,
40143
40144                 version = "2.1.4",
40145
40146                 // Define a local copy of jQuery
40147                 jQuery = function(selector, context) {
40148                     // The jQuery object is actually just the init constructor 'enhanced'
40149                     // Need init if jQuery is called (just allow error to be thrown if not
40150                     // included)
40151                     return new jQuery.fn.init(selector, context);
40152                 },
40153
40154                 // Support: Android<4.1
40155                 // Make sure we trim BOM and NBSP
40156                 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
40157
40158                 // Matches dashed string for camelizing
40159                 rmsPrefix = /^-ms-/,
40160                 rdashAlpha = /-([\da-z])/gi,
40161
40162                 // Used by jQuery.camelCase as callback to replace()
40163                 fcamelCase = function(all, letter) {
40164                     return letter.toUpperCase();
40165                 };
40166
40167             jQuery.fn = jQuery.prototype = {
40168                 // The current version of jQuery being used
40169                 jquery: version,
40170
40171                 constructor: jQuery,
40172
40173                 // Start with an empty selector
40174                 selector: "",
40175
40176                 // The default length of a jQuery object is 0
40177                 length: 0,
40178
40179                 toArray: function() {
40180                     return slice.call(this);
40181                 },
40182
40183                 // Get the Nth element in the matched element set OR
40184                 // Get the whole matched element set as a clean array
40185                 get: function(num) {
40186                     return num != null ?
40187
40188                         // Return just the one element from the set
40189                         (num < 0 ? this[num + this.length] : this[num]) :
40190
40191                         // Return all the elements in a clean array
40192                         slice.call(this);
40193                 },
40194
40195                 // Take an array of elements and push it onto the stack
40196                 // (returning the new matched element set)
40197                 pushStack: function(elems) {
40198
40199                     // Build a new jQuery matched element set
40200                     var ret = jQuery.merge(this.constructor(), elems);
40201
40202                     // Add the old object onto the stack (as a reference)
40203                     ret.prevObject = this;
40204                     ret.context = this.context;
40205
40206                     // Return the newly-formed element set
40207                     return ret;
40208                 },
40209
40210                 // Execute a callback for every element in the matched set.
40211                 // (You can seed the arguments with an array of args, but this is
40212                 // only used internally.)
40213                 each: function(callback, args) {
40214                     return jQuery.each(this, callback, args);
40215                 },
40216
40217                 map: function(callback) {
40218                     return this.pushStack(jQuery.map(this, function(elem, i) {
40219                         return callback.call(elem, i, elem);
40220                     }));
40221                 },
40222
40223                 slice: function() {
40224                     return this.pushStack(slice.apply(this, arguments));
40225                 },
40226
40227                 first: function() {
40228                     return this.eq(0);
40229                 },
40230
40231                 last: function() {
40232                     return this.eq(-1);
40233                 },
40234
40235                 eq: function(i) {
40236                     var len = this.length,
40237                         j = +i + (i < 0 ? len : 0);
40238                     return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
40239                 },
40240
40241                 end: function() {
40242                     return this.prevObject || this.constructor(null);
40243                 },
40244
40245                 // For internal use only.
40246                 // Behaves like an Array's method, not like a jQuery method.
40247                 push: push,
40248                 sort: arr.sort,
40249                 splice: arr.splice
40250             };
40251
40252             jQuery.extend = jQuery.fn.extend = function() {
40253                 var options, name, src, copy, copyIsArray, clone,
40254                     target = arguments[0] || {},
40255                     i = 1,
40256                     length = arguments.length,
40257                     deep = false;
40258
40259                 // Handle a deep copy situation
40260                 if (typeof target === "boolean") {
40261                     deep = target;
40262
40263                     // Skip the boolean and the target
40264                     target = arguments[i] || {};
40265                     i++;
40266                 }
40267
40268                 // Handle case when target is a string or something (possible in deep copy)
40269                 if (typeof target !== "object" && !jQuery.isFunction(target)) {
40270                     target = {};
40271                 }
40272
40273                 // Extend jQuery itself if only one argument is passed
40274                 if (i === length) {
40275                     target = this;
40276                     i--;
40277                 }
40278
40279                 for (; i < length; i++) {
40280                     // Only deal with non-null/undefined values
40281                     if ((options = arguments[i]) != null) {
40282                         // Extend the base object
40283                         for (name in options) {
40284                             src = target[name];
40285                             copy = options[name];
40286
40287                             // Prevent never-ending loop
40288                             if (target === copy) {
40289                                 continue;
40290                             }
40291
40292                             // Recurse if we're merging plain objects or arrays
40293                             if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
40294                                 if (copyIsArray) {
40295                                     copyIsArray = false;
40296                                     clone = src && jQuery.isArray(src) ? src : [];
40297
40298                                 } else {
40299                                     clone = src && jQuery.isPlainObject(src) ? src : {};
40300                                 }
40301
40302                                 // Never move original objects, clone them
40303                                 target[name] = jQuery.extend(deep, clone, copy);
40304
40305                                 // Don't bring in undefined values
40306                             } else if (copy !== undefined) {
40307                                 target[name] = copy;
40308                             }
40309                         }
40310                     }
40311                 }
40312
40313                 // Return the modified object
40314                 return target;
40315             };
40316
40317             jQuery.extend({
40318                 // Unique for each copy of jQuery on the page
40319                 expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
40320
40321                 // Assume jQuery is ready without the ready module
40322                 isReady: true,
40323
40324                 error: function(msg) {
40325                     throw new Error(msg);
40326                 },
40327
40328                 noop: function() {},
40329
40330                 isFunction: function(obj) {
40331                     return jQuery.type(obj) === "function";
40332                 },
40333
40334                 isArray: Array.isArray,
40335
40336                 isWindow: function(obj) {
40337                     return obj != null && obj === obj.window;
40338                 },
40339
40340                 isNumeric: function(obj) {
40341                     // parseFloat NaNs numeric-cast false positives (null|true|false|"")
40342                     // ...but misinterprets leading-number strings, particularly hex
40343                     // literals ("0x...")
40344                     // subtraction forces infinities to NaN
40345                     // adding 1 corrects loss of precision from parseFloat (#15100)
40346                     return !jQuery.isArray(obj) && (obj - parseFloat(obj) + 1) >= 0;
40347                 },
40348
40349                 isPlainObject: function(obj) {
40350                     // Not plain objects:
40351                     // - Any object or value whose internal [[Class]] property is not
40352                     // "[object Object]"
40353                     // - DOM nodes
40354                     // - window
40355                     if (jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) {
40356                         return false;
40357                     }
40358
40359                     if (obj.constructor &&
40360                         !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
40361                         return false;
40362                     }
40363
40364                     // If the function hasn't returned already, we're confident that
40365                     // |obj| is a plain object, created by {} or constructed with new Object
40366                     return true;
40367                 },
40368
40369                 isEmptyObject: function(obj) {
40370                     var name;
40371                     for (name in obj) {
40372                         return false;
40373                     }
40374                     return true;
40375                 },
40376
40377                 type: function(obj) {
40378                     if (obj == null) {
40379                         return obj + "";
40380                     }
40381                     // Support: Android<4.0, iOS<6 (functionish RegExp)
40382                     return typeof obj === "object" || typeof obj === "function" ?
40383                         class2type[toString.call(obj)] || "object" :
40384                         typeof obj;
40385                 },
40386
40387                 // Evaluates a script in a global context
40388                 globalEval: function(code) {
40389                     var script,
40390                         indirect = eval;
40391
40392                     code = jQuery.trim(code);
40393
40394                     if (code) {
40395                         // If the code includes a valid, prologue position
40396                         // strict mode pragma, execute code by injecting a
40397                         // script tag into the document.
40398                         if (code.indexOf("use strict") === 1) {
40399                             script = document.createElement("script");
40400                             script.text = code;
40401                             document.head.appendChild(script).parentNode.removeChild(script);
40402                         } else {
40403                             // Otherwise, avoid the DOM node creation, insertion
40404                             // and removal by using an indirect global eval
40405                             indirect(code);
40406                         }
40407                     }
40408                 },
40409
40410                 // Convert dashed to camelCase; used by the css and data modules
40411                 // Support: IE9-11+
40412                 // Microsoft forgot to hump their vendor prefix (#9572)
40413                 camelCase: function(string) {
40414                     return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
40415                 },
40416
40417                 nodeName: function(elem, name) {
40418                     return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
40419                 },
40420
40421                 // args is for internal usage only
40422                 each: function(obj, callback, args) {
40423                     var value,
40424                         i = 0,
40425                         length = obj.length,
40426                         isArray = isArraylike(obj);
40427
40428                     if (args) {
40429                         if (isArray) {
40430                             for (; i < length; i++) {
40431                                 value = callback.apply(obj[i], args);
40432
40433                                 if (value === false) {
40434                                     break;
40435                                 }
40436                             }
40437                         } else {
40438                             for (i in obj) {
40439                                 value = callback.apply(obj[i], args);
40440
40441                                 if (value === false) {
40442                                     break;
40443                                 }
40444                             }
40445                         }
40446
40447                         // A special, fast, case for the most common use of each
40448                     } else {
40449                         if (isArray) {
40450                             for (; i < length; i++) {
40451                                 value = callback.call(obj[i], i, obj[i]);
40452
40453                                 if (value === false) {
40454                                     break;
40455                                 }
40456                             }
40457                         } else {
40458                             for (i in obj) {
40459                                 value = callback.call(obj[i], i, obj[i]);
40460
40461                                 if (value === false) {
40462                                     break;
40463                                 }
40464                             }
40465                         }
40466                     }
40467
40468                     return obj;
40469                 },
40470
40471                 // Support: Android<4.1
40472                 trim: function(text) {
40473                     return text == null ?
40474                         "" :
40475                         (text + "").replace(rtrim, "");
40476                 },
40477
40478                 // results is for internal usage only
40479                 makeArray: function(arr, results) {
40480                     var ret = results || [];
40481
40482                     if (arr != null) {
40483                         if (isArraylike(Object(arr))) {
40484                             jQuery.merge(ret,
40485                                 typeof arr === "string" ? [arr] : arr
40486                             );
40487                         } else {
40488                             push.call(ret, arr);
40489                         }
40490                     }
40491
40492                     return ret;
40493                 },
40494
40495                 inArray: function(elem, arr, i) {
40496                     return arr == null ? -1 : indexOf.call(arr, elem, i);
40497                 },
40498
40499                 merge: function(first, second) {
40500                     var len = +second.length,
40501                         j = 0,
40502                         i = first.length;
40503
40504                     for (; j < len; j++) {
40505                         first[i++] = second[j];
40506                     }
40507
40508                     first.length = i;
40509
40510                     return first;
40511                 },
40512
40513                 grep: function(elems, callback, invert) {
40514                     var callbackInverse,
40515                         matches = [],
40516                         i = 0,
40517                         length = elems.length,
40518                         callbackExpect = !invert;
40519
40520                     // Go through the array, only saving the items
40521                     // that pass the validator function
40522                     for (; i < length; i++) {
40523                         callbackInverse = !callback(elems[i], i);
40524                         if (callbackInverse !== callbackExpect) {
40525                             matches.push(elems[i]);
40526                         }
40527                     }
40528
40529                     return matches;
40530                 },
40531
40532                 // arg is for internal usage only
40533                 map: function(elems, callback, arg) {
40534                     var value,
40535                         i = 0,
40536                         length = elems.length,
40537                         isArray = isArraylike(elems),
40538                         ret = [];
40539
40540                     // Go through the array, translating each of the items to their new
40541                     // values
40542                     if (isArray) {
40543                         for (; i < length; i++) {
40544                             value = callback(elems[i], i, arg);
40545
40546                             if (value != null) {
40547                                 ret.push(value);
40548                             }
40549                         }
40550
40551                         // Go through every key on the object,
40552                     } else {
40553                         for (i in elems) {
40554                             value = callback(elems[i], i, arg);
40555
40556                             if (value != null) {
40557                                 ret.push(value);
40558                             }
40559                         }
40560                     }
40561
40562                     // Flatten any nested arrays
40563                     return concat.apply([], ret);
40564                 },
40565
40566                 // A global GUID counter for objects
40567                 guid: 1,
40568
40569                 // Bind a function to a context, optionally partially applying any
40570                 // arguments.
40571                 proxy: function(fn, context) {
40572                     var tmp, args, proxy;
40573
40574                     if (typeof context === "string") {
40575                         tmp = fn[context];
40576                         context = fn;
40577                         fn = tmp;
40578                     }
40579
40580                     // Quick check to determine if target is callable, in the spec
40581                     // this throws a TypeError, but we will just return undefined.
40582                     if (!jQuery.isFunction(fn)) {
40583                         return undefined;
40584                     }
40585
40586                     // Simulated bind
40587                     args = slice.call(arguments, 2);
40588                     proxy = function() {
40589                         return fn.apply(context || this, args.concat(slice.call(arguments)));
40590                     };
40591
40592                     // Set the guid of unique handler to the same of original handler, so it
40593                     // can be removed
40594                     proxy.guid = fn.guid = fn.guid || jQuery.guid++;
40595
40596                     return proxy;
40597                 },
40598
40599                 now: Date.now,
40600
40601                 // jQuery.support is not used in Core but other projects attach their
40602                 // properties to it so it needs to exist.
40603                 support: support
40604             });
40605
40606             // Populate the class2type map
40607             jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
40608                 class2type["[object " + name + "]"] = name.toLowerCase();
40609             });
40610
40611             function isArraylike(obj) {
40612
40613                 // Support: iOS 8.2 (not reproducible in simulator)
40614                 // `in` check used to prevent JIT error (gh-2145)
40615                 // hasOwn isn't used here due to false negatives
40616                 // regarding Nodelist length in IE
40617                 var length = "length" in obj && obj.length,
40618                     type = jQuery.type(obj);
40619
40620                 if (type === "function" || jQuery.isWindow(obj)) {
40621                     return false;
40622                 }
40623
40624                 if (obj.nodeType === 1 && length) {
40625                     return true;
40626                 }
40627
40628                 return type === "array" || length === 0 ||
40629                     typeof length === "number" && length > 0 && (length - 1) in obj;
40630             }
40631             var Sizzle =
40632                 /*
40633                  * ! Sizzle CSS Selector Engine v2.2.0-pre http://sizzlejs.com/
40634                  * 
40635                  * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors Released
40636                  * under the MIT license http://jquery.org/license
40637                  * 
40638                  * Date: 2014-12-16
40639                  */
40640                 (function(window) {
40641
40642                     var i,
40643                         support,
40644                         Expr,
40645                         getText,
40646                         isXML,
40647                         tokenize,
40648                         compile,
40649                         select,
40650                         outermostContext,
40651                         sortInput,
40652                         hasDuplicate,
40653
40654                         // Local document vars
40655                         setDocument,
40656                         document,
40657                         docElem,
40658                         documentIsHTML,
40659                         rbuggyQSA,
40660                         rbuggyMatches,
40661                         matches,
40662                         contains,
40663
40664                         // Instance-specific data
40665                         expando = "sizzle" + 1 * new Date(),
40666                         preferredDoc = window.document,
40667                         dirruns = 0,
40668                         done = 0,
40669                         classCache = createCache(),
40670                         tokenCache = createCache(),
40671                         compilerCache = createCache(),
40672                         sortOrder = function(a, b) {
40673                             if (a === b) {
40674                                 hasDuplicate = true;
40675                             }
40676                             return 0;
40677                         },
40678
40679                         // General-purpose constants
40680                         MAX_NEGATIVE = 1 << 31,
40681
40682                         // Instance methods
40683                         hasOwn = ({}).hasOwnProperty,
40684                         arr = [],
40685                         pop = arr.pop,
40686                         push_native = arr.push,
40687                         push = arr.push,
40688                         slice = arr.slice,
40689                         // Use a stripped-down indexOf as it's faster than native
40690                         // http://jsperf.com/thor-indexof-vs-for/5
40691                         indexOf = function(list, elem) {
40692                             var i = 0,
40693                                 len = list.length;
40694                             for (; i < len; i++) {
40695                                 if (list[i] === elem) {
40696                                     return i;
40697                                 }
40698                             }
40699                             return -1;
40700                         },
40701
40702                         booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
40703
40704                         // Regular expressions
40705
40706                         // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
40707                         whitespace = "[\\x20\\t\\r\\n\\f]",
40708                         // http://www.w3.org/TR/css3-syntax/#characters
40709                         characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
40710
40711                         // Loosely modeled on CSS identifier characters
40712                         // An unquoted value should be a CSS identifier
40713                         // http://www.w3.org/TR/css3-selectors/#attribute-selectors
40714                         // Proper syntax:
40715                         // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
40716                         identifier = characterEncoding.replace("w", "w#"),
40717
40718                         // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
40719                         attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
40720                         // Operator (capture 2)
40721                         "*([*^$|!~]?=)" + whitespace +
40722                         // "Attribute values must be CSS identifiers [capture 5] or strings
40723                         // [capture 3 or capture 4]"
40724                         "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
40725                         "*\\]",
40726
40727                         pseudos = ":(" + characterEncoding + ")(?:\\((" +
40728                         // To reduce the number of selectors needing tokenize in the preFilter,
40729                         // prefer arguments:
40730                         // 1. quoted (capture 3; capture 4 or capture 5)
40731                         "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
40732                         // 2. simple (capture 6)
40733                         "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
40734                         // 3. anything else (capture 2)
40735                         ".*" +
40736                         ")\\)|)",
40737
40738                         // Leading and non-escaped trailing whitespace, capturing some
40739                         // non-whitespace characters preceding the latter
40740                         rwhitespace = new RegExp(whitespace + "+", "g"),
40741                         rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"),
40742
40743                         rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"),
40744                         rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"),
40745
40746                         rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g"),
40747
40748                         rpseudo = new RegExp(pseudos),
40749                         ridentifier = new RegExp("^" + identifier + "$"),
40750
40751                         matchExpr = {
40752                             "ID": new RegExp("^#(" + characterEncoding + ")"),
40753                             "CLASS": new RegExp("^\\.(" + characterEncoding + ")"),
40754                             "TAG": new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"),
40755                             "ATTR": new RegExp("^" + attributes),
40756                             "PSEUDO": new RegExp("^" + pseudos),
40757                             "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
40758                                 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
40759                                 "*(\\d+)|))" + whitespace + "*\\)|)", "i"),
40760                             "bool": new RegExp("^(?:" + booleans + ")$", "i"),
40761                             // For use in libraries implementing .is()
40762                             // We use this for POS matching in `select`
40763                             "needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
40764                                 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
40765                         },
40766
40767                         rinputs = /^(?:input|select|textarea|button)$/i,
40768                         rheader = /^h\d$/i,
40769
40770                         rnative = /^[^{]+\{\s*\[native \w/,
40771
40772                         // Easily-parseable/retrievable ID or TAG or CLASS selectors
40773                         rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
40774
40775                         rsibling = /[+~]/,
40776                         rescape = /'|\\/g,
40777
40778                         // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
40779                         runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig"),
40780                         funescape = function(_, escaped, escapedWhitespace) {
40781                             var high = "0x" + escaped - 0x10000;
40782                             // NaN means non-codepoint
40783                             // Support: Firefox<24
40784                             // Workaround erroneous numeric interpretation of +"0x"
40785                             return high !== high || escapedWhitespace ?
40786                                 escaped :
40787                                 high < 0 ?
40788                                 // BMP codepoint
40789                                 String.fromCharCode(high + 0x10000) :
40790                                 // Supplemental Plane codepoint (surrogate pair)
40791                                 String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);
40792                         },
40793
40794                         // Used for iframes
40795                         // See setDocument()
40796                         // Removing the function wrapper causes a "Permission Denied"
40797                         // error in IE
40798                         unloadHandler = function() {
40799                             setDocument();
40800                         };
40801
40802                     // Optimize for push.apply( _, NodeList )
40803                     try {
40804                         push.apply(
40805                             (arr = slice.call(preferredDoc.childNodes)),
40806                             preferredDoc.childNodes
40807                         );
40808                         // Support: Android<4.0
40809                         // Detect silently failing push.apply
40810                         arr[preferredDoc.childNodes.length].nodeType;
40811                     } catch (e) {
40812                         push = {
40813                             apply: arr.length ?
40814
40815                                 // Leverage slice if possible
40816                                 function(target, els) {
40817                                     push_native.apply(target, slice.call(els));
40818                                 } :
40819
40820                                 // Support: IE<9
40821                                 // Otherwise append directly
40822                                 function(target, els) {
40823                                     var j = target.length,
40824                                         i = 0;
40825                                     // Can't trust NodeList.length
40826                                     while ((target[j++] = els[i++])) {}
40827                                     target.length = j - 1;
40828                                 }
40829                         };
40830                     }
40831
40832                     function Sizzle(selector, context, results, seed) {
40833                         var match, elem, m, nodeType,
40834                             // QSA vars
40835                             i, groups, old, nid, newContext, newSelector;
40836
40837                         if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
40838                             setDocument(context);
40839                         }
40840
40841                         context = context || document;
40842                         results = results || [];
40843                         nodeType = context.nodeType;
40844
40845                         if (typeof selector !== "string" || !selector ||
40846                             nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
40847
40848                             return results;
40849                         }
40850
40851                         if (!seed && documentIsHTML) {
40852
40853                             // Try to shortcut find operations when possible (e.g., not under
40854                             // DocumentFragment)
40855                             if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {
40856                                 // Speed-up: Sizzle("#ID")
40857                                 if ((m = match[1])) {
40858                                     if (nodeType === 9) {
40859                                         elem = context.getElementById(m);
40860                                         // Check parentNode to catch when Blackberry 4.6 returns
40861                                         // nodes that are no longer in the document (jQuery #6963)
40862                                         if (elem && elem.parentNode) {
40863                                             // Handle the case where IE, Opera, and Webkit return
40864                                             // items
40865                                             // by name instead of ID
40866                                             if (elem.id === m) {
40867                                                 results.push(elem);
40868                                                 return results;
40869                                             }
40870                                         } else {
40871                                             return results;
40872                                         }
40873                                     } else {
40874                                         // Context is not a document
40875                                         if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) &&
40876                                             contains(context, elem) && elem.id === m) {
40877                                             results.push(elem);
40878                                             return results;
40879                                         }
40880                                     }
40881
40882                                     // Speed-up: Sizzle("TAG")
40883                                 } else if (match[2]) {
40884                                     push.apply(results, context.getElementsByTagName(selector));
40885                                     return results;
40886
40887                                     // Speed-up: Sizzle(".CLASS")
40888                                 } else if ((m = match[3]) && support.getElementsByClassName) {
40889                                     push.apply(results, context.getElementsByClassName(m));
40890                                     return results;
40891                                 }
40892                             }
40893
40894                             // QSA path
40895                             if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
40896                                 nid = old = expando;
40897                                 newContext = context;
40898                                 newSelector = nodeType !== 1 && selector;
40899
40900                                 // qSA works strangely on Element-rooted queries
40901                                 // We can work around this by specifying an extra ID on the root
40902                                 // and working up from there (Thanks to Andrew Dupont for the
40903                                 // technique)
40904                                 // IE 8 doesn't work on object elements
40905                                 if (nodeType === 1 && context.nodeName.toLowerCase() !== "object") {
40906                                     groups = tokenize(selector);
40907
40908                                     if ((old = context.getAttribute("id"))) {
40909                                         nid = old.replace(rescape, "\\$&");
40910                                     } else {
40911                                         context.setAttribute("id", nid);
40912                                     }
40913                                     nid = "[id='" + nid + "'] ";
40914
40915                                     i = groups.length;
40916                                     while (i--) {
40917                                         groups[i] = nid + toSelector(groups[i]);
40918                                     }
40919                                     newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
40920                                     newSelector = groups.join(",");
40921                                 }
40922
40923                                 if (newSelector) {
40924                                     try {
40925                                         push.apply(results,
40926                                             newContext.querySelectorAll(newSelector)
40927                                         );
40928                                         return results;
40929                                     } catch (qsaError) {} finally {
40930                                         if (!old) {
40931                                             context.removeAttribute("id");
40932                                         }
40933                                     }
40934                                 }
40935                             }
40936                         }
40937
40938                         // All others
40939                         return select(selector.replace(rtrim, "$1"), context, results, seed);
40940                     }
40941
40942                     /**
40943                      * Create key-value caches of limited size
40944                      * 
40945                      * @returns {Function(string, Object)} Returns the Object data after storing it
40946                      *          on itself with property name the (space-suffixed) string and (if the
40947                      *          cache is larger than Expr.cacheLength) deleting the oldest entry
40948                      */
40949                     function createCache() {
40950                         var keys = [];
40951
40952                         function cache(key, value) {
40953                             // Use (key + " ") to avoid collision with native prototype properties
40954                             // (see Issue #157)
40955                             if (keys.push(key + " ") > Expr.cacheLength) {
40956                                 // Only keep the most recent entries
40957                                 delete cache[keys.shift()];
40958                             }
40959                             return (cache[key + " "] = value);
40960                         }
40961                         return cache;
40962                     }
40963
40964                     /**
40965                      * Mark a function for special use by Sizzle
40966                      * 
40967                      * @param {Function}
40968                      *            fn The function to mark
40969                      */
40970                     function markFunction(fn) {
40971                         fn[expando] = true;
40972                         return fn;
40973                     }
40974
40975                     /**
40976                      * Support testing using an element
40977                      * 
40978                      * @param {Function}
40979                      *            fn Passed the created div and expects a boolean result
40980                      */
40981                     function assert(fn) {
40982                         var div = document.createElement("div");
40983
40984                         try {
40985                             return !!fn(div);
40986                         } catch (e) {
40987                             return false;
40988                         } finally {
40989                             // Remove from its parent by default
40990                             if (div.parentNode) {
40991                                 div.parentNode.removeChild(div);
40992                             }
40993                             // release memory in IE
40994                             div = null;
40995                         }
40996                     }
40997
40998                     /**
40999                      * Adds the same handler for all of the specified attrs
41000                      * 
41001                      * @param {String}
41002                      *            attrs Pipe-separated list of attributes
41003                      * @param {Function}
41004                      *            handler The method that will be applied
41005                      */
41006                     function addHandle(attrs, handler) {
41007                         var arr = attrs.split("|"),
41008                             i = attrs.length;
41009
41010                         while (i--) {
41011                             Expr.attrHandle[arr[i]] = handler;
41012                         }
41013                     }
41014
41015                     /**
41016                      * Checks document order of two siblings
41017                      * 
41018                      * @param {Element}
41019                      *            a
41020                      * @param {Element}
41021                      *            b
41022                      * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a
41023                      *          follows b
41024                      */
41025                     function siblingCheck(a, b) {
41026                         var cur = b && a,
41027                             diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
41028                             (~b.sourceIndex || MAX_NEGATIVE) -
41029                             (~a.sourceIndex || MAX_NEGATIVE);
41030
41031                         // Use IE sourceIndex if available on both nodes
41032                         if (diff) {
41033                             return diff;
41034                         }
41035
41036                         // Check if b follows a
41037                         if (cur) {
41038                             while ((cur = cur.nextSibling)) {
41039                                 if (cur === b) {
41040                                     return -1;
41041                                 }
41042                             }
41043                         }
41044
41045                         return a ? 1 : -1;
41046                     }
41047
41048                     /**
41049                      * Returns a function to use in pseudos for input types
41050                      * 
41051                      * @param {String}
41052                      *            type
41053                      */
41054                     function createInputPseudo(type) {
41055                         return function(elem) {
41056                             var name = elem.nodeName.toLowerCase();
41057                             return name === "input" && elem.type === type;
41058                         };
41059                     }
41060
41061                     /**
41062                      * Returns a function to use in pseudos for buttons
41063                      * 
41064                      * @param {String}
41065                      *            type
41066                      */
41067                     function createButtonPseudo(type) {
41068                         return function(elem) {
41069                             var name = elem.nodeName.toLowerCase();
41070                             return (name === "input" || name === "button") && elem.type === type;
41071                         };
41072                     }
41073
41074                     /**
41075                      * Returns a function to use in pseudos for positionals
41076                      * 
41077                      * @param {Function}
41078                      *            fn
41079                      */
41080                     function createPositionalPseudo(fn) {
41081                         return markFunction(function(argument) {
41082                             argument = +argument;
41083                             return markFunction(function(seed, matches) {
41084                                 var j,
41085                                     matchIndexes = fn([], seed.length, argument),
41086                                     i = matchIndexes.length;
41087
41088                                 // Match elements found at the specified indexes
41089                                 while (i--) {
41090                                     if (seed[(j = matchIndexes[i])]) {
41091                                         seed[j] = !(matches[j] = seed[j]);
41092                                     }
41093                                 }
41094                             });
41095                         });
41096                     }
41097
41098                     /**
41099                      * Checks a node for validity as a Sizzle context
41100                      * 
41101                      * @param {Element|Object=}
41102                      *            context
41103                      * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a
41104                      *          falsy value
41105                      */
41106                     function testContext(context) {
41107                         return context && typeof context.getElementsByTagName !== "undefined" && context;
41108                     }
41109
41110                     // Expose support vars for convenience
41111                     support = Sizzle.support = {};
41112
41113                     /**
41114                      * Detects XML nodes
41115                      * 
41116                      * @param {Element|Object}
41117                      *            elem An element or a document
41118                      * @returns {Boolean} True iff elem is a non-HTML XML node
41119                      */
41120                     isXML = Sizzle.isXML = function(elem) {
41121                         // documentElement is verified for cases where it doesn't yet exist
41122                         // (such as loading iframes in IE - #4833)
41123                         var documentElement = elem && (elem.ownerDocument || elem).documentElement;
41124                         return documentElement ? documentElement.nodeName !== "HTML" : false;
41125                     };
41126
41127                     /**
41128                      * Sets document-related variables once based on the current document
41129                      * 
41130                      * @param {Element|Object}
41131                      *            [doc] An element or document object to use to set the document
41132                      * @returns {Object} Returns the current document
41133                      */
41134                     setDocument = Sizzle.setDocument = function(node) {
41135                         var hasCompare, parent,
41136                             doc = node ? node.ownerDocument || node : preferredDoc;
41137
41138                         // If no document and documentElement is available, return
41139                         if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {
41140                             return document;
41141                         }
41142
41143                         // Set our document
41144                         document = doc;
41145                         docElem = doc.documentElement;
41146                         parent = doc.defaultView;
41147
41148                         // Support: IE>8
41149                         // If iframe document is assigned to "document" variable and if iframe has
41150                         // been reloaded,
41151                         // IE will throw "permission denied" error when accessing "document"
41152                         // variable, see jQuery #13936
41153                         // IE6-8 do not support the defaultView property so parent will be undefined
41154                         if (parent && parent !== parent.top) {
41155                             // IE11 does not have attachEvent, so all must suffer
41156                             if (parent.addEventListener) {
41157                                 parent.addEventListener("unload", unloadHandler, false);
41158                             } else if (parent.attachEvent) {
41159                                 parent.attachEvent("onunload", unloadHandler);
41160                             }
41161                         }
41162
41163                         /*
41164                          * Support tests
41165                          * ----------------------------------------------------------------------
41166                          */
41167                         documentIsHTML = !isXML(doc);
41168
41169                         /*
41170                          * Attributes
41171                          * ----------------------------------------------------------------------
41172                          */
41173
41174                         // Support: IE<8
41175                         // Verify that getAttribute really returns attributes and not properties
41176                         // (excepting IE8 booleans)
41177                         support.attributes = assert(function(div) {
41178                             div.className = "i";
41179                             return !div.getAttribute("className");
41180                         });
41181
41182                         /***************************************************************************
41183                          * getElement(s)By
41184                          * ----------------------------------------------------------------------
41185                          */
41186
41187                         // Check if getElementsByTagName("*") returns only elements
41188                         support.getElementsByTagName = assert(function(div) {
41189                             div.appendChild(doc.createComment(""));
41190                             return !div.getElementsByTagName("*").length;
41191                         });
41192
41193                         // Support: IE<9
41194                         support.getElementsByClassName = rnative.test(doc.getElementsByClassName);
41195
41196                         // Support: IE<10
41197                         // Check if getElementById returns elements by name
41198                         // The broken getElementById methods don't pick up programatically-set
41199                         // names,
41200                         // so use a roundabout getElementsByName test
41201                         support.getById = assert(function(div) {
41202                             docElem.appendChild(div).id = expando;
41203                             return !doc.getElementsByName || !doc.getElementsByName(expando).length;
41204                         });
41205
41206                         // ID find and filter
41207                         if (support.getById) {
41208                             Expr.find["ID"] = function(id, context) {
41209                                 if (typeof context.getElementById !== "undefined" && documentIsHTML) {
41210                                     var m = context.getElementById(id);
41211                                     // Check parentNode to catch when Blackberry 4.6 returns
41212                                     // nodes that are no longer in the document #6963
41213                                     return m && m.parentNode ? [m] : [];
41214                                 }
41215                             };
41216                             Expr.filter["ID"] = function(id) {
41217                                 var attrId = id.replace(runescape, funescape);
41218                                 return function(elem) {
41219                                     return elem.getAttribute("id") === attrId;
41220                                 };
41221                             };
41222                         } else {
41223                             // Support: IE6/7
41224                             // getElementById is not reliable as a find shortcut
41225                             delete Expr.find["ID"];
41226
41227                             Expr.filter["ID"] = function(id) {
41228                                 var attrId = id.replace(runescape, funescape);
41229                                 return function(elem) {
41230                                     var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
41231                                     return node && node.value === attrId;
41232                                 };
41233                             };
41234                         }
41235
41236                         // Tag
41237                         Expr.find["TAG"] = support.getElementsByTagName ?
41238                             function(tag, context) {
41239                                 if (typeof context.getElementsByTagName !== "undefined") {
41240                                     return context.getElementsByTagName(tag);
41241
41242                                     // DocumentFragment nodes don't have gEBTN
41243                                 } else if (support.qsa) {
41244                                     return context.querySelectorAll(tag);
41245                                 }
41246                             } :
41247
41248                             function(tag, context) {
41249                                 var elem,
41250                                     tmp = [],
41251                                     i = 0,
41252                                     // By happy coincidence, a (broken) gEBTN appears on
41253                                     // DocumentFragment nodes too
41254                                     results = context.getElementsByTagName(tag);
41255
41256                                 // Filter out possible comments
41257                                 if (tag === "*") {
41258                                     while ((elem = results[i++])) {
41259                                         if (elem.nodeType === 1) {
41260                                             tmp.push(elem);
41261                                         }
41262                                     }
41263
41264                                     return tmp;
41265                                 }
41266                                 return results;
41267                             };
41268
41269                         // Class
41270                         Expr.find["CLASS"] = support.getElementsByClassName && function(className, context) {
41271                             if (documentIsHTML) {
41272                                 return context.getElementsByClassName(className);
41273                             }
41274                         };
41275
41276                         /*
41277                          * QSA/matchesSelector
41278                          * ----------------------------------------------------------------------
41279                          */
41280
41281                         // QSA and matchesSelector support
41282
41283                         // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
41284                         rbuggyMatches = [];
41285
41286                         // qSa(:focus) reports false when true (Chrome 21)
41287                         // We allow this because of a bug in IE8/9 that throws an error
41288                         // whenever `document.activeElement` is accessed on an iframe
41289                         // So, we allow :focus to pass through QSA all the time to avoid the IE
41290                         // error
41291                         // See http://bugs.jquery.com/ticket/13378
41292                         rbuggyQSA = [];
41293
41294                         if ((support.qsa = rnative.test(doc.querySelectorAll))) {
41295                             // Build QSA regex
41296                             // Regex strategy adopted from Diego Perini
41297                             assert(function(div) {
41298                                 // Select is set to empty string on purpose
41299                                 // This is to test IE's treatment of not explicitly
41300                                 // setting a boolean content attribute,
41301                                 // since its presence should be enough
41302                                 // http://bugs.jquery.com/ticket/12359
41303                                 docElem.appendChild(div).innerHTML = "<a id='" + expando + "'></a>" +
41304                                     "<select id='" + expando + "-\f]' msallowcapture=''>" +
41305                                     "<option selected=''></option></select>";
41306
41307                                 // Support: IE8, Opera 11-12.16
41308                                 // Nothing should be selected when empty strings follow ^= or $= or
41309                                 // *=
41310                                 // The test attribute must be unknown in Opera but "safe" for WinRT
41311                                 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
41312                                 if (div.querySelectorAll("[msallowcapture^='']").length) {
41313                                     rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")");
41314                                 }
41315
41316                                 // Support: IE8
41317                                 // Boolean attributes and "value" are not treated correctly
41318                                 if (!div.querySelectorAll("[selected]").length) {
41319                                     rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
41320                                 }
41321
41322                                 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+,
41323                                 // PhantomJS<1.9.7+
41324                                 if (!div.querySelectorAll("[id~=" + expando + "-]").length) {
41325                                     rbuggyQSA.push("~=");
41326                                 }
41327
41328                                 // Webkit/Opera - :checked should return selected option elements
41329                                 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
41330                                 // IE8 throws error here and will not see later tests
41331                                 if (!div.querySelectorAll(":checked").length) {
41332                                     rbuggyQSA.push(":checked");
41333                                 }
41334
41335                                 // Support: Safari 8+, iOS 8+
41336                                 // https://bugs.webkit.org/show_bug.cgi?id=136851
41337                                 // In-page `selector#id sibing-combinator selector` fails
41338                                 if (!div.querySelectorAll("a#" + expando + "+*").length) {
41339                                     rbuggyQSA.push(".#.+[+~]");
41340                                 }
41341                             });
41342
41343                             assert(function(div) {
41344                                 // Support: Windows 8 Native Apps
41345                                 // The type and name attributes are restricted during .innerHTML
41346                                 // assignment
41347                                 var input = doc.createElement("input");
41348                                 input.setAttribute("type", "hidden");
41349                                 div.appendChild(input).setAttribute("name", "D");
41350
41351                                 // Support: IE8
41352                                 // Enforce case-sensitivity of name attribute
41353                                 if (div.querySelectorAll("[name=d]").length) {
41354                                     rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=");
41355                                 }
41356
41357                                 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements
41358                                 // are still enabled)
41359                                 // IE8 throws error here and will not see later tests
41360                                 if (!div.querySelectorAll(":enabled").length) {
41361                                     rbuggyQSA.push(":enabled", ":disabled");
41362                                 }
41363
41364                                 // Opera 10-11 does not throw on post-comma invalid pseudos
41365                                 div.querySelectorAll("*,:x");
41366                                 rbuggyQSA.push(",.*:");
41367                             });
41368                         }
41369
41370                         if ((support.matchesSelector = rnative.test((matches = docElem.matches ||
41371                                 docElem.webkitMatchesSelector ||
41372                                 docElem.mozMatchesSelector ||
41373                                 docElem.oMatchesSelector ||
41374                                 docElem.msMatchesSelector)))) {
41375
41376                             assert(function(div) {
41377                                 // Check to see if it's possible to do matchesSelector
41378                                 // on a disconnected node (IE 9)
41379                                 support.disconnectedMatch = matches.call(div, "div");
41380
41381                                 // This should fail with an exception
41382                                 // Gecko does not error, returns false instead
41383                                 matches.call(div, "[s!='']:x");
41384                                 rbuggyMatches.push("!=", pseudos);
41385                             });
41386                         }
41387
41388                         rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
41389                         rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|"));
41390
41391                         /*
41392                          * Contains
41393                          * ----------------------------------------------------------------------
41394                          */
41395                         hasCompare = rnative.test(docElem.compareDocumentPosition);
41396
41397                         // Element contains another
41398                         // Purposefully does not implement inclusive descendent
41399                         // As in, an element does not contain itself
41400                         contains = hasCompare || rnative.test(docElem.contains) ?
41401                             function(a, b) {
41402                                 var adown = a.nodeType === 9 ? a.documentElement : a,
41403                                     bup = b && b.parentNode;
41404                                 return a === bup || !!(bup && bup.nodeType === 1 && (
41405                                     adown.contains ?
41406                                     adown.contains(bup) :
41407                                     a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
41408                                 ));
41409                             } :
41410                             function(a, b) {
41411                                 if (b) {
41412                                     while ((b = b.parentNode)) {
41413                                         if (b === a) {
41414                                             return true;
41415                                         }
41416                                     }
41417                                 }
41418                                 return false;
41419                             };
41420
41421                         /*
41422                          * Sorting
41423                          * ----------------------------------------------------------------------
41424                          */
41425
41426                         // Document order sorting
41427                         sortOrder = hasCompare ?
41428                             function(a, b) {
41429
41430                                 // Flag for duplicate removal
41431                                 if (a === b) {
41432                                     hasDuplicate = true;
41433                                     return 0;
41434                                 }
41435
41436                                 // Sort on method existence if only one input has
41437                                 // compareDocumentPosition
41438                                 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
41439                                 if (compare) {
41440                                     return compare;
41441                                 }
41442
41443                                 // Calculate position if both inputs belong to the same document
41444                                 compare = (a.ownerDocument || a) === (b.ownerDocument || b) ?
41445                                     a.compareDocumentPosition(b) :
41446
41447                                     // Otherwise we know they are disconnected
41448                                     1;
41449
41450                                 // Disconnected nodes
41451                                 if (compare & 1 ||
41452                                     (!support.sortDetached && b.compareDocumentPosition(a) === compare)) {
41453
41454                                     // Choose the first element that is related to our preferred
41455                                     // document
41456                                     if (a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) {
41457                                         return -1;
41458                                     }
41459                                     if (b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) {
41460                                         return 1;
41461                                     }
41462
41463                                     // Maintain original order
41464                                     return sortInput ?
41465                                         (indexOf(sortInput, a) - indexOf(sortInput, b)) :
41466                                         0;
41467                                 }
41468
41469                                 return compare & 4 ? -1 : 1;
41470                             } :
41471                             function(a, b) {
41472                                 // Exit early if the nodes are identical
41473                                 if (a === b) {
41474                                     hasDuplicate = true;
41475                                     return 0;
41476                                 }
41477
41478                                 var cur,
41479                                     i = 0,
41480                                     aup = a.parentNode,
41481                                     bup = b.parentNode,
41482                                     ap = [a],
41483                                     bp = [b];
41484
41485                                 // Parentless nodes are either documents or disconnected
41486                                 if (!aup || !bup) {
41487                                     return a === doc ? -1 :
41488                                         b === doc ? 1 :
41489                                         aup ? -1 :
41490                                         bup ? 1 :
41491                                         sortInput ?
41492                                         (indexOf(sortInput, a) - indexOf(sortInput, b)) :
41493                                         0;
41494
41495                                     // If the nodes are siblings, we can do a quick check
41496                                 } else if (aup === bup) {
41497                                     return siblingCheck(a, b);
41498                                 }
41499
41500                                 // Otherwise we need full lists of their ancestors for comparison
41501                                 cur = a;
41502                                 while ((cur = cur.parentNode)) {
41503                                     ap.unshift(cur);
41504                                 }
41505                                 cur = b;
41506                                 while ((cur = cur.parentNode)) {
41507                                     bp.unshift(cur);
41508                                 }
41509
41510                                 // Walk down the tree looking for a discrepancy
41511                                 while (ap[i] === bp[i]) {
41512                                     i++;
41513                                 }
41514
41515                                 return i ?
41516                                     // Do a sibling check if the nodes have a common ancestor
41517                                     siblingCheck(ap[i], bp[i]) :
41518
41519                                     // Otherwise nodes in our document sort first
41520                                     ap[i] === preferredDoc ? -1 :
41521                                     bp[i] === preferredDoc ? 1 :
41522                                     0;
41523                             };
41524
41525                         return doc;
41526                     };
41527
41528                     Sizzle.matches = function(expr, elements) {
41529                         return Sizzle(expr, null, null, elements);
41530                     };
41531
41532                     Sizzle.matchesSelector = function(elem, expr) {
41533                         // Set document vars if needed
41534                         if ((elem.ownerDocument || elem) !== document) {
41535                             setDocument(elem);
41536                         }
41537
41538                         // Make sure that attribute selectors are quoted
41539                         expr = expr.replace(rattributeQuotes, "='$1']");
41540
41541                         if (support.matchesSelector && documentIsHTML &&
41542                             (!rbuggyMatches || !rbuggyMatches.test(expr)) &&
41543                             (!rbuggyQSA || !rbuggyQSA.test(expr))) {
41544
41545                             try {
41546                                 var ret = matches.call(elem, expr);
41547
41548                                 // IE 9's matchesSelector returns false on disconnected nodes
41549                                 if (ret || support.disconnectedMatch ||
41550                                     // As well, disconnected nodes are said to be in a document
41551                                     // fragment in IE 9
41552                                     elem.document && elem.document.nodeType !== 11) {
41553                                     return ret;
41554                                 }
41555                             } catch (e) {}
41556                         }
41557
41558                         return Sizzle(expr, document, null, [elem]).length > 0;
41559                     };
41560
41561                     Sizzle.contains = function(context, elem) {
41562                         // Set document vars if needed
41563                         if ((context.ownerDocument || context) !== document) {
41564                             setDocument(context);
41565                         }
41566                         return contains(context, elem);
41567                     };
41568
41569                     Sizzle.attr = function(elem, name) {
41570                         // Set document vars if needed
41571                         if ((elem.ownerDocument || elem) !== document) {
41572                             setDocument(elem);
41573                         }
41574
41575                         var fn = Expr.attrHandle[name.toLowerCase()],
41576                             // Don't get fooled by Object.prototype properties (jQuery #13807)
41577                             val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ?
41578                             fn(elem, name, !documentIsHTML) :
41579                             undefined;
41580
41581                         return val !== undefined ?
41582                             val :
41583                             support.attributes || !documentIsHTML ?
41584                             elem.getAttribute(name) :
41585                             (val = elem.getAttributeNode(name)) && val.specified ?
41586                             val.value :
41587                             null;
41588                     };
41589
41590                     Sizzle.error = function(msg) {
41591                         throw new Error("Syntax error, unrecognized expression: " + msg);
41592                     };
41593
41594                     /**
41595                      * Document sorting and removing duplicates
41596                      * 
41597                      * @param {ArrayLike}
41598                      *            results
41599                      */
41600                     Sizzle.uniqueSort = function(results) {
41601                         var elem,
41602                             duplicates = [],
41603                             j = 0,
41604                             i = 0;
41605
41606                         // Unless we *know* we can detect duplicates, assume their presence
41607                         hasDuplicate = !support.detectDuplicates;
41608                         sortInput = !support.sortStable && results.slice(0);
41609                         results.sort(sortOrder);
41610
41611                         if (hasDuplicate) {
41612                             while ((elem = results[i++])) {
41613                                 if (elem === results[i]) {
41614                                     j = duplicates.push(i);
41615                                 }
41616                             }
41617                             while (j--) {
41618                                 results.splice(duplicates[j], 1);
41619                             }
41620                         }
41621
41622                         // Clear input after sorting to release objects
41623                         // See https://github.com/jquery/sizzle/pull/225
41624                         sortInput = null;
41625
41626                         return results;
41627                     };
41628
41629                     /**
41630                      * Utility function for retrieving the text value of an array of DOM nodes
41631                      * 
41632                      * @param {Array|Element}
41633                      *            elem
41634                      */
41635                     getText = Sizzle.getText = function(elem) {
41636                         var node,
41637                             ret = "",
41638                             i = 0,
41639                             nodeType = elem.nodeType;
41640
41641                         if (!nodeType) {
41642                             // If no nodeType, this is expected to be an array
41643                             while ((node = elem[i++])) {
41644                                 // Do not traverse comment nodes
41645                                 ret += getText(node);
41646                             }
41647                         } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
41648                             // Use textContent for elements
41649                             // innerText usage removed for consistency of new lines (jQuery #11153)
41650                             if (typeof elem.textContent === "string") {
41651                                 return elem.textContent;
41652                             } else {
41653                                 // Traverse its children
41654                                 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
41655                                     ret += getText(elem);
41656                                 }
41657                             }
41658                         } else if (nodeType === 3 || nodeType === 4) {
41659                             return elem.nodeValue;
41660                         }
41661                         // Do not include comment or processing instruction nodes
41662
41663                         return ret;
41664                     };
41665
41666                     Expr = Sizzle.selectors = {
41667
41668                         // Can be adjusted by the user
41669                         cacheLength: 50,
41670
41671                         createPseudo: markFunction,
41672
41673                         match: matchExpr,
41674
41675                         attrHandle: {},
41676
41677                         find: {},
41678
41679                         relative: {
41680                             ">": {
41681                                 dir: "parentNode",
41682                                 first: true
41683                             },
41684                             " ": {
41685                                 dir: "parentNode"
41686                             },
41687                             "+": {
41688                                 dir: "previousSibling",
41689                                 first: true
41690                             },
41691                             "~": {
41692                                 dir: "previousSibling"
41693                             }
41694                         },
41695
41696                         preFilter: {
41697                             "ATTR": function(match) {
41698                                 match[1] = match[1].replace(runescape, funescape);
41699
41700                                 // Move the given value to match[3] whether quoted or unquoted
41701                                 match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
41702
41703                                 if (match[2] === "~=") {
41704                                     match[3] = " " + match[3] + " ";
41705                                 }
41706
41707                                 return match.slice(0, 4);
41708                             },
41709
41710                             "CHILD": function(match) {
41711                                 /*
41712                                  * matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what
41713                                  * (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4
41714                                  * xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component
41715                                  * 6 x of xn-component 7 sign of y-component 8 y of y-component
41716                                  */
41717                                 match[1] = match[1].toLowerCase();
41718
41719                                 if (match[1].slice(0, 3) === "nth") {
41720                                     // nth-* requires argument
41721                                     if (!match[3]) {
41722                                         Sizzle.error(match[0]);
41723                                     }
41724
41725                                     // numeric x and y parameters for Expr.filter.CHILD
41726                                     // remember that false/true cast respectively to 0/1
41727                                     match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
41728                                     match[5] = +((match[7] + match[8]) || match[3] === "odd");
41729
41730                                     // other types prohibit arguments
41731                                 } else if (match[3]) {
41732                                     Sizzle.error(match[0]);
41733                                 }
41734
41735                                 return match;
41736                             },
41737
41738                             "PSEUDO": function(match) {
41739                                 var excess,
41740                                     unquoted = !match[6] && match[2];
41741
41742                                 if (matchExpr["CHILD"].test(match[0])) {
41743                                     return null;
41744                                 }
41745
41746                                 // Accept quoted arguments as-is
41747                                 if (match[3]) {
41748                                     match[2] = match[4] || match[5] || "";
41749
41750                                     // Strip excess characters from unquoted arguments
41751                                 } else if (unquoted && rpseudo.test(unquoted) &&
41752                                     // Get excess from tokenize (recursively)
41753                                     (excess = tokenize(unquoted, true)) &&
41754                                     // advance to the next closing parenthesis
41755                                     (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
41756
41757                                     // excess is a negative index
41758                                     match[0] = match[0].slice(0, excess);
41759                                     match[2] = unquoted.slice(0, excess);
41760                                 }
41761
41762                                 // Return only captures needed by the pseudo filter method (type and
41763                                 // argument)
41764                                 return match.slice(0, 3);
41765                             }
41766                         },
41767
41768                         filter: {
41769
41770                             "TAG": function(nodeNameSelector) {
41771                                 var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
41772                                 return nodeNameSelector === "*" ?
41773                                     function() {
41774                                         return true;
41775                                     } :
41776                                     function(elem) {
41777                                         return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
41778                                     };
41779                             },
41780
41781                             "CLASS": function(className) {
41782                                 var pattern = classCache[className + " "];
41783
41784                                 return pattern ||
41785                                     (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) &&
41786                                     classCache(className, function(elem) {
41787                                         return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "");
41788                                     });
41789                             },
41790
41791                             "ATTR": function(name, operator, check) {
41792                                 return function(elem) {
41793                                     var result = Sizzle.attr(elem, name);
41794
41795                                     if (result == null) {
41796                                         return operator === "!=";
41797                                     }
41798                                     if (!operator) {
41799                                         return true;
41800                                     }
41801
41802                                     result += "";
41803
41804                                     return operator === "=" ? result === check :
41805                                         operator === "!=" ? result !== check :
41806                                         operator === "^=" ? check && result.indexOf(check) === 0 :
41807                                         operator === "*=" ? check && result.indexOf(check) > -1 :
41808                                         operator === "$=" ? check && result.slice(-check.length) === check :
41809                                         operator === "~=" ? (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1 :
41810                                         operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" :
41811                                         false;
41812                                 };
41813                             },
41814
41815                             "CHILD": function(type, what, argument, first, last) {
41816                                 var simple = type.slice(0, 3) !== "nth",
41817                                     forward = type.slice(-4) !== "last",
41818                                     ofType = what === "of-type";
41819
41820                                 return first === 1 && last === 0 ?
41821
41822                                     // Shortcut for :nth-*(n)
41823                                     function(elem) {
41824                                         return !!elem.parentNode;
41825                                     } :
41826
41827                                     function(elem, context, xml) {
41828                                         var cache, outerCache, node, diff, nodeIndex, start,
41829                                             dir = simple !== forward ? "nextSibling" : "previousSibling",
41830                                             parent = elem.parentNode,
41831                                             name = ofType && elem.nodeName.toLowerCase(),
41832                                             useCache = !xml && !ofType;
41833
41834                                         if (parent) {
41835
41836                                             // :(first|last|only)-(child|of-type)
41837                                             if (simple) {
41838                                                 while (dir) {
41839                                                     node = elem;
41840                                                     while ((node = node[dir])) {
41841                                                         if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
41842                                                             return false;
41843                                                         }
41844                                                     }
41845                                                     // Reverse direction for :only-* (if we haven't
41846                                                     // yet done so)
41847                                                     start = dir = type === "only" && !start && "nextSibling";
41848                                                 }
41849                                                 return true;
41850                                             }
41851
41852                                             start = [forward ? parent.firstChild : parent.lastChild];
41853
41854                                             // non-xml :nth-child(...) stores cache data on `parent`
41855                                             if (forward && useCache) {
41856                                                 // Seek `elem` from a previously-cached index
41857                                                 outerCache = parent[expando] || (parent[expando] = {});
41858                                                 cache = outerCache[type] || [];
41859                                                 nodeIndex = cache[0] === dirruns && cache[1];
41860                                                 diff = cache[0] === dirruns && cache[2];
41861                                                 node = nodeIndex && parent.childNodes[nodeIndex];
41862
41863                                                 while ((node = ++nodeIndex && node && node[dir] ||
41864
41865                                                         // Fallback to seeking `elem` from the start
41866                                                         (diff = nodeIndex = 0) || start.pop())) {
41867
41868                                                     // When found, cache indexes on `parent` and
41869                                                     // break
41870                                                     if (node.nodeType === 1 && ++diff && node === elem) {
41871                                                         outerCache[type] = [dirruns, nodeIndex, diff];
41872                                                         break;
41873                                                     }
41874                                                 }
41875
41876                                                 // Use previously-cached element index if available
41877                                             } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
41878                                                 diff = cache[1];
41879
41880                                                 // xml :nth-child(...) or :nth-last-child(...) or
41881                                                 // :nth(-last)?-of-type(...)
41882                                             } else {
41883                                                 // Use the same loop as above to seek `elem` from
41884                                                 // the start
41885                                                 while ((node = ++nodeIndex && node && node[dir] ||
41886                                                         (diff = nodeIndex = 0) || start.pop())) {
41887
41888                                                     if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
41889                                                         // Cache the index of each encountered
41890                                                         // element
41891                                                         if (useCache) {
41892                                                             (node[expando] || (node[expando] = {}))[type] = [dirruns, diff];
41893                                                         }
41894
41895                                                         if (node === elem) {
41896                                                             break;
41897                                                         }
41898                                                     }
41899                                                 }
41900                                             }
41901
41902                                             // Incorporate the offset, then check against cycle size
41903                                             diff -= last;
41904                                             return diff === first || (diff % first === 0 && diff / first >= 0);
41905                                         }
41906                                     };
41907                             },
41908
41909                             "PSEUDO": function(pseudo, argument) {
41910                                 // pseudo-class names are case-insensitive
41911                                 // http://www.w3.org/TR/selectors/#pseudo-classes
41912                                 // Prioritize by case sensitivity in case custom pseudos are added
41913                                 // with uppercase letters
41914                                 // Remember that setFilters inherits from pseudos
41915                                 var args,
41916                                     fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] ||
41917                                     Sizzle.error("unsupported pseudo: " + pseudo);
41918
41919                                 // The user may use createPseudo to indicate that
41920                                 // arguments are needed to create the filter function
41921                                 // just as Sizzle does
41922                                 if (fn[expando]) {
41923                                     return fn(argument);
41924                                 }
41925
41926                                 // But maintain support for old signatures
41927                                 if (fn.length > 1) {
41928                                     args = [pseudo, pseudo, "", argument];
41929                                     return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ?
41930                                         markFunction(function(seed, matches) {
41931                                             var idx,
41932                                                 matched = fn(seed, argument),
41933                                                 i = matched.length;
41934                                             while (i--) {
41935                                                 idx = indexOf(seed, matched[i]);
41936                                                 seed[idx] = !(matches[idx] = matched[i]);
41937                                             }
41938                                         }) :
41939                                         function(elem) {
41940                                             return fn(elem, 0, args);
41941                                         };
41942                                 }
41943
41944                                 return fn;
41945                             }
41946                         },
41947
41948                         pseudos: {
41949                             // Potentially complex pseudos
41950                             "not": markFunction(function(selector) {
41951                                 // Trim the selector passed to compile
41952                                 // to avoid treating leading and trailing
41953                                 // spaces as combinators
41954                                 var input = [],
41955                                     results = [],
41956                                     matcher = compile(selector.replace(rtrim, "$1"));
41957
41958                                 return matcher[expando] ?
41959                                     markFunction(function(seed, matches, context, xml) {
41960                                         var elem,
41961                                             unmatched = matcher(seed, null, xml, []),
41962                                             i = seed.length;
41963
41964                                         // Match elements unmatched by `matcher`
41965                                         while (i--) {
41966                                             if ((elem = unmatched[i])) {
41967                                                 seed[i] = !(matches[i] = elem);
41968                                             }
41969                                         }
41970                                     }) :
41971                                     function(elem, context, xml) {
41972                                         input[0] = elem;
41973                                         matcher(input, null, xml, results);
41974                                         // Don't keep the element (issue #299)
41975                                         input[0] = null;
41976                                         return !results.pop();
41977                                     };
41978                             }),
41979
41980                             "has": markFunction(function(selector) {
41981                                 return function(elem) {
41982                                     return Sizzle(selector, elem).length > 0;
41983                                 };
41984                             }),
41985
41986                             "contains": markFunction(function(text) {
41987                                 text = text.replace(runescape, funescape);
41988                                 return function(elem) {
41989                                     return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
41990                                 };
41991                             }),
41992
41993                             // "Whether an element is represented by a :lang() selector
41994                             // is based solely on the element's language value
41995                             // being equal to the identifier C,
41996                             // or beginning with the identifier C immediately followed by "-".
41997                             // The matching of C against the element's language value is performed
41998                             // case-insensitively.
41999                             // The identifier C does not have to be a valid language name."
42000                             // http://www.w3.org/TR/selectors/#lang-pseudo
42001                             "lang": markFunction(function(lang) {
42002                                 // lang value must be a valid identifier
42003                                 if (!ridentifier.test(lang || "")) {
42004                                     Sizzle.error("unsupported lang: " + lang);
42005                                 }
42006                                 lang = lang.replace(runescape, funescape).toLowerCase();
42007                                 return function(elem) {
42008                                     var elemLang;
42009                                     do {
42010                                         if ((elemLang = documentIsHTML ?
42011                                                 elem.lang :
42012                                                 elem.getAttribute("xml:lang") || elem.getAttribute("lang"))) {
42013
42014                                             elemLang = elemLang.toLowerCase();
42015                                             return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
42016                                         }
42017                                     } while ((elem = elem.parentNode) && elem.nodeType === 1);
42018                                     return false;
42019                                 };
42020                             }),
42021
42022                             // Miscellaneous
42023                             "target": function(elem) {
42024                                 var hash = window.location && window.location.hash;
42025                                 return hash && hash.slice(1) === elem.id;
42026                             },
42027
42028                             "root": function(elem) {
42029                                 return elem === docElem;
42030                             },
42031
42032                             "focus": function(elem) {
42033                                 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
42034                             },
42035
42036                             // Boolean properties
42037                             "enabled": function(elem) {
42038                                 return elem.disabled === false;
42039                             },
42040
42041                             "disabled": function(elem) {
42042                                 return elem.disabled === true;
42043                             },
42044
42045                             "checked": function(elem) {
42046                                 // In CSS3, :checked should return both checked and selected
42047                                 // elements
42048                                 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
42049                                 var nodeName = elem.nodeName.toLowerCase();
42050                                 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
42051                             },
42052
42053                             "selected": function(elem) {
42054                                 // Accessing this property makes selected-by-default
42055                                 // options in Safari work properly
42056                                 if (elem.parentNode) {
42057                                     elem.parentNode.selectedIndex;
42058                                 }
42059
42060                                 return elem.selected === true;
42061                             },
42062
42063                             // Contents
42064                             "empty": function(elem) {
42065                                 // http://www.w3.org/TR/selectors/#empty-pseudo
42066                                 // :empty is negated by element (1) or content nodes (text: 3;
42067                                 // cdata: 4; entity ref: 5),
42068                                 // but not by others (comment: 8; processing instruction: 7; etc.)
42069                                 // nodeType < 6 works because attributes (2) do not appear as
42070                                 // children
42071                                 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
42072                                     if (elem.nodeType < 6) {
42073                                         return false;
42074                                     }
42075                                 }
42076                                 return true;
42077                             },
42078
42079                             "parent": function(elem) {
42080                                 return !Expr.pseudos["empty"](elem);
42081                             },
42082
42083                             // Element/input types
42084                             "header": function(elem) {
42085                                 return rheader.test(elem.nodeName);
42086                             },
42087
42088                             "input": function(elem) {
42089                                 return rinputs.test(elem.nodeName);
42090                             },
42091
42092                             "button": function(elem) {
42093                                 var name = elem.nodeName.toLowerCase();
42094                                 return name === "input" && elem.type === "button" || name === "button";
42095                             },
42096
42097                             "text": function(elem) {
42098                                 var attr;
42099                                 return elem.nodeName.toLowerCase() === "input" &&
42100                                     elem.type === "text" &&
42101
42102                                     // Support: IE<8
42103                                     // New HTML5 attribute values (e.g., "search") appear with
42104                                     // elem.type === "text"
42105                                     ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
42106                             },
42107
42108                             // Position-in-collection
42109                             "first": createPositionalPseudo(function() {
42110                                 return [0];
42111                             }),
42112
42113                             "last": createPositionalPseudo(function(matchIndexes, length) {
42114                                 return [length - 1];
42115                             }),
42116
42117                             "eq": createPositionalPseudo(function(matchIndexes, length, argument) {
42118                                 return [argument < 0 ? argument + length : argument];
42119                             }),
42120
42121                             "even": createPositionalPseudo(function(matchIndexes, length) {
42122                                 var i = 0;
42123                                 for (; i < length; i += 2) {
42124                                     matchIndexes.push(i);
42125                                 }
42126                                 return matchIndexes;
42127                             }),
42128
42129                             "odd": createPositionalPseudo(function(matchIndexes, length) {
42130                                 var i = 1;
42131                                 for (; i < length; i += 2) {
42132                                     matchIndexes.push(i);
42133                                 }
42134                                 return matchIndexes;
42135                             }),
42136
42137                             "lt": createPositionalPseudo(function(matchIndexes, length, argument) {
42138                                 var i = argument < 0 ? argument + length : argument;
42139                                 for (; --i >= 0;) {
42140                                     matchIndexes.push(i);
42141                                 }
42142                                 return matchIndexes;
42143                             }),
42144
42145                             "gt": createPositionalPseudo(function(matchIndexes, length, argument) {
42146                                 var i = argument < 0 ? argument + length : argument;
42147                                 for (; ++i < length;) {
42148                                     matchIndexes.push(i);
42149                                 }
42150                                 return matchIndexes;
42151                             })
42152                         }
42153                     };
42154
42155                     Expr.pseudos["nth"] = Expr.pseudos["eq"];
42156
42157                     // Add button/input type pseudos
42158                     for (i in {
42159                             radio: true,
42160                             checkbox: true,
42161                             file: true,
42162                             password: true,
42163                             image: true
42164                         }) {
42165                         Expr.pseudos[i] = createInputPseudo(i);
42166                     }
42167                     for (i in {
42168                             submit: true,
42169                             reset: true
42170                         }) {
42171                         Expr.pseudos[i] = createButtonPseudo(i);
42172                     }
42173
42174                     // Easy API for creating new setFilters
42175                     function setFilters() {}
42176                     setFilters.prototype = Expr.filters = Expr.pseudos;
42177                     Expr.setFilters = new setFilters();
42178
42179                     tokenize = Sizzle.tokenize = function(selector, parseOnly) {
42180                         var matched, match, tokens, type,
42181                             soFar, groups, preFilters,
42182                             cached = tokenCache[selector + " "];
42183
42184                         if (cached) {
42185                             return parseOnly ? 0 : cached.slice(0);
42186                         }
42187
42188                         soFar = selector;
42189                         groups = [];
42190                         preFilters = Expr.preFilter;
42191
42192                         while (soFar) {
42193
42194                             // Comma and first run
42195                             if (!matched || (match = rcomma.exec(soFar))) {
42196                                 if (match) {
42197                                     // Don't consume trailing commas as valid
42198                                     soFar = soFar.slice(match[0].length) || soFar;
42199                                 }
42200                                 groups.push((tokens = []));
42201                             }
42202
42203                             matched = false;
42204
42205                             // Combinators
42206                             if ((match = rcombinators.exec(soFar))) {
42207                                 matched = match.shift();
42208                                 tokens.push({
42209                                     value: matched,
42210                                     // Cast descendant combinators to space
42211                                     type: match[0].replace(rtrim, " ")
42212                                 });
42213                                 soFar = soFar.slice(matched.length);
42214                             }
42215
42216                             // Filters
42217                             for (type in Expr.filter) {
42218                                 if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] ||
42219                                         (match = preFilters[type](match)))) {
42220                                     matched = match.shift();
42221                                     tokens.push({
42222                                         value: matched,
42223                                         type: type,
42224                                         matches: match
42225                                     });
42226                                     soFar = soFar.slice(matched.length);
42227                                 }
42228                             }
42229
42230                             if (!matched) {
42231                                 break;
42232                             }
42233                         }
42234
42235                         // Return the length of the invalid excess
42236                         // if we're just parsing
42237                         // Otherwise, throw an error or return tokens
42238                         return parseOnly ?
42239                             soFar.length :
42240                             soFar ?
42241                             Sizzle.error(selector) :
42242                             // Cache the tokens
42243                             tokenCache(selector, groups).slice(0);
42244                     };
42245
42246                     function toSelector(tokens) {
42247                         var i = 0,
42248                             len = tokens.length,
42249                             selector = "";
42250                         for (; i < len; i++) {
42251                             selector += tokens[i].value;
42252                         }
42253                         return selector;
42254                     }
42255
42256                     function addCombinator(matcher, combinator, base) {
42257                         var dir = combinator.dir,
42258                             checkNonElements = base && dir === "parentNode",
42259                             doneName = done++;
42260
42261                         return combinator.first ?
42262                             // Check against closest ancestor/preceding element
42263                             function(elem, context, xml) {
42264                                 while ((elem = elem[dir])) {
42265                                     if (elem.nodeType === 1 || checkNonElements) {
42266                                         return matcher(elem, context, xml);
42267                                     }
42268                                 }
42269                             } :
42270
42271                             // Check against all ancestor/preceding elements
42272                             function(elem, context, xml) {
42273                                 var oldCache, outerCache,
42274                                     newCache = [dirruns, doneName];
42275
42276                                 // We can't set arbitrary data on XML nodes, so they don't benefit
42277                                 // from dir caching
42278                                 if (xml) {
42279                                     while ((elem = elem[dir])) {
42280                                         if (elem.nodeType === 1 || checkNonElements) {
42281                                             if (matcher(elem, context, xml)) {
42282                                                 return true;
42283                                             }
42284                                         }
42285                                     }
42286                                 } else {
42287                                     while ((elem = elem[dir])) {
42288                                         if (elem.nodeType === 1 || checkNonElements) {
42289                                             outerCache = elem[expando] || (elem[expando] = {});
42290                                             if ((oldCache = outerCache[dir]) &&
42291                                                 oldCache[0] === dirruns && oldCache[1] === doneName) {
42292
42293                                                 // Assign to newCache so results back-propagate to
42294                                                 // previous elements
42295                                                 return (newCache[2] = oldCache[2]);
42296                                             } else {
42297                                                 // Reuse newcache so results back-propagate to
42298                                                 // previous elements
42299                                                 outerCache[dir] = newCache;
42300
42301                                                 // A match means we're done; a fail means we have to
42302                                                 // keep checking
42303                                                 if ((newCache[2] = matcher(elem, context, xml))) {
42304                                                     return true;
42305                                                 }
42306                                             }
42307                                         }
42308                                     }
42309                                 }
42310                             };
42311                     }
42312
42313                     function elementMatcher(matchers) {
42314                         return matchers.length > 1 ?
42315                             function(elem, context, xml) {
42316                                 var i = matchers.length;
42317                                 while (i--) {
42318                                     if (!matchers[i](elem, context, xml)) {
42319                                         return false;
42320                                     }
42321                                 }
42322                                 return true;
42323                             } :
42324                             matchers[0];
42325                     }
42326
42327                     function multipleContexts(selector, contexts, results) {
42328                         var i = 0,
42329                             len = contexts.length;
42330                         for (; i < len; i++) {
42331                             Sizzle(selector, contexts[i], results);
42332                         }
42333                         return results;
42334                     }
42335
42336                     function condense(unmatched, map, filter, context, xml) {
42337                         var elem,
42338                             newUnmatched = [],
42339                             i = 0,
42340                             len = unmatched.length,
42341                             mapped = map != null;
42342
42343                         for (; i < len; i++) {
42344                             if ((elem = unmatched[i])) {
42345                                 if (!filter || filter(elem, context, xml)) {
42346                                     newUnmatched.push(elem);
42347                                     if (mapped) {
42348                                         map.push(i);
42349                                     }
42350                                 }
42351                             }
42352                         }
42353
42354                         return newUnmatched;
42355                     }
42356
42357                     function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
42358                         if (postFilter && !postFilter[expando]) {
42359                             postFilter = setMatcher(postFilter);
42360                         }
42361                         if (postFinder && !postFinder[expando]) {
42362                             postFinder = setMatcher(postFinder, postSelector);
42363                         }
42364                         return markFunction(function(seed, results, context, xml) {
42365                             var temp, i, elem,
42366                                 preMap = [],
42367                                 postMap = [],
42368                                 preexisting = results.length,
42369
42370                                 // Get initial elements from seed or context
42371                                 elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []),
42372
42373                                 // Prefilter to get matcher input, preserving a map for seed-results
42374                                 // synchronization
42375                                 matcherIn = preFilter && (seed || !selector) ?
42376                                 condense(elems, preMap, preFilter, context, xml) :
42377                                 elems,
42378
42379                                 matcherOut = matcher ?
42380                                 // If we have a postFinder, or filtered seed, or non-seed
42381                                 // postFilter or preexisting results,
42382                                 postFinder || (seed ? preFilter : preexisting || postFilter) ?
42383
42384                                 // ...intermediate processing is necessary
42385                                 [] :
42386
42387                                 // ...otherwise use results directly
42388                                 results :
42389                                 matcherIn;
42390
42391                             // Find primary matches
42392                             if (matcher) {
42393                                 matcher(matcherIn, matcherOut, context, xml);
42394                             }
42395
42396                             // Apply postFilter
42397                             if (postFilter) {
42398                                 temp = condense(matcherOut, postMap);
42399                                 postFilter(temp, [], context, xml);
42400
42401                                 // Un-match failing elements by moving them back to matcherIn
42402                                 i = temp.length;
42403                                 while (i--) {
42404                                     if ((elem = temp[i])) {
42405                                         matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
42406                                     }
42407                                 }
42408                             }
42409
42410                             if (seed) {
42411                                 if (postFinder || preFilter) {
42412                                     if (postFinder) {
42413                                         // Get the final matcherOut by condensing this intermediate
42414                                         // into postFinder contexts
42415                                         temp = [];
42416                                         i = matcherOut.length;
42417                                         while (i--) {
42418                                             if ((elem = matcherOut[i])) {
42419                                                 // Restore matcherIn since elem is not yet a final
42420                                                 // match
42421                                                 temp.push((matcherIn[i] = elem));
42422                                             }
42423                                         }
42424                                         postFinder(null, (matcherOut = []), temp, xml);
42425                                     }
42426
42427                                     // Move matched elements from seed to results to keep them
42428                                     // synchronized
42429                                     i = matcherOut.length;
42430                                     while (i--) {
42431                                         if ((elem = matcherOut[i]) &&
42432                                             (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) {
42433
42434                                             seed[temp] = !(results[temp] = elem);
42435                                         }
42436                                     }
42437                                 }
42438
42439                                 // Add elements to results, through postFinder if defined
42440                             } else {
42441                                 matcherOut = condense(
42442                                     matcherOut === results ?
42443                                     matcherOut.splice(preexisting, matcherOut.length) :
42444                                     matcherOut
42445                                 );
42446                                 if (postFinder) {
42447                                     postFinder(null, results, matcherOut, xml);
42448                                 } else {
42449                                     push.apply(results, matcherOut);
42450                                 }
42451                             }
42452                         });
42453                     }
42454
42455                     function matcherFromTokens(tokens) {
42456                         var checkContext, matcher, j,
42457                             len = tokens.length,
42458                             leadingRelative = Expr.relative[tokens[0].type],
42459                             implicitRelative = leadingRelative || Expr.relative[" "],
42460                             i = leadingRelative ? 1 : 0,
42461
42462                             // The foundational matcher ensures that elements are reachable from
42463                             // top-level context(s)
42464                             matchContext = addCombinator(function(elem) {
42465                                 return elem === checkContext;
42466                             }, implicitRelative, true),
42467                             matchAnyContext = addCombinator(function(elem) {
42468                                 return indexOf(checkContext, elem) > -1;
42469                             }, implicitRelative, true),
42470                             matchers = [function(elem, context, xml) {
42471                                 var ret = (!leadingRelative && (xml || context !== outermostContext)) || (
42472                                     (checkContext = context).nodeType ?
42473                                     matchContext(elem, context, xml) :
42474                                     matchAnyContext(elem, context, xml));
42475                                 // Avoid hanging onto element (issue #299)
42476                                 checkContext = null;
42477                                 return ret;
42478                             }];
42479
42480                         for (; i < len; i++) {
42481                             if ((matcher = Expr.relative[tokens[i].type])) {
42482                                 matchers = [addCombinator(elementMatcher(matchers), matcher)];
42483                             } else {
42484                                 matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
42485
42486                                 // Return special upon seeing a positional matcher
42487                                 if (matcher[expando]) {
42488                                     // Find the next relative operator (if any) for proper handling
42489                                     j = ++i;
42490                                     for (; j < len; j++) {
42491                                         if (Expr.relative[tokens[j].type]) {
42492                                             break;
42493                                         }
42494                                     }
42495                                     return setMatcher(
42496                                         i > 1 && elementMatcher(matchers),
42497                                         i > 1 && toSelector(
42498                                             // If the preceding token was a descendant combinator,
42499                                             // insert an implicit any-element `*`
42500                                             tokens.slice(0, i - 1).concat({
42501                                                 value: tokens[i - 2].type === " " ? "*" : ""
42502                                             })
42503                                         ).replace(rtrim, "$1"),
42504                                         matcher,
42505                                         i < j && matcherFromTokens(tokens.slice(i, j)),
42506                                         j < len && matcherFromTokens((tokens = tokens.slice(j))),
42507                                         j < len && toSelector(tokens)
42508                                     );
42509                                 }
42510                                 matchers.push(matcher);
42511                             }
42512                         }
42513
42514                         return elementMatcher(matchers);
42515                     }
42516
42517                     function matcherFromGroupMatchers(elementMatchers, setMatchers) {
42518                         var bySet = setMatchers.length > 0,
42519                             byElement = elementMatchers.length > 0,
42520                             superMatcher = function(seed, context, xml, results, outermost) {
42521                                 var elem, j, matcher,
42522                                     matchedCount = 0,
42523                                     i = "0",
42524                                     unmatched = seed && [],
42525                                     setMatched = [],
42526                                     contextBackup = outermostContext,
42527                                     // We must always have either seed elements or outermost context
42528                                     elems = seed || byElement && Expr.find["TAG"]("*", outermost),
42529                                     // Use integer dirruns iff this is the outermost matcher
42530                                     dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
42531                                     len = elems.length;
42532
42533                                 if (outermost) {
42534                                     outermostContext = context !== document && context;
42535                                 }
42536
42537                                 // Add elements passing elementMatchers directly to results
42538                                 // Keep `i` a string if there are no elements so `matchedCount` will
42539                                 // be "00" below
42540                                 // Support: IE<9, Safari
42541                                 // Tolerate NodeList properties (IE: "length"; Safari: <number>)
42542                                 // matching elements by id
42543                                 for (; i !== len && (elem = elems[i]) != null; i++) {
42544                                     if (byElement && elem) {
42545                                         j = 0;
42546                                         while ((matcher = elementMatchers[j++])) {
42547                                             if (matcher(elem, context, xml)) {
42548                                                 results.push(elem);
42549                                                 break;
42550                                             }
42551                                         }
42552                                         if (outermost) {
42553                                             dirruns = dirrunsUnique;
42554                                         }
42555                                     }
42556
42557                                     // Track unmatched elements for set filters
42558                                     if (bySet) {
42559                                         // They will have gone through all possible matchers
42560                                         if ((elem = !matcher && elem)) {
42561                                             matchedCount--;
42562                                         }
42563
42564                                         // Lengthen the array for every element, matched or not
42565                                         if (seed) {
42566                                             unmatched.push(elem);
42567                                         }
42568                                     }
42569                                 }
42570
42571                                 // Apply set filters to unmatched elements
42572                                 matchedCount += i;
42573                                 if (bySet && i !== matchedCount) {
42574                                     j = 0;
42575                                     while ((matcher = setMatchers[j++])) {
42576                                         matcher(unmatched, setMatched, context, xml);
42577                                     }
42578
42579                                     if (seed) {
42580                                         // Reintegrate element matches to eliminate the need for
42581                                         // sorting
42582                                         if (matchedCount > 0) {
42583                                             while (i--) {
42584                                                 if (!(unmatched[i] || setMatched[i])) {
42585                                                     setMatched[i] = pop.call(results);
42586                                                 }
42587                                             }
42588                                         }
42589
42590                                         // Discard index placeholder values to get only actual
42591                                         // matches
42592                                         setMatched = condense(setMatched);
42593                                     }
42594
42595                                     // Add matches to results
42596                                     push.apply(results, setMatched);
42597
42598                                     // Seedless set matches succeeding multiple successful matchers
42599                                     // stipulate sorting
42600                                     if (outermost && !seed && setMatched.length > 0 &&
42601                                         (matchedCount + setMatchers.length) > 1) {
42602
42603                                         Sizzle.uniqueSort(results);
42604                                     }
42605                                 }
42606
42607                                 // Override manipulation of globals by nested matchers
42608                                 if (outermost) {
42609                                     dirruns = dirrunsUnique;
42610                                     outermostContext = contextBackup;
42611                                 }
42612
42613                                 return unmatched;
42614                             };
42615
42616                         return bySet ?
42617                             markFunction(superMatcher) :
42618                             superMatcher;
42619                     }
42620
42621                     compile = Sizzle.compile = function(selector, match /* Internal Use Only */ ) {
42622                         var i,
42623                             setMatchers = [],
42624                             elementMatchers = [],
42625                             cached = compilerCache[selector + " "];
42626
42627                         if (!cached) {
42628                             // Generate a function of recursive functions that can be used to check
42629                             // each element
42630                             if (!match) {
42631                                 match = tokenize(selector);
42632                             }
42633                             i = match.length;
42634                             while (i--) {
42635                                 cached = matcherFromTokens(match[i]);
42636                                 if (cached[expando]) {
42637                                     setMatchers.push(cached);
42638                                 } else {
42639                                     elementMatchers.push(cached);
42640                                 }
42641                             }
42642
42643                             // Cache the compiled function
42644                             cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
42645
42646                             // Save selector and tokenization
42647                             cached.selector = selector;
42648                         }
42649                         return cached;
42650                     };
42651
42652                     /**
42653                      * A low-level selection function that works with Sizzle's compiled selector
42654                      * functions
42655                      * 
42656                      * @param {String|Function}
42657                      *            selector A selector or a pre-compiled selector function built with
42658                      *            Sizzle.compile
42659                      * @param {Element}
42660                      *            context
42661                      * @param {Array}
42662                      *            [results]
42663                      * @param {Array}
42664                      *            [seed] A set of elements to match against
42665                      */
42666                     select = Sizzle.select = function(selector, context, results, seed) {
42667                         var i, tokens, token, type, find,
42668                             compiled = typeof selector === "function" && selector,
42669                             match = !seed && tokenize((selector = compiled.selector || selector));
42670
42671                         results = results || [];
42672
42673                         // Try to minimize operations if there is no seed and only one group
42674                         if (match.length === 1) {
42675
42676                             // Take a shortcut and set the context if the root selector is an ID
42677                             tokens = match[0] = match[0].slice(0);
42678                             if (tokens.length > 2 && (token = tokens[0]).type === "ID" &&
42679                                 support.getById && context.nodeType === 9 && documentIsHTML &&
42680                                 Expr.relative[tokens[1].type]) {
42681
42682                                 context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0];
42683                                 if (!context) {
42684                                     return results;
42685
42686                                     // Precompiled matchers will still verify ancestry, so step up a
42687                                     // level
42688                                 } else if (compiled) {
42689                                     context = context.parentNode;
42690                                 }
42691
42692                                 selector = selector.slice(tokens.shift().value.length);
42693                             }
42694
42695                             // Fetch a seed set for right-to-left matching
42696                             i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
42697                             while (i--) {
42698                                 token = tokens[i];
42699
42700                                 // Abort if we hit a combinator
42701                                 if (Expr.relative[(type = token.type)]) {
42702                                     break;
42703                                 }
42704                                 if ((find = Expr.find[type])) {
42705                                     // Search, expanding context for leading sibling combinators
42706                                     if ((seed = find(
42707                                             token.matches[0].replace(runescape, funescape),
42708                                             rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
42709                                         ))) {
42710
42711                                         // If seed is empty or no tokens remain, we can return early
42712                                         tokens.splice(i, 1);
42713                                         selector = seed.length && toSelector(tokens);
42714                                         if (!selector) {
42715                                             push.apply(results, seed);
42716                                             return results;
42717                                         }
42718
42719                                         break;
42720                                     }
42721                                 }
42722                             }
42723                         }
42724
42725                         // Compile and execute a filtering function if one is not provided
42726                         // Provide `match` to avoid retokenization if we modified the selector above
42727                         (compiled || compile(selector, match))(
42728                             seed,
42729                             context, !documentIsHTML,
42730                             results,
42731                             rsibling.test(selector) && testContext(context.parentNode) || context
42732                         );
42733                         return results;
42734                     };
42735
42736                     // One-time assignments
42737
42738                     // Sort stability
42739                     support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
42740
42741                     // Support: Chrome 14-35+
42742                     // Always assume duplicates if they aren't passed to the comparison function
42743                     support.detectDuplicates = !!hasDuplicate;
42744
42745                     // Initialize against the default document
42746                     setDocument();
42747
42748                     // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
42749                     // Detached nodes confoundingly follow *each other*
42750                     support.sortDetached = assert(function(div1) {
42751                         // Should return 1, but returns 4 (following)
42752                         return div1.compareDocumentPosition(document.createElement("div")) & 1;
42753                     });
42754
42755                     // Support: IE<8
42756                     // Prevent attribute/property "interpolation"
42757                     // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
42758                     if (!assert(function(div) {
42759                             div.innerHTML = "<a href='#'></a>";
42760                             return div.firstChild.getAttribute("href") === "#";
42761                         })) {
42762                         addHandle("type|href|height|width", function(elem, name, isXML) {
42763                             if (!isXML) {
42764                                 return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2);
42765                             }
42766                         });
42767                     }
42768
42769                     // Support: IE<9
42770                     // Use defaultValue in place of getAttribute("value")
42771                     if (!support.attributes || !assert(function(div) {
42772                             div.innerHTML = "<input/>";
42773                             div.firstChild.setAttribute("value", "");
42774                             return div.firstChild.getAttribute("value") === "";
42775                         })) {
42776                         addHandle("value", function(elem, name, isXML) {
42777                             if (!isXML && elem.nodeName.toLowerCase() === "input") {
42778                                 return elem.defaultValue;
42779                             }
42780                         });
42781                     }
42782
42783                     // Support: IE<9
42784                     // Use getAttributeNode to fetch booleans when getAttribute lies
42785                     if (!assert(function(div) {
42786                             return div.getAttribute("disabled") == null;
42787                         })) {
42788                         addHandle(booleans, function(elem, name, isXML) {
42789                             var val;
42790                             if (!isXML) {
42791                                 return elem[name] === true ? name.toLowerCase() :
42792                                     (val = elem.getAttributeNode(name)) && val.specified ?
42793                                     val.value :
42794                                     null;
42795                             }
42796                         });
42797                     }
42798
42799                     return Sizzle;
42800
42801                 })(window);
42802
42803
42804
42805             jQuery.find = Sizzle;
42806             jQuery.expr = Sizzle.selectors;
42807             jQuery.expr[":"] = jQuery.expr.pseudos;
42808             jQuery.unique = Sizzle.uniqueSort;
42809             jQuery.text = Sizzle.getText;
42810             jQuery.isXMLDoc = Sizzle.isXML;
42811             jQuery.contains = Sizzle.contains;
42812
42813
42814
42815             var rneedsContext = jQuery.expr.match.needsContext;
42816
42817             var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
42818
42819
42820
42821             var risSimple = /^.[^:#\[\.,]*$/;
42822
42823             // Implement the identical functionality for filter and not
42824             function winnow(elements, qualifier, not) {
42825                 if (jQuery.isFunction(qualifier)) {
42826                     return jQuery.grep(elements, function(elem, i) {
42827                         /* jshint -W018 */
42828                         return !!qualifier.call(elem, i, elem) !== not;
42829                     });
42830
42831                 }
42832
42833                 if (qualifier.nodeType) {
42834                     return jQuery.grep(elements, function(elem) {
42835                         return (elem === qualifier) !== not;
42836                     });
42837
42838                 }
42839
42840                 if (typeof qualifier === "string") {
42841                     if (risSimple.test(qualifier)) {
42842                         return jQuery.filter(qualifier, elements, not);
42843                     }
42844
42845                     qualifier = jQuery.filter(qualifier, elements);
42846                 }
42847
42848                 return jQuery.grep(elements, function(elem) {
42849                     return (indexOf.call(qualifier, elem) >= 0) !== not;
42850                 });
42851             }
42852
42853             jQuery.filter = function(expr, elems, not) {
42854                 var elem = elems[0];
42855
42856                 if (not) {
42857                     expr = ":not(" + expr + ")";
42858                 }
42859
42860                 return elems.length === 1 && elem.nodeType === 1 ?
42861                     jQuery.find.matchesSelector(elem, expr) ? [elem] : [] :
42862                     jQuery.find.matches(expr, jQuery.grep(elems, function(elem) {
42863                         return elem.nodeType === 1;
42864                     }));
42865             };
42866
42867             jQuery.fn.extend({
42868                 find: function(selector) {
42869                     var i,
42870                         len = this.length,
42871                         ret = [],
42872                         self = this;
42873
42874                     if (typeof selector !== "string") {
42875                         return this.pushStack(jQuery(selector).filter(function() {
42876                             for (i = 0; i < len; i++) {
42877                                 if (jQuery.contains(self[i], this)) {
42878                                     return true;
42879                                 }
42880                             }
42881                         }));
42882                     }
42883
42884                     for (i = 0; i < len; i++) {
42885                         jQuery.find(selector, self[i], ret);
42886                     }
42887
42888                     // Needed because $( selector, context ) becomes $( context ).find(
42889                     // selector )
42890                     ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);
42891                     ret.selector = this.selector ? this.selector + " " + selector : selector;
42892                     return ret;
42893                 },
42894                 filter: function(selector) {
42895                     return this.pushStack(winnow(this, selector || [], false));
42896                 },
42897                 not: function(selector) {
42898                     return this.pushStack(winnow(this, selector || [], true));
42899                 },
42900                 is: function(selector) {
42901                     return !!winnow(
42902                         this,
42903
42904                         // If this is a positional/relative selector, check membership in
42905                         // the returned set
42906                         // so $("p:first").is("p:last") won't return true for a doc with two
42907                         // "p".
42908                         typeof selector === "string" && rneedsContext.test(selector) ?
42909                         jQuery(selector) :
42910                         selector || [],
42911                         false
42912                     ).length;
42913                 }
42914             });
42915
42916
42917             // Initialize a jQuery object
42918
42919
42920             // A central reference to the root jQuery(document)
42921             var rootjQuery,
42922
42923                 // A simple way to check for HTML strings
42924                 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
42925                 // Strict HTML recognition (#11290: must start with <)
42926                 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
42927
42928                 init = jQuery.fn.init = function(selector, context) {
42929                     var match, elem;
42930
42931                     // HANDLE: $(""), $(null), $(undefined), $(false)
42932                     if (!selector) {
42933                         return this;
42934                     }
42935
42936                     // Handle HTML strings
42937                     if (typeof selector === "string") {
42938                         if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
42939                             // Assume that strings that start and end with <> are HTML and
42940                             // skip the regex check
42941                             match = [null, selector, null];
42942
42943                         } else {
42944                             match = rquickExpr.exec(selector);
42945                         }
42946
42947                         // Match html or make sure no context is specified for #id
42948                         if (match && (match[1] || !context)) {
42949
42950                             // HANDLE: $(html) -> $(array)
42951                             if (match[1]) {
42952                                 context = context instanceof jQuery ? context[0] : context;
42953
42954                                 // Option to run scripts is true for back-compat
42955                                 // Intentionally let the error be thrown if parseHTML is not
42956                                 // present
42957                                 jQuery.merge(this, jQuery.parseHTML(
42958                                     match[1],
42959                                     context && context.nodeType ? context.ownerDocument || context : document,
42960                                     true
42961                                 ));
42962
42963                                 // HANDLE: $(html, props)
42964                                 if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
42965                                     for (match in context) {
42966                                         // Properties of context are called as methods if
42967                                         // possible
42968                                         if (jQuery.isFunction(this[match])) {
42969                                             this[match](context[match]);
42970
42971                                             // ...and otherwise set as attributes
42972                                         } else {
42973                                             this.attr(match, context[match]);
42974                                         }
42975                                     }
42976                                 }
42977
42978                                 return this;
42979
42980                                 // HANDLE: $(#id)
42981                             } else {
42982                                 elem = document.getElementById(match[2]);
42983
42984                                 // Support: Blackberry 4.6
42985                                 // gEBID returns nodes no longer in the document (#6963)
42986                                 if (elem && elem.parentNode) {
42987                                     // Inject the element directly into the jQuery object
42988                                     this.length = 1;
42989                                     this[0] = elem;
42990                                 }
42991
42992                                 this.context = document;
42993                                 this.selector = selector;
42994                                 return this;
42995                             }
42996
42997                             // HANDLE: $(expr, $(...))
42998                         } else if (!context || context.jquery) {
42999                             return (context || rootjQuery).find(selector);
43000
43001                             // HANDLE: $(expr, context)
43002                             // (which is just equivalent to: $(context).find(expr)
43003                         } else {
43004                             return this.constructor(context).find(selector);
43005                         }
43006
43007                         // HANDLE: $(DOMElement)
43008                     } else if (selector.nodeType) {
43009                         this.context = this[0] = selector;
43010                         this.length = 1;
43011                         return this;
43012
43013                         // HANDLE: $(function)
43014                         // Shortcut for document ready
43015                     } else if (jQuery.isFunction(selector)) {
43016                         return typeof rootjQuery.ready !== "undefined" ?
43017                             rootjQuery.ready(selector) :
43018                             // Execute immediately if ready is not present
43019                             selector(jQuery);
43020                     }
43021
43022                     if (selector.selector !== undefined) {
43023                         this.selector = selector.selector;
43024                         this.context = selector.context;
43025                     }
43026
43027                     return jQuery.makeArray(selector, this);
43028                 };
43029
43030             // Give the init function the jQuery prototype for later instantiation
43031             init.prototype = jQuery.fn;
43032
43033             // Initialize central reference
43034             rootjQuery = jQuery(document);
43035
43036
43037             var rparentsprev = /^(?:parents|prev(?:Until|All))/,
43038                 // Methods guaranteed to produce a unique set when starting from a unique
43039                 // set
43040                 guaranteedUnique = {
43041                     children: true,
43042                     contents: true,
43043                     next: true,
43044                     prev: true
43045                 };
43046
43047             jQuery.extend({
43048                 dir: function(elem, dir, until) {
43049                     var matched = [],
43050                         truncate = until !== undefined;
43051
43052                     while ((elem = elem[dir]) && elem.nodeType !== 9) {
43053                         if (elem.nodeType === 1) {
43054                             if (truncate && jQuery(elem).is(until)) {
43055                                 break;
43056                             }
43057                             matched.push(elem);
43058                         }
43059                     }
43060                     return matched;
43061                 },
43062
43063                 sibling: function(n, elem) {
43064                     var matched = [];
43065
43066                     for (; n; n = n.nextSibling) {
43067                         if (n.nodeType === 1 && n !== elem) {
43068                             matched.push(n);
43069                         }
43070                     }
43071
43072                     return matched;
43073                 }
43074             });
43075
43076             jQuery.fn.extend({
43077                 has: function(target) {
43078                     var targets = jQuery(target, this),
43079                         l = targets.length;
43080
43081                     return this.filter(function() {
43082                         var i = 0;
43083                         for (; i < l; i++) {
43084                             if (jQuery.contains(this, targets[i])) {
43085                                 return true;
43086                             }
43087                         }
43088                     });
43089                 },
43090
43091                 closest: function(selectors, context) {
43092                     var cur,
43093                         i = 0,
43094                         l = this.length,
43095                         matched = [],
43096                         pos = rneedsContext.test(selectors) || typeof selectors !== "string" ?
43097                         jQuery(selectors, context || this.context) :
43098                         0;
43099
43100                     for (; i < l; i++) {
43101                         for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
43102                             // Always skip document fragments
43103                             if (cur.nodeType < 11 && (pos ?
43104                                     pos.index(cur) > -1 :
43105
43106                                     // Don't pass non-elements to Sizzle
43107                                     cur.nodeType === 1 &&
43108                                     jQuery.find.matchesSelector(cur, selectors))) {
43109
43110                                 matched.push(cur);
43111                                 break;
43112                             }
43113                         }
43114                     }
43115
43116                     return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched);
43117                 },
43118
43119                 // Determine the position of an element within the set
43120                 index: function(elem) {
43121
43122                     // No argument, return index in parent
43123                     if (!elem) {
43124                         return (this[0] && this[0].parentNode) ? this.first().prevAll().length : -1;
43125                     }
43126
43127                     // Index in selector
43128                     if (typeof elem === "string") {
43129                         return indexOf.call(jQuery(elem), this[0]);
43130                     }
43131
43132                     // Locate the position of the desired element
43133                     return indexOf.call(this,
43134
43135                         // If it receives a jQuery object, the first element is used
43136                         elem.jquery ? elem[0] : elem
43137                     );
43138                 },
43139
43140                 add: function(selector, context) {
43141                     return this.pushStack(
43142                         jQuery.unique(
43143                             jQuery.merge(this.get(), jQuery(selector, context))
43144                         )
43145                     );
43146                 },
43147
43148                 addBack: function(selector) {
43149                     return this.add(selector == null ?
43150                         this.prevObject : this.prevObject.filter(selector)
43151                     );
43152                 }
43153             });
43154
43155             function sibling(cur, dir) {
43156                 while ((cur = cur[dir]) && cur.nodeType !== 1) {}
43157                 return cur;
43158             }
43159
43160             jQuery.each({
43161                 parent: function(elem) {
43162                     var parent = elem.parentNode;
43163                     return parent && parent.nodeType !== 11 ? parent : null;
43164                 },
43165                 parents: function(elem) {
43166                     return jQuery.dir(elem, "parentNode");
43167                 },
43168                 parentsUntil: function(elem, i, until) {
43169                     return jQuery.dir(elem, "parentNode", until);
43170                 },
43171                 next: function(elem) {
43172                     return sibling(elem, "nextSibling");
43173                 },
43174                 prev: function(elem) {
43175                     return sibling(elem, "previousSibling");
43176                 },
43177                 nextAll: function(elem) {
43178                     return jQuery.dir(elem, "nextSibling");
43179                 },
43180                 prevAll: function(elem) {
43181                     return jQuery.dir(elem, "previousSibling");
43182                 },
43183                 nextUntil: function(elem, i, until) {
43184                     return jQuery.dir(elem, "nextSibling", until);
43185                 },
43186                 prevUntil: function(elem, i, until) {
43187                     return jQuery.dir(elem, "previousSibling", until);
43188                 },
43189                 siblings: function(elem) {
43190                     return jQuery.sibling((elem.parentNode || {}).firstChild, elem);
43191                 },
43192                 children: function(elem) {
43193                     return jQuery.sibling(elem.firstChild);
43194                 },
43195                 contents: function(elem) {
43196                     return elem.contentDocument || jQuery.merge([], elem.childNodes);
43197                 }
43198             }, function(name, fn) {
43199                 jQuery.fn[name] = function(until, selector) {
43200                     var matched = jQuery.map(this, fn, until);
43201
43202                     if (name.slice(-5) !== "Until") {
43203                         selector = until;
43204                     }
43205
43206                     if (selector && typeof selector === "string") {
43207                         matched = jQuery.filter(selector, matched);
43208                     }
43209
43210                     if (this.length > 1) {
43211                         // Remove duplicates
43212                         if (!guaranteedUnique[name]) {
43213                             jQuery.unique(matched);
43214                         }
43215
43216                         // Reverse order for parents* and prev-derivatives
43217                         if (rparentsprev.test(name)) {
43218                             matched.reverse();
43219                         }
43220                     }
43221
43222                     return this.pushStack(matched);
43223                 };
43224             });
43225             var rnotwhite = (/\S+/g);
43226
43227
43228
43229             // String to Object options format cache
43230             var optionsCache = {};
43231
43232             // Convert String-formatted options into Object-formatted ones and store in
43233             // cache
43234             function createOptions(options) {
43235                 var object = optionsCache[options] = {};
43236                 jQuery.each(options.match(rnotwhite) || [], function(_, flag) {
43237                     object[flag] = true;
43238                 });
43239                 return object;
43240             }
43241
43242             /*
43243              * Create a callback list using the following parameters:
43244              * 
43245              * options: an optional list of space-separated options that will change how the
43246              * callback list behaves or a more traditional option object
43247              * 
43248              * By default a callback list will act like an event callback list and can be
43249              * "fired" multiple times.
43250              * 
43251              * Possible options:
43252              * 
43253              * once: will ensure the callback list can only be fired once (like a Deferred)
43254              * 
43255              * memory: will keep track of previous values and will call any callback added
43256              * after the list has been fired right away with the latest "memorized" values
43257              * (like a Deferred)
43258              * 
43259              * unique: will ensure a callback can only be added once (no duplicate in the
43260              * list)
43261              * 
43262              * stopOnFalse: interrupt callings when a callback returns false
43263              * 
43264              */
43265             jQuery.Callbacks = function(options) {
43266
43267                 // Convert options from String-formatted to Object-formatted if needed
43268                 // (we check in cache first)
43269                 options = typeof options === "string" ?
43270                     (optionsCache[options] || createOptions(options)) :
43271                     jQuery.extend({}, options);
43272
43273                 var // Last fire value (for non-forgettable lists)
43274                     memory,
43275                     // Flag to know if list was already fired
43276                     fired,
43277                     // Flag to know if list is currently firing
43278                     firing,
43279                     // First callback to fire (used internally by add and fireWith)
43280                     firingStart,
43281                     // End of the loop when firing
43282                     firingLength,
43283                     // Index of currently firing callback (modified by remove if needed)
43284                     firingIndex,
43285                     // Actual callback list
43286                     list = [],
43287                     // Stack of fire calls for repeatable lists
43288                     stack = !options.once && [],
43289                     // Fire callbacks
43290                     fire = function(data) {
43291                         memory = options.memory && data;
43292                         fired = true;
43293                         firingIndex = firingStart || 0;
43294                         firingStart = 0;
43295                         firingLength = list.length;
43296                         firing = true;
43297                         for (; list && firingIndex < firingLength; firingIndex++) {
43298                             if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
43299                                 memory = false; // To prevent further calls using add
43300                                 break;
43301                             }
43302                         }
43303                         firing = false;
43304                         if (list) {
43305                             if (stack) {
43306                                 if (stack.length) {
43307                                     fire(stack.shift());
43308                                 }
43309                             } else if (memory) {
43310                                 list = [];
43311                             } else {
43312                                 self.disable();
43313                             }
43314                         }
43315                     },
43316                     // Actual Callbacks object
43317                     self = {
43318                         // Add a callback or a collection of callbacks to the list
43319                         add: function() {
43320                             if (list) {
43321                                 // First, we save the current length
43322                                 var start = list.length;
43323                                 (function add(args) {
43324                                     jQuery.each(args, function(_, arg) {
43325                                         var type = jQuery.type(arg);
43326                                         if (type === "function") {
43327                                             if (!options.unique || !self.has(arg)) {
43328                                                 list.push(arg);
43329                                             }
43330                                         } else if (arg && arg.length && type !== "string") {
43331                                             // Inspect recursively
43332                                             add(arg);
43333                                         }
43334                                     });
43335                                 })(arguments);
43336                                 // Do we need to add the callbacks to the
43337                                 // current firing batch?
43338                                 if (firing) {
43339                                     firingLength = list.length;
43340                                     // With memory, if we're not firing then
43341                                     // we should call right away
43342                                 } else if (memory) {
43343                                     firingStart = start;
43344                                     fire(memory);
43345                                 }
43346                             }
43347                             return this;
43348                         },
43349                         // Remove a callback from the list
43350                         remove: function() {
43351                             if (list) {
43352                                 jQuery.each(arguments, function(_, arg) {
43353                                     var index;
43354                                     while ((index = jQuery.inArray(arg, list, index)) > -1) {
43355                                         list.splice(index, 1);
43356                                         // Handle firing indexes
43357                                         if (firing) {
43358                                             if (index <= firingLength) {
43359                                                 firingLength--;
43360                                             }
43361                                             if (index <= firingIndex) {
43362                                                 firingIndex--;
43363                                             }
43364                                         }
43365                                     }
43366                                 });
43367                             }
43368                             return this;
43369                         },
43370                         // Check if a given callback is in the list.
43371                         // If no argument is given, return whether or not list has callbacks
43372                         // attached.
43373                         has: function(fn) {
43374                             return fn ? jQuery.inArray(fn, list) > -1 : !!(list && list.length);
43375                         },
43376                         // Remove all callbacks from the list
43377                         empty: function() {
43378                             list = [];
43379                             firingLength = 0;
43380                             return this;
43381                         },
43382                         // Have the list do nothing anymore
43383                         disable: function() {
43384                             list = stack = memory = undefined;
43385                             return this;
43386                         },
43387                         // Is it disabled?
43388                         disabled: function() {
43389                             return !list;
43390                         },
43391                         // Lock the list in its current state
43392                         lock: function() {
43393                             stack = undefined;
43394                             if (!memory) {
43395                                 self.disable();
43396                             }
43397                             return this;
43398                         },
43399                         // Is it locked?
43400                         locked: function() {
43401                             return !stack;
43402                         },
43403                         // Call all callbacks with the given context and arguments
43404                         fireWith: function(context, args) {
43405                             if (list && (!fired || stack)) {
43406                                 args = args || [];
43407                                 args = [context, args.slice ? args.slice() : args];
43408                                 if (firing) {
43409                                     stack.push(args);
43410                                 } else {
43411                                     fire(args);
43412                                 }
43413                             }
43414                             return this;
43415                         },
43416                         // Call all the callbacks with the given arguments
43417                         fire: function() {
43418                             self.fireWith(this, arguments);
43419                             return this;
43420                         },
43421                         // To know if the callbacks have already been called at least once
43422                         fired: function() {
43423                             return !!fired;
43424                         }
43425                     };
43426
43427                 return self;
43428             };
43429
43430
43431             jQuery.extend({
43432
43433                 Deferred: function(func) {
43434                     var tuples = [
43435                             // action, add listener, listener list, final state
43436                             ["resolve", "done", jQuery.Callbacks("once memory"), "resolved"],
43437                             ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"],
43438                             ["notify", "progress", jQuery.Callbacks("memory")]
43439                         ],
43440                         state = "pending",
43441                         promise = {
43442                             state: function() {
43443                                 return state;
43444                             },
43445                             always: function() {
43446                                 deferred.done(arguments).fail(arguments);
43447                                 return this;
43448                             },
43449                             then: function( /* fnDone, fnFail, fnProgress */ ) {
43450                                 var fns = arguments;
43451                                 return jQuery.Deferred(function(newDefer) {
43452                                     jQuery.each(tuples, function(i, tuple) {
43453                                         var fn = jQuery.isFunction(fns[i]) && fns[i];
43454                                         // deferred[ done | fail | progress ] for forwarding
43455                                         // actions to newDefer
43456                                         deferred[tuple[1]](function() {
43457                                             var returned = fn && fn.apply(this, arguments);
43458                                             if (returned && jQuery.isFunction(returned.promise)) {
43459                                                 returned.promise()
43460                                                     .done(newDefer.resolve)
43461                                                     .fail(newDefer.reject)
43462                                                     .progress(newDefer.notify);
43463                                             } else {
43464                                                 newDefer[tuple[0] + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);
43465                                             }
43466                                         });
43467                                     });
43468                                     fns = null;
43469                                 }).promise();
43470                             },
43471                             // Get a promise for this deferred
43472                             // If obj is provided, the promise aspect is added to the object
43473                             promise: function(obj) {
43474                                 return obj != null ? jQuery.extend(obj, promise) : promise;
43475                             }
43476                         },
43477                         deferred = {};
43478
43479                     // Keep pipe for back-compat
43480                     promise.pipe = promise.then;
43481
43482                     // Add list-specific methods
43483                     jQuery.each(tuples, function(i, tuple) {
43484                         var list = tuple[2],
43485                             stateString = tuple[3];
43486
43487                         // promise[ done | fail | progress ] = list.add
43488                         promise[tuple[1]] = list.add;
43489
43490                         // Handle state
43491                         if (stateString) {
43492                             list.add(function() {
43493                                 // state = [ resolved | rejected ]
43494                                 state = stateString;
43495
43496                                 // [ reject_list | resolve_list ].disable; progress_list.lock
43497                             }, tuples[i ^ 1][2].disable, tuples[2][2].lock);
43498                         }
43499
43500                         // deferred[ resolve | reject | notify ]
43501                         deferred[tuple[0]] = function() {
43502                             deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments);
43503                             return this;
43504                         };
43505                         deferred[tuple[0] + "With"] = list.fireWith;
43506                     });
43507
43508                     // Make the deferred a promise
43509                     promise.promise(deferred);
43510
43511                     // Call given func if any
43512                     if (func) {
43513                         func.call(deferred, deferred);
43514                     }
43515
43516                     // All done!
43517                     return deferred;
43518                 },
43519
43520                 // Deferred helper
43521                 when: function(subordinate /* , ..., subordinateN */ ) {
43522                     var i = 0,
43523                         resolveValues = slice.call(arguments),
43524                         length = resolveValues.length,
43525
43526                         // the count of uncompleted subordinates
43527                         remaining = length !== 1 || (subordinate && jQuery.isFunction(subordinate.promise)) ? length : 0,
43528
43529                         // the master Deferred. If resolveValues consist of only a single
43530                         // Deferred, just use that.
43531                         deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
43532
43533                         // Update function for both resolve and progress values
43534                         updateFunc = function(i, contexts, values) {
43535                             return function(value) {
43536                                 contexts[i] = this;
43537                                 values[i] = arguments.length > 1 ? slice.call(arguments) : value;
43538                                 if (values === progressValues) {
43539                                     deferred.notifyWith(contexts, values);
43540                                 } else if (!(--remaining)) {
43541                                     deferred.resolveWith(contexts, values);
43542                                 }
43543                             };
43544                         },
43545
43546                         progressValues, progressContexts, resolveContexts;
43547
43548                     // Add listeners to Deferred subordinates; treat others as resolved
43549                     if (length > 1) {
43550                         progressValues = new Array(length);
43551                         progressContexts = new Array(length);
43552                         resolveContexts = new Array(length);
43553                         for (; i < length; i++) {
43554                             if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
43555                                 resolveValues[i].promise()
43556                                     .done(updateFunc(i, resolveContexts, resolveValues))
43557                                     .fail(deferred.reject)
43558                                     .progress(updateFunc(i, progressContexts, progressValues));
43559                             } else {
43560                                 --remaining;
43561                             }
43562                         }
43563                     }
43564
43565                     // If we're not waiting on anything, resolve the master
43566                     if (!remaining) {
43567                         deferred.resolveWith(resolveContexts, resolveValues);
43568                     }
43569
43570                     return deferred.promise();
43571                 }
43572             });
43573
43574
43575             // The deferred used on DOM ready
43576             var readyList;
43577
43578             jQuery.fn.ready = function(fn) {
43579                 // Add the callback
43580                 jQuery.ready.promise().done(fn);
43581
43582                 return this;
43583             };
43584
43585             jQuery.extend({
43586                 // Is the DOM ready to be used? Set to true once it occurs.
43587                 isReady: false,
43588
43589                 // A counter to track how many items to wait for before
43590                 // the ready event fires. See #6781
43591                 readyWait: 1,
43592
43593                 // Hold (or release) the ready event
43594                 holdReady: function(hold) {
43595                     if (hold) {
43596                         jQuery.readyWait++;
43597                     } else {
43598                         jQuery.ready(true);
43599                     }
43600                 },
43601
43602                 // Handle when the DOM is ready
43603                 ready: function(wait) {
43604
43605                     // Abort if there are pending holds or we're already ready
43606                     if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
43607                         return;
43608                     }
43609
43610                     // Remember that the DOM is ready
43611                     jQuery.isReady = true;
43612
43613                     // If a normal DOM Ready event fired, decrement, and wait if need be
43614                     if (wait !== true && --jQuery.readyWait > 0) {
43615                         return;
43616                     }
43617
43618                     // If there are functions bound, to execute
43619                     readyList.resolveWith(document, [jQuery]);
43620
43621                     // Trigger any bound ready events
43622                     if (jQuery.fn.triggerHandler) {
43623                         jQuery(document).triggerHandler("ready");
43624                         jQuery(document).off("ready");
43625                     }
43626                 }
43627             });
43628
43629             /**
43630              * The ready event handler and self cleanup method
43631              */
43632             function completed() {
43633                 document.removeEventListener("DOMContentLoaded", completed, false);
43634                 window.removeEventListener("load", completed, false);
43635                 jQuery.ready();
43636             }
43637
43638             jQuery.ready.promise = function(obj) {
43639                 if (!readyList) {
43640
43641                     readyList = jQuery.Deferred();
43642
43643                     // Catch cases where $(document).ready() is called after the browser
43644                     // event has already occurred.
43645                     // We once tried to use readyState "interactive" here, but it caused
43646                     // issues like the one
43647                     // discovered by ChrisS here:
43648                     // http://bugs.jquery.com/ticket/12282#comment:15
43649                     if (document.readyState === "complete") {
43650                         // Handle it asynchronously to allow scripts the opportunity to
43651                         // delay ready
43652                         setTimeout(jQuery.ready);
43653
43654                     } else {
43655
43656                         // Use the handy event callback
43657                         document.addEventListener("DOMContentLoaded", completed, false);
43658
43659                         // A fallback to window.onload, that will always work
43660                         window.addEventListener("load", completed, false);
43661                     }
43662                 }
43663                 return readyList.promise(obj);
43664             };
43665
43666             // Kick off the DOM ready check even if the user does not
43667             jQuery.ready.promise();
43668
43669
43670
43671
43672             // Multifunctional method to get and set values of a collection
43673             // The value/s can optionally be executed if it's a function
43674             var access = jQuery.access = function(elems, fn, key, value, chainable, emptyGet, raw) {
43675                 var i = 0,
43676                     len = elems.length,
43677                     bulk = key == null;
43678
43679                 // Sets many values
43680                 if (jQuery.type(key) === "object") {
43681                     chainable = true;
43682                     for (i in key) {
43683                         jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);
43684                     }
43685
43686                     // Sets one value
43687                 } else if (value !== undefined) {
43688                     chainable = true;
43689
43690                     if (!jQuery.isFunction(value)) {
43691                         raw = true;
43692                     }
43693
43694                     if (bulk) {
43695                         // Bulk operations run against the entire set
43696                         if (raw) {
43697                             fn.call(elems, value);
43698                             fn = null;
43699
43700                             // ...except when executing function values
43701                         } else {
43702                             bulk = fn;
43703                             fn = function(elem, key, value) {
43704                                 return bulk.call(jQuery(elem), value);
43705                             };
43706                         }
43707                     }
43708
43709                     if (fn) {
43710                         for (; i < len; i++) {
43711                             fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
43712                         }
43713                     }
43714                 }
43715
43716                 return chainable ?
43717                     elems :
43718
43719                     // Gets
43720                     bulk ?
43721                     fn.call(elems) :
43722                     len ? fn(elems[0], key) : emptyGet;
43723             };
43724
43725
43726             /**
43727              * Determines whether an object can have data
43728              */
43729             jQuery.acceptData = function(owner) {
43730                 // Accepts only:
43731                 // - Node
43732                 // - Node.ELEMENT_NODE
43733                 // - Node.DOCUMENT_NODE
43734                 // - Object
43735                 // - Any
43736                 /* jshint -W018 */
43737                 return owner.nodeType === 1 || owner.nodeType === 9 || !(+owner.nodeType);
43738             };
43739
43740
43741             function Data() {
43742                 // Support: Android<4,
43743                 // Old WebKit does not have Object.preventExtensions/freeze method,
43744                 // return new empty object instead with no [[set]] accessor
43745                 Object.defineProperty(this.cache = {}, 0, {
43746                     get: function() {
43747                         return {};
43748                     }
43749                 });
43750
43751                 this.expando = jQuery.expando + Data.uid++;
43752             }
43753
43754             Data.uid = 1;
43755             Data.accepts = jQuery.acceptData;
43756
43757             Data.prototype = {
43758                 key: function(owner) {
43759                     // We can accept data for non-element nodes in modern browsers,
43760                     // but we should not, see #8335.
43761                     // Always return the key for a frozen object.
43762                     if (!Data.accepts(owner)) {
43763                         return 0;
43764                     }
43765
43766                     var descriptor = {},
43767                         // Check if the owner object already has a cache key
43768                         unlock = owner[this.expando];
43769
43770                     // If not, create one
43771                     if (!unlock) {
43772                         unlock = Data.uid++;
43773
43774                         // Secure it in a non-enumerable, non-writable property
43775                         try {
43776                             descriptor[this.expando] = {
43777                                 value: unlock
43778                             };
43779                             Object.defineProperties(owner, descriptor);
43780
43781                             // Support: Android<4
43782                             // Fallback to a less secure definition
43783                         } catch (e) {
43784                             descriptor[this.expando] = unlock;
43785                             jQuery.extend(owner, descriptor);
43786                         }
43787                     }
43788
43789                     // Ensure the cache object
43790                     if (!this.cache[unlock]) {
43791                         this.cache[unlock] = {};
43792                     }
43793
43794                     return unlock;
43795                 },
43796                 set: function(owner, data, value) {
43797                     var prop,
43798                         // There may be an unlock assigned to this node,
43799                         // if there is no entry for this "owner", create one inline
43800                         // and set the unlock as though an owner entry had always existed
43801                         unlock = this.key(owner),
43802                         cache = this.cache[unlock];
43803
43804                     // Handle: [ owner, key, value ] args
43805                     if (typeof data === "string") {
43806                         cache[data] = value;
43807
43808                         // Handle: [ owner, { properties } ] args
43809                     } else {
43810                         // Fresh assignments by object are shallow copied
43811                         if (jQuery.isEmptyObject(cache)) {
43812                             jQuery.extend(this.cache[unlock], data);
43813                             // Otherwise, copy the properties one-by-one to the cache object
43814                         } else {
43815                             for (prop in data) {
43816                                 cache[prop] = data[prop];
43817                             }
43818                         }
43819                     }
43820                     return cache;
43821                 },
43822                 get: function(owner, key) {
43823                     // Either a valid cache is found, or will be created.
43824                     // New caches will be created and the unlock returned,
43825                     // allowing direct access to the newly created
43826                     // empty data object. A valid owner object must be provided.
43827                     var cache = this.cache[this.key(owner)];
43828
43829                     return key === undefined ?
43830                         cache : cache[key];
43831                 },
43832                 access: function(owner, key, value) {
43833                     var stored;
43834                     // In cases where either:
43835                     //
43836                     // 1. No key was specified
43837                     // 2. A string key was specified, but no value provided
43838                     //
43839                     // Take the "read" path and allow the get method to determine
43840                     // which value to return, respectively either:
43841                     //
43842                     // 1. The entire cache object
43843                     // 2. The data stored at the key
43844                     //
43845                     if (key === undefined ||
43846                         ((key && typeof key === "string") && value === undefined)) {
43847
43848                         stored = this.get(owner, key);
43849
43850                         return stored !== undefined ?
43851                             stored : this.get(owner, jQuery.camelCase(key));
43852                     }
43853
43854                     // [*]When the key is not a string, or both a key and value
43855                     // are specified, set or extend (existing objects) with either:
43856                     //
43857                     // 1. An object of properties
43858                     // 2. A key and value
43859                     //
43860                     this.set(owner, key, value);
43861
43862                     // Since the "set" path can have two possible entry points
43863                     // return the expected data based on which path was taken[*]
43864                     return value !== undefined ? value : key;
43865                 },
43866                 remove: function(owner, key) {
43867                     var i, name, camel,
43868                         unlock = this.key(owner),
43869                         cache = this.cache[unlock];
43870
43871                     if (key === undefined) {
43872                         this.cache[unlock] = {};
43873
43874                     } else {
43875                         // Support array or space separated string of keys
43876                         if (jQuery.isArray(key)) {
43877                             // If "name" is an array of keys...
43878                             // When data is initially created, via ("key", "val") signature,
43879                             // keys will be converted to camelCase.
43880                             // Since there is no way to tell _how_ a key was added, remove
43881                             // both plain key and camelCase key. #12786
43882                             // This will only penalize the array argument path.
43883                             name = key.concat(key.map(jQuery.camelCase));
43884                         } else {
43885                             camel = jQuery.camelCase(key);
43886                             // Try the string as a key before any manipulation
43887                             if (key in cache) {
43888                                 name = [key, camel];
43889                             } else {
43890                                 // If a key with the spaces exists, use it.
43891                                 // Otherwise, create an array by matching non-whitespace
43892                                 name = camel;
43893                                 name = name in cache ? [name] : (name.match(rnotwhite) || []);
43894                             }
43895                         }
43896
43897                         i = name.length;
43898                         while (i--) {
43899                             delete cache[name[i]];
43900                         }
43901                     }
43902                 },
43903                 hasData: function(owner) {
43904                     return !jQuery.isEmptyObject(
43905                         this.cache[owner[this.expando]] || {}
43906                     );
43907                 },
43908                 discard: function(owner) {
43909                     if (owner[this.expando]) {
43910                         delete this.cache[owner[this.expando]];
43911                     }
43912                 }
43913             };
43914             var data_priv = new Data();
43915
43916             var data_user = new Data();
43917
43918
43919
43920             // Implementation Summary
43921             //
43922             // 1. Enforce API surface and semantic compatibility with 1.9.x branch
43923             // 2. Improve the module's maintainability by reducing the storage
43924             // paths to a single mechanism.
43925             // 3. Use the same single mechanism to support "private" and "user" data.
43926             // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
43927             // 5. Avoid exposing implementation details on user objects (eg. expando
43928             // properties)
43929             // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
43930
43931             var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
43932                 rmultiDash = /([A-Z])/g;
43933
43934             function dataAttr(elem, key, data) {
43935                 var name;
43936
43937                 // If nothing was found internally, try to fetch any
43938                 // data from the HTML5 data-* attribute
43939                 if (data === undefined && elem.nodeType === 1) {
43940                     name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase();
43941                     data = elem.getAttribute(name);
43942
43943                     if (typeof data === "string") {
43944                         try {
43945                             data = data === "true" ? true :
43946                                 data === "false" ? false :
43947                                 data === "null" ? null :
43948                                 // Only convert to a number if it doesn't change the string
43949                                 +data + "" === data ? +data :
43950                                 rbrace.test(data) ? jQuery.parseJSON(data) :
43951                                 data;
43952                         } catch (e) {}
43953
43954                         // Make sure we set the data so it isn't changed later
43955                         data_user.set(elem, key, data);
43956                     } else {
43957                         data = undefined;
43958                     }
43959                 }
43960                 return data;
43961             }
43962
43963             jQuery.extend({
43964                 hasData: function(elem) {
43965                     return data_user.hasData(elem) || data_priv.hasData(elem);
43966                 },
43967
43968                 data: function(elem, name, data) {
43969                     return data_user.access(elem, name, data);
43970                 },
43971
43972                 removeData: function(elem, name) {
43973                     data_user.remove(elem, name);
43974                 },
43975
43976                 // TODO: Now that all calls to _data and _removeData have been replaced
43977                 // with direct calls to data_priv methods, these can be deprecated.
43978                 _data: function(elem, name, data) {
43979                     return data_priv.access(elem, name, data);
43980                 },
43981
43982                 _removeData: function(elem, name) {
43983                     data_priv.remove(elem, name);
43984                 }
43985             });
43986
43987             jQuery.fn.extend({
43988                 data: function(key, value) {
43989                     var i, name, data,
43990                         elem = this[0],
43991                         attrs = elem && elem.attributes;
43992
43993                     // Gets all values
43994                     if (key === undefined) {
43995                         if (this.length) {
43996                             data = data_user.get(elem);
43997
43998                             if (elem.nodeType === 1 && !data_priv.get(elem, "hasDataAttrs")) {
43999                                 i = attrs.length;
44000                                 while (i--) {
44001
44002                                     // Support: IE11+
44003                                     // The attrs elements can be null (#14894)
44004                                     if (attrs[i]) {
44005                                         name = attrs[i].name;
44006                                         if (name.indexOf("data-") === 0) {
44007                                             name = jQuery.camelCase(name.slice(5));
44008                                             dataAttr(elem, name, data[name]);
44009                                         }
44010                                     }
44011                                 }
44012                                 data_priv.set(elem, "hasDataAttrs", true);
44013                             }
44014                         }
44015
44016                         return data;
44017                     }
44018
44019                     // Sets multiple values
44020                     if (typeof key === "object") {
44021                         return this.each(function() {
44022                             data_user.set(this, key);
44023                         });
44024                     }
44025
44026                     return access(this, function(value) {
44027                         var data,
44028                             camelKey = jQuery.camelCase(key);
44029
44030                         // The calling jQuery object (element matches) is not empty
44031                         // (and therefore has an element appears at this[ 0 ]) and the
44032                         // `value` parameter was not undefined. An empty jQuery object
44033                         // will result in `undefined` for elem = this[ 0 ] which will
44034                         // throw an exception if an attempt to read a data cache is made.
44035                         if (elem && value === undefined) {
44036                             // Attempt to get data from the cache
44037                             // with the key as-is
44038                             data = data_user.get(elem, key);
44039                             if (data !== undefined) {
44040                                 return data;
44041                             }
44042
44043                             // Attempt to get data from the cache
44044                             // with the key camelized
44045                             data = data_user.get(elem, camelKey);
44046                             if (data !== undefined) {
44047                                 return data;
44048                             }
44049
44050                             // Attempt to "discover" the data in
44051                             // HTML5 custom data-* attrs
44052                             data = dataAttr(elem, camelKey, undefined);
44053                             if (data !== undefined) {
44054                                 return data;
44055                             }
44056
44057                             // We tried really hard, but the data doesn't exist.
44058                             return;
44059                         }
44060
44061                         // Set the data...
44062                         this.each(function() {
44063                             // First, attempt to store a copy or reference of any
44064                             // data that might've been store with a camelCased key.
44065                             var data = data_user.get(this, camelKey);
44066
44067                             // For HTML5 data-* attribute interop, we have to
44068                             // store property names with dashes in a camelCase form.
44069                             // This might not apply to all properties...*
44070                             data_user.set(this, camelKey, value);
44071
44072                             // *... In the case of properties that might _actually_
44073                             // have dashes, we need to also store a copy of that
44074                             // unchanged property.
44075                             if (key.indexOf("-") !== -1 && data !== undefined) {
44076                                 data_user.set(this, key, value);
44077                             }
44078                         });
44079                     }, null, value, arguments.length > 1, null, true);
44080                 },
44081
44082                 removeData: function(key) {
44083                     return this.each(function() {
44084                         data_user.remove(this, key);
44085                     });
44086                 }
44087             });
44088
44089
44090             jQuery.extend({
44091                 queue: function(elem, type, data) {
44092                     var queue;
44093
44094                     if (elem) {
44095                         type = (type || "fx") + "queue";
44096                         queue = data_priv.get(elem, type);
44097
44098                         // Speed up dequeue by getting out quickly if this is just a lookup
44099                         if (data) {
44100                             if (!queue || jQuery.isArray(data)) {
44101                                 queue = data_priv.access(elem, type, jQuery.makeArray(data));
44102                             } else {
44103                                 queue.push(data);
44104                             }
44105                         }
44106                         return queue || [];
44107                     }
44108                 },
44109
44110                 dequeue: function(elem, type) {
44111                     type = type || "fx";
44112
44113                     var queue = jQuery.queue(elem, type),
44114                         startLength = queue.length,
44115                         fn = queue.shift(),
44116                         hooks = jQuery._queueHooks(elem, type),
44117                         next = function() {
44118                             jQuery.dequeue(elem, type);
44119                         };
44120
44121                     // If the fx queue is dequeued, always remove the progress sentinel
44122                     if (fn === "inprogress") {
44123                         fn = queue.shift();
44124                         startLength--;
44125                     }
44126
44127                     if (fn) {
44128
44129                         // Add a progress sentinel to prevent the fx queue from being
44130                         // automatically dequeued
44131                         if (type === "fx") {
44132                             queue.unshift("inprogress");
44133                         }
44134
44135                         // Clear up the last queue stop function
44136                         delete hooks.stop;
44137                         fn.call(elem, next, hooks);
44138                     }
44139
44140                     if (!startLength && hooks) {
44141                         hooks.empty.fire();
44142                     }
44143                 },
44144
44145                 // Not public - generate a queueHooks object, or return the current one
44146                 _queueHooks: function(elem, type) {
44147                     var key = type + "queueHooks";
44148                     return data_priv.get(elem, key) || data_priv.access(elem, key, {
44149                         empty: jQuery.Callbacks("once memory").add(function() {
44150                             data_priv.remove(elem, [type + "queue", key]);
44151                         })
44152                     });
44153                 }
44154             });
44155
44156             jQuery.fn.extend({
44157                 queue: function(type, data) {
44158                     var setter = 2;
44159
44160                     if (typeof type !== "string") {
44161                         data = type;
44162                         type = "fx";
44163                         setter--;
44164                     }
44165
44166                     if (arguments.length < setter) {
44167                         return jQuery.queue(this[0], type);
44168                     }
44169
44170                     return data === undefined ?
44171                         this :
44172                         this.each(function() {
44173                             var queue = jQuery.queue(this, type, data);
44174
44175                             // Ensure a hooks for this queue
44176                             jQuery._queueHooks(this, type);
44177
44178                             if (type === "fx" && queue[0] !== "inprogress") {
44179                                 jQuery.dequeue(this, type);
44180                             }
44181                         });
44182                 },
44183                 dequeue: function(type) {
44184                     return this.each(function() {
44185                         jQuery.dequeue(this, type);
44186                     });
44187                 },
44188                 clearQueue: function(type) {
44189                     return this.queue(type || "fx", []);
44190                 },
44191                 // Get a promise resolved when queues of a certain type
44192                 // are emptied (fx is the type by default)
44193                 promise: function(type, obj) {
44194                     var tmp,
44195                         count = 1,
44196                         defer = jQuery.Deferred(),
44197                         elements = this,
44198                         i = this.length,
44199                         resolve = function() {
44200                             if (!(--count)) {
44201                                 defer.resolveWith(elements, [elements]);
44202                             }
44203                         };
44204
44205                     if (typeof type !== "string") {
44206                         obj = type;
44207                         type = undefined;
44208                     }
44209                     type = type || "fx";
44210
44211                     while (i--) {
44212                         tmp = data_priv.get(elements[i], type + "queueHooks");
44213                         if (tmp && tmp.empty) {
44214                             count++;
44215                             tmp.empty.add(resolve);
44216                         }
44217                     }
44218                     resolve();
44219                     return defer.promise(obj);
44220                 }
44221             });
44222             var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
44223
44224             var cssExpand = ["Top", "Right", "Bottom", "Left"];
44225
44226             var isHidden = function(elem, el) {
44227                 // isHidden might be called from jQuery#filter function;
44228                 // in that case, element will be second argument
44229                 elem = el || elem;
44230                 return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem);
44231             };
44232
44233             var rcheckableType = (/^(?:checkbox|radio)$/i);
44234
44235
44236
44237             (function() {
44238                 var fragment = document.createDocumentFragment(),
44239                     div = fragment.appendChild(document.createElement("div")),
44240                     input = document.createElement("input");
44241
44242                 // Support: Safari<=5.1
44243                 // Check state lost if the name is set (#11217)
44244                 // Support: Windows Web Apps (WWA)
44245                 // `name` and `type` must use .setAttribute for WWA (#14901)
44246                 input.setAttribute("type", "radio");
44247                 input.setAttribute("checked", "checked");
44248                 input.setAttribute("name", "t");
44249
44250                 div.appendChild(input);
44251
44252                 // Support: Safari<=5.1, Android<4.2
44253                 // Older WebKit doesn't clone checked state correctly in fragments
44254                 support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
44255
44256                 // Support: IE<=11+
44257                 // Make sure textarea (and checkbox) defaultValue is properly cloned
44258                 div.innerHTML = "<textarea>x</textarea>";
44259                 support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
44260             })();
44261             var strundefined = typeof undefined;
44262
44263
44264
44265             support.focusinBubbles = "onfocusin" in window;
44266
44267
44268             var
44269                 rkeyEvent = /^key/,
44270                 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
44271                 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
44272                 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
44273
44274             function returnTrue() {
44275                 return true;
44276             }
44277
44278             function returnFalse() {
44279                 return false;
44280             }
44281
44282             function safeActiveElement() {
44283                 try {
44284                     return document.activeElement;
44285                 } catch (err) {}
44286             }
44287
44288             /*
44289              * Helper functions for managing events -- not part of the public interface.
44290              * Props to Dean Edwards' addEvent library for many of the ideas.
44291              */
44292             jQuery.event = {
44293
44294                 global: {},
44295
44296                 add: function(elem, types, handler, data, selector) {
44297
44298                     var handleObjIn, eventHandle, tmp,
44299                         events, t, handleObj,
44300                         special, handlers, type, namespaces, origType,
44301                         elemData = data_priv.get(elem);
44302
44303                     // Don't attach events to noData or text/comment nodes (but allow plain
44304                     // objects)
44305                     if (!elemData) {
44306                         return;
44307                     }
44308
44309                     // Caller can pass in an object of custom data in lieu of the handler
44310                     if (handler.handler) {
44311                         handleObjIn = handler;
44312                         handler = handleObjIn.handler;
44313                         selector = handleObjIn.selector;
44314                     }
44315
44316                     // Make sure that the handler has a unique ID, used to find/remove it
44317                     // later
44318                     if (!handler.guid) {
44319                         handler.guid = jQuery.guid++;
44320                     }
44321
44322                     // Init the element's event structure and main handler, if this is the
44323                     // first
44324                     if (!(events = elemData.events)) {
44325                         events = elemData.events = {};
44326                     }
44327                     if (!(eventHandle = elemData.handle)) {
44328                         eventHandle = elemData.handle = function(e) {
44329                             // Discard the second event of a jQuery.event.trigger() and
44330                             // when an event is called after a page has unloaded
44331                             return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
44332                                 jQuery.event.dispatch.apply(elem, arguments) : undefined;
44333                         };
44334                     }
44335
44336                     // Handle multiple events separated by a space
44337                     types = (types || "").match(rnotwhite) || [""];
44338                     t = types.length;
44339                     while (t--) {
44340                         tmp = rtypenamespace.exec(types[t]) || [];
44341                         type = origType = tmp[1];
44342                         namespaces = (tmp[2] || "").split(".").sort();
44343
44344                         // There *must* be a type, no attaching namespace-only handlers
44345                         if (!type) {
44346                             continue;
44347                         }
44348
44349                         // If event changes its type, use the special event handlers for the
44350                         // changed type
44351                         special = jQuery.event.special[type] || {};
44352
44353                         // If selector defined, determine special event api type, otherwise
44354                         // given type
44355                         type = (selector ? special.delegateType : special.bindType) || type;
44356
44357                         // Update special based on newly reset type
44358                         special = jQuery.event.special[type] || {};
44359
44360                         // handleObj is passed to all event handlers
44361                         handleObj = jQuery.extend({
44362                             type: type,
44363                             origType: origType,
44364                             data: data,
44365                             handler: handler,
44366                             guid: handler.guid,
44367                             selector: selector,
44368                             needsContext: selector && jQuery.expr.match.needsContext.test(selector),
44369                             namespace: namespaces.join(".")
44370                         }, handleObjIn);
44371
44372                         // Init the event handler queue if we're the first
44373                         if (!(handlers = events[type])) {
44374                             handlers = events[type] = [];
44375                             handlers.delegateCount = 0;
44376
44377                             // Only use addEventListener if the special events handler
44378                             // returns false
44379                             if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
44380                                 if (elem.addEventListener) {
44381                                     elem.addEventListener(type, eventHandle, false);
44382                                 }
44383                             }
44384                         }
44385
44386                         if (special.add) {
44387                             special.add.call(elem, handleObj);
44388
44389                             if (!handleObj.handler.guid) {
44390                                 handleObj.handler.guid = handler.guid;
44391                             }
44392                         }
44393
44394                         // Add to the element's handler list, delegates in front
44395                         if (selector) {
44396                             handlers.splice(handlers.delegateCount++, 0, handleObj);
44397                         } else {
44398                             handlers.push(handleObj);
44399                         }
44400
44401                         // Keep track of which events have ever been used, for event
44402                         // optimization
44403                         jQuery.event.global[type] = true;
44404                     }
44405
44406                 },
44407
44408                 // Detach an event or set of events from an element
44409                 remove: function(elem, types, handler, selector, mappedTypes) {
44410
44411                     var j, origCount, tmp,
44412                         events, t, handleObj,
44413                         special, handlers, type, namespaces, origType,
44414                         elemData = data_priv.hasData(elem) && data_priv.get(elem);
44415
44416                     if (!elemData || !(events = elemData.events)) {
44417                         return;
44418                     }
44419
44420                     // Once for each type.namespace in types; type may be omitted
44421                     types = (types || "").match(rnotwhite) || [""];
44422                     t = types.length;
44423                     while (t--) {
44424                         tmp = rtypenamespace.exec(types[t]) || [];
44425                         type = origType = tmp[1];
44426                         namespaces = (tmp[2] || "").split(".").sort();
44427
44428                         // Unbind all events (on this namespace, if provided) for the
44429                         // element
44430                         if (!type) {
44431                             for (type in events) {
44432                                 jQuery.event.remove(elem, type + types[t], handler, selector, true);
44433                             }
44434                             continue;
44435                         }
44436
44437                         special = jQuery.event.special[type] || {};
44438                         type = (selector ? special.delegateType : special.bindType) || type;
44439                         handlers = events[type] || [];
44440                         tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
44441
44442                         // Remove matching events
44443                         origCount = j = handlers.length;
44444                         while (j--) {
44445                             handleObj = handlers[j];
44446
44447                             if ((mappedTypes || origType === handleObj.origType) &&
44448                                 (!handler || handler.guid === handleObj.guid) &&
44449                                 (!tmp || tmp.test(handleObj.namespace)) &&
44450                                 (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
44451                                 handlers.splice(j, 1);
44452
44453                                 if (handleObj.selector) {
44454                                     handlers.delegateCount--;
44455                                 }
44456                                 if (special.remove) {
44457                                     special.remove.call(elem, handleObj);
44458                                 }
44459                             }
44460                         }
44461
44462                         // Remove generic event handler if we removed something and no more
44463                         // handlers exist
44464                         // (avoids potential for endless recursion during removal of special
44465                         // event handlers)
44466                         if (origCount && !handlers.length) {
44467                             if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
44468                                 jQuery.removeEvent(elem, type, elemData.handle);
44469                             }
44470
44471                             delete events[type];
44472                         }
44473                     }
44474
44475                     // Remove the expando if it's no longer used
44476                     if (jQuery.isEmptyObject(events)) {
44477                         delete elemData.handle;
44478                         data_priv.remove(elem, "events");
44479                     }
44480                 },
44481
44482                 trigger: function(event, data, elem, onlyHandlers) {
44483
44484                     var i, cur, tmp, bubbleType, ontype, handle, special,
44485                         eventPath = [elem || document],
44486                         type = hasOwn.call(event, "type") ? event.type : event,
44487                         namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
44488
44489                     cur = tmp = elem = elem || document;
44490
44491                     // Don't do events on text and comment nodes
44492                     if (elem.nodeType === 3 || elem.nodeType === 8) {
44493                         return;
44494                     }
44495
44496                     // focus/blur morphs to focusin/out; ensure we're not firing them right
44497                     // now
44498                     if (rfocusMorph.test(type + jQuery.event.triggered)) {
44499                         return;
44500                     }
44501
44502                     if (type.indexOf(".") >= 0) {
44503                         // Namespaced trigger; create a regexp to match event type in
44504                         // handle()
44505                         namespaces = type.split(".");
44506                         type = namespaces.shift();
44507                         namespaces.sort();
44508                     }
44509                     ontype = type.indexOf(":") < 0 && "on" + type;
44510
44511                     // Caller can pass in a jQuery.Event object, Object, or just an event
44512                     // type string
44513                     event = event[jQuery.expando] ?
44514                         event :
44515                         new jQuery.Event(type, typeof event === "object" && event);
44516
44517                     // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always
44518                     // true)
44519                     event.isTrigger = onlyHandlers ? 2 : 3;
44520                     event.namespace = namespaces.join(".");
44521                     event.namespace_re = event.namespace ?
44522                         new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") :
44523                         null;
44524
44525                     // Clean up the event in case it is being reused
44526                     event.result = undefined;
44527                     if (!event.target) {
44528                         event.target = elem;
44529                     }
44530
44531                     // Clone any incoming data and prepend the event, creating the handler
44532                     // arg list
44533                     data = data == null ? [event] :
44534                         jQuery.makeArray(data, [event]);
44535
44536                     // Allow special events to draw outside the lines
44537                     special = jQuery.event.special[type] || {};
44538                     if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
44539                         return;
44540                     }
44541
44542                     // Determine event propagation path in advance, per W3C events spec
44543                     // (#9951)
44544                     // Bubble up to document, then to window; watch for a global
44545                     // ownerDocument var (#9724)
44546                     if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {
44547
44548                         bubbleType = special.delegateType || type;
44549                         if (!rfocusMorph.test(bubbleType + type)) {
44550                             cur = cur.parentNode;
44551                         }
44552                         for (; cur; cur = cur.parentNode) {
44553                             eventPath.push(cur);
44554                             tmp = cur;
44555                         }
44556
44557                         // Only add window if we got to document (e.g., not plain obj or
44558                         // detached DOM)
44559                         if (tmp === (elem.ownerDocument || document)) {
44560                             eventPath.push(tmp.defaultView || tmp.parentWindow || window);
44561                         }
44562                     }
44563
44564                     // Fire handlers on the event path
44565                     i = 0;
44566                     while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
44567
44568                         event.type = i > 1 ?
44569                             bubbleType :
44570                             special.bindType || type;
44571
44572                         // jQuery handler
44573                         handle = (data_priv.get(cur, "events") || {})[event.type] && data_priv.get(cur, "handle");
44574                         if (handle) {
44575                             handle.apply(cur, data);
44576                         }
44577
44578                         // Native handler
44579                         handle = ontype && cur[ontype];
44580                         if (handle && handle.apply && jQuery.acceptData(cur)) {
44581                             event.result = handle.apply(cur, data);
44582                             if (event.result === false) {
44583                                 event.preventDefault();
44584                             }
44585                         }
44586                     }
44587                     event.type = type;
44588
44589                     // If nobody prevented the default action, do it now
44590                     if (!onlyHandlers && !event.isDefaultPrevented()) {
44591
44592                         if ((!special._default || special._default.apply(eventPath.pop(), data) === false) &&
44593                             jQuery.acceptData(elem)) {
44594
44595                             // Call a native DOM method on the target with the same name
44596                             // name as the event.
44597                             // Don't do default actions on window, that's where global
44598                             // variables be (#6170)
44599                             if (ontype && jQuery.isFunction(elem[type]) && !jQuery.isWindow(elem)) {
44600
44601                                 // Don't re-trigger an onFOO event when we call its FOO()
44602                                 // method
44603                                 tmp = elem[ontype];
44604
44605                                 if (tmp) {
44606                                     elem[ontype] = null;
44607                                 }
44608
44609                                 // Prevent re-triggering of the same event, since we already
44610                                 // bubbled it above
44611                                 jQuery.event.triggered = type;
44612                                 elem[type]();
44613                                 jQuery.event.triggered = undefined;
44614
44615                                 if (tmp) {
44616                                     elem[ontype] = tmp;
44617                                 }
44618                             }
44619                         }
44620                     }
44621
44622                     return event.result;
44623                 },
44624
44625                 dispatch: function(event) {
44626
44627                     // Make a writable jQuery.Event from the native event object
44628                     event = jQuery.event.fix(event);
44629
44630                     var i, j, ret, matched, handleObj,
44631                         handlerQueue = [],
44632                         args = slice.call(arguments),
44633                         handlers = (data_priv.get(this, "events") || {})[event.type] || [],
44634                         special = jQuery.event.special[event.type] || {};
44635
44636                     // Use the fix-ed jQuery.Event rather than the (read-only) native event
44637                     args[0] = event;
44638                     event.delegateTarget = this;
44639
44640                     // Call the preDispatch hook for the mapped type, and let it bail if
44641                     // desired
44642                     if (special.preDispatch && special.preDispatch.call(this, event) === false) {
44643                         return;
44644                     }
44645
44646                     // Determine handlers
44647                     handlerQueue = jQuery.event.handlers.call(this, event, handlers);
44648
44649                     // Run delegates first; they may want to stop propagation beneath us
44650                     i = 0;
44651                     while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
44652                         event.currentTarget = matched.elem;
44653
44654                         j = 0;
44655                         while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
44656
44657                             // Triggered event must either 1) have no namespace, or 2) have
44658                             // namespace(s)
44659                             // a subset or equal to those in the bound event (both can have
44660                             // no namespace).
44661                             if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {
44662
44663                                 event.handleObj = handleObj;
44664                                 event.data = handleObj.data;
44665
44666                                 ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler)
44667                                     .apply(matched.elem, args);
44668
44669                                 if (ret !== undefined) {
44670                                     if ((event.result = ret) === false) {
44671                                         event.preventDefault();
44672                                         event.stopPropagation();
44673                                     }
44674                                 }
44675                             }
44676                         }
44677                     }
44678
44679                     // Call the postDispatch hook for the mapped type
44680                     if (special.postDispatch) {
44681                         special.postDispatch.call(this, event);
44682                     }
44683
44684                     return event.result;
44685                 },
44686
44687                 handlers: function(event, handlers) {
44688                     var i, matches, sel, handleObj,
44689                         handlerQueue = [],
44690                         delegateCount = handlers.delegateCount,
44691                         cur = event.target;
44692
44693                     // Find delegate handlers
44694                     // Black-hole SVG <use> instance trees (#13180)
44695                     // Avoid non-left-click bubbling in Firefox (#3861)
44696                     if (delegateCount && cur.nodeType && (!event.button || event.type !== "click")) {
44697
44698                         for (; cur !== this; cur = cur.parentNode || this) {
44699
44700                             // Don't process clicks on disabled elements (#6911, #8165,
44701                             // #11382, #11764)
44702                             if (cur.disabled !== true || event.type !== "click") {
44703                                 matches = [];
44704                                 for (i = 0; i < delegateCount; i++) {
44705                                     handleObj = handlers[i];
44706
44707                                     // Don't conflict with Object.prototype properties
44708                                     // (#13203)
44709                                     sel = handleObj.selector + " ";
44710
44711                                     if (matches[sel] === undefined) {
44712                                         matches[sel] = handleObj.needsContext ?
44713                                             jQuery(sel, this).index(cur) >= 0 :
44714                                             jQuery.find(sel, this, null, [cur]).length;
44715                                     }
44716                                     if (matches[sel]) {
44717                                         matches.push(handleObj);
44718                                     }
44719                                 }
44720                                 if (matches.length) {
44721                                     handlerQueue.push({
44722                                         elem: cur,
44723                                         handlers: matches
44724                                     });
44725                                 }
44726                             }
44727                         }
44728                     }
44729
44730                     // Add the remaining (directly-bound) handlers
44731                     if (delegateCount < handlers.length) {
44732                         handlerQueue.push({
44733                             elem: this,
44734                             handlers: handlers.slice(delegateCount)
44735                         });
44736                     }
44737
44738                     return handlerQueue;
44739                 },
44740
44741                 // Includes some event props shared by KeyEvent and MouseEvent
44742                 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
44743
44744                 fixHooks: {},
44745
44746                 keyHooks: {
44747                     props: "char charCode key keyCode".split(" "),
44748                     filter: function(event, original) {
44749
44750                         // Add which for key events
44751                         if (event.which == null) {
44752                             event.which = original.charCode != null ? original.charCode : original.keyCode;
44753                         }
44754
44755                         return event;
44756                     }
44757                 },
44758
44759                 mouseHooks: {
44760                     props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
44761                     filter: function(event, original) {
44762                         var eventDoc, doc, body,
44763                             button = original.button;
44764
44765                         // Calculate pageX/Y if missing and clientX/Y available
44766                         if (event.pageX == null && original.clientX != null) {
44767                             eventDoc = event.target.ownerDocument || document;
44768                             doc = eventDoc.documentElement;
44769                             body = eventDoc.body;
44770
44771                             event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
44772                             event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
44773                         }
44774
44775                         // Add which for click: 1 === left; 2 === middle; 3 === right
44776                         // Note: button is not normalized, so don't use it
44777                         if (!event.which && button !== undefined) {
44778                             event.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));
44779                         }
44780
44781                         return event;
44782                     }
44783                 },
44784
44785                 fix: function(event) {
44786                     if (event[jQuery.expando]) {
44787                         return event;
44788                     }
44789
44790                     // Create a writable copy of the event object and normalize some
44791                     // properties
44792                     var i, prop, copy,
44793                         type = event.type,
44794                         originalEvent = event,
44795                         fixHook = this.fixHooks[type];
44796
44797                     if (!fixHook) {
44798                         this.fixHooks[type] = fixHook =
44799                             rmouseEvent.test(type) ? this.mouseHooks :
44800                             rkeyEvent.test(type) ? this.keyHooks : {};
44801                     }
44802                     copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
44803
44804                     event = new jQuery.Event(originalEvent);
44805
44806                     i = copy.length;
44807                     while (i--) {
44808                         prop = copy[i];
44809                         event[prop] = originalEvent[prop];
44810                     }
44811
44812                     // Support: Cordova 2.5 (WebKit) (#13255)
44813                     // All events should have a target; Cordova deviceready doesn't
44814                     if (!event.target) {
44815                         event.target = document;
44816                     }
44817
44818                     // Support: Safari 6.0+, Chrome<28
44819                     // Target should not be a text node (#504, #13143)
44820                     if (event.target.nodeType === 3) {
44821                         event.target = event.target.parentNode;
44822                     }
44823
44824                     return fixHook.filter ? fixHook.filter(event, originalEvent) : event;
44825                 },
44826
44827                 special: {
44828                     load: {
44829                         // Prevent triggered image.load events from bubbling to window.load
44830                         noBubble: true
44831                     },
44832                     focus: {
44833                         // Fire native event if possible so blur/focus sequence is correct
44834                         trigger: function() {
44835                             if (this !== safeActiveElement() && this.focus) {
44836                                 this.focus();
44837                                 return false;
44838                             }
44839                         },
44840                         delegateType: "focusin"
44841                     },
44842                     blur: {
44843                         trigger: function() {
44844                             if (this === safeActiveElement() && this.blur) {
44845                                 this.blur();
44846                                 return false;
44847                             }
44848                         },
44849                         delegateType: "focusout"
44850                     },
44851                     click: {
44852                         // For checkbox, fire native event so checked state will be right
44853                         trigger: function() {
44854                             if (this.type === "checkbox" && this.click && jQuery.nodeName(this, "input")) {
44855                                 this.click();
44856                                 return false;
44857                             }
44858                         },
44859
44860                         // For cross-browser consistency, don't fire native .click() on
44861                         // links
44862                         _default: function(event) {
44863                             return jQuery.nodeName(event.target, "a");
44864                         }
44865                     },
44866
44867                     beforeunload: {
44868                         postDispatch: function(event) {
44869
44870                             // Support: Firefox 20+
44871                             // Firefox doesn't alert if the returnValue field is not set.
44872                             if (event.result !== undefined && event.originalEvent) {
44873                                 event.originalEvent.returnValue = event.result;
44874                             }
44875                         }
44876                     }
44877                 },
44878
44879                 simulate: function(type, elem, event, bubble) {
44880                     // Piggyback on a donor event to simulate a different one.
44881                     // Fake originalEvent to avoid donor's stopPropagation, but if the
44882                     // simulated event prevents default then we do the same on the donor.
44883                     var e = jQuery.extend(
44884                         new jQuery.Event(),
44885                         event, {
44886                             type: type,
44887                             isSimulated: true,
44888                             originalEvent: {}
44889                         }
44890                     );
44891                     if (bubble) {
44892                         jQuery.event.trigger(e, null, elem);
44893                     } else {
44894                         jQuery.event.dispatch.call(elem, e);
44895                     }
44896                     if (e.isDefaultPrevented()) {
44897                         event.preventDefault();
44898                     }
44899                 }
44900             };
44901
44902             jQuery.removeEvent = function(elem, type, handle) {
44903                 if (elem.removeEventListener) {
44904                     elem.removeEventListener(type, handle, false);
44905                 }
44906             };
44907
44908             jQuery.Event = function(src, props) {
44909                 // Allow instantiation without the 'new' keyword
44910                 if (!(this instanceof jQuery.Event)) {
44911                     return new jQuery.Event(src, props);
44912                 }
44913
44914                 // Event object
44915                 if (src && src.type) {
44916                     this.originalEvent = src;
44917                     this.type = src.type;
44918
44919                     // Events bubbling up the document may have been marked as prevented
44920                     // by a handler lower down the tree; reflect the correct value.
44921                     this.isDefaultPrevented = src.defaultPrevented ||
44922                         src.defaultPrevented === undefined &&
44923                         // Support: Android<4.0
44924                         src.returnValue === false ?
44925                         returnTrue :
44926                         returnFalse;
44927
44928                     // Event type
44929                 } else {
44930                     this.type = src;
44931                 }
44932
44933                 // Put explicitly provided properties onto the event object
44934                 if (props) {
44935                     jQuery.extend(this, props);
44936                 }
44937
44938                 // Create a timestamp if incoming event doesn't have one
44939                 this.timeStamp = src && src.timeStamp || jQuery.now();
44940
44941                 // Mark it as fixed
44942                 this[jQuery.expando] = true;
44943             };
44944
44945             // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language
44946             // Binding
44947             // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
44948             jQuery.Event.prototype = {
44949                 isDefaultPrevented: returnFalse,
44950                 isPropagationStopped: returnFalse,
44951                 isImmediatePropagationStopped: returnFalse,
44952
44953                 preventDefault: function() {
44954                     var e = this.originalEvent;
44955
44956                     this.isDefaultPrevented = returnTrue;
44957
44958                     if (e && e.preventDefault) {
44959                         e.preventDefault();
44960                     }
44961                 },
44962                 stopPropagation: function() {
44963                     var e = this.originalEvent;
44964
44965                     this.isPropagationStopped = returnTrue;
44966
44967                     if (e && e.stopPropagation) {
44968                         e.stopPropagation();
44969                     }
44970                 },
44971                 stopImmediatePropagation: function() {
44972                     var e = this.originalEvent;
44973
44974                     this.isImmediatePropagationStopped = returnTrue;
44975
44976                     if (e && e.stopImmediatePropagation) {
44977                         e.stopImmediatePropagation();
44978                     }
44979
44980                     this.stopPropagation();
44981                 }
44982             };
44983
44984             // Create mouseenter/leave events using mouseover/out and event-time checks
44985             // Support: Chrome 15+
44986             jQuery.each({
44987                 mouseenter: "mouseover",
44988                 mouseleave: "mouseout",
44989                 pointerenter: "pointerover",
44990                 pointerleave: "pointerout"
44991             }, function(orig, fix) {
44992                 jQuery.event.special[orig] = {
44993                     delegateType: fix,
44994                     bindType: fix,
44995
44996                     handle: function(event) {
44997                         var ret,
44998                             target = this,
44999                             related = event.relatedTarget,
45000                             handleObj = event.handleObj;
45001
45002                         // For mousenter/leave call the handler if related is outside the
45003                         // target.
45004                         // NB: No relatedTarget if the mouse left/entered the browser window
45005                         if (!related || (related !== target && !jQuery.contains(target, related))) {
45006                             event.type = handleObj.origType;
45007                             ret = handleObj.handler.apply(this, arguments);
45008                             event.type = fix;
45009                         }
45010                         return ret;
45011                     }
45012                 };
45013             });
45014
45015             // Support: Firefox, Chrome, Safari
45016             // Create "bubbling" focus and blur events
45017             if (!support.focusinBubbles) {
45018                 jQuery.each({
45019                     focus: "focusin",
45020                     blur: "focusout"
45021                 }, function(orig, fix) {
45022
45023                     // Attach a single capturing handler on the document while someone wants
45024                     // focusin/focusout
45025                     var handler = function(event) {
45026                         jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true);
45027                     };
45028
45029                     jQuery.event.special[fix] = {
45030                         setup: function() {
45031                             var doc = this.ownerDocument || this,
45032                                 attaches = data_priv.access(doc, fix);
45033
45034                             if (!attaches) {
45035                                 doc.addEventListener(orig, handler, true);
45036                             }
45037                             data_priv.access(doc, fix, (attaches || 0) + 1);
45038                         },
45039                         teardown: function() {
45040                             var doc = this.ownerDocument || this,
45041                                 attaches = data_priv.access(doc, fix) - 1;
45042
45043                             if (!attaches) {
45044                                 doc.removeEventListener(orig, handler, true);
45045                                 data_priv.remove(doc, fix);
45046
45047                             } else {
45048                                 data_priv.access(doc, fix, attaches);
45049                             }
45050                         }
45051                     };
45052                 });
45053             }
45054
45055             jQuery.fn.extend({
45056
45057                 on: function(types, selector, data, fn, /* INTERNAL */ one) {
45058                     var origFn, type;
45059
45060                     // Types can be a map of types/handlers
45061                     if (typeof types === "object") {
45062                         // ( types-Object, selector, data )
45063                         if (typeof selector !== "string") {
45064                             // ( types-Object, data )
45065                             data = data || selector;
45066                             selector = undefined;
45067                         }
45068                         for (type in types) {
45069                             this.on(type, selector, data, types[type], one);
45070                         }
45071                         return this;
45072                     }
45073
45074                     if (data == null && fn == null) {
45075                         // ( types, fn )
45076                         fn = selector;
45077                         data = selector = undefined;
45078                     } else if (fn == null) {
45079                         if (typeof selector === "string") {
45080                             // ( types, selector, fn )
45081                             fn = data;
45082                             data = undefined;
45083                         } else {
45084                             // ( types, data, fn )
45085                             fn = data;
45086                             data = selector;
45087                             selector = undefined;
45088                         }
45089                     }
45090                     if (fn === false) {
45091                         fn = returnFalse;
45092                     } else if (!fn) {
45093                         return this;
45094                     }
45095
45096                     if (one === 1) {
45097                         origFn = fn;
45098                         fn = function(event) {
45099                             // Can use an empty set, since event contains the info
45100                             jQuery().off(event);
45101                             return origFn.apply(this, arguments);
45102                         };
45103                         // Use same guid so caller can remove using origFn
45104                         fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
45105                     }
45106                     return this.each(function() {
45107                         jQuery.event.add(this, types, fn, data, selector);
45108                     });
45109                 },
45110                 one: function(types, selector, data, fn) {
45111                     return this.on(types, selector, data, fn, 1);
45112                 },
45113                 off: function(types, selector, fn) {
45114                     var handleObj, type;
45115                     if (types && types.preventDefault && types.handleObj) {
45116                         // ( event ) dispatched jQuery.Event
45117                         handleObj = types.handleObj;
45118                         jQuery(types.delegateTarget).off(
45119                             handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
45120                             handleObj.selector,
45121                             handleObj.handler
45122                         );
45123                         return this;
45124                     }
45125                     if (typeof types === "object") {
45126                         // ( types-object [, selector] )
45127                         for (type in types) {
45128                             this.off(type, selector, types[type]);
45129                         }
45130                         return this;
45131                     }
45132                     if (selector === false || typeof selector === "function") {
45133                         // ( types [, fn] )
45134                         fn = selector;
45135                         selector = undefined;
45136                     }
45137                     if (fn === false) {
45138                         fn = returnFalse;
45139                     }
45140                     return this.each(function() {
45141                         jQuery.event.remove(this, types, fn, selector);
45142                     });
45143                 },
45144
45145                 trigger: function(type, data) {
45146                     return this.each(function() {
45147                         jQuery.event.trigger(type, data, this);
45148                     });
45149                 },
45150                 triggerHandler: function(type, data) {
45151                     var elem = this[0];
45152                     if (elem) {
45153                         return jQuery.event.trigger(type, data, elem, true);
45154                     }
45155                 }
45156             });
45157
45158
45159             var
45160                 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
45161                 rtagName = /<([\w:]+)/,
45162                 rhtml = /<|&#?\w+;/,
45163                 rnoInnerhtml = /<(?:script|style|link)/i,
45164                 // checked="checked" or checked
45165                 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
45166                 rscriptType = /^$|\/(?:java|ecma)script/i,
45167                 rscriptTypeMasked = /^true\/(.*)/,
45168                 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
45169
45170                 // We have to close these tags to support XHTML (#13200)
45171                 wrapMap = {
45172
45173                     // Support: IE9
45174                     option: [1, "<select multiple='multiple'>", "</select>"],
45175
45176                     thead: [1, "<table>", "</table>"],
45177                     col: [2, "<table><colgroup>", "</colgroup></table>"],
45178                     tr: [2, "<table><tbody>", "</tbody></table>"],
45179                     td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
45180
45181                     _default: [0, "", ""]
45182                 };
45183
45184             // Support: IE9
45185             wrapMap.optgroup = wrapMap.option;
45186
45187             wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
45188             wrapMap.th = wrapMap.td;
45189
45190             // Support: 1.x compatibility
45191             // Manipulating tables requires a tbody
45192             function manipulationTarget(elem, content) {
45193                 return jQuery.nodeName(elem, "table") &&
45194                     jQuery.nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr") ?
45195
45196                     elem.getElementsByTagName("tbody")[0] ||
45197                     elem.appendChild(elem.ownerDocument.createElement("tbody")) :
45198                     elem;
45199             }
45200
45201             // Replace/restore the type attribute of script elements for safe DOM
45202             // manipulation
45203             function disableScript(elem) {
45204                 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
45205                 return elem;
45206             }
45207
45208             function restoreScript(elem) {
45209                 var match = rscriptTypeMasked.exec(elem.type);
45210
45211                 if (match) {
45212                     elem.type = match[1];
45213                 } else {
45214                     elem.removeAttribute("type");
45215                 }
45216
45217                 return elem;
45218             }
45219
45220             // Mark scripts as having already been evaluated
45221             function setGlobalEval(elems, refElements) {
45222                 var i = 0,
45223                     l = elems.length;
45224
45225                 for (; i < l; i++) {
45226                     data_priv.set(
45227                         elems[i], "globalEval", !refElements || data_priv.get(refElements[i], "globalEval")
45228                     );
45229                 }
45230             }
45231
45232             function cloneCopyEvent(src, dest) {
45233                 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
45234
45235                 if (dest.nodeType !== 1) {
45236                     return;
45237                 }
45238
45239                 // 1. Copy private data: events, handlers, etc.
45240                 if (data_priv.hasData(src)) {
45241                     pdataOld = data_priv.access(src);
45242                     pdataCur = data_priv.set(dest, pdataOld);
45243                     events = pdataOld.events;
45244
45245                     if (events) {
45246                         delete pdataCur.handle;
45247                         pdataCur.events = {};
45248
45249                         for (type in events) {
45250                             for (i = 0, l = events[type].length; i < l; i++) {
45251                                 jQuery.event.add(dest, type, events[type][i]);
45252                             }
45253                         }
45254                     }
45255                 }
45256
45257                 // 2. Copy user data
45258                 if (data_user.hasData(src)) {
45259                     udataOld = data_user.access(src);
45260                     udataCur = jQuery.extend({}, udataOld);
45261
45262                     data_user.set(dest, udataCur);
45263                 }
45264             }
45265
45266             function getAll(context, tag) {
45267                 var ret = context.getElementsByTagName ? context.getElementsByTagName(tag || "*") :
45268                     context.querySelectorAll ? context.querySelectorAll(tag || "*") : [];
45269
45270                 return tag === undefined || tag && jQuery.nodeName(context, tag) ?
45271                     jQuery.merge([context], ret) :
45272                     ret;
45273             }
45274
45275             // Fix IE bugs, see support tests
45276             function fixInput(src, dest) {
45277                 var nodeName = dest.nodeName.toLowerCase();
45278
45279                 // Fails to persist the checked state of a cloned checkbox or radio button.
45280                 if (nodeName === "input" && rcheckableType.test(src.type)) {
45281                     dest.checked = src.checked;
45282
45283                     // Fails to return the selected option to the default selected state when
45284                     // cloning options
45285                 } else if (nodeName === "input" || nodeName === "textarea") {
45286                     dest.defaultValue = src.defaultValue;
45287                 }
45288             }
45289
45290             jQuery.extend({
45291                 clone: function(elem, dataAndEvents, deepDataAndEvents) {
45292                     var i, l, srcElements, destElements,
45293                         clone = elem.cloneNode(true),
45294                         inPage = jQuery.contains(elem.ownerDocument, elem);
45295
45296                     // Fix IE cloning issues
45297                     if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) &&
45298                         !jQuery.isXMLDoc(elem)) {
45299
45300                         // We eschew Sizzle here for performance reasons:
45301                         // http://jsperf.com/getall-vs-sizzle/2
45302                         destElements = getAll(clone);
45303                         srcElements = getAll(elem);
45304
45305                         for (i = 0, l = srcElements.length; i < l; i++) {
45306                             fixInput(srcElements[i], destElements[i]);
45307                         }
45308                     }
45309
45310                     // Copy the events from the original to the clone
45311                     if (dataAndEvents) {
45312                         if (deepDataAndEvents) {
45313                             srcElements = srcElements || getAll(elem);
45314                             destElements = destElements || getAll(clone);
45315
45316                             for (i = 0, l = srcElements.length; i < l; i++) {
45317                                 cloneCopyEvent(srcElements[i], destElements[i]);
45318                             }
45319                         } else {
45320                             cloneCopyEvent(elem, clone);
45321                         }
45322                     }
45323
45324                     // Preserve script evaluation history
45325                     destElements = getAll(clone, "script");
45326                     if (destElements.length > 0) {
45327                         setGlobalEval(destElements, !inPage && getAll(elem, "script"));
45328                     }
45329
45330                     // Return the cloned set
45331                     return clone;
45332                 },
45333
45334                 buildFragment: function(elems, context, scripts, selection) {
45335                     var elem, tmp, tag, wrap, contains, j,
45336                         fragment = context.createDocumentFragment(),
45337                         nodes = [],
45338                         i = 0,
45339                         l = elems.length;
45340
45341                     for (; i < l; i++) {
45342                         elem = elems[i];
45343
45344                         if (elem || elem === 0) {
45345
45346                             // Add nodes directly
45347                             if (jQuery.type(elem) === "object") {
45348                                 // Support: QtWebKit, PhantomJS
45349                                 // push.apply(_, arraylike) throws on ancient WebKit
45350                                 jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
45351
45352                                 // Convert non-html into a text node
45353                             } else if (!rhtml.test(elem)) {
45354                                 nodes.push(context.createTextNode(elem));
45355
45356                                 // Convert html into DOM nodes
45357                             } else {
45358                                 tmp = tmp || fragment.appendChild(context.createElement("div"));
45359
45360                                 // Deserialize a standard representation
45361                                 tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
45362                                 wrap = wrapMap[tag] || wrapMap._default;
45363                                 tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2];
45364
45365                                 // Descend through wrappers to the right content
45366                                 j = wrap[0];
45367                                 while (j--) {
45368                                     tmp = tmp.lastChild;
45369                                 }
45370
45371                                 // Support: QtWebKit, PhantomJS
45372                                 // push.apply(_, arraylike) throws on ancient WebKit
45373                                 jQuery.merge(nodes, tmp.childNodes);
45374
45375                                 // Remember the top-level container
45376                                 tmp = fragment.firstChild;
45377
45378                                 // Ensure the created nodes are orphaned (#12392)
45379                                 tmp.textContent = "";
45380                             }
45381                         }
45382                     }
45383
45384                     // Remove wrapper from fragment
45385                     fragment.textContent = "";
45386
45387                     i = 0;
45388                     while ((elem = nodes[i++])) {
45389
45390                         // #4087 - If origin and destination elements are the same, and this
45391                         // is
45392                         // that element, do not do anything
45393                         if (selection && jQuery.inArray(elem, selection) !== -1) {
45394                             continue;
45395                         }
45396
45397                         contains = jQuery.contains(elem.ownerDocument, elem);
45398
45399                         // Append to fragment
45400                         tmp = getAll(fragment.appendChild(elem), "script");
45401
45402                         // Preserve script evaluation history
45403                         if (contains) {
45404                             setGlobalEval(tmp);
45405                         }
45406
45407                         // Capture executables
45408                         if (scripts) {
45409                             j = 0;
45410                             while ((elem = tmp[j++])) {
45411                                 if (rscriptType.test(elem.type || "")) {
45412                                     scripts.push(elem);
45413                                 }
45414                             }
45415                         }
45416                     }
45417
45418                     return fragment;
45419                 },
45420
45421                 cleanData: function(elems) {
45422                     var data, elem, type, key,
45423                         special = jQuery.event.special,
45424                         i = 0;
45425
45426                     for (;
45427                         (elem = elems[i]) !== undefined; i++) {
45428                         if (jQuery.acceptData(elem)) {
45429                             key = elem[data_priv.expando];
45430
45431                             if (key && (data = data_priv.cache[key])) {
45432                                 if (data.events) {
45433                                     for (type in data.events) {
45434                                         if (special[type]) {
45435                                             jQuery.event.remove(elem, type);
45436
45437                                             // This is a shortcut to avoid jQuery.event.remove's
45438                                             // overhead
45439                                         } else {
45440                                             jQuery.removeEvent(elem, type, data.handle);
45441                                         }
45442                                     }
45443                                 }
45444                                 if (data_priv.cache[key]) {
45445                                     // Discard any remaining `private` data
45446                                     delete data_priv.cache[key];
45447                                 }
45448                             }
45449                         }
45450                         // Discard any remaining `user` data
45451                         delete data_user.cache[elem[data_user.expando]];
45452                     }
45453                 }
45454             });
45455
45456             jQuery.fn.extend({
45457                 text: function(value) {
45458                     return access(this, function(value) {
45459                         return value === undefined ?
45460                             jQuery.text(this) :
45461                             this.empty().each(function() {
45462                                 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45463                                     this.textContent = value;
45464                                 }
45465                             });
45466                     }, null, value, arguments.length);
45467                 },
45468
45469                 append: function() {
45470                     return this.domManip(arguments, function(elem) {
45471                         if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45472                             var target = manipulationTarget(this, elem);
45473                             target.appendChild(elem);
45474                         }
45475                     });
45476                 },
45477
45478                 prepend: function() {
45479                     return this.domManip(arguments, function(elem) {
45480                         if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45481                             var target = manipulationTarget(this, elem);
45482                             target.insertBefore(elem, target.firstChild);
45483                         }
45484                     });
45485                 },
45486
45487                 before: function() {
45488                     return this.domManip(arguments, function(elem) {
45489                         if (this.parentNode) {
45490                             this.parentNode.insertBefore(elem, this);
45491                         }
45492                     });
45493                 },
45494
45495                 after: function() {
45496                     return this.domManip(arguments, function(elem) {
45497                         if (this.parentNode) {
45498                             this.parentNode.insertBefore(elem, this.nextSibling);
45499                         }
45500                     });
45501                 },
45502
45503                 remove: function(selector, keepData /* Internal Use Only */ ) {
45504                     var elem,
45505                         elems = selector ? jQuery.filter(selector, this) : this,
45506                         i = 0;
45507
45508                     for (;
45509                         (elem = elems[i]) != null; i++) {
45510                         if (!keepData && elem.nodeType === 1) {
45511                             jQuery.cleanData(getAll(elem));
45512                         }
45513
45514                         if (elem.parentNode) {
45515                             if (keepData && jQuery.contains(elem.ownerDocument, elem)) {
45516                                 setGlobalEval(getAll(elem, "script"));
45517                             }
45518                             elem.parentNode.removeChild(elem);
45519                         }
45520                     }
45521
45522                     return this;
45523                 },
45524
45525                 empty: function() {
45526                     var elem,
45527                         i = 0;
45528
45529                     for (;
45530                         (elem = this[i]) != null; i++) {
45531                         if (elem.nodeType === 1) {
45532
45533                             // Prevent memory leaks
45534                             jQuery.cleanData(getAll(elem, false));
45535
45536                             // Remove any remaining nodes
45537                             elem.textContent = "";
45538                         }
45539                     }
45540
45541                     return this;
45542                 },
45543
45544                 clone: function(dataAndEvents, deepDataAndEvents) {
45545                     dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
45546                     deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
45547
45548                     return this.map(function() {
45549                         return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
45550                     });
45551                 },
45552
45553                 html: function(value) {
45554                     return access(this, function(value) {
45555                         var elem = this[0] || {},
45556                             i = 0,
45557                             l = this.length;
45558
45559                         if (value === undefined && elem.nodeType === 1) {
45560                             return elem.innerHTML;
45561                         }
45562
45563                         // See if we can take a shortcut and just use innerHTML
45564                         if (typeof value === "string" && !rnoInnerhtml.test(value) &&
45565                             !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
45566
45567                             value = value.replace(rxhtmlTag, "<$1></$2>");
45568
45569                             try {
45570                                 for (; i < l; i++) {
45571                                     elem = this[i] || {};
45572
45573                                     // Remove element nodes and prevent memory leaks
45574                                     if (elem.nodeType === 1) {
45575                                         jQuery.cleanData(getAll(elem, false));
45576                                         elem.innerHTML = value;
45577                                     }
45578                                 }
45579
45580                                 elem = 0;
45581
45582                                 // If using innerHTML throws an exception, use the fallback
45583                                 // method
45584                             } catch (e) {}
45585                         }
45586
45587                         if (elem) {
45588                             this.empty().append(value);
45589                         }
45590                     }, null, value, arguments.length);
45591                 },
45592
45593                 replaceWith: function() {
45594                     var arg = arguments[0];
45595
45596                     // Make the changes, replacing each context element with the new content
45597                     this.domManip(arguments, function(elem) {
45598                         arg = this.parentNode;
45599
45600                         jQuery.cleanData(getAll(this));
45601
45602                         if (arg) {
45603                             arg.replaceChild(elem, this);
45604                         }
45605                     });
45606
45607                     // Force removal if there was no new content (e.g., from empty
45608                     // arguments)
45609                     return arg && (arg.length || arg.nodeType) ? this : this.remove();
45610                 },
45611
45612                 detach: function(selector) {
45613                     return this.remove(selector, true);
45614                 },
45615
45616                 domManip: function(args, callback) {
45617
45618                     // Flatten any nested arrays
45619                     args = concat.apply([], args);
45620
45621                     var fragment, first, scripts, hasScripts, node, doc,
45622                         i = 0,
45623                         l = this.length,
45624                         set = this,
45625                         iNoClone = l - 1,
45626                         value = args[0],
45627                         isFunction = jQuery.isFunction(value);
45628
45629                     // We can't cloneNode fragments that contain checked, in WebKit
45630                     if (isFunction ||
45631                         (l > 1 && typeof value === "string" &&
45632                             !support.checkClone && rchecked.test(value))) {
45633                         return this.each(function(index) {
45634                             var self = set.eq(index);
45635                             if (isFunction) {
45636                                 args[0] = value.call(this, index, self.html());
45637                             }
45638                             self.domManip(args, callback);
45639                         });
45640                     }
45641
45642                     if (l) {
45643                         fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, this);
45644                         first = fragment.firstChild;
45645
45646                         if (fragment.childNodes.length === 1) {
45647                             fragment = first;
45648                         }
45649
45650                         if (first) {
45651                             scripts = jQuery.map(getAll(fragment, "script"), disableScript);
45652                             hasScripts = scripts.length;
45653
45654                             // Use the original fragment for the last item instead of the
45655                             // first because it can end up
45656                             // being emptied incorrectly in certain situations (#8070).
45657                             for (; i < l; i++) {
45658                                 node = fragment;
45659
45660                                 if (i !== iNoClone) {
45661                                     node = jQuery.clone(node, true, true);
45662
45663                                     // Keep references to cloned scripts for later
45664                                     // restoration
45665                                     if (hasScripts) {
45666                                         // Support: QtWebKit
45667                                         // jQuery.merge because push.apply(_, arraylike)
45668                                         // throws
45669                                         jQuery.merge(scripts, getAll(node, "script"));
45670                                     }
45671                                 }
45672
45673                                 callback.call(this[i], node, i);
45674                             }
45675
45676                             if (hasScripts) {
45677                                 doc = scripts[scripts.length - 1].ownerDocument;
45678
45679                                 // Reenable scripts
45680                                 jQuery.map(scripts, restoreScript);
45681
45682                                 // Evaluate executable scripts on first document insertion
45683                                 for (i = 0; i < hasScripts; i++) {
45684                                     node = scripts[i];
45685                                     if (rscriptType.test(node.type || "") &&
45686                                         !data_priv.access(node, "globalEval") && jQuery.contains(doc, node)) {
45687
45688                                         if (node.src) {
45689                                             // Optional AJAX dependency, but won't run
45690                                             // scripts if not present
45691                                             if (jQuery._evalUrl) {
45692                                                 jQuery._evalUrl(node.src);
45693                                             }
45694                                         } else {
45695                                             jQuery.globalEval(node.textContent.replace(rcleanScript, ""));
45696                                         }
45697                                     }
45698                                 }
45699                             }
45700                         }
45701                     }
45702
45703                     return this;
45704                 }
45705             });
45706
45707             jQuery.each({
45708                 appendTo: "append",
45709                 prependTo: "prepend",
45710                 insertBefore: "before",
45711                 insertAfter: "after",
45712                 replaceAll: "replaceWith"
45713             }, function(name, original) {
45714                 jQuery.fn[name] = function(selector) {
45715                     var elems,
45716                         ret = [],
45717                         insert = jQuery(selector),
45718                         last = insert.length - 1,
45719                         i = 0;
45720
45721                     for (; i <= last; i++) {
45722                         elems = i === last ? this : this.clone(true);
45723                         jQuery(insert[i])[original](elems);
45724
45725                         // Support: QtWebKit
45726                         // .get() because push.apply(_, arraylike) throws
45727                         push.apply(ret, elems.get());
45728                     }
45729
45730                     return this.pushStack(ret);
45731                 };
45732             });
45733
45734
45735             var iframe,
45736                 elemdisplay = {};
45737
45738             /**
45739              * Retrieve the actual display of a element
45740              * 
45741              * @param {String}
45742              *            name nodeName of the element
45743              * @param {Object}
45744              *            doc Document object
45745              */
45746             // Called only from within defaultDisplay
45747             function actualDisplay(name, doc) {
45748                 var style,
45749                     elem = jQuery(doc.createElement(name)).appendTo(doc.body),
45750
45751                     // getDefaultComputedStyle might be reliably used only on attached
45752                     // element
45753                     display = window.getDefaultComputedStyle && (style = window.getDefaultComputedStyle(elem[0])) ?
45754
45755                     // Use of this method is a temporary fix (more like optimization)
45756                     // until something better comes along,
45757                     // since it was removed from specification and supported only in FF
45758                     style.display : jQuery.css(elem[0], "display");
45759
45760                 // We don't have any data stored on the element,
45761                 // so use "detach" method as fast way to get rid of the element
45762                 elem.detach();
45763
45764                 return display;
45765             }
45766
45767             /**
45768              * Try to determine the default display value of an element
45769              * 
45770              * @param {String}
45771              *            nodeName
45772              */
45773             function defaultDisplay(nodeName) {
45774                 var doc = document,
45775                     display = elemdisplay[nodeName];
45776
45777                 if (!display) {
45778                     display = actualDisplay(nodeName, doc);
45779
45780                     // If the simple way fails, read from inside an iframe
45781                     if (display === "none" || !display) {
45782
45783                         // Use the already-created iframe if possible
45784                         iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement);
45785
45786                         // Always write a new HTML skeleton so Webkit and Firefox don't
45787                         // choke on reuse
45788                         doc = iframe[0].contentDocument;
45789
45790                         // Support: IE
45791                         doc.write();
45792                         doc.close();
45793
45794                         display = actualDisplay(nodeName, doc);
45795                         iframe.detach();
45796                     }
45797
45798                     // Store the correct default display
45799                     elemdisplay[nodeName] = display;
45800                 }
45801
45802                 return display;
45803             }
45804             var rmargin = (/^margin/);
45805
45806             var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
45807
45808             var getStyles = function(elem) {
45809                 // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
45810                 // IE throws on elements created in popups
45811                 // FF meanwhile throws on frame elements through
45812                 // "defaultView.getComputedStyle"
45813                 if (elem.ownerDocument.defaultView.opener) {
45814                     return elem.ownerDocument.defaultView.getComputedStyle(elem, null);
45815                 }
45816
45817                 return window.getComputedStyle(elem, null);
45818             };
45819
45820
45821
45822             function curCSS(elem, name, computed) {
45823                 var width, minWidth, maxWidth, ret,
45824                     style = elem.style;
45825
45826                 computed = computed || getStyles(elem);
45827
45828                 // Support: IE9
45829                 // getPropertyValue is only needed for .css('filter') (#12537)
45830                 if (computed) {
45831                     ret = computed.getPropertyValue(name) || computed[name];
45832                 }
45833
45834                 if (computed) {
45835
45836                     if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) {
45837                         ret = jQuery.style(elem, name);
45838                     }
45839
45840                     // Support: iOS < 6
45841                     // A tribute to the "awesome hack by Dean Edwards"
45842                     // iOS < 6 (at least) returns percentage for a larger set of values, but
45843                     // width seems to be reliably pixels
45844                     // this is against the CSSOM draft spec:
45845                     // http://dev.w3.org/csswg/cssom/#resolved-values
45846                     if (rnumnonpx.test(ret) && rmargin.test(name)) {
45847
45848                         // Remember the original values
45849                         width = style.width;
45850                         minWidth = style.minWidth;
45851                         maxWidth = style.maxWidth;
45852
45853                         // Put in the new values to get a computed value out
45854                         style.minWidth = style.maxWidth = style.width = ret;
45855                         ret = computed.width;
45856
45857                         // Revert the changed values
45858                         style.width = width;
45859                         style.minWidth = minWidth;
45860                         style.maxWidth = maxWidth;
45861                     }
45862                 }
45863
45864                 return ret !== undefined ?
45865                     // Support: IE
45866                     // IE returns zIndex value as an integer.
45867                     ret + "" :
45868                     ret;
45869             }
45870
45871
45872             function addGetHookIf(conditionFn, hookFn) {
45873                 // Define the hook, we'll check on the first run if it's really needed.
45874                 return {
45875                     get: function() {
45876                         if (conditionFn()) {
45877                             // Hook not needed (or it's not possible to use it due
45878                             // to missing dependency), remove it.
45879                             delete this.get;
45880                             return;
45881                         }
45882
45883                         // Hook needed; redefine it so that the support test is not executed
45884                         // again.
45885                         return (this.get = hookFn).apply(this, arguments);
45886                     }
45887                 };
45888             }
45889
45890
45891             (function() {
45892                 var pixelPositionVal, boxSizingReliableVal,
45893                     docElem = document.documentElement,
45894                     container = document.createElement("div"),
45895                     div = document.createElement("div");
45896
45897                 if (!div.style) {
45898                     return;
45899                 }
45900
45901                 // Support: IE9-11+
45902                 // Style of cloned element affects source element cloned (#8908)
45903                 div.style.backgroundClip = "content-box";
45904                 div.cloneNode(true).style.backgroundClip = "";
45905                 support.clearCloneStyle = div.style.backgroundClip === "content-box";
45906
45907                 container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
45908                     "position:absolute";
45909                 container.appendChild(div);
45910
45911                 // Executing both pixelPosition & boxSizingReliable tests require only one
45912                 // layout
45913                 // so they're executed at the same time to save the second computation.
45914                 function computePixelPositionAndBoxSizingReliable() {
45915                     div.style.cssText =
45916                         // Support: Firefox<29, Android 2.3
45917                         // Vendor-prefix box-sizing
45918                         "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
45919                         "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
45920                         "border:1px;padding:1px;width:4px;position:absolute";
45921                     div.innerHTML = "";
45922                     docElem.appendChild(container);
45923
45924                     var divStyle = window.getComputedStyle(div, null);
45925                     pixelPositionVal = divStyle.top !== "1%";
45926                     boxSizingReliableVal = divStyle.width === "4px";
45927
45928                     docElem.removeChild(container);
45929                 }
45930
45931                 // Support: node.js jsdom
45932                 // Don't assume that getComputedStyle is a property of the global object
45933                 if (window.getComputedStyle) {
45934                     jQuery.extend(support, {
45935                         pixelPosition: function() {
45936
45937                             // This test is executed only once but we still do memoizing
45938                             // since we can use the boxSizingReliable pre-computing.
45939                             // No need to check if the test was already performed, though.
45940                             computePixelPositionAndBoxSizingReliable();
45941                             return pixelPositionVal;
45942                         },
45943                         boxSizingReliable: function() {
45944                             if (boxSizingReliableVal == null) {
45945                                 computePixelPositionAndBoxSizingReliable();
45946                             }
45947                             return boxSizingReliableVal;
45948                         },
45949                         reliableMarginRight: function() {
45950
45951                             // Support: Android 2.3
45952                             // Check if div with explicit width and no margin-right
45953                             // incorrectly
45954                             // gets computed margin-right based on width of container.
45955                             // (#3333)
45956                             // WebKit Bug 13343 - getComputedStyle returns wrong value for
45957                             // margin-right
45958                             // This support function is only executed once so no memoizing
45959                             // is needed.
45960                             var ret,
45961                                 marginDiv = div.appendChild(document.createElement("div"));
45962
45963                             // Reset CSS: box-sizing; display; margin; border; padding
45964                             marginDiv.style.cssText = div.style.cssText =
45965                                 // Support: Firefox<29, Android 2.3
45966                                 // Vendor-prefix box-sizing
45967                                 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
45968                                 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
45969                             marginDiv.style.marginRight = marginDiv.style.width = "0";
45970                             div.style.width = "1px";
45971                             docElem.appendChild(container);
45972
45973                             ret = !parseFloat(window.getComputedStyle(marginDiv, null).marginRight);
45974
45975                             docElem.removeChild(container);
45976                             div.removeChild(marginDiv);
45977
45978                             return ret;
45979                         }
45980                     });
45981                 }
45982             })();
45983
45984
45985             // A method for quickly swapping in/out CSS properties to get correct
45986             // calculations.
45987             jQuery.swap = function(elem, options, callback, args) {
45988                 var ret, name,
45989                     old = {};
45990
45991                 // Remember the old values, and insert the new ones
45992                 for (name in options) {
45993                     old[name] = elem.style[name];
45994                     elem.style[name] = options[name];
45995                 }
45996
45997                 ret = callback.apply(elem, args || []);
45998
45999                 // Revert the old values
46000                 for (name in options) {
46001                     elem.style[name] = old[name];
46002                 }
46003
46004                 return ret;
46005             };
46006
46007
46008             var
46009             // Swappable if display is none or starts with table except "table",
46010             // "table-cell", or "table-caption"
46011             // See here for display values:
46012             // https://developer.mozilla.org/en-US/docs/CSS/display
46013                 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
46014                 rnumsplit = new RegExp("^(" + pnum + ")(.*)$", "i"),
46015                 rrelNum = new RegExp("^([+-])=(" + pnum + ")", "i"),
46016
46017                 cssShow = {
46018                     position: "absolute",
46019                     visibility: "hidden",
46020                     display: "block"
46021                 },
46022                 cssNormalTransform = {
46023                     letterSpacing: "0",
46024                     fontWeight: "400"
46025                 },
46026
46027                 cssPrefixes = ["Webkit", "O", "Moz", "ms"];
46028
46029             // Return a css property mapped to a potentially vendor prefixed property
46030             function vendorPropName(style, name) {
46031
46032                 // Shortcut for names that are not vendor prefixed
46033                 if (name in style) {
46034                     return name;
46035                 }
46036
46037                 // Check for vendor prefixed names
46038                 var capName = name[0].toUpperCase() + name.slice(1),
46039                     origName = name,
46040                     i = cssPrefixes.length;
46041
46042                 while (i--) {
46043                     name = cssPrefixes[i] + capName;
46044                     if (name in style) {
46045                         return name;
46046                     }
46047                 }
46048
46049                 return origName;
46050             }
46051
46052             function setPositiveNumber(elem, value, subtract) {
46053                 var matches = rnumsplit.exec(value);
46054                 return matches ?
46055                     // Guard against undefined "subtract", e.g., when used as in cssHooks
46056                     Math.max(0, matches[1] - (subtract || 0)) + (matches[2] || "px") :
46057                     value;
46058             }
46059
46060             function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) {
46061                 var i = extra === (isBorderBox ? "border" : "content") ?
46062                     // If we already have the right measurement, avoid augmentation
46063                     4 :
46064                     // Otherwise initialize for horizontal or vertical properties
46065                     name === "width" ? 1 : 0,
46066
46067                     val = 0;
46068
46069                 for (; i < 4; i += 2) {
46070                     // Both box models exclude margin, so add it if we want it
46071                     if (extra === "margin") {
46072                         val += jQuery.css(elem, extra + cssExpand[i], true, styles);
46073                     }
46074
46075                     if (isBorderBox) {
46076                         // border-box includes padding, so remove it if we want content
46077                         if (extra === "content") {
46078                             val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
46079                         }
46080
46081                         // At this point, extra isn't border nor margin, so remove border
46082                         if (extra !== "margin") {
46083                             val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
46084                         }
46085                     } else {
46086                         // At this point, extra isn't content, so add padding
46087                         val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
46088
46089                         // At this point, extra isn't content nor padding, so add border
46090                         if (extra !== "padding") {
46091                             val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
46092                         }
46093                     }
46094                 }
46095
46096                 return val;
46097             }
46098
46099             function getWidthOrHeight(elem, name, extra) {
46100
46101                 // Start with offset property, which is equivalent to the border-box value
46102                 var valueIsBorderBox = true,
46103                     val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
46104                     styles = getStyles(elem),
46105                     isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
46106
46107                 // Some non-html elements return undefined for offsetWidth, so check for
46108                 // null/undefined
46109                 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
46110                 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
46111                 if (val <= 0 || val == null) {
46112                     // Fall back to computed then uncomputed css if necessary
46113                     val = curCSS(elem, name, styles);
46114                     if (val < 0 || val == null) {
46115                         val = elem.style[name];
46116                     }
46117
46118                     // Computed unit is not pixels. Stop here and return.
46119                     if (rnumnonpx.test(val)) {
46120                         return val;
46121                     }
46122
46123                     // Check for style in case a browser which returns unreliable values
46124                     // for getComputedStyle silently falls back to the reliable elem.style
46125                     valueIsBorderBox = isBorderBox &&
46126                         (support.boxSizingReliable() || val === elem.style[name]);
46127
46128                     // Normalize "", auto, and prepare for extra
46129                     val = parseFloat(val) || 0;
46130                 }
46131
46132                 // Use the active box-sizing model to add/subtract irrelevant styles
46133                 return (val +
46134                     augmentWidthOrHeight(
46135                         elem,
46136                         name,
46137                         extra || (isBorderBox ? "border" : "content"),
46138                         valueIsBorderBox,
46139                         styles
46140                     )
46141                 ) + "px";
46142             }
46143
46144             function showHide(elements, show) {
46145                 var display, elem, hidden,
46146                     values = [],
46147                     index = 0,
46148                     length = elements.length;
46149
46150                 for (; index < length; index++) {
46151                     elem = elements[index];
46152                     if (!elem.style) {
46153                         continue;
46154                     }
46155
46156                     values[index] = data_priv.get(elem, "olddisplay");
46157                     display = elem.style.display;
46158                     if (show) {
46159                         // Reset the inline display of this element to learn if it is
46160                         // being hidden by cascaded rules or not
46161                         if (!values[index] && display === "none") {
46162                             elem.style.display = "";
46163                         }
46164
46165                         // Set elements which have been overridden with display: none
46166                         // in a stylesheet to whatever the default browser style is
46167                         // for such an element
46168                         if (elem.style.display === "" && isHidden(elem)) {
46169                             values[index] = data_priv.access(elem, "olddisplay", defaultDisplay(elem.nodeName));
46170                         }
46171                     } else {
46172                         hidden = isHidden(elem);
46173
46174                         if (display !== "none" || !hidden) {
46175                             data_priv.set(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"));
46176                         }
46177                     }
46178                 }
46179
46180                 // Set the display of most of the elements in a second loop
46181                 // to avoid the constant reflow
46182                 for (index = 0; index < length; index++) {
46183                     elem = elements[index];
46184                     if (!elem.style) {
46185                         continue;
46186                     }
46187                     if (!show || elem.style.display === "none" || elem.style.display === "") {
46188                         elem.style.display = show ? values[index] || "" : "none";
46189                     }
46190                 }
46191
46192                 return elements;
46193             }
46194
46195             jQuery.extend({
46196
46197                 // Add in style property hooks for overriding the default
46198                 // behavior of getting and setting a style property
46199                 cssHooks: {
46200                     opacity: {
46201                         get: function(elem, computed) {
46202                             if (computed) {
46203
46204                                 // We should always get a number back from opacity
46205                                 var ret = curCSS(elem, "opacity");
46206                                 return ret === "" ? "1" : ret;
46207                             }
46208                         }
46209                     }
46210                 },
46211
46212                 // Don't automatically add "px" to these possibly-unitless properties
46213                 cssNumber: {
46214                     "columnCount": true,
46215                     "fillOpacity": true,
46216                     "flexGrow": true,
46217                     "flexShrink": true,
46218                     "fontWeight": true,
46219                     "lineHeight": true,
46220                     "opacity": true,
46221                     "order": true,
46222                     "orphans": true,
46223                     "widows": true,
46224                     "zIndex": true,
46225                     "zoom": true
46226                 },
46227
46228                 // Add in properties whose names you wish to fix before
46229                 // setting or getting the value
46230                 cssProps: {
46231                     "float": "cssFloat"
46232                 },
46233
46234                 // Get and set the style property on a DOM Node
46235                 style: function(elem, name, value, extra) {
46236
46237                     // Don't set styles on text and comment nodes
46238                     if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
46239                         return;
46240                     }
46241
46242                     // Make sure that we're working with the right name
46243                     var ret, type, hooks,
46244                         origName = jQuery.camelCase(name),
46245                         style = elem.style;
46246
46247                     name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName));
46248
46249                     // Gets hook for the prefixed version, then unprefixed version
46250                     hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
46251
46252                     // Check if we're setting a value
46253                     if (value !== undefined) {
46254                         type = typeof value;
46255
46256                         // Convert "+=" or "-=" to relative numbers (#7345)
46257                         if (type === "string" && (ret = rrelNum.exec(value))) {
46258                             value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name));
46259                             // Fixes bug #9237
46260                             type = "number";
46261                         }
46262
46263                         // Make sure that null and NaN values aren't set (#7116)
46264                         if (value == null || value !== value) {
46265                             return;
46266                         }
46267
46268                         // If a number, add 'px' to the (except for certain CSS properties)
46269                         if (type === "number" && !jQuery.cssNumber[origName]) {
46270                             value += "px";
46271                         }
46272
46273                         // Support: IE9-11+
46274                         // background-* props affect original clone's values
46275                         if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
46276                             style[name] = "inherit";
46277                         }
46278
46279                         // If a hook was provided, use that value, otherwise just set the
46280                         // specified value
46281                         if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {
46282                             style[name] = value;
46283                         }
46284
46285                     } else {
46286                         // If a hook was provided get the non-computed value from there
46287                         if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {
46288                             return ret;
46289                         }
46290
46291                         // Otherwise just get the value from the style object
46292                         return style[name];
46293                     }
46294                 },
46295
46296                 css: function(elem, name, extra, styles) {
46297                     var val, num, hooks,
46298                         origName = jQuery.camelCase(name);
46299
46300                     // Make sure that we're working with the right name
46301                     name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName));
46302
46303                     // Try prefixed name followed by the unprefixed name
46304                     hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
46305
46306                     // If a hook was provided get the computed value from there
46307                     if (hooks && "get" in hooks) {
46308                         val = hooks.get(elem, true, extra);
46309                     }
46310
46311                     // Otherwise, if a way to get the computed value exists, use that
46312                     if (val === undefined) {
46313                         val = curCSS(elem, name, styles);
46314                     }
46315
46316                     // Convert "normal" to computed value
46317                     if (val === "normal" && name in cssNormalTransform) {
46318                         val = cssNormalTransform[name];
46319                     }
46320
46321                     // Make numeric if forced or a qualifier was provided and val looks
46322                     // numeric
46323                     if (extra === "" || extra) {
46324                         num = parseFloat(val);
46325                         return extra === true || jQuery.isNumeric(num) ? num || 0 : val;
46326                     }
46327                     return val;
46328                 }
46329             });
46330
46331             jQuery.each(["height", "width"], function(i, name) {
46332                 jQuery.cssHooks[name] = {
46333                     get: function(elem, computed, extra) {
46334                         if (computed) {
46335
46336                             // Certain elements can have dimension info if we invisibly show
46337                             // them
46338                             // but it must have a current display style that would benefit
46339                             return rdisplayswap.test(jQuery.css(elem, "display")) && elem.offsetWidth === 0 ?
46340                                 jQuery.swap(elem, cssShow, function() {
46341                                     return getWidthOrHeight(elem, name, extra);
46342                                 }) :
46343                                 getWidthOrHeight(elem, name, extra);
46344                         }
46345                     },
46346
46347                     set: function(elem, value, extra) {
46348                         var styles = extra && getStyles(elem);
46349                         return setPositiveNumber(elem, value, extra ?
46350                             augmentWidthOrHeight(
46351                                 elem,
46352                                 name,
46353                                 extra,
46354                                 jQuery.css(elem, "boxSizing", false, styles) === "border-box",
46355                                 styles
46356                             ) : 0
46357                         );
46358                     }
46359                 };
46360             });
46361
46362             // Support: Android 2.3
46363             jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight,
46364                 function(elem, computed) {
46365                     if (computed) {
46366                         return jQuery.swap(elem, {
46367                                 "display": "inline-block"
46368                             },
46369                             curCSS, [elem, "marginRight"]);
46370                     }
46371                 }
46372             );
46373
46374             // These hooks are used by animate to expand properties
46375             jQuery.each({
46376                 margin: "",
46377                 padding: "",
46378                 border: "Width"
46379             }, function(prefix, suffix) {
46380                 jQuery.cssHooks[prefix + suffix] = {
46381                     expand: function(value) {
46382                         var i = 0,
46383                             expanded = {},
46384
46385                             // Assumes a single number if not a string
46386                             parts = typeof value === "string" ? value.split(" ") : [value];
46387
46388                         for (; i < 4; i++) {
46389                             expanded[prefix + cssExpand[i] + suffix] =
46390                                 parts[i] || parts[i - 2] || parts[0];
46391                         }
46392
46393                         return expanded;
46394                     }
46395                 };
46396
46397                 if (!rmargin.test(prefix)) {
46398                     jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
46399                 }
46400             });
46401
46402             jQuery.fn.extend({
46403                 css: function(name, value) {
46404                     return access(this, function(elem, name, value) {
46405                         var styles, len,
46406                             map = {},
46407                             i = 0;
46408
46409                         if (jQuery.isArray(name)) {
46410                             styles = getStyles(elem);
46411                             len = name.length;
46412
46413                             for (; i < len; i++) {
46414                                 map[name[i]] = jQuery.css(elem, name[i], false, styles);
46415                             }
46416
46417                             return map;
46418                         }
46419
46420                         return value !== undefined ?
46421                             jQuery.style(elem, name, value) :
46422                             jQuery.css(elem, name);
46423                     }, name, value, arguments.length > 1);
46424                 },
46425                 show: function() {
46426                     return showHide(this, true);
46427                 },
46428                 hide: function() {
46429                     return showHide(this);
46430                 },
46431                 toggle: function(state) {
46432                     if (typeof state === "boolean") {
46433                         return state ? this.show() : this.hide();
46434                     }
46435
46436                     return this.each(function() {
46437                         if (isHidden(this)) {
46438                             jQuery(this).show();
46439                         } else {
46440                             jQuery(this).hide();
46441                         }
46442                     });
46443                 }
46444             });
46445
46446
46447             function Tween(elem, options, prop, end, easing) {
46448                 return new Tween.prototype.init(elem, options, prop, end, easing);
46449             }
46450             jQuery.Tween = Tween;
46451
46452             Tween.prototype = {
46453                 constructor: Tween,
46454                 init: function(elem, options, prop, end, easing, unit) {
46455                     this.elem = elem;
46456                     this.prop = prop;
46457                     this.easing = easing || "swing";
46458                     this.options = options;
46459                     this.start = this.now = this.cur();
46460                     this.end = end;
46461                     this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
46462                 },
46463                 cur: function() {
46464                     var hooks = Tween.propHooks[this.prop];
46465
46466                     return hooks && hooks.get ?
46467                         hooks.get(this) :
46468                         Tween.propHooks._default.get(this);
46469                 },
46470                 run: function(percent) {
46471                     var eased,
46472                         hooks = Tween.propHooks[this.prop];
46473
46474                     if (this.options.duration) {
46475                         this.pos = eased = jQuery.easing[this.easing](
46476                             percent, this.options.duration * percent, 0, 1, this.options.duration
46477                         );
46478                     } else {
46479                         this.pos = eased = percent;
46480                     }
46481                     this.now = (this.end - this.start) * eased + this.start;
46482
46483                     if (this.options.step) {
46484                         this.options.step.call(this.elem, this.now, this);
46485                     }
46486
46487                     if (hooks && hooks.set) {
46488                         hooks.set(this);
46489                     } else {
46490                         Tween.propHooks._default.set(this);
46491                     }
46492                     return this;
46493                 }
46494             };
46495
46496             Tween.prototype.init.prototype = Tween.prototype;
46497
46498             Tween.propHooks = {
46499                 _default: {
46500                     get: function(tween) {
46501                         var result;
46502
46503                         if (tween.elem[tween.prop] != null &&
46504                             (!tween.elem.style || tween.elem.style[tween.prop] == null)) {
46505                             return tween.elem[tween.prop];
46506                         }
46507
46508                         // Passing an empty string as a 3rd parameter to .css will
46509                         // automatically
46510                         // attempt a parseFloat and fallback to a string if the parse fails.
46511                         // Simple values such as "10px" are parsed to Float;
46512                         // complex values such as "rotate(1rad)" are returned as-is.
46513                         result = jQuery.css(tween.elem, tween.prop, "");
46514                         // Empty strings, null, undefined and "auto" are converted to 0.
46515                         return !result || result === "auto" ? 0 : result;
46516                     },
46517                     set: function(tween) {
46518                         // Use step hook for back compat.
46519                         // Use cssHook if its there.
46520                         // Use .style if available and use plain properties where available.
46521                         if (jQuery.fx.step[tween.prop]) {
46522                             jQuery.fx.step[tween.prop](tween);
46523                         } else if (tween.elem.style && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) {
46524                             jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
46525                         } else {
46526                             tween.elem[tween.prop] = tween.now;
46527                         }
46528                     }
46529                 }
46530             };
46531
46532             // Support: IE9
46533             // Panic based approach to setting things on disconnected nodes
46534             Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
46535                 set: function(tween) {
46536                     if (tween.elem.nodeType && tween.elem.parentNode) {
46537                         tween.elem[tween.prop] = tween.now;
46538                     }
46539                 }
46540             };
46541
46542             jQuery.easing = {
46543                 linear: function(p) {
46544                     return p;
46545                 },
46546                 swing: function(p) {
46547                     return 0.5 - Math.cos(p * Math.PI) / 2;
46548                 }
46549             };
46550
46551             jQuery.fx = Tween.prototype.init;
46552
46553             // Back Compat <1.8 extension point
46554             jQuery.fx.step = {};
46555
46556
46557
46558
46559             var
46560                 fxNow, timerId,
46561                 rfxtypes = /^(?:toggle|show|hide)$/,
46562                 rfxnum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"),
46563                 rrun = /queueHooks$/,
46564                 animationPrefilters = [defaultPrefilter],
46565                 tweeners = {
46566                     "*": [function(prop, value) {
46567                         var tween = this.createTween(prop, value),
46568                             target = tween.cur(),
46569                             parts = rfxnum.exec(value),
46570                             unit = parts && parts[3] || (jQuery.cssNumber[prop] ? "" : "px"),
46571
46572                             // Starting value computation is required for potential unit
46573                             // mismatches
46574                             start = (jQuery.cssNumber[prop] || unit !== "px" && +target) &&
46575                             rfxnum.exec(jQuery.css(tween.elem, prop)),
46576                             scale = 1,
46577                             maxIterations = 20;
46578
46579                         if (start && start[3] !== unit) {
46580                             // Trust units reported by jQuery.css
46581                             unit = unit || start[3];
46582
46583                             // Make sure we update the tween properties later on
46584                             parts = parts || [];
46585
46586                             // Iteratively approximate from a nonzero starting point
46587                             start = +target || 1;
46588
46589                             do {
46590                                 // If previous iteration zeroed out, double until we get
46591                                 // *something*.
46592                                 // Use string for doubling so we don't accidentally see
46593                                 // scale as unchanged below
46594                                 scale = scale || ".5";
46595
46596                                 // Adjust and apply
46597                                 start = start / scale;
46598                                 jQuery.style(tween.elem, prop, start + unit);
46599
46600                                 // Update scale, tolerating zero or NaN from tween.cur(),
46601                                 // break the loop if scale is unchanged or perfect, or if we've
46602                                 // just had enough
46603                             } while (scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations);
46604                         }
46605
46606                         // Update tween properties
46607                         if (parts) {
46608                             start = tween.start = +start || +target || 0;
46609                             tween.unit = unit;
46610                             // If a +=/-= token was provided, we're doing a relative
46611                             // animation
46612                             tween.end = parts[1] ?
46613                                 start + (parts[1] + 1) * parts[2] :
46614                                 +parts[2];
46615                         }
46616
46617                         return tween;
46618                     }]
46619                 };
46620
46621             // Animations created synchronously will run synchronously
46622             function createFxNow() {
46623                 setTimeout(function() {
46624                     fxNow = undefined;
46625                 });
46626                 return (fxNow = jQuery.now());
46627             }
46628
46629             // Generate parameters to create a standard animation
46630             function genFx(type, includeWidth) {
46631                 var which,
46632                     i = 0,
46633                     attrs = {
46634                         height: type
46635                     };
46636
46637                 // If we include width, step value is 1 to do all cssExpand values,
46638                 // otherwise step value is 2 to skip over Left and Right
46639                 includeWidth = includeWidth ? 1 : 0;
46640                 for (; i < 4; i += 2 - includeWidth) {
46641                     which = cssExpand[i];
46642                     attrs["margin" + which] = attrs["padding" + which] = type;
46643                 }
46644
46645                 if (includeWidth) {
46646                     attrs.opacity = attrs.width = type;
46647                 }
46648
46649                 return attrs;
46650             }
46651
46652             function createTween(value, prop, animation) {
46653                 var tween,
46654                     collection = (tweeners[prop] || []).concat(tweeners["*"]),
46655                     index = 0,
46656                     length = collection.length;
46657                 for (; index < length; index++) {
46658                     if ((tween = collection[index].call(animation, prop, value))) {
46659
46660                         // We're done with this property
46661                         return tween;
46662                     }
46663                 }
46664             }
46665
46666             function defaultPrefilter(elem, props, opts) {
46667                 /* jshint validthis: true */
46668                 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
46669                     anim = this,
46670                     orig = {},
46671                     style = elem.style,
46672                     hidden = elem.nodeType && isHidden(elem),
46673                     dataShow = data_priv.get(elem, "fxshow");
46674
46675                 // Handle queue: false promises
46676                 if (!opts.queue) {
46677                     hooks = jQuery._queueHooks(elem, "fx");
46678                     if (hooks.unqueued == null) {
46679                         hooks.unqueued = 0;
46680                         oldfire = hooks.empty.fire;
46681                         hooks.empty.fire = function() {
46682                             if (!hooks.unqueued) {
46683                                 oldfire();
46684                             }
46685                         };
46686                     }
46687                     hooks.unqueued++;
46688
46689                     anim.always(function() {
46690                         // Ensure the complete handler is called before this completes
46691                         anim.always(function() {
46692                             hooks.unqueued--;
46693                             if (!jQuery.queue(elem, "fx").length) {
46694                                 hooks.empty.fire();
46695                             }
46696                         });
46697                     });
46698                 }
46699
46700                 // Height/width overflow pass
46701                 if (elem.nodeType === 1 && ("height" in props || "width" in props)) {
46702                     // Make sure that nothing sneaks out
46703                     // Record all 3 overflow attributes because IE9-10 do not
46704                     // change the overflow attribute when overflowX and
46705                     // overflowY are set to the same value
46706                     opts.overflow = [style.overflow, style.overflowX, style.overflowY];
46707
46708                     // Set display property to inline-block for height/width
46709                     // animations on inline elements that are having width/height animated
46710                     display = jQuery.css(elem, "display");
46711
46712                     // Test default display if display is currently "none"
46713                     checkDisplay = display === "none" ?
46714                         data_priv.get(elem, "olddisplay") || defaultDisplay(elem.nodeName) : display;
46715
46716                     if (checkDisplay === "inline" && jQuery.css(elem, "float") === "none") {
46717                         style.display = "inline-block";
46718                     }
46719                 }
46720
46721                 if (opts.overflow) {
46722                     style.overflow = "hidden";
46723                     anim.always(function() {
46724                         style.overflow = opts.overflow[0];
46725                         style.overflowX = opts.overflow[1];
46726                         style.overflowY = opts.overflow[2];
46727                     });
46728                 }
46729
46730                 // show/hide pass
46731                 for (prop in props) {
46732                     value = props[prop];
46733                     if (rfxtypes.exec(value)) {
46734                         delete props[prop];
46735                         toggle = toggle || value === "toggle";
46736                         if (value === (hidden ? "hide" : "show")) {
46737
46738                             // If there is dataShow left over from a stopped hide or show
46739                             // and we are going to proceed with show, we should pretend to
46740                             // be hidden
46741                             if (value === "show" && dataShow && dataShow[prop] !== undefined) {
46742                                 hidden = true;
46743                             } else {
46744                                 continue;
46745                             }
46746                         }
46747                         orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
46748
46749                         // Any non-fx value stops us from restoring the original display value
46750                     } else {
46751                         display = undefined;
46752                     }
46753                 }
46754
46755                 if (!jQuery.isEmptyObject(orig)) {
46756                     if (dataShow) {
46757                         if ("hidden" in dataShow) {
46758                             hidden = dataShow.hidden;
46759                         }
46760                     } else {
46761                         dataShow = data_priv.access(elem, "fxshow", {});
46762                     }
46763
46764                     // Store state if its toggle - enables .stop().toggle() to "reverse"
46765                     if (toggle) {
46766                         dataShow.hidden = !hidden;
46767                     }
46768                     if (hidden) {
46769                         jQuery(elem).show();
46770                     } else {
46771                         anim.done(function() {
46772                             jQuery(elem).hide();
46773                         });
46774                     }
46775                     anim.done(function() {
46776                         var prop;
46777
46778                         data_priv.remove(elem, "fxshow");
46779                         for (prop in orig) {
46780                             jQuery.style(elem, prop, orig[prop]);
46781                         }
46782                     });
46783                     for (prop in orig) {
46784                         tween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
46785
46786                         if (!(prop in dataShow)) {
46787                             dataShow[prop] = tween.start;
46788                             if (hidden) {
46789                                 tween.end = tween.start;
46790                                 tween.start = prop === "width" || prop === "height" ? 1 : 0;
46791                             }
46792                         }
46793                     }
46794
46795                     // If this is a noop like .hide().hide(), restore an overwritten display
46796                     // value
46797                 } else if ((display === "none" ? defaultDisplay(elem.nodeName) : display) === "inline") {
46798                     style.display = display;
46799                 }
46800             }
46801
46802             function propFilter(props, specialEasing) {
46803                 var index, name, easing, value, hooks;
46804
46805                 // camelCase, specialEasing and expand cssHook pass
46806                 for (index in props) {
46807                     name = jQuery.camelCase(index);
46808                     easing = specialEasing[name];
46809                     value = props[index];
46810                     if (jQuery.isArray(value)) {
46811                         easing = value[1];
46812                         value = props[index] = value[0];
46813                     }
46814
46815                     if (index !== name) {
46816                         props[name] = value;
46817                         delete props[index];
46818                     }
46819
46820                     hooks = jQuery.cssHooks[name];
46821                     if (hooks && "expand" in hooks) {
46822                         value = hooks.expand(value);
46823                         delete props[name];
46824
46825                         // Not quite $.extend, this won't overwrite existing keys.
46826                         // Reusing 'index' because we have the correct "name"
46827                         for (index in value) {
46828                             if (!(index in props)) {
46829                                 props[index] = value[index];
46830                                 specialEasing[index] = easing;
46831                             }
46832                         }
46833                     } else {
46834                         specialEasing[name] = easing;
46835                     }
46836                 }
46837             }
46838
46839             function Animation(elem, properties, options) {
46840                 var result,
46841                     stopped,
46842                     index = 0,
46843                     length = animationPrefilters.length,
46844                     deferred = jQuery.Deferred().always(function() {
46845                         // Don't match elem in the :animated selector
46846                         delete tick.elem;
46847                     }),
46848                     tick = function() {
46849                         if (stopped) {
46850                             return false;
46851                         }
46852                         var currentTime = fxNow || createFxNow(),
46853                             remaining = Math.max(0, animation.startTime + animation.duration - currentTime),
46854                             // Support: Android 2.3
46855                             // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )`
46856                             // (#12497)
46857                             temp = remaining / animation.duration || 0,
46858                             percent = 1 - temp,
46859                             index = 0,
46860                             length = animation.tweens.length;
46861
46862                         for (; index < length; index++) {
46863                             animation.tweens[index].run(percent);
46864                         }
46865
46866                         deferred.notifyWith(elem, [animation, percent, remaining]);
46867
46868                         if (percent < 1 && length) {
46869                             return remaining;
46870                         } else {
46871                             deferred.resolveWith(elem, [animation]);
46872                             return false;
46873                         }
46874                     },
46875                     animation = deferred.promise({
46876                         elem: elem,
46877                         props: jQuery.extend({}, properties),
46878                         opts: jQuery.extend(true, {
46879                             specialEasing: {}
46880                         }, options),
46881                         originalProperties: properties,
46882                         originalOptions: options,
46883                         startTime: fxNow || createFxNow(),
46884                         duration: options.duration,
46885                         tweens: [],
46886                         createTween: function(prop, end) {
46887                             var tween = jQuery.Tween(elem, animation.opts, prop, end,
46888                                 animation.opts.specialEasing[prop] || animation.opts.easing);
46889                             animation.tweens.push(tween);
46890                             return tween;
46891                         },
46892                         stop: function(gotoEnd) {
46893                             var index = 0,
46894                                 // If we are going to the end, we want to run all the tweens
46895                                 // otherwise we skip this part
46896                                 length = gotoEnd ? animation.tweens.length : 0;
46897                             if (stopped) {
46898                                 return this;
46899                             }
46900                             stopped = true;
46901                             for (; index < length; index++) {
46902                                 animation.tweens[index].run(1);
46903                             }
46904
46905                             // Resolve when we played the last frame; otherwise, reject
46906                             if (gotoEnd) {
46907                                 deferred.resolveWith(elem, [animation, gotoEnd]);
46908                             } else {
46909                                 deferred.rejectWith(elem, [animation, gotoEnd]);
46910                             }
46911                             return this;
46912                         }
46913                     }),
46914                     props = animation.props;
46915
46916                 propFilter(props, animation.opts.specialEasing);
46917
46918                 for (; index < length; index++) {
46919                     result = animationPrefilters[index].call(animation, elem, props, animation.opts);
46920                     if (result) {
46921                         return result;
46922                     }
46923                 }
46924
46925                 jQuery.map(props, createTween, animation);
46926
46927                 if (jQuery.isFunction(animation.opts.start)) {
46928                     animation.opts.start.call(elem, animation);
46929                 }
46930
46931                 jQuery.fx.timer(
46932                     jQuery.extend(tick, {
46933                         elem: elem,
46934                         anim: animation,
46935                         queue: animation.opts.queue
46936                     })
46937                 );
46938
46939                 // attach callbacks from options
46940                 return animation.progress(animation.opts.progress)
46941                     .done(animation.opts.done, animation.opts.complete)
46942                     .fail(animation.opts.fail)
46943                     .always(animation.opts.always);
46944             }
46945
46946             jQuery.Animation = jQuery.extend(Animation, {
46947
46948                 tweener: function(props, callback) {
46949                     if (jQuery.isFunction(props)) {
46950                         callback = props;
46951                         props = ["*"];
46952                     } else {
46953                         props = props.split(" ");
46954                     }
46955
46956                     var prop,
46957                         index = 0,
46958                         length = props.length;
46959
46960                     for (; index < length; index++) {
46961                         prop = props[index];
46962                         tweeners[prop] = tweeners[prop] || [];
46963                         tweeners[prop].unshift(callback);
46964                     }
46965                 },
46966
46967                 prefilter: function(callback, prepend) {
46968                     if (prepend) {
46969                         animationPrefilters.unshift(callback);
46970                     } else {
46971                         animationPrefilters.push(callback);
46972                     }
46973                 }
46974             });
46975
46976             jQuery.speed = function(speed, easing, fn) {
46977                 var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
46978                     complete: fn || !fn && easing ||
46979                         jQuery.isFunction(speed) && speed,
46980                     duration: speed,
46981                     easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
46982                 };
46983
46984                 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
46985                     opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
46986
46987                 // Normalize opt.queue - true/undefined/null -> "fx"
46988                 if (opt.queue == null || opt.queue === true) {
46989                     opt.queue = "fx";
46990                 }
46991
46992                 // Queueing
46993                 opt.old = opt.complete;
46994
46995                 opt.complete = function() {
46996                     if (jQuery.isFunction(opt.old)) {
46997                         opt.old.call(this);
46998                     }
46999
47000                     if (opt.queue) {
47001                         jQuery.dequeue(this, opt.queue);
47002                     }
47003                 };
47004
47005                 return opt;
47006             };
47007
47008             jQuery.fn.extend({
47009                 fadeTo: function(speed, to, easing, callback) {
47010
47011                     // Show any hidden elements after setting opacity to 0
47012                     return this.filter(isHidden).css("opacity", 0).show()
47013
47014                     // Animate to the value specified
47015                     .end().animate({
47016                         opacity: to
47017                     }, speed, easing, callback);
47018                 },
47019                 animate: function(prop, speed, easing, callback) {
47020                     var empty = jQuery.isEmptyObject(prop),
47021                         optall = jQuery.speed(speed, easing, callback),
47022                         doAnimation = function() {
47023                             // Operate on a copy of prop so per-property easing won't be
47024                             // lost
47025                             var anim = Animation(this, jQuery.extend({}, prop), optall);
47026
47027                             // Empty animations, or finishing resolves immediately
47028                             if (empty || data_priv.get(this, "finish")) {
47029                                 anim.stop(true);
47030                             }
47031                         };
47032                     doAnimation.finish = doAnimation;
47033
47034                     return empty || optall.queue === false ?
47035                         this.each(doAnimation) :
47036                         this.queue(optall.queue, doAnimation);
47037                 },
47038                 stop: function(type, clearQueue, gotoEnd) {
47039                     var stopQueue = function(hooks) {
47040                         var stop = hooks.stop;
47041                         delete hooks.stop;
47042                         stop(gotoEnd);
47043                     };
47044
47045                     if (typeof type !== "string") {
47046                         gotoEnd = clearQueue;
47047                         clearQueue = type;
47048                         type = undefined;
47049                     }
47050                     if (clearQueue && type !== false) {
47051                         this.queue(type || "fx", []);
47052                     }
47053
47054                     return this.each(function() {
47055                         var dequeue = true,
47056                             index = type != null && type + "queueHooks",
47057                             timers = jQuery.timers,
47058                             data = data_priv.get(this);
47059
47060                         if (index) {
47061                             if (data[index] && data[index].stop) {
47062                                 stopQueue(data[index]);
47063                             }
47064                         } else {
47065                             for (index in data) {
47066                                 if (data[index] && data[index].stop && rrun.test(index)) {
47067                                     stopQueue(data[index]);
47068                                 }
47069                             }
47070                         }
47071
47072                         for (index = timers.length; index--;) {
47073                             if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
47074                                 timers[index].anim.stop(gotoEnd);
47075                                 dequeue = false;
47076                                 timers.splice(index, 1);
47077                             }
47078                         }
47079
47080                         // Start the next in the queue if the last step wasn't forced.
47081                         // Timers currently will call their complete callbacks, which
47082                         // will dequeue but only if they were gotoEnd.
47083                         if (dequeue || !gotoEnd) {
47084                             jQuery.dequeue(this, type);
47085                         }
47086                     });
47087                 },
47088                 finish: function(type) {
47089                     if (type !== false) {
47090                         type = type || "fx";
47091                     }
47092                     return this.each(function() {
47093                         var index,
47094                             data = data_priv.get(this),
47095                             queue = data[type + "queue"],
47096                             hooks = data[type + "queueHooks"],
47097                             timers = jQuery.timers,
47098                             length = queue ? queue.length : 0;
47099
47100                         // Enable finishing flag on private data
47101                         data.finish = true;
47102
47103                         // Empty the queue first
47104                         jQuery.queue(this, type, []);
47105
47106                         if (hooks && hooks.stop) {
47107                             hooks.stop.call(this, true);
47108                         }
47109
47110                         // Look for any active animations, and finish them
47111                         for (index = timers.length; index--;) {
47112                             if (timers[index].elem === this && timers[index].queue === type) {
47113                                 timers[index].anim.stop(true);
47114                                 timers.splice(index, 1);
47115                             }
47116                         }
47117
47118                         // Look for any animations in the old queue and finish them
47119                         for (index = 0; index < length; index++) {
47120                             if (queue[index] && queue[index].finish) {
47121                                 queue[index].finish.call(this);
47122                             }
47123                         }
47124
47125                         // Turn off finishing flag
47126                         delete data.finish;
47127                     });
47128                 }
47129             });
47130
47131             jQuery.each(["toggle", "show", "hide"], function(i, name) {
47132                 var cssFn = jQuery.fn[name];
47133                 jQuery.fn[name] = function(speed, easing, callback) {
47134                     return speed == null || typeof speed === "boolean" ?
47135                         cssFn.apply(this, arguments) :
47136                         this.animate(genFx(name, true), speed, easing, callback);
47137                 };
47138             });
47139
47140             // Generate shortcuts for custom animations
47141             jQuery.each({
47142                 slideDown: genFx("show"),
47143                 slideUp: genFx("hide"),
47144                 slideToggle: genFx("toggle"),
47145                 fadeIn: {
47146                     opacity: "show"
47147                 },
47148                 fadeOut: {
47149                     opacity: "hide"
47150                 },
47151                 fadeToggle: {
47152                     opacity: "toggle"
47153                 }
47154             }, function(name, props) {
47155                 jQuery.fn[name] = function(speed, easing, callback) {
47156                     return this.animate(props, speed, easing, callback);
47157                 };
47158             });
47159
47160             jQuery.timers = [];
47161             jQuery.fx.tick = function() {
47162                 var timer,
47163                     i = 0,
47164                     timers = jQuery.timers;
47165
47166                 fxNow = jQuery.now();
47167
47168                 for (; i < timers.length; i++) {
47169                     timer = timers[i];
47170                     // Checks the timer has not already been removed
47171                     if (!timer() && timers[i] === timer) {
47172                         timers.splice(i--, 1);
47173                     }
47174                 }
47175
47176                 if (!timers.length) {
47177                     jQuery.fx.stop();
47178                 }
47179                 fxNow = undefined;
47180             };
47181
47182             jQuery.fx.timer = function(timer) {
47183                 jQuery.timers.push(timer);
47184                 if (timer()) {
47185                     jQuery.fx.start();
47186                 } else {
47187                     jQuery.timers.pop();
47188                 }
47189             };
47190
47191             jQuery.fx.interval = 13;
47192
47193             jQuery.fx.start = function() {
47194                 if (!timerId) {
47195                     timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval);
47196                 }
47197             };
47198
47199             jQuery.fx.stop = function() {
47200                 clearInterval(timerId);
47201                 timerId = null;
47202             };
47203
47204             jQuery.fx.speeds = {
47205                 slow: 600,
47206                 fast: 200,
47207                 // Default speed
47208                 _default: 400
47209             };
47210
47211
47212             // Based off of the plugin by Clint Helfers, with permission.
47213             // http://blindsignals.com/index.php/2009/07/jquery-delay/
47214             jQuery.fn.delay = function(time, type) {
47215                 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
47216                 type = type || "fx";
47217
47218                 return this.queue(type, function(next, hooks) {
47219                     var timeout = setTimeout(next, time);
47220                     hooks.stop = function() {
47221                         clearTimeout(timeout);
47222                     };
47223                 });
47224             };
47225
47226
47227             (function() {
47228                 var input = document.createElement("input"),
47229                     select = document.createElement("select"),
47230                     opt = select.appendChild(document.createElement("option"));
47231
47232                 input.type = "checkbox";
47233
47234                 // Support: iOS<=5.1, Android<=4.2+
47235                 // Default value for a checkbox should be "on"
47236                 support.checkOn = input.value !== "";
47237
47238                 // Support: IE<=11+
47239                 // Must access selectedIndex to make default options select
47240                 support.optSelected = opt.selected;
47241
47242                 // Support: Android<=2.3
47243                 // Options inside disabled selects are incorrectly marked as disabled
47244                 select.disabled = true;
47245                 support.optDisabled = !opt.disabled;
47246
47247                 // Support: IE<=11+
47248                 // An input loses its value after becoming a radio
47249                 input = document.createElement("input");
47250                 input.value = "t";
47251                 input.type = "radio";
47252                 support.radioValue = input.value === "t";
47253             })();
47254
47255
47256             var nodeHook, boolHook,
47257                 attrHandle = jQuery.expr.attrHandle;
47258
47259             jQuery.fn.extend({
47260                 attr: function(name, value) {
47261                     return access(this, jQuery.attr, name, value, arguments.length > 1);
47262                 },
47263
47264                 removeAttr: function(name) {
47265                     return this.each(function() {
47266                         jQuery.removeAttr(this, name);
47267                     });
47268                 }
47269             });
47270
47271             jQuery.extend({
47272                 attr: function(elem, name, value) {
47273                     var hooks, ret,
47274                         nType = elem.nodeType;
47275
47276                     // don't get/set attributes on text, comment and attribute nodes
47277                     if (!elem || nType === 3 || nType === 8 || nType === 2) {
47278                         return;
47279                     }
47280
47281                     // Fallback to prop when attributes are not supported
47282                     if (typeof elem.getAttribute === strundefined) {
47283                         return jQuery.prop(elem, name, value);
47284                     }
47285
47286                     // All attributes are lowercase
47287                     // Grab necessary hook if one is defined
47288                     if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
47289                         name = name.toLowerCase();
47290                         hooks = jQuery.attrHooks[name] ||
47291                             (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook);
47292                     }
47293
47294                     if (value !== undefined) {
47295
47296                         if (value === null) {
47297                             jQuery.removeAttr(elem, name);
47298
47299                         } else if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
47300                             return ret;
47301
47302                         } else {
47303                             elem.setAttribute(name, value + "");
47304                             return value;
47305                         }
47306
47307                     } else if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
47308                         return ret;
47309
47310                     } else {
47311                         ret = jQuery.find.attr(elem, name);
47312
47313                         // Non-existent attributes return null, we normalize to undefined
47314                         return ret == null ?
47315                             undefined :
47316                             ret;
47317                     }
47318                 },
47319
47320                 removeAttr: function(elem, value) {
47321                     var name, propName,
47322                         i = 0,
47323                         attrNames = value && value.match(rnotwhite);
47324
47325                     if (attrNames && elem.nodeType === 1) {
47326                         while ((name = attrNames[i++])) {
47327                             propName = jQuery.propFix[name] || name;
47328
47329                             // Boolean attributes get special treatment (#10870)
47330                             if (jQuery.expr.match.bool.test(name)) {
47331                                 // Set corresponding property to false
47332                                 elem[propName] = false;
47333                             }
47334
47335                             elem.removeAttribute(name);
47336                         }
47337                     }
47338                 },
47339
47340                 attrHooks: {
47341                     type: {
47342                         set: function(elem, value) {
47343                             if (!support.radioValue && value === "radio" &&
47344                                 jQuery.nodeName(elem, "input")) {
47345                                 var val = elem.value;
47346                                 elem.setAttribute("type", value);
47347                                 if (val) {
47348                                     elem.value = val;
47349                                 }
47350                                 return value;
47351                             }
47352                         }
47353                     }
47354                 }
47355             });
47356
47357             // Hooks for boolean attributes
47358             boolHook = {
47359                 set: function(elem, value, name) {
47360                     if (value === false) {
47361                         // Remove boolean attributes when set to false
47362                         jQuery.removeAttr(elem, name);
47363                     } else {
47364                         elem.setAttribute(name, name);
47365                     }
47366                     return name;
47367                 }
47368             };
47369             jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(i, name) {
47370                 var getter = attrHandle[name] || jQuery.find.attr;
47371
47372                 attrHandle[name] = function(elem, name, isXML) {
47373                     var ret, handle;
47374                     if (!isXML) {
47375                         // Avoid an infinite loop by temporarily removing this function from
47376                         // the getter
47377                         handle = attrHandle[name];
47378                         attrHandle[name] = ret;
47379                         ret = getter(elem, name, isXML) != null ?
47380                             name.toLowerCase() :
47381                             null;
47382                         attrHandle[name] = handle;
47383                     }
47384                     return ret;
47385                 };
47386             });
47387
47388
47389
47390
47391             var rfocusable = /^(?:input|select|textarea|button)$/i;
47392
47393             jQuery.fn.extend({
47394                 prop: function(name, value) {
47395                     return access(this, jQuery.prop, name, value, arguments.length > 1);
47396                 },
47397
47398                 removeProp: function(name) {
47399                     return this.each(function() {
47400                         delete this[jQuery.propFix[name] || name];
47401                     });
47402                 }
47403             });
47404
47405             jQuery.extend({
47406                 propFix: {
47407                     "for": "htmlFor",
47408                     "class": "className"
47409                 },
47410
47411                 prop: function(elem, name, value) {
47412                     var ret, hooks, notxml,
47413                         nType = elem.nodeType;
47414
47415                     // Don't get/set properties on text, comment and attribute nodes
47416                     if (!elem || nType === 3 || nType === 8 || nType === 2) {
47417                         return;
47418                     }
47419
47420                     notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
47421
47422                     if (notxml) {
47423                         // Fix name and attach hooks
47424                         name = jQuery.propFix[name] || name;
47425                         hooks = jQuery.propHooks[name];
47426                     }
47427
47428                     if (value !== undefined) {
47429                         return hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined ?
47430                             ret :
47431                             (elem[name] = value);
47432
47433                     } else {
47434                         return hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null ?
47435                             ret :
47436                             elem[name];
47437                     }
47438                 },
47439
47440                 propHooks: {
47441                     tabIndex: {
47442                         get: function(elem) {
47443                             return elem.hasAttribute("tabindex") || rfocusable.test(elem.nodeName) || elem.href ?
47444                                 elem.tabIndex :
47445                                 -1;
47446                         }
47447                     }
47448                 }
47449             });
47450
47451             if (!support.optSelected) {
47452                 jQuery.propHooks.selected = {
47453                     get: function(elem) {
47454                         var parent = elem.parentNode;
47455                         if (parent && parent.parentNode) {
47456                             parent.parentNode.selectedIndex;
47457                         }
47458                         return null;
47459                     }
47460                 };
47461             }
47462
47463             jQuery.each([
47464                 "tabIndex",
47465                 "readOnly",
47466                 "maxLength",
47467                 "cellSpacing",
47468                 "cellPadding",
47469                 "rowSpan",
47470                 "colSpan",
47471                 "useMap",
47472                 "frameBorder",
47473                 "contentEditable"
47474             ], function() {
47475                 jQuery.propFix[this.toLowerCase()] = this;
47476             });
47477
47478
47479
47480
47481             var rclass = /[\t\r\n\f]/g;
47482
47483             jQuery.fn.extend({
47484                 addClass: function(value) {
47485                     var classes, elem, cur, clazz, j, finalValue,
47486                         proceed = typeof value === "string" && value,
47487                         i = 0,
47488                         len = this.length;
47489
47490                     if (jQuery.isFunction(value)) {
47491                         return this.each(function(j) {
47492                             jQuery(this).addClass(value.call(this, j, this.className));
47493                         });
47494                     }
47495
47496                     if (proceed) {
47497                         // The disjunction here is for better compressibility (see
47498                         // removeClass)
47499                         classes = (value || "").match(rnotwhite) || [];
47500
47501                         for (; i < len; i++) {
47502                             elem = this[i];
47503                             cur = elem.nodeType === 1 && (elem.className ?
47504                                 (" " + elem.className + " ").replace(rclass, " ") :
47505                                 " "
47506                             );
47507
47508                             if (cur) {
47509                                 j = 0;
47510                                 while ((clazz = classes[j++])) {
47511                                     if (cur.indexOf(" " + clazz + " ") < 0) {
47512                                         cur += clazz + " ";
47513                                     }
47514                                 }
47515
47516                                 // only assign if different to avoid unneeded rendering.
47517                                 finalValue = jQuery.trim(cur);
47518                                 if (elem.className !== finalValue) {
47519                                     elem.className = finalValue;
47520                                 }
47521                             }
47522                         }
47523                     }
47524
47525                     return this;
47526                 },
47527
47528                 removeClass: function(value) {
47529                     var classes, elem, cur, clazz, j, finalValue,
47530                         proceed = arguments.length === 0 || typeof value === "string" && value,
47531                         i = 0,
47532                         len = this.length;
47533
47534                     if (jQuery.isFunction(value)) {
47535                         return this.each(function(j) {
47536                             jQuery(this).removeClass(value.call(this, j, this.className));
47537                         });
47538                     }
47539                     if (proceed) {
47540                         classes = (value || "").match(rnotwhite) || [];
47541
47542                         for (; i < len; i++) {
47543                             elem = this[i];
47544                             // This expression is here for better compressibility (see
47545                             // addClass)
47546                             cur = elem.nodeType === 1 && (elem.className ?
47547                                 (" " + elem.className + " ").replace(rclass, " ") :
47548                                 ""
47549                             );
47550
47551                             if (cur) {
47552                                 j = 0;
47553                                 while ((clazz = classes[j++])) {
47554                                     // Remove *all* instances
47555                                     while (cur.indexOf(" " + clazz + " ") >= 0) {
47556                                         cur = cur.replace(" " + clazz + " ", " ");
47557                                     }
47558                                 }
47559
47560                                 // Only assign if different to avoid unneeded rendering.
47561                                 finalValue = value ? jQuery.trim(cur) : "";
47562                                 if (elem.className !== finalValue) {
47563                                     elem.className = finalValue;
47564                                 }
47565                             }
47566                         }
47567                     }
47568
47569                     return this;
47570                 },
47571
47572                 toggleClass: function(value, stateVal) {
47573                     var type = typeof value;
47574
47575                     if (typeof stateVal === "boolean" && type === "string") {
47576                         return stateVal ? this.addClass(value) : this.removeClass(value);
47577                     }
47578
47579                     if (jQuery.isFunction(value)) {
47580                         return this.each(function(i) {
47581                             jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal);
47582                         });
47583                     }
47584
47585                     return this.each(function() {
47586                         if (type === "string") {
47587                             // Toggle individual class names
47588                             var className,
47589                                 i = 0,
47590                                 self = jQuery(this),
47591                                 classNames = value.match(rnotwhite) || [];
47592
47593                             while ((className = classNames[i++])) {
47594                                 // Check each className given, space separated list
47595                                 if (self.hasClass(className)) {
47596                                     self.removeClass(className);
47597                                 } else {
47598                                     self.addClass(className);
47599                                 }
47600                             }
47601
47602                             // Toggle whole class name
47603                         } else if (type === strundefined || type === "boolean") {
47604                             if (this.className) {
47605                                 // store className if set
47606                                 data_priv.set(this, "__className__", this.className);
47607                             }
47608
47609                             // If the element has a class name or if we're passed `false`,
47610                             // then remove the whole classname (if there was one, the above
47611                             // saved it).
47612                             // Otherwise bring back whatever was previously saved (if
47613                             // anything),
47614                             // falling back to the empty string if nothing was stored.
47615                             this.className = this.className || value === false ? "" : data_priv.get(this, "__className__") || "";
47616                         }
47617                     });
47618                 },
47619
47620                 hasClass: function(selector) {
47621                     var className = " " + selector + " ",
47622                         i = 0,
47623                         l = this.length;
47624                     for (; i < l; i++) {
47625                         if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) {
47626                             return true;
47627                         }
47628                     }
47629
47630                     return false;
47631                 }
47632             });
47633
47634
47635
47636
47637             var rreturn = /\r/g;
47638
47639             jQuery.fn.extend({
47640                 val: function(value) {
47641                     var hooks, ret, isFunction,
47642                         elem = this[0];
47643
47644                     if (!arguments.length) {
47645                         if (elem) {
47646                             hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
47647
47648                             if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
47649                                 return ret;
47650                             }
47651
47652                             ret = elem.value;
47653
47654                             return typeof ret === "string" ?
47655                                 // Handle most common string cases
47656                                 ret.replace(rreturn, "") :
47657                                 // Handle cases where value is null/undef or number
47658                                 ret == null ? "" : ret;
47659                         }
47660
47661                         return;
47662                     }
47663
47664                     isFunction = jQuery.isFunction(value);
47665
47666                     return this.each(function(i) {
47667                         var val;
47668
47669                         if (this.nodeType !== 1) {
47670                             return;
47671                         }
47672
47673                         if (isFunction) {
47674                             val = value.call(this, i, jQuery(this).val());
47675                         } else {
47676                             val = value;
47677                         }
47678
47679                         // Treat null/undefined as ""; convert numbers to string
47680                         if (val == null) {
47681                             val = "";
47682
47683                         } else if (typeof val === "number") {
47684                             val += "";
47685
47686                         } else if (jQuery.isArray(val)) {
47687                             val = jQuery.map(val, function(value) {
47688                                 return value == null ? "" : value + "";
47689                             });
47690                         }
47691
47692                         hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
47693
47694                         // If set returns undefined, fall back to normal setting
47695                         if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) {
47696                             this.value = val;
47697                         }
47698                     });
47699                 }
47700             });
47701
47702             jQuery.extend({
47703                 valHooks: {
47704                     option: {
47705                         get: function(elem) {
47706                             var val = jQuery.find.attr(elem, "value");
47707                             return val != null ?
47708                                 val :
47709                                 // Support: IE10-11+
47710                                 // option.text throws exceptions (#14686, #14858)
47711                                 jQuery.trim(jQuery.text(elem));
47712                         }
47713                     },
47714                     select: {
47715                         get: function(elem) {
47716                             var value, option,
47717                                 options = elem.options,
47718                                 index = elem.selectedIndex,
47719                                 one = elem.type === "select-one" || index < 0,
47720                                 values = one ? null : [],
47721                                 max = one ? index + 1 : options.length,
47722                                 i = index < 0 ?
47723                                 max :
47724                                 one ? index : 0;
47725
47726                             // Loop through all the selected options
47727                             for (; i < max; i++) {
47728                                 option = options[i];
47729
47730                                 // IE6-9 doesn't update selected after form reset (#2551)
47731                                 if ((option.selected || i === index) &&
47732                                     // Don't return options that are disabled or in a
47733                                     // disabled optgroup
47734                                     (support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
47735                                     (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) {
47736
47737                                     // Get the specific value for the option
47738                                     value = jQuery(option).val();
47739
47740                                     // We don't need an array for one selects
47741                                     if (one) {
47742                                         return value;
47743                                     }
47744
47745                                     // Multi-Selects return an array
47746                                     values.push(value);
47747                                 }
47748                             }
47749
47750                             return values;
47751                         },
47752
47753                         set: function(elem, value) {
47754                             var optionSet, option,
47755                                 options = elem.options,
47756                                 values = jQuery.makeArray(value),
47757                                 i = options.length;
47758
47759                             while (i--) {
47760                                 option = options[i];
47761                                 if ((option.selected = jQuery.inArray(option.value, values) >= 0)) {
47762                                     optionSet = true;
47763                                 }
47764                             }
47765
47766                             // Force browsers to behave consistently when non-matching value
47767                             // is set
47768                             if (!optionSet) {
47769                                 elem.selectedIndex = -1;
47770                             }
47771                             return values;
47772                         }
47773                     }
47774                 }
47775             });
47776
47777             // Radios and checkboxes getter/setter
47778             jQuery.each(["radio", "checkbox"], function() {
47779                 jQuery.valHooks[this] = {
47780                     set: function(elem, value) {
47781                         if (jQuery.isArray(value)) {
47782                             return (elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0);
47783                         }
47784                     }
47785                 };
47786                 if (!support.checkOn) {
47787                     jQuery.valHooks[this].get = function(elem) {
47788                         return elem.getAttribute("value") === null ? "on" : elem.value;
47789                     };
47790                 }
47791             });
47792
47793
47794
47795
47796             // Return jQuery for attributes-only inclusion
47797
47798
47799             jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " +
47800                 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
47801                 "change select submit keydown keypress keyup error contextmenu").split(" "), function(i, name) {
47802
47803                 // Handle event binding
47804                 jQuery.fn[name] = function(data, fn) {
47805                     return arguments.length > 0 ?
47806                         this.on(name, null, data, fn) :
47807                         this.trigger(name);
47808                 };
47809             });
47810
47811             jQuery.fn.extend({
47812                 hover: function(fnOver, fnOut) {
47813                     return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
47814                 },
47815
47816                 bind: function(types, data, fn) {
47817                     return this.on(types, null, data, fn);
47818                 },
47819                 unbind: function(types, fn) {
47820                     return this.off(types, null, fn);
47821                 },
47822
47823                 delegate: function(selector, types, data, fn) {
47824                     return this.on(types, selector, data, fn);
47825                 },
47826                 undelegate: function(selector, types, fn) {
47827                     // ( namespace ) or ( selector, types [, fn] )
47828                     return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
47829                 }
47830             });
47831
47832
47833             var nonce = jQuery.now();
47834
47835             var rquery = (/\?/);
47836
47837
47838
47839             // Support: Android 2.3
47840             // Workaround failure to string-cast null input
47841             jQuery.parseJSON = function(data) {
47842                 return JSON.parse(data + "");
47843             };
47844
47845
47846             // Cross-browser xml parsing
47847             jQuery.parseXML = function(data) {
47848                 var xml, tmp;
47849                 if (!data || typeof data !== "string") {
47850                     return null;
47851                 }
47852
47853                 // Support: IE9
47854                 try {
47855                     tmp = new DOMParser();
47856                     xml = tmp.parseFromString(data, "text/xml");
47857                 } catch (e) {
47858                     xml = undefined;
47859                 }
47860
47861                 if (!xml || xml.getElementsByTagName("parsererror").length) {
47862                     jQuery.error("Invalid XML: " + data);
47863                 }
47864                 return xml;
47865             };
47866
47867
47868             var
47869                 rhash = /#.*$/,
47870                 rts = /([?&])_=[^&]*/,
47871                 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
47872                 // #7653, #8125, #8152: local protocol detection
47873                 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
47874                 rnoContent = /^(?:GET|HEAD)$/,
47875                 rprotocol = /^\/\//,
47876                 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
47877
47878                 /*
47879                  * Prefilters 1) They are useful to introduce custom dataTypes (see
47880                  * ajax/jsonp.js for an example) 2) These are called: - BEFORE asking for a
47881                  * transport - AFTER param serialization (s.data is a string if
47882                  * s.processData is true) 3) key is the dataType 4) the catchall symbol "*"
47883                  * can be used 5) execution will start with transport dataType and THEN
47884                  * continue down to "*" if needed
47885                  */
47886                 prefilters = {},
47887
47888                 /*
47889                  * Transports bindings 1) key is the dataType 2) the catchall symbol "*" can
47890                  * be used 3) selection will start with transport dataType and THEN go to
47891                  * "*" if needed
47892                  */
47893                 transports = {},
47894
47895                 // Avoid comment-prolog char sequence (#10098); must appease lint and evade
47896                 // compression
47897                 allTypes = "*/".concat("*"),
47898
47899                 // Document location
47900                 ajaxLocation = window.location.href,
47901
47902                 // Segment location into parts
47903                 ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [];
47904
47905             // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
47906             function addToPrefiltersOrTransports(structure) {
47907
47908                 // dataTypeExpression is optional and defaults to "*"
47909                 return function(dataTypeExpression, func) {
47910
47911                     if (typeof dataTypeExpression !== "string") {
47912                         func = dataTypeExpression;
47913                         dataTypeExpression = "*";
47914                     }
47915
47916                     var dataType,
47917                         i = 0,
47918                         dataTypes = dataTypeExpression.toLowerCase().match(rnotwhite) || [];
47919
47920                     if (jQuery.isFunction(func)) {
47921                         // For each dataType in the dataTypeExpression
47922                         while ((dataType = dataTypes[i++])) {
47923                             // Prepend if requested
47924                             if (dataType[0] === "+") {
47925                                 dataType = dataType.slice(1) || "*";
47926                                 (structure[dataType] = structure[dataType] || []).unshift(func);
47927
47928                                 // Otherwise append
47929                             } else {
47930                                 (structure[dataType] = structure[dataType] || []).push(func);
47931                             }
47932                         }
47933                     }
47934                 };
47935             }
47936
47937             // Base inspection function for prefilters and transports
47938             function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
47939
47940                 var inspected = {},
47941                     seekingTransport = (structure === transports);
47942
47943                 function inspect(dataType) {
47944                     var selected;
47945                     inspected[dataType] = true;
47946                     jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
47947                         var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
47948                         if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
47949                             options.dataTypes.unshift(dataTypeOrTransport);
47950                             inspect(dataTypeOrTransport);
47951                             return false;
47952                         } else if (seekingTransport) {
47953                             return !(selected = dataTypeOrTransport);
47954                         }
47955                     });
47956                     return selected;
47957                 }
47958
47959                 return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
47960             }
47961
47962             // A special extend for ajax options
47963             // that takes "flat" options (not to be deep extended)
47964             // Fixes #9887
47965             function ajaxExtend(target, src) {
47966                 var key, deep,
47967                     flatOptions = jQuery.ajaxSettings.flatOptions || {};
47968
47969                 for (key in src) {
47970                     if (src[key] !== undefined) {
47971                         (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];
47972                     }
47973                 }
47974                 if (deep) {
47975                     jQuery.extend(true, target, deep);
47976                 }
47977
47978                 return target;
47979             }
47980
47981             /*
47982              * Handles responses to an ajax request: - finds the right dataType (mediates
47983              * between content-type and expected dataType) - returns the corresponding
47984              * response
47985              */
47986             function ajaxHandleResponses(s, jqXHR, responses) {
47987
47988                 var ct, type, finalDataType, firstDataType,
47989                     contents = s.contents,
47990                     dataTypes = s.dataTypes;
47991
47992                 // Remove auto dataType and get content-type in the process
47993                 while (dataTypes[0] === "*") {
47994                     dataTypes.shift();
47995                     if (ct === undefined) {
47996                         ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
47997                     }
47998                 }
47999
48000                 // Check if we're dealing with a known content-type
48001                 if (ct) {
48002                     for (type in contents) {
48003                         if (contents[type] && contents[type].test(ct)) {
48004                             dataTypes.unshift(type);
48005                             break;
48006                         }
48007                     }
48008                 }
48009
48010                 // Check to see if we have a response for the expected dataType
48011                 if (dataTypes[0] in responses) {
48012                     finalDataType = dataTypes[0];
48013                 } else {
48014                     // Try convertible dataTypes
48015                     for (type in responses) {
48016                         if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
48017                             finalDataType = type;
48018                             break;
48019                         }
48020                         if (!firstDataType) {
48021                             firstDataType = type;
48022                         }
48023                     }
48024                     // Or just use first one
48025                     finalDataType = finalDataType || firstDataType;
48026                 }
48027
48028                 // If we found a dataType
48029                 // We add the dataType to the list if needed
48030                 // and return the corresponding response
48031                 if (finalDataType) {
48032                     if (finalDataType !== dataTypes[0]) {
48033                         dataTypes.unshift(finalDataType);
48034                     }
48035                     return responses[finalDataType];
48036                 }
48037             }
48038
48039             /*
48040              * Chain conversions given the request and the original response Also sets the
48041              * responseXXX fields on the jqXHR instance
48042              */
48043             function ajaxConvert(s, response, jqXHR, isSuccess) {
48044                 var conv2, current, conv, tmp, prev,
48045                     converters = {},
48046                     // Work with a copy of dataTypes in case we need to modify it for
48047                     // conversion
48048                     dataTypes = s.dataTypes.slice();
48049
48050                 // Create converters map with lowercased keys
48051                 if (dataTypes[1]) {
48052                     for (conv in s.converters) {
48053                         converters[conv.toLowerCase()] = s.converters[conv];
48054                     }
48055                 }
48056
48057                 current = dataTypes.shift();
48058
48059                 // Convert to each sequential dataType
48060                 while (current) {
48061
48062                     if (s.responseFields[current]) {
48063                         jqXHR[s.responseFields[current]] = response;
48064                     }
48065
48066                     // Apply the dataFilter if provided
48067                     if (!prev && isSuccess && s.dataFilter) {
48068                         response = s.dataFilter(response, s.dataType);
48069                     }
48070
48071                     prev = current;
48072                     current = dataTypes.shift();
48073
48074                     if (current) {
48075
48076                         // There's only work to do if current dataType is non-auto
48077                         if (current === "*") {
48078
48079                             current = prev;
48080
48081                             // Convert response if prev dataType is non-auto and differs from
48082                             // current
48083                         } else if (prev !== "*" && prev !== current) {
48084
48085                             // Seek a direct converter
48086                             conv = converters[prev + " " + current] || converters["* " + current];
48087
48088                             // If none found, seek a pair
48089                             if (!conv) {
48090                                 for (conv2 in converters) {
48091
48092                                     // If conv2 outputs current
48093                                     tmp = conv2.split(" ");
48094                                     if (tmp[1] === current) {
48095
48096                                         // If prev can be converted to accepted input
48097                                         conv = converters[prev + " " + tmp[0]] ||
48098                                             converters["* " + tmp[0]];
48099                                         if (conv) {
48100                                             // Condense equivalence converters
48101                                             if (conv === true) {
48102                                                 conv = converters[conv2];
48103
48104                                                 // Otherwise, insert the intermediate dataType
48105                                             } else if (converters[conv2] !== true) {
48106                                                 current = tmp[0];
48107                                                 dataTypes.unshift(tmp[1]);
48108                                             }
48109                                             break;
48110                                         }
48111                                     }
48112                                 }
48113                             }
48114
48115                             // Apply converter (if not an equivalence)
48116                             if (conv !== true) {
48117
48118                                 // Unless errors are allowed to bubble, catch and return
48119                                 // them
48120                                 if (conv && s["throws"]) {
48121                                     response = conv(response);
48122                                 } else {
48123                                     try {
48124                                         response = conv(response);
48125                                     } catch (e) {
48126                                         return {
48127                                             state: "parsererror",
48128                                             error: conv ? e : "No conversion from " + prev + " to " + current
48129                                         };
48130                                     }
48131                                 }
48132                             }
48133                         }
48134                     }
48135                 }
48136
48137                 return {
48138                     state: "success",
48139                     data: response
48140                 };
48141             }
48142
48143             jQuery.extend({
48144
48145                 // Counter for holding the number of active queries
48146                 active: 0,
48147
48148                 // Last-Modified header cache for next request
48149                 lastModified: {},
48150                 etag: {},
48151
48152                 ajaxSettings: {
48153                     url: ajaxLocation,
48154                     type: "GET",
48155                     isLocal: rlocalProtocol.test(ajaxLocParts[1]),
48156                     global: true,
48157                     processData: true,
48158                     async: true,
48159                     contentType: "application/x-www-form-urlencoded; charset=UTF-8",
48160                     /*
48161                      * timeout: 0, data: null, dataType: null, username: null, password:
48162                      * null, cache: null, throws: false, traditional: false, headers: {},
48163                      */
48164
48165                     accepts: {
48166                         "*": allTypes,
48167                         text: "text/plain",
48168                         html: "text/html",
48169                         xml: "application/xml, text/xml",
48170                         json: "application/json, text/javascript"
48171                     },
48172
48173                     contents: {
48174                         xml: /xml/,
48175                         html: /html/,
48176                         json: /json/
48177                     },
48178
48179                     responseFields: {
48180                         xml: "responseXML",
48181                         text: "responseText",
48182                         json: "responseJSON"
48183                     },
48184
48185                     // Data converters
48186                     // Keys separate source (or catchall "*") and destination types with a
48187                     // single space
48188                     converters: {
48189
48190                         // Convert anything to text
48191                         "* text": String,
48192
48193                         // Text to html (true = no transformation)
48194                         "text html": true,
48195
48196                         // Evaluate text as a json expression
48197                         "text json": jQuery.parseJSON,
48198
48199                         // Parse text as xml
48200                         "text xml": jQuery.parseXML
48201                     },
48202
48203                     // For options that shouldn't be deep extended:
48204                     // you can add your own custom options here if
48205                     // and when you create one that shouldn't be
48206                     // deep extended (see ajaxExtend)
48207                     flatOptions: {
48208                         url: true,
48209                         context: true
48210                     }
48211                 },
48212
48213                 // Creates a full fledged settings object into target
48214                 // with both ajaxSettings and settings fields.
48215                 // If target is omitted, writes into ajaxSettings.
48216                 ajaxSetup: function(target, settings) {
48217                     return settings ?
48218
48219                         // Building a settings object
48220                         ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :
48221
48222                         // Extending ajaxSettings
48223                         ajaxExtend(jQuery.ajaxSettings, target);
48224                 },
48225
48226                 ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
48227                 ajaxTransport: addToPrefiltersOrTransports(transports),
48228
48229                 // Main method
48230                 ajax: function(url, options) {
48231
48232                     // If url is an object, simulate pre-1.5 signature
48233                     if (typeof url === "object") {
48234                         options = url;
48235                         url = undefined;
48236                     }
48237
48238                     // Force options to be an object
48239                     options = options || {};
48240
48241                     var transport,
48242                         // URL without anti-cache param
48243                         cacheURL,
48244                         // Response headers
48245                         responseHeadersString,
48246                         responseHeaders,
48247                         // timeout handle
48248                         timeoutTimer,
48249                         // Cross-domain detection vars
48250                         parts,
48251                         // To know if global events are to be dispatched
48252                         fireGlobals,
48253                         // Loop variable
48254                         i,
48255                         // Create the final options object
48256                         s = jQuery.ajaxSetup({}, options),
48257                         // Callbacks context
48258                         callbackContext = s.context || s,
48259                         // Context for global events is callbackContext if it is a DOM node
48260                         // or jQuery collection
48261                         globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ?
48262                         jQuery(callbackContext) :
48263                         jQuery.event,
48264                         // Deferreds
48265                         deferred = jQuery.Deferred(),
48266                         completeDeferred = jQuery.Callbacks("once memory"),
48267                         // Status-dependent callbacks
48268                         statusCode = s.statusCode || {},
48269                         // Headers (they are sent all at once)
48270                         requestHeaders = {},
48271                         requestHeadersNames = {},
48272                         // The jqXHR state
48273                         state = 0,
48274                         // Default abort message
48275                         strAbort = "canceled",
48276                         // Fake xhr
48277                         jqXHR = {
48278                             readyState: 0,
48279
48280                             // Builds headers hashtable if needed
48281                             getResponseHeader: function(key) {
48282                                 var match;
48283                                 if (state === 2) {
48284                                     if (!responseHeaders) {
48285                                         responseHeaders = {};
48286                                         while ((match = rheaders.exec(responseHeadersString))) {
48287                                             responseHeaders[match[1].toLowerCase()] = match[2];
48288                                         }
48289                                     }
48290                                     match = responseHeaders[key.toLowerCase()];
48291                                 }
48292                                 return match == null ? null : match;
48293                             },
48294
48295                             // Raw string
48296                             getAllResponseHeaders: function() {
48297                                 return state === 2 ? responseHeadersString : null;
48298                             },
48299
48300                             // Caches the header
48301                             setRequestHeader: function(name, value) {
48302                                 var lname = name.toLowerCase();
48303                                 if (!state) {
48304                                     name = requestHeadersNames[lname] = requestHeadersNames[lname] || name;
48305                                     requestHeaders[name] = value;
48306                                 }
48307                                 return this;
48308                             },
48309
48310                             // Overrides response content-type header
48311                             overrideMimeType: function(type) {
48312                                 if (!state) {
48313                                     s.mimeType = type;
48314                                 }
48315                                 return this;
48316                             },
48317
48318                             // Status-dependent callbacks
48319                             statusCode: function(map) {
48320                                 var code;
48321                                 if (map) {
48322                                     if (state < 2) {
48323                                         for (code in map) {
48324                                             // Lazy-add the new callback in a way that
48325                                             // preserves old ones
48326                                             statusCode[code] = [statusCode[code], map[code]];
48327                                         }
48328                                     } else {
48329                                         // Execute the appropriate callbacks
48330                                         jqXHR.always(map[jqXHR.status]);
48331                                     }
48332                                 }
48333                                 return this;
48334                             },
48335
48336                             // Cancel the request
48337                             abort: function(statusText) {
48338                                 var finalText = statusText || strAbort;
48339                                 if (transport) {
48340                                     transport.abort(finalText);
48341                                 }
48342                                 done(0, finalText);
48343                                 return this;
48344                             }
48345                         };
48346
48347                     // Attach deferreds
48348                     deferred.promise(jqXHR).complete = completeDeferred.add;
48349                     jqXHR.success = jqXHR.done;
48350                     jqXHR.error = jqXHR.fail;
48351
48352                     // Remove hash character (#7531: and string promotion)
48353                     // Add protocol if not provided (prefilters might expect it)
48354                     // Handle falsy url in the settings object (#10093: consistency with old
48355                     // signature)
48356                     // We also use the url parameter if available
48357                     s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "")
48358                         .replace(rprotocol, ajaxLocParts[1] + "//");
48359
48360                     // Alias method option to type as per ticket #12004
48361                     s.type = options.method || options.type || s.method || s.type;
48362
48363                     // Extract dataTypes list
48364                     s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(rnotwhite) || [""];
48365
48366                     // A cross-domain request is in order when we have a protocol:host:port
48367                     // mismatch
48368                     if (s.crossDomain == null) {
48369                         parts = rurl.exec(s.url.toLowerCase());
48370                         s.crossDomain = !!(parts &&
48371                             (parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] ||
48372                                 (parts[3] || (parts[1] === "http:" ? "80" : "443")) !==
48373                                 (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? "80" : "443")))
48374                         );
48375                     }
48376
48377                     // Convert data if not already a string
48378                     if (s.data && s.processData && typeof s.data !== "string") {
48379                         s.data = jQuery.param(s.data, s.traditional);
48380                     }
48381
48382                     // Apply prefilters
48383                     inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
48384
48385                     // If request was aborted inside a prefilter, stop there
48386                     if (state === 2) {
48387                         return jqXHR;
48388                     }
48389
48390                     // We can fire global events as of now if asked to
48391                     // Don't fire events if jQuery.event is undefined in an AMD-usage
48392                     // scenario (#15118)
48393                     fireGlobals = jQuery.event && s.global;
48394
48395                     // Watch for a new set of requests
48396                     if (fireGlobals && jQuery.active++ === 0) {
48397                         jQuery.event.trigger("ajaxStart");
48398                     }
48399
48400                     // Uppercase the type
48401                     s.type = s.type.toUpperCase();
48402
48403                     // Determine if request has content
48404                     s.hasContent = !rnoContent.test(s.type);
48405
48406                     // Save the URL in case we're toying with the If-Modified-Since
48407                     // and/or If-None-Match header later on
48408                     cacheURL = s.url;
48409
48410                     // More options handling for requests with no content
48411                     if (!s.hasContent) {
48412
48413                         // If data is available, append data to url
48414                         if (s.data) {
48415                             cacheURL = (s.url += (rquery.test(cacheURL) ? "&" : "?") + s.data);
48416                             // #9682: remove data so that it's not used in an eventual retry
48417                             delete s.data;
48418                         }
48419
48420                         // Add anti-cache in url if needed
48421                         if (s.cache === false) {
48422                             s.url = rts.test(cacheURL) ?
48423
48424                                 // If there is already a '_' parameter, set its value
48425                                 cacheURL.replace(rts, "$1_=" + nonce++) :
48426
48427                                 // Otherwise add one to the end
48428                                 cacheURL + (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce++;
48429                         }
48430                     }
48431
48432                     // Set the If-Modified-Since and/or If-None-Match header, if in
48433                     // ifModified mode.
48434                     if (s.ifModified) {
48435                         if (jQuery.lastModified[cacheURL]) {
48436                             jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
48437                         }
48438                         if (jQuery.etag[cacheURL]) {
48439                             jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
48440                         }
48441                     }
48442
48443                     // Set the correct header, if data is being sent
48444                     if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
48445                         jqXHR.setRequestHeader("Content-Type", s.contentType);
48446                     }
48447
48448                     // Set the Accepts header for the server, depending on the dataType
48449                     jqXHR.setRequestHeader(
48450                         "Accept",
48451                         s.dataTypes[0] && s.accepts[s.dataTypes[0]] ?
48452                         s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") :
48453                         s.accepts["*"]
48454                     );
48455
48456                     // Check for headers option
48457                     for (i in s.headers) {
48458                         jqXHR.setRequestHeader(i, s.headers[i]);
48459                     }
48460
48461                     // Allow custom headers/mimetypes and early abort
48462                     if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) {
48463                         // Abort if not done already and return
48464                         return jqXHR.abort();
48465                     }
48466
48467                     // Aborting is no longer a cancellation
48468                     strAbort = "abort";
48469
48470                     // Install callbacks on deferreds
48471                     for (i in {
48472                             success: 1,
48473                             error: 1,
48474                             complete: 1
48475                         }) {
48476                         jqXHR[i](s[i]);
48477                     }
48478
48479                     // Get transport
48480                     transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
48481
48482                     // If no transport, we auto-abort
48483                     if (!transport) {
48484                         done(-1, "No Transport");
48485                     } else {
48486                         jqXHR.readyState = 1;
48487
48488                         // Send global event
48489                         if (fireGlobals) {
48490                             globalEventContext.trigger("ajaxSend", [jqXHR, s]);
48491                         }
48492                         // Timeout
48493                         if (s.async && s.timeout > 0) {
48494                             timeoutTimer = setTimeout(function() {
48495                                 jqXHR.abort("timeout");
48496                             }, s.timeout);
48497                         }
48498
48499                         try {
48500                             state = 1;
48501                             transport.send(requestHeaders, done);
48502                         } catch (e) {
48503                             // Propagate exception as error if not done
48504                             if (state < 2) {
48505                                 done(-1, e);
48506                                 // Simply rethrow otherwise
48507                             } else {
48508                                 throw e;
48509                             }
48510                         }
48511                     }
48512
48513                     // Callback for when everything is done
48514                     function done(status, nativeStatusText, responses, headers) {
48515                         var isSuccess, success, error, response, modified,
48516                             statusText = nativeStatusText;
48517
48518                         // Called once
48519                         if (state === 2) {
48520                             return;
48521                         }
48522
48523                         // State is "done" now
48524                         state = 2;
48525
48526                         // Clear timeout if it exists
48527                         if (timeoutTimer) {
48528                             clearTimeout(timeoutTimer);
48529                         }
48530
48531                         // Dereference transport for early garbage collection
48532                         // (no matter how long the jqXHR object will be used)
48533                         transport = undefined;
48534
48535                         // Cache response headers
48536                         responseHeadersString = headers || "";
48537
48538                         // Set readyState
48539                         jqXHR.readyState = status > 0 ? 4 : 0;
48540
48541                         // Determine if successful
48542                         isSuccess = status >= 200 && status < 300 || status === 304;
48543
48544                         // Get response data
48545                         if (responses) {
48546                             response = ajaxHandleResponses(s, jqXHR, responses);
48547                         }
48548
48549                         // Convert no matter what (that way responseXXX fields are always
48550                         // set)
48551                         response = ajaxConvert(s, response, jqXHR, isSuccess);
48552
48553                         // If successful, handle type chaining
48554                         if (isSuccess) {
48555
48556                             // Set the If-Modified-Since and/or If-None-Match header, if in
48557                             // ifModified mode.
48558                             if (s.ifModified) {
48559                                 modified = jqXHR.getResponseHeader("Last-Modified");
48560                                 if (modified) {
48561                                     jQuery.lastModified[cacheURL] = modified;
48562                                 }
48563                                 modified = jqXHR.getResponseHeader("etag");
48564                                 if (modified) {
48565                                     jQuery.etag[cacheURL] = modified;
48566                                 }
48567                             }
48568
48569                             // if no content
48570                             if (status === 204 || s.type === "HEAD") {
48571                                 statusText = "nocontent";
48572
48573                                 // if not modified
48574                             } else if (status === 304) {
48575                                 statusText = "notmodified";
48576
48577                                 // If we have data, let's convert it
48578                             } else {
48579                                 statusText = response.state;
48580                                 success = response.data;
48581                                 error = response.error;
48582                                 isSuccess = !error;
48583                             }
48584                         } else {
48585                             // Extract error from statusText and normalize for non-aborts
48586                             error = statusText;
48587                             if (status || !statusText) {
48588                                 statusText = "error";
48589                                 if (status < 0) {
48590                                     status = 0;
48591                                 }
48592                             }
48593                         }
48594
48595                         // Set data for the fake xhr object
48596                         jqXHR.status = status;
48597                         jqXHR.statusText = (nativeStatusText || statusText) + "";
48598
48599                         // Success/Error
48600                         if (isSuccess) {
48601                             deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
48602                         } else {
48603                             deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
48604                         }
48605
48606                         // Status-dependent callbacks
48607                         jqXHR.statusCode(statusCode);
48608                         statusCode = undefined;
48609
48610                         if (fireGlobals) {
48611                             globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]);
48612                         }
48613
48614                         // Complete
48615                         completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
48616
48617                         if (fireGlobals) {
48618                             globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
48619                             // Handle the global AJAX counter
48620                             if (!(--jQuery.active)) {
48621                                 jQuery.event.trigger("ajaxStop");
48622                             }
48623                         }
48624                     }
48625
48626                     return jqXHR;
48627                 },
48628
48629                 getJSON: function(url, data, callback) {
48630                     return jQuery.get(url, data, callback, "json");
48631                 },
48632
48633                 getScript: function(url, callback) {
48634                     return jQuery.get(url, undefined, callback, "script");
48635                 }
48636             });
48637
48638             jQuery.each(["get", "post"], function(i, method) {
48639                 jQuery[method] = function(url, data, callback, type) {
48640                     // Shift arguments if data argument was omitted
48641                     if (jQuery.isFunction(data)) {
48642                         type = type || callback;
48643                         callback = data;
48644                         data = undefined;
48645                     }
48646
48647                     return jQuery.ajax({
48648                         url: url,
48649                         type: method,
48650                         dataType: type,
48651                         data: data,
48652                         success: callback
48653                     });
48654                 };
48655             });
48656
48657
48658             jQuery._evalUrl = function(url) {
48659                 return jQuery.ajax({
48660                     url: url,
48661                     type: "GET",
48662                     dataType: "script",
48663                     async: false,
48664                     global: false,
48665                     "throws": true
48666                 });
48667             };
48668
48669
48670             jQuery.fn.extend({
48671                 wrapAll: function(html) {
48672                     var wrap;
48673
48674                     if (jQuery.isFunction(html)) {
48675                         return this.each(function(i) {
48676                             jQuery(this).wrapAll(html.call(this, i));
48677                         });
48678                     }
48679
48680                     if (this[0]) {
48681
48682                         // The elements to wrap the target around
48683                         wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
48684
48685                         if (this[0].parentNode) {
48686                             wrap.insertBefore(this[0]);
48687                         }
48688
48689                         wrap.map(function() {
48690                             var elem = this;
48691
48692                             while (elem.firstElementChild) {
48693                                 elem = elem.firstElementChild;
48694                             }
48695
48696                             return elem;
48697                         }).append(this);
48698                     }
48699
48700                     return this;
48701                 },
48702
48703                 wrapInner: function(html) {
48704                     if (jQuery.isFunction(html)) {
48705                         return this.each(function(i) {
48706                             jQuery(this).wrapInner(html.call(this, i));
48707                         });
48708                     }
48709
48710                     return this.each(function() {
48711                         var self = jQuery(this),
48712                             contents = self.contents();
48713
48714                         if (contents.length) {
48715                             contents.wrapAll(html);
48716
48717                         } else {
48718                             self.append(html);
48719                         }
48720                     });
48721                 },
48722
48723                 wrap: function(html) {
48724                     var isFunction = jQuery.isFunction(html);
48725
48726                     return this.each(function(i) {
48727                         jQuery(this).wrapAll(isFunction ? html.call(this, i) : html);
48728                     });
48729                 },
48730
48731                 unwrap: function() {
48732                     return this.parent().each(function() {
48733                         if (!jQuery.nodeName(this, "body")) {
48734                             jQuery(this).replaceWith(this.childNodes);
48735                         }
48736                     }).end();
48737                 }
48738             });
48739
48740
48741             jQuery.expr.filters.hidden = function(elem) {
48742                 // Support: Opera <= 12.12
48743                 // Opera reports offsetWidths and offsetHeights less than zero on some
48744                 // elements
48745                 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
48746             };
48747             jQuery.expr.filters.visible = function(elem) {
48748                 return !jQuery.expr.filters.hidden(elem);
48749             };
48750
48751
48752
48753
48754             var r20 = /%20/g,
48755                 rbracket = /\[\]$/,
48756                 rCRLF = /\r?\n/g,
48757                 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
48758                 rsubmittable = /^(?:input|select|textarea|keygen)/i;
48759
48760             function buildParams(prefix, obj, traditional, add) {
48761                 var name;
48762
48763                 if (jQuery.isArray(obj)) {
48764                     // Serialize array item.
48765                     jQuery.each(obj, function(i, v) {
48766                         if (traditional || rbracket.test(prefix)) {
48767                             // Treat each array item as a scalar.
48768                             add(prefix, v);
48769
48770                         } else {
48771                             // Item is non-scalar (array or object), encode its numeric
48772                             // index.
48773                             buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add);
48774                         }
48775                     });
48776
48777                 } else if (!traditional && jQuery.type(obj) === "object") {
48778                     // Serialize object item.
48779                     for (name in obj) {
48780                         buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
48781                     }
48782
48783                 } else {
48784                     // Serialize scalar item.
48785                     add(prefix, obj);
48786                 }
48787             }
48788
48789             // Serialize an array of form elements or a set of
48790             // key/values into a query string
48791             jQuery.param = function(a, traditional) {
48792                 var prefix,
48793                     s = [],
48794                     add = function(key, value) {
48795                         // If value is a function, invoke it and return its value
48796                         value = jQuery.isFunction(value) ? value() : (value == null ? "" : value);
48797                         s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
48798                     };
48799
48800                 // Set traditional to true for jQuery <= 1.3.2 behavior.
48801                 if (traditional === undefined) {
48802                     traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
48803                 }
48804
48805                 // If an array was passed in, assume that it is an array of form elements.
48806                 if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) {
48807                     // Serialize the form elements
48808                     jQuery.each(a, function() {
48809                         add(this.name, this.value);
48810                     });
48811
48812                 } else {
48813                     // If traditional, encode the "old" way (the way 1.3.2 or older
48814                     // did it), otherwise encode params recursively.
48815                     for (prefix in a) {
48816                         buildParams(prefix, a[prefix], traditional, add);
48817                     }
48818                 }
48819
48820                 // Return the resulting serialization
48821                 return s.join("&").replace(r20, "+");
48822             };
48823
48824             jQuery.fn.extend({
48825                 serialize: function() {
48826                     return jQuery.param(this.serializeArray());
48827                 },
48828                 serializeArray: function() {
48829                     return this.map(function() {
48830                             // Can add propHook for "elements" to filter or add form elements
48831                             var elements = jQuery.prop(this, "elements");
48832                             return elements ? jQuery.makeArray(elements) : this;
48833                         })
48834                         .filter(function() {
48835                             var type = this.type;
48836
48837                             // Use .is( ":disabled" ) so that fieldset[disabled] works
48838                             return this.name && !jQuery(this).is(":disabled") &&
48839                                 rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&
48840                                 (this.checked || !rcheckableType.test(type));
48841                         })
48842                         .map(function(i, elem) {
48843                             var val = jQuery(this).val();
48844
48845                             return val == null ?
48846                                 null :
48847                                 jQuery.isArray(val) ?
48848                                 jQuery.map(val, function(val) {
48849                                     return {
48850                                         name: elem.name,
48851                                         value: val.replace(rCRLF, "\r\n")
48852                                     };
48853                                 }) : {
48854                                     name: elem.name,
48855                                     value: val.replace(rCRLF, "\r\n")
48856                                 };
48857                         }).get();
48858                 }
48859             });
48860
48861
48862             jQuery.ajaxSettings.xhr = function() {
48863                 try {
48864                     return new XMLHttpRequest();
48865                 } catch (e) {}
48866             };
48867
48868             var xhrId = 0,
48869                 xhrCallbacks = {},
48870                 xhrSuccessStatus = {
48871                     // file protocol always yields status code 0, assume 200
48872                     0: 200,
48873                     // Support: IE9
48874                     // #1450: sometimes IE returns 1223 when it should be 204
48875                     1223: 204
48876                 },
48877                 xhrSupported = jQuery.ajaxSettings.xhr();
48878
48879             // Support: IE9
48880             // Open requests must be manually aborted on unload (#5280)
48881             // See https://support.microsoft.com/kb/2856746 for more info
48882             if (window.attachEvent) {
48883                 window.attachEvent("onunload", function() {
48884                     for (var key in xhrCallbacks) {
48885                         xhrCallbacks[key]();
48886                     }
48887                 });
48888             }
48889
48890             support.cors = !!xhrSupported && ("withCredentials" in xhrSupported);
48891             support.ajax = xhrSupported = !!xhrSupported;
48892
48893             jQuery.ajaxTransport(function(options) {
48894                 var callback;
48895
48896                 // Cross domain only allowed if supported through XMLHttpRequest
48897                 if (support.cors || xhrSupported && !options.crossDomain) {
48898                     return {
48899                         send: function(headers, complete) {
48900                             var i,
48901                                 xhr = options.xhr(),
48902                                 id = ++xhrId;
48903
48904                             xhr.open(options.type, options.url, options.async, options.username, options.password);
48905
48906                             // Apply custom fields if provided
48907                             if (options.xhrFields) {
48908                                 for (i in options.xhrFields) {
48909                                     xhr[i] = options.xhrFields[i];
48910                                 }
48911                             }
48912
48913                             // Override mime type if needed
48914                             if (options.mimeType && xhr.overrideMimeType) {
48915                                 xhr.overrideMimeType(options.mimeType);
48916                             }
48917
48918                             // X-Requested-With header
48919                             // For cross-domain requests, seeing as conditions for a
48920                             // preflight are
48921                             // akin to a jigsaw puzzle, we simply never set it to be sure.
48922                             // (it can always be set on a per-request basis or even using
48923                             // ajaxSetup)
48924                             // For same-domain requests, won't change header if already
48925                             // provided.
48926                             if (!options.crossDomain && !headers["X-Requested-With"]) {
48927                                 headers["X-Requested-With"] = "XMLHttpRequest";
48928                             }
48929
48930                             // Set headers
48931                             for (i in headers) {
48932                                 xhr.setRequestHeader(i, headers[i]);
48933                             }
48934
48935                             // Callback
48936                             callback = function(type) {
48937                                 return function() {
48938                                     if (callback) {
48939                                         delete xhrCallbacks[id];
48940                                         callback = xhr.onload = xhr.onerror = null;
48941
48942                                         if (type === "abort") {
48943                                             xhr.abort();
48944                                         } else if (type === "error") {
48945                                             complete(
48946                                                 // file: protocol always yields status 0;
48947                                                 // see #8605, #14207
48948                                                 xhr.status,
48949                                                 xhr.statusText
48950                                             );
48951                                         } else {
48952                                             complete(
48953                                                 xhrSuccessStatus[xhr.status] || xhr.status,
48954                                                 xhr.statusText,
48955                                                 // Support: IE9
48956                                                 // Accessing binary-data responseText throws
48957                                                 // an exception
48958                                                 // (#11426)
48959                                                 typeof xhr.responseText === "string" ? {
48960                                                     text: xhr.responseText
48961                                                 } : undefined,
48962                                                 xhr.getAllResponseHeaders()
48963                                             );
48964                                         }
48965                                     }
48966                                 };
48967                             };
48968
48969                             // Listen to events
48970                             xhr.onload = callback();
48971                             xhr.onerror = callback("error");
48972
48973                             // Create the abort callback
48974                             callback = xhrCallbacks[id] = callback("abort");
48975
48976                             try {
48977                                 // Do send the request (this may raise an exception)
48978                                 xhr.send(options.hasContent && options.data || null);
48979                             } catch (e) {
48980                                 // #14683: Only rethrow if this hasn't been notified as an
48981                                 // error yet
48982                                 if (callback) {
48983                                     throw e;
48984                                 }
48985                             }
48986                         },
48987
48988                         abort: function() {
48989                             if (callback) {
48990                                 callback();
48991                             }
48992                         }
48993                     };
48994                 }
48995             });
48996
48997
48998
48999
49000             // Install script dataType
49001             jQuery.ajaxSetup({
49002                 accepts: {
49003                     script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
49004                 },
49005                 contents: {
49006                     script: /(?:java|ecma)script/
49007                 },
49008                 converters: {
49009                     "text script": function(text) {
49010                         jQuery.globalEval(text);
49011                         return text;
49012                     }
49013                 }
49014             });
49015
49016             // Handle cache's special case and crossDomain
49017             jQuery.ajaxPrefilter("script", function(s) {
49018                 if (s.cache === undefined) {
49019                     s.cache = false;
49020                 }
49021                 if (s.crossDomain) {
49022                     s.type = "GET";
49023                 }
49024             });
49025
49026             // Bind script tag hack transport
49027             jQuery.ajaxTransport("script", function(s) {
49028                 // This transport only deals with cross domain requests
49029                 if (s.crossDomain) {
49030                     var script, callback;
49031                     return {
49032                         send: function(_, complete) {
49033                             script = jQuery("<script>").prop({
49034                                 async: true,
49035                                 charset: s.scriptCharset,
49036                                 src: s.url
49037                             }).on(
49038                                 "load error",
49039                                 callback = function(evt) {
49040                                     script.remove();
49041                                     callback = null;
49042                                     if (evt) {
49043                                         complete(evt.type === "error" ? 404 : 200, evt.type);
49044                                     }
49045                                 }
49046                             );
49047                             document.head.appendChild(script[0]);
49048                         },
49049                         abort: function() {
49050                             if (callback) {
49051                                 callback();
49052                             }
49053                         }
49054                     };
49055                 }
49056             });
49057
49058
49059
49060
49061             var oldCallbacks = [],
49062                 rjsonp = /(=)\?(?=&|$)|\?\?/;
49063
49064             // Default jsonp settings
49065             jQuery.ajaxSetup({
49066                 jsonp: "callback",
49067                 jsonpCallback: function() {
49068                     var callback = oldCallbacks.pop() || (jQuery.expando + "_" + (nonce++));
49069                     this[callback] = true;
49070                     return callback;
49071                 }
49072             });
49073
49074             // Detect, normalize options and install callbacks for jsonp requests
49075             jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
49076
49077                 var callbackName, overwritten, responseContainer,
49078                     jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ?
49079                         "url" :
49080                         typeof s.data === "string" && !(s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(s.data) && "data"
49081                     );
49082
49083                 // Handle iff the expected data type is "jsonp" or we have a parameter to
49084                 // set
49085                 if (jsonProp || s.dataTypes[0] === "jsonp") {
49086
49087                     // Get callback name, remembering preexisting value associated with it
49088                     callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ?
49089                         s.jsonpCallback() :
49090                         s.jsonpCallback;
49091
49092                     // Insert callback into url or form data
49093                     if (jsonProp) {
49094                         s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
49095                     } else if (s.jsonp !== false) {
49096                         s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
49097                     }
49098
49099                     // Use data converter to retrieve json after script execution
49100                     s.converters["script json"] = function() {
49101                         if (!responseContainer) {
49102                             jQuery.error(callbackName + " was not called");
49103                         }
49104                         return responseContainer[0];
49105                     };
49106
49107                     // force json dataType
49108                     s.dataTypes[0] = "json";
49109
49110                     // Install callback
49111                     overwritten = window[callbackName];
49112                     window[callbackName] = function() {
49113                         responseContainer = arguments;
49114                     };
49115
49116                     // Clean-up function (fires after converters)
49117                     jqXHR.always(function() {
49118                         // Restore preexisting value
49119                         window[callbackName] = overwritten;
49120
49121                         // Save back as free
49122                         if (s[callbackName]) {
49123                             // make sure that re-using the options doesn't screw things
49124                             // around
49125                             s.jsonpCallback = originalSettings.jsonpCallback;
49126
49127                             // save the callback name for future use
49128                             oldCallbacks.push(callbackName);
49129                         }
49130
49131                         // Call if it was a function and we have a response
49132                         if (responseContainer && jQuery.isFunction(overwritten)) {
49133                             overwritten(responseContainer[0]);
49134                         }
49135
49136                         responseContainer = overwritten = undefined;
49137                     });
49138
49139                     // Delegate to script
49140                     return "script";
49141                 }
49142             });
49143
49144
49145
49146
49147             // data: string of html
49148             // context (optional): If specified, the fragment will be created in this
49149             // context, defaults to document
49150             // keepScripts (optional): If true, will include scripts passed in the html
49151             // string
49152             jQuery.parseHTML = function(data, context, keepScripts) {
49153                 if (!data || typeof data !== "string") {
49154                     return null;
49155                 }
49156                 if (typeof context === "boolean") {
49157                     keepScripts = context;
49158                     context = false;
49159                 }
49160                 context = context || document;
49161
49162                 var parsed = rsingleTag.exec(data),
49163                     scripts = !keepScripts && [];
49164
49165                 // Single tag
49166                 if (parsed) {
49167                     return [context.createElement(parsed[1])];
49168                 }
49169
49170                 parsed = jQuery.buildFragment([data], context, scripts);
49171
49172                 if (scripts && scripts.length) {
49173                     jQuery(scripts).remove();
49174                 }
49175
49176                 return jQuery.merge([], parsed.childNodes);
49177             };
49178
49179
49180             // Keep a copy of the old load method
49181             var _load = jQuery.fn.load;
49182
49183             /**
49184              * Load a url into a page
49185              */
49186             jQuery.fn.load = function(url, params, callback) {
49187                 if (typeof url !== "string" && _load) {
49188                     return _load.apply(this, arguments);
49189                 }
49190
49191                 var selector, type, response,
49192                     self = this,
49193                     off = url.indexOf(" ");
49194
49195                 if (off >= 0) {
49196                     selector = jQuery.trim(url.slice(off));
49197                     url = url.slice(0, off);
49198                 }
49199
49200                 // If it's a function
49201                 if (jQuery.isFunction(params)) {
49202
49203                     // We assume that it's the callback
49204                     callback = params;
49205                     params = undefined;
49206
49207                     // Otherwise, build a param string
49208                 } else if (params && typeof params === "object") {
49209                     type = "POST";
49210                 }
49211
49212                 // If we have elements to modify, make the request
49213                 if (self.length > 0) {
49214                     jQuery.ajax({
49215                         url: url,
49216
49217                         // if "type" variable is undefined, then "GET" method will be used
49218                         type: type,
49219                         dataType: "html",
49220                         data: params
49221                     }).done(function(responseText) {
49222
49223                         // Save response for use in complete callback
49224                         response = arguments;
49225
49226                         self.html(selector ?
49227
49228                             // If a selector was specified, locate the right elements in a
49229                             // dummy div
49230                             // Exclude scripts to avoid IE 'Permission Denied' errors
49231                             jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) :
49232
49233                             // Otherwise use the full result
49234                             responseText);
49235
49236                     }).complete(callback && function(jqXHR, status) {
49237                         self.each(callback, response || [jqXHR.responseText, status, jqXHR]);
49238                     });
49239                 }
49240
49241                 return this;
49242             };
49243
49244
49245
49246
49247             // Attach a bunch of functions for handling common AJAX events
49248             jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(i, type) {
49249                 jQuery.fn[type] = function(fn) {
49250                     return this.on(type, fn);
49251                 };
49252             });
49253
49254
49255
49256
49257             jQuery.expr.filters.animated = function(elem) {
49258                 return jQuery.grep(jQuery.timers, function(fn) {
49259                     return elem === fn.elem;
49260                 }).length;
49261             };
49262
49263
49264
49265
49266             var docElem = window.document.documentElement;
49267
49268             /**
49269              * Gets a window from an element
49270              */
49271             function getWindow(elem) {
49272                 return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
49273             }
49274
49275             jQuery.offset = {
49276                 setOffset: function(elem, options, i) {
49277                     var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
49278                         position = jQuery.css(elem, "position"),
49279                         curElem = jQuery(elem),
49280                         props = {};
49281
49282                     // Set position first, in-case top/left are set even on static elem
49283                     if (position === "static") {
49284                         elem.style.position = "relative";
49285                     }
49286
49287                     curOffset = curElem.offset();
49288                     curCSSTop = jQuery.css(elem, "top");
49289                     curCSSLeft = jQuery.css(elem, "left");
49290                     calculatePosition = (position === "absolute" || position === "fixed") &&
49291                         (curCSSTop + curCSSLeft).indexOf("auto") > -1;
49292
49293                     // Need to be able to calculate position if either
49294                     // top or left is auto and position is either absolute or fixed
49295                     if (calculatePosition) {
49296                         curPosition = curElem.position();
49297                         curTop = curPosition.top;
49298                         curLeft = curPosition.left;
49299
49300                     } else {
49301                         curTop = parseFloat(curCSSTop) || 0;
49302                         curLeft = parseFloat(curCSSLeft) || 0;
49303                     }
49304
49305                     if (jQuery.isFunction(options)) {
49306                         options = options.call(elem, i, curOffset);
49307                     }
49308
49309                     if (options.top != null) {
49310                         props.top = (options.top - curOffset.top) + curTop;
49311                     }
49312                     if (options.left != null) {
49313                         props.left = (options.left - curOffset.left) + curLeft;
49314                     }
49315
49316                     if ("using" in options) {
49317                         options.using.call(elem, props);
49318
49319                     } else {
49320                         curElem.css(props);
49321                     }
49322                 }
49323             };
49324
49325             jQuery.fn.extend({
49326                 offset: function(options) {
49327                     if (arguments.length) {
49328                         return options === undefined ?
49329                             this :
49330                             this.each(function(i) {
49331                                 jQuery.offset.setOffset(this, options, i);
49332                             });
49333                     }
49334
49335                     var docElem, win,
49336                         elem = this[0],
49337                         box = {
49338                             top: 0,
49339                             left: 0
49340                         },
49341                         doc = elem && elem.ownerDocument;
49342
49343                     if (!doc) {
49344                         return;
49345                     }
49346
49347                     docElem = doc.documentElement;
49348
49349                     // Make sure it's not a disconnected DOM node
49350                     if (!jQuery.contains(docElem, elem)) {
49351                         return box;
49352                     }
49353
49354                     // Support: BlackBerry 5, iOS 3 (original iPhone)
49355                     // If we don't have gBCR, just use 0,0 rather than error
49356                     if (typeof elem.getBoundingClientRect !== strundefined) {
49357                         box = elem.getBoundingClientRect();
49358                     }
49359                     win = getWindow(doc);
49360                     return {
49361                         top: box.top + win.pageYOffset - docElem.clientTop,
49362                         left: box.left + win.pageXOffset - docElem.clientLeft
49363                     };
49364                 },
49365
49366                 position: function() {
49367                     if (!this[0]) {
49368                         return;
49369                     }
49370
49371                     var offsetParent, offset,
49372                         elem = this[0],
49373                         parentOffset = {
49374                             top: 0,
49375                             left: 0
49376                         };
49377
49378                     // Fixed elements are offset from window (parentOffset = {top:0, left:
49379                     // 0}, because it is its only offset parent
49380                     if (jQuery.css(elem, "position") === "fixed") {
49381                         // Assume getBoundingClientRect is there when computed position is
49382                         // fixed
49383                         offset = elem.getBoundingClientRect();
49384
49385                     } else {
49386                         // Get *real* offsetParent
49387                         offsetParent = this.offsetParent();
49388
49389                         // Get correct offsets
49390                         offset = this.offset();
49391                         if (!jQuery.nodeName(offsetParent[0], "html")) {
49392                             parentOffset = offsetParent.offset();
49393                         }
49394
49395                         // Add offsetParent borders
49396                         parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true);
49397                         parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true);
49398                     }
49399
49400                     // Subtract parent offsets and element margins
49401                     return {
49402                         top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
49403                         left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
49404                     };
49405                 },
49406
49407                 offsetParent: function() {
49408                     return this.map(function() {
49409                         var offsetParent = this.offsetParent || docElem;
49410
49411                         while (offsetParent && (!jQuery.nodeName(offsetParent, "html") && jQuery.css(offsetParent, "position") === "static")) {
49412                             offsetParent = offsetParent.offsetParent;
49413                         }
49414
49415                         return offsetParent || docElem;
49416                     });
49417                 }
49418             });
49419
49420             // Create scrollLeft and scrollTop methods
49421             jQuery.each({
49422                 scrollLeft: "pageXOffset",
49423                 scrollTop: "pageYOffset"
49424             }, function(method, prop) {
49425                 var top = "pageYOffset" === prop;
49426
49427                 jQuery.fn[method] = function(val) {
49428                     return access(this, function(elem, method, val) {
49429                         var win = getWindow(elem);
49430
49431                         if (val === undefined) {
49432                             return win ? win[prop] : elem[method];
49433                         }
49434
49435                         if (win) {
49436                             win.scrollTo(!top ? val : window.pageXOffset,
49437                                 top ? val : window.pageYOffset
49438                             );
49439
49440                         } else {
49441                             elem[method] = val;
49442                         }
49443                     }, method, val, arguments.length, null);
49444                 };
49445             });
49446
49447             // Support: Safari<7+, Chrome<37+
49448             // Add the top/left cssHooks using jQuery.fn.position
49449             // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
49450             // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
49451             // getComputedStyle returns percent when specified for top/left/bottom/right;
49452             // rather than make the css module depend on the offset module, just check for
49453             // it here
49454             jQuery.each(["top", "left"], function(i, prop) {
49455                 jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition,
49456                     function(elem, computed) {
49457                         if (computed) {
49458                             computed = curCSS(elem, prop);
49459                             // If curCSS returns percentage, fallback to offset
49460                             return rnumnonpx.test(computed) ?
49461                                 jQuery(elem).position()[prop] + "px" :
49462                                 computed;
49463                         }
49464                     }
49465                 );
49466             });
49467
49468
49469             // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth
49470             // methods
49471             jQuery.each({
49472                 Height: "height",
49473                 Width: "width"
49474             }, function(name, type) {
49475                 jQuery.each({
49476                     padding: "inner" + name,
49477                     content: type,
49478                     "": "outer" + name
49479                 }, function(defaultExtra, funcName) {
49480                     // Margin is only for outerHeight, outerWidth
49481                     jQuery.fn[funcName] = function(margin, value) {
49482                         var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
49483                             extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
49484
49485                         return access(this, function(elem, type, value) {
49486                             var doc;
49487
49488                             if (jQuery.isWindow(elem)) {
49489                                 // As of 5/8/2012 this will yield incorrect results for
49490                                 // Mobile Safari, but there
49491                                 // isn't a whole lot we can do. See pull request at this URL
49492                                 // for discussion:
49493                                 // https://github.com/jquery/jquery/pull/764
49494                                 return elem.document.documentElement["client" + name];
49495                             }
49496
49497                             // Get document width or height
49498                             if (elem.nodeType === 9) {
49499                                 doc = elem.documentElement;
49500
49501                                 // Either scroll[Width/Height] or offset[Width/Height] or
49502                                 // client[Width/Height],
49503                                 // whichever is greatest
49504                                 return Math.max(
49505                                     elem.body["scroll" + name], doc["scroll" + name],
49506                                     elem.body["offset" + name], doc["offset" + name],
49507                                     doc["client" + name]
49508                                 );
49509                             }
49510
49511                             return value === undefined ?
49512                                 // Get width or height on the element, requesting but not
49513                                 // forcing parseFloat
49514                                 jQuery.css(elem, type, extra) :
49515
49516                                 // Set width or height on the element
49517                                 jQuery.style(elem, type, value, extra);
49518                         }, type, chainable ? margin : undefined, chainable, null);
49519                     };
49520                 });
49521             });
49522
49523
49524             // The number of elements contained in the matched element set
49525             jQuery.fn.size = function() {
49526                 return this.length;
49527             };
49528
49529             jQuery.fn.andSelf = jQuery.fn.addBack;
49530
49531
49532
49533
49534             // Register as a named AMD module, since jQuery can be concatenated with other
49535             // files that may use define, but not via a proper concatenation script that
49536             // understands anonymous AMD modules. A named AMD is safest and most robust
49537             // way to register. Lowercase jquery is used because AMD module names are
49538             // derived from file names, and jQuery is normally delivered in a lowercase
49539             // file name. Do this after creating the global so that if an AMD module wants
49540             // to call noConflict to hide this version of jQuery, it will work.
49541
49542             // Note that for maximum portability, libraries that are not jQuery should
49543             // declare themselves as anonymous modules, and avoid setting a global if an
49544             // AMD loader is present. jQuery is a special case. For more information, see
49545             // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
49546
49547             if (typeof define === "function" && define.amd) {
49548                 define("jquery", [], function() {
49549                     return jQuery;
49550                 });
49551             }
49552
49553
49554
49555
49556             var
49557             // Map over jQuery in case of overwrite
49558                 _jQuery = window.jQuery,
49559
49560                 // Map over the $ in case of overwrite
49561                 _$ = window.$;
49562
49563             jQuery.noConflict = function(deep) {
49564                 if (window.$ === jQuery) {
49565                     window.$ = _$;
49566                 }
49567
49568                 if (deep && window.jQuery === jQuery) {
49569                     window.jQuery = _jQuery;
49570                 }
49571
49572                 return jQuery;
49573             };
49574
49575             // Expose jQuery and $ identifiers, even in AMD
49576             // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
49577             // and CommonJS for browser emulators (#13566)
49578             if (typeof noGlobal === strundefined) {
49579                 window.jQuery = window.$ = jQuery;
49580             }
49581
49582
49583
49584
49585             return jQuery;
49586
49587         }));
49588
49589     }, {}],
49590     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\flatten.js": [function(require, module, exports) {
49591         var baseFlatten = require('../internal/baseFlatten'),
49592             isIterateeCall = require('../internal/isIterateeCall');
49593
49594         /**
49595          * Flattens a nested array. If `isDeep` is `true` the array is recursively
49596          * flattened, otherwise it's only flattened a single level.
49597          * 
49598          * @static
49599          * @memberOf _
49600          * @category Array
49601          * @param {Array}
49602          *            array The array to flatten.
49603          * @param {boolean}
49604          *            [isDeep] Specify a deep flatten.
49605          * @param- {Object} [guard] Enables use as a callback for functions like
49606          *         `_.map`.
49607          * @returns {Array} Returns the new flattened array.
49608          * @example
49609          * 
49610          * _.flatten([1, [2, 3, [4]]]); // => [1, 2, 3, [4]]
49611          *  // using `isDeep` _.flatten([1, [2, 3, [4]]], true); // => [1, 2, 3, 4]
49612          */
49613         function flatten(array, isDeep, guard) {
49614             var length = array ? array.length : 0;
49615             if (guard && isIterateeCall(array, isDeep, guard)) {
49616                 isDeep = false;
49617             }
49618             return length ? baseFlatten(array, isDeep) : [];
49619         }
49620
49621         module.exports = flatten;
49622
49623     }, {
49624         "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
49625         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
49626     }],
49627     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\last.js": [function(require, module, exports) {
49628         /**
49629          * Gets the last element of `array`.
49630          * 
49631          * @static
49632          * @memberOf _
49633          * @category Array
49634          * @param {Array}
49635          *            array The array to query.
49636          * @returns {*} Returns the last element of `array`.
49637          * @example
49638          * 
49639          * _.last([1, 2, 3]); // => 3
49640          */
49641         function last(array) {
49642             var length = array ? array.length : 0;
49643             return length ? array[length - 1] : undefined;
49644         }
49645
49646         module.exports = last;
49647
49648     }, {}],
49649     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\uniq.js": [function(require, module, exports) {
49650         var baseCallback = require('../internal/baseCallback'),
49651             baseUniq = require('../internal/baseUniq'),
49652             isIterateeCall = require('../internal/isIterateeCall'),
49653             sortedUniq = require('../internal/sortedUniq');
49654
49655         /**
49656          * Creates a duplicate-free version of an array, using
49657          * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
49658          * for equality comparisons, in which only the first occurence of each element
49659          * is kept. Providing `true` for `isSorted` performs a faster search algorithm
49660          * for sorted arrays. If an iteratee function is provided it's invoked for each
49661          * element in the array to generate the criterion by which uniqueness is
49662          * computed. The `iteratee` is bound to `thisArg` and invoked with three
49663          * arguments: (value, index, array).
49664          * 
49665          * If a property name is provided for `iteratee` the created `_.property` style
49666          * callback returns the property value of the given element.
49667          * 
49668          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49669          * style callback returns `true` for elements that have a matching property
49670          * value, else `false`.
49671          * 
49672          * If an object is provided for `iteratee` the created `_.matches` style
49673          * callback returns `true` for elements that have the properties of the given
49674          * object, else `false`.
49675          * 
49676          * @static
49677          * @memberOf _
49678          * @alias unique
49679          * @category Array
49680          * @param {Array}
49681          *            array The array to inspect.
49682          * @param {boolean}
49683          *            [isSorted] Specify the array is sorted.
49684          * @param {Function|Object|string}
49685          *            [iteratee] The function invoked per iteration.
49686          * @param {*}
49687          *            [thisArg] The `this` binding of `iteratee`.
49688          * @returns {Array} Returns the new duplicate-value-free array.
49689          * @example
49690          * 
49691          * _.uniq([2, 1, 2]); // => [2, 1]
49692          *  // using `isSorted` _.uniq([1, 1, 2], true); // => [1, 2]
49693          *  // using an iteratee function _.uniq([1, 2.5, 1.5, 2], function(n) { return
49694          * this.floor(n); }, Math); // => [1, 2.5]
49695          *  // using the `_.property` callback shorthand _.uniq([{ 'x': 1 }, { 'x': 2 }, {
49696          * 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }]
49697          */
49698         function uniq(array, isSorted, iteratee, thisArg) {
49699             var length = array ? array.length : 0;
49700             if (!length) {
49701                 return [];
49702             }
49703             if (isSorted != null && typeof isSorted != 'boolean') {
49704                 thisArg = iteratee;
49705                 iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
49706                 isSorted = false;
49707             }
49708             iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);
49709             return (isSorted) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
49710         }
49711
49712         module.exports = uniq;
49713
49714     }, {
49715         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49716         "../internal/baseUniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseUniq.js",
49717         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
49718         "../internal/sortedUniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\sortedUniq.js"
49719     }],
49720     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\unique.js": [function(require, module, exports) {
49721         module.exports = require('./uniq');
49722
49723     }, {
49724         "./uniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\uniq.js"
49725     }],
49726     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\chain\\lodash.js": [function(require, module, exports) {
49727         var LazyWrapper = require('../internal/LazyWrapper'),
49728             LodashWrapper = require('../internal/LodashWrapper'),
49729             baseLodash = require('../internal/baseLodash'),
49730             isArray = require('../lang/isArray'),
49731             isObjectLike = require('../internal/isObjectLike'),
49732             wrapperClone = require('../internal/wrapperClone');
49733
49734         /** Used for native method references. */
49735         var objectProto = Object.prototype;
49736
49737         /** Used to check objects for own properties. */
49738         var hasOwnProperty = objectProto.hasOwnProperty;
49739
49740         /**
49741          * Creates a `lodash` object which wraps `value` to enable implicit chaining.
49742          * Methods that operate on and return arrays, collections, and functions can be
49743          * chained together. Methods that retrieve a single value or may return a
49744          * primitive value will automatically end the chain returning the unwrapped
49745          * value. Explicit chaining may be enabled using `_.chain`. The execution of
49746          * chained methods is lazy, that is, execution is deferred until `_#value` is
49747          * implicitly or explicitly called.
49748          * 
49749          * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
49750          * fusion is an optimization strategy which merge iteratee calls; this can help
49751          * to avoid the creation of intermediate data structures and greatly reduce the
49752          * number of iteratee executions.
49753          * 
49754          * Chaining is supported in custom builds as long as the `_#value` method is
49755          * directly or indirectly included in the build.
49756          * 
49757          * In addition to lodash methods, wrappers have `Array` and `String` methods.
49758          * 
49759          * The wrapper `Array` methods are: `concat`, `join`, `pop`, `push`, `reverse`,
49760          * `shift`, `slice`, `sort`, `splice`, and `unshift`
49761          * 
49762          * The wrapper `String` methods are: `replace` and `split`
49763          * 
49764          * The wrapper methods that support shortcut fusion are: `compact`, `drop`,
49765          * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, `initial`,
49766          * `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, `take`,
49767          * `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, and `where`
49768          * 
49769          * The chainable wrapper methods are: `after`, `ary`, `assign`, `at`, `before`,
49770          * `bind`, `bindAll`, `bindKey`, `callback`, `chain`, `chunk`, `commit`,
49771          * `compact`, `concat`, `constant`, `countBy`, `create`, `curry`, `debounce`,
49772          * `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, `drop`,
49773          * `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`, `flatten`,
49774          * `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`,
49775          * `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`,
49776          * `initial`, `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`,
49777          * `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`,
49778          * `method`, `methodOf`, `mixin`, `modArgs`, `negate`, `omit`, `once`, `pairs`,
49779          * `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`, `property`,
49780          * `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`,
49781          * `rest`, `restParam`, `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`,
49782          * `sortByAll`, `sortByOrder`, `splice`, `spread`, `take`, `takeRight`,
49783          * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`,
49784          * `toPlainObject`, `transform`, `union`, `uniq`, `unshift`, `unzip`,
49785          * `unzipWith`, `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`,
49786          * `zipObject`, `zipWith`
49787          * 
49788          * The wrapper methods that are **not** chainable by default are: `add`,
49789          * `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, `deburr`,
49790          * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
49791          * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
49792          * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
49793          * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
49794          * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
49795          * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
49796          * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
49797          * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
49798          * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
49799          * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
49800          * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
49801          * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
49802          * `unescape`, `uniqueId`, `value`, and `words`
49803          * 
49804          * The wrapper method `sample` will return a wrapped value when `n` is provided,
49805          * otherwise an unwrapped value is returned.
49806          * 
49807          * @name _
49808          * @constructor
49809          * @category Chain
49810          * @param {*}
49811          *            value The value to wrap in a `lodash` instance.
49812          * @returns {Object} Returns the new `lodash` wrapper instance.
49813          * @example
49814          * 
49815          * var wrapped = _([1, 2, 3]);
49816          *  // returns an unwrapped value wrapped.reduce(function(total, n) { return
49817          * total + n; }); // => 6
49818          *  // returns a wrapped value var squares = wrapped.map(function(n) { return n *
49819          * n; });
49820          * 
49821          * _.isArray(squares); // => false
49822          * 
49823          * _.isArray(squares.value()); // => true
49824          */
49825         function lodash(value) {
49826             if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
49827                 if (value instanceof LodashWrapper) {
49828                     return value;
49829                 }
49830                 if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
49831                     return wrapperClone(value);
49832                 }
49833             }
49834             return new LodashWrapper(value);
49835         }
49836
49837         // Ensure wrappers are instances of `baseLodash`.
49838         lodash.prototype = baseLodash.prototype;
49839
49840         module.exports = lodash;
49841
49842     }, {
49843         "../internal/LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
49844         "../internal/LodashWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js",
49845         "../internal/baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js",
49846         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
49847         "../internal/wrapperClone": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\wrapperClone.js",
49848         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49849     }],
49850     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\every.js": [function(require, module, exports) {
49851         var arrayEvery = require('../internal/arrayEvery'),
49852             baseCallback = require('../internal/baseCallback'),
49853             baseEvery = require('../internal/baseEvery'),
49854             isArray = require('../lang/isArray'),
49855             isIterateeCall = require('../internal/isIterateeCall');
49856
49857         /**
49858          * Checks if `predicate` returns truthy for **all** elements of `collection`.
49859          * The predicate is bound to `thisArg` and invoked with three arguments: (value,
49860          * index|key, collection).
49861          * 
49862          * If a property name is provided for `predicate` the created `_.property` style
49863          * callback returns the property value of the given element.
49864          * 
49865          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49866          * style callback returns `true` for elements that have a matching property
49867          * value, else `false`.
49868          * 
49869          * If an object is provided for `predicate` the created `_.matches` style
49870          * callback returns `true` for elements that have the properties of the given
49871          * object, else `false`.
49872          * 
49873          * @static
49874          * @memberOf _
49875          * @alias all
49876          * @category Collection
49877          * @param {Array|Object|string}
49878          *            collection The collection to iterate over.
49879          * @param {Function|Object|string}
49880          *            [predicate=_.identity] The function invoked per iteration.
49881          * @param {*}
49882          *            [thisArg] The `this` binding of `predicate`.
49883          * @returns {boolean} Returns `true` if all elements pass the predicate check,
49884          *          else `false`.
49885          * @example
49886          * 
49887          * _.every([true, 1, null, 'yes'], Boolean); // => false
49888          * 
49889          * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
49890          * 'active': false } ];
49891          *  // using the `_.matches` callback shorthand _.every(users, { 'user':
49892          * 'barney', 'active': false }); // => false
49893          *  // using the `_.matchesProperty` callback shorthand _.every(users, 'active',
49894          * false); // => true
49895          *  // using the `_.property` callback shorthand _.every(users, 'active'); // =>
49896          * false
49897          */
49898         function every(collection, predicate, thisArg) {
49899             var func = isArray(collection) ? arrayEvery : baseEvery;
49900             if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
49901                 predicate = undefined;
49902             }
49903             if (typeof predicate != 'function' || thisArg !== undefined) {
49904                 predicate = baseCallback(predicate, thisArg, 3);
49905             }
49906             return func(collection, predicate);
49907         }
49908
49909         module.exports = every;
49910
49911     }, {
49912         "../internal/arrayEvery": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEvery.js",
49913         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49914         "../internal/baseEvery": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEvery.js",
49915         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
49916         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49917     }],
49918     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js": [function(require, module, exports) {
49919         var arrayFilter = require('../internal/arrayFilter'),
49920             baseCallback = require('../internal/baseCallback'),
49921             baseFilter = require('../internal/baseFilter'),
49922             isArray = require('../lang/isArray');
49923
49924         /**
49925          * Iterates over elements of `collection`, returning an array of all elements
49926          * `predicate` returns truthy for. The predicate is bound to `thisArg` and
49927          * invoked with three arguments: (value, index|key, collection).
49928          * 
49929          * If a property name is provided for `predicate` the created `_.property` style
49930          * callback returns the property value of the given element.
49931          * 
49932          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49933          * style callback returns `true` for elements that have a matching property
49934          * value, else `false`.
49935          * 
49936          * If an object is provided for `predicate` the created `_.matches` style
49937          * callback returns `true` for elements that have the properties of the given
49938          * object, else `false`.
49939          * 
49940          * @static
49941          * @memberOf _
49942          * @alias select
49943          * @category Collection
49944          * @param {Array|Object|string}
49945          *            collection The collection to iterate over.
49946          * @param {Function|Object|string}
49947          *            [predicate=_.identity] The function invoked per iteration.
49948          * @param {*}
49949          *            [thisArg] The `this` binding of `predicate`.
49950          * @returns {Array} Returns the new filtered array.
49951          * @example
49952          * 
49953          * _.filter([4, 5, 6], function(n) { return n % 2 == 0; }); // => [4, 6]
49954          * 
49955          * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
49956          * 'fred', 'age': 40, 'active': false } ];
49957          *  // using the `_.matches` callback shorthand _.pluck(_.filter(users, { 'age':
49958          * 36, 'active': true }), 'user'); // => ['barney']
49959          *  // using the `_.matchesProperty` callback shorthand _.pluck(_.filter(users,
49960          * 'active', false), 'user'); // => ['fred']
49961          *  // using the `_.property` callback shorthand _.pluck(_.filter(users,
49962          * 'active'), 'user'); // => ['barney']
49963          */
49964         function filter(collection, predicate, thisArg) {
49965             var func = isArray(collection) ? arrayFilter : baseFilter;
49966             predicate = baseCallback(predicate, thisArg, 3);
49967             return func(collection, predicate);
49968         }
49969
49970         module.exports = filter;
49971
49972     }, {
49973         "../internal/arrayFilter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayFilter.js",
49974         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49975         "../internal/baseFilter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFilter.js",
49976         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49977     }],
49978     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js": [function(require, module, exports) {
49979         var baseEach = require('../internal/baseEach'),
49980             createFind = require('../internal/createFind');
49981
49982         /**
49983          * Iterates over elements of `collection`, returning the first element
49984          * `predicate` returns truthy for. The predicate is bound to `thisArg` and
49985          * invoked with three arguments: (value, index|key, collection).
49986          * 
49987          * If a property name is provided for `predicate` the created `_.property` style
49988          * callback returns the property value of the given element.
49989          * 
49990          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49991          * style callback returns `true` for elements that have a matching property
49992          * value, else `false`.
49993          * 
49994          * If an object is provided for `predicate` the created `_.matches` style
49995          * callback returns `true` for elements that have the properties of the given
49996          * object, else `false`.
49997          * 
49998          * @static
49999          * @memberOf _
50000          * @alias detect
50001          * @category Collection
50002          * @param {Array|Object|string}
50003          *            collection The collection to search.
50004          * @param {Function|Object|string}
50005          *            [predicate=_.identity] The function invoked per iteration.
50006          * @param {*}
50007          *            [thisArg] The `this` binding of `predicate`.
50008          * @returns {*} Returns the matched element, else `undefined`.
50009          * @example
50010          * 
50011          * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
50012          * 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1,
50013          * 'active': true } ];
50014          * 
50015          * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); // =>
50016          * 'barney'
50017          *  // using the `_.matches` callback shorthand _.result(_.find(users, { 'age':
50018          * 1, 'active': true }), 'user'); // => 'pebbles'
50019          *  // using the `_.matchesProperty` callback shorthand _.result(_.find(users,
50020          * 'active', false), 'user'); // => 'fred'
50021          *  // using the `_.property` callback shorthand _.result(_.find(users,
50022          * 'active'), 'user'); // => 'barney'
50023          */
50024         var find = createFind(baseEach);
50025
50026         module.exports = find;
50027
50028     }, {
50029         "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
50030         "../internal/createFind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createFind.js"
50031     }],
50032     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js": [function(require, module, exports) {
50033         var arrayEach = require('../internal/arrayEach'),
50034             baseEach = require('../internal/baseEach'),
50035             createForEach = require('../internal/createForEach');
50036
50037         /**
50038          * Iterates over elements of `collection` invoking `iteratee` for each element.
50039          * The `iteratee` is bound to `thisArg` and invoked with three arguments:
50040          * (value, index|key, collection). Iteratee functions may exit iteration early
50041          * by explicitly returning `false`.
50042          * 
50043          * **Note:** As with other "Collections" methods, objects with a "length"
50044          * property are iterated like arrays. To avoid this behavior `_.forIn` or
50045          * `_.forOwn` may be used for object iteration.
50046          * 
50047          * @static
50048          * @memberOf _
50049          * @alias each
50050          * @category Collection
50051          * @param {Array|Object|string}
50052          *            collection The collection to iterate over.
50053          * @param {Function}
50054          *            [iteratee=_.identity] The function invoked per iteration.
50055          * @param {*}
50056          *            [thisArg] The `this` binding of `iteratee`.
50057          * @returns {Array|Object|string} Returns `collection`.
50058          * @example
50059          * 
50060          * _([1, 2]).forEach(function(n) { console.log(n); }).value(); // => logs each
50061          * value from left to right and returns the array
50062          * 
50063          * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { console.log(n, key); }); // =>
50064          * logs each value-key pair and returns the object (iteration order is not
50065          * guaranteed)
50066          */
50067         var forEach = createForEach(arrayEach, baseEach);
50068
50069         module.exports = forEach;
50070
50071     }, {
50072         "../internal/arrayEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js",
50073         "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
50074         "../internal/createForEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createForEach.js"
50075     }],
50076     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js": [function(require, module, exports) {
50077         var createAggregator = require('../internal/createAggregator');
50078
50079         /** Used for native method references. */
50080         var objectProto = Object.prototype;
50081
50082         /** Used to check objects for own properties. */
50083         var hasOwnProperty = objectProto.hasOwnProperty;
50084
50085         /**
50086          * Creates an object composed of keys generated from the results of running each
50087          * element of `collection` through `iteratee`. The corresponding value of each
50088          * key is an array of the elements responsible for generating the key. The
50089          * `iteratee` is bound to `thisArg` and invoked with three arguments: (value,
50090          * index|key, collection).
50091          * 
50092          * If a property name is provided for `iteratee` the created `_.property` style
50093          * callback returns the property value of the given element.
50094          * 
50095          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50096          * style callback returns `true` for elements that have a matching property
50097          * value, else `false`.
50098          * 
50099          * If an object is provided for `iteratee` the created `_.matches` style
50100          * callback returns `true` for elements that have the properties of the given
50101          * object, else `false`.
50102          * 
50103          * @static
50104          * @memberOf _
50105          * @category Collection
50106          * @param {Array|Object|string}
50107          *            collection The collection to iterate over.
50108          * @param {Function|Object|string}
50109          *            [iteratee=_.identity] The function invoked per iteration.
50110          * @param {*}
50111          *            [thisArg] The `this` binding of `iteratee`.
50112          * @returns {Object} Returns the composed aggregate object.
50113          * @example
50114          * 
50115          * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
50116          * '4': [4.2], '6': [6.1, 6.4] }
50117          * 
50118          * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
50119          * '4': [4.2], '6': [6.1, 6.4] }
50120          *  // using the `_.property` callback shorthand _.groupBy(['one', 'two',
50121          * 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] }
50122          */
50123         var groupBy = createAggregator(function(result, value, key) {
50124             if (hasOwnProperty.call(result, key)) {
50125                 result[key].push(value);
50126             } else {
50127                 result[key] = [value];
50128             }
50129         });
50130
50131         module.exports = groupBy;
50132
50133     }, {
50134         "../internal/createAggregator": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAggregator.js"
50135     }],
50136     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\includes.js": [function(require, module, exports) {
50137         var baseIndexOf = require('../internal/baseIndexOf'),
50138             getLength = require('../internal/getLength'),
50139             isArray = require('../lang/isArray'),
50140             isIterateeCall = require('../internal/isIterateeCall'),
50141             isLength = require('../internal/isLength'),
50142             isString = require('../lang/isString'),
50143             values = require('../object/values');
50144
50145         /*
50146          * Native method references for those with the same name as other `lodash`
50147          * methods.
50148          */
50149         var nativeMax = Math.max;
50150
50151         /**
50152          * Checks if `target` is in `collection` using
50153          * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
50154          * for equality comparisons. If `fromIndex` is negative, it's used as the offset
50155          * from the end of `collection`.
50156          * 
50157          * @static
50158          * @memberOf _
50159          * @alias contains, include
50160          * @category Collection
50161          * @param {Array|Object|string}
50162          *            collection The collection to search.
50163          * @param {*}
50164          *            target The value to search for.
50165          * @param {number}
50166          *            [fromIndex=0] The index to search from.
50167          * @param- {Object} [guard] Enables use as a callback for functions like
50168          *         `_.reduce`.
50169          * @returns {boolean} Returns `true` if a matching element is found, else
50170          *          `false`.
50171          * @example
50172          * 
50173          * _.includes([1, 2, 3], 1); // => true
50174          * 
50175          * _.includes([1, 2, 3], 1, 2); // => false
50176          * 
50177          * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); // => true
50178          * 
50179          * _.includes('pebbles', 'eb'); // => true
50180          */
50181         function includes(collection, target, fromIndex, guard) {
50182             var length = collection ? getLength(collection) : 0;
50183             if (!isLength(length)) {
50184                 collection = values(collection);
50185                 length = collection.length;
50186             }
50187             if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
50188                 fromIndex = 0;
50189             } else {
50190                 fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
50191             }
50192             return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) : (!!length && baseIndexOf(collection, target, fromIndex) > -1);
50193         }
50194
50195         module.exports = includes;
50196
50197     }, {
50198         "../internal/baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
50199         "../internal/getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
50200         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
50201         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
50202         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
50203         "../lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
50204         "../object/values": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js"
50205     }],
50206     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js": [function(require, module, exports) {
50207         var arrayMap = require('../internal/arrayMap'),
50208             baseCallback = require('../internal/baseCallback'),
50209             baseMap = require('../internal/baseMap'),
50210             isArray = require('../lang/isArray');
50211
50212         /**
50213          * Creates an array of values by running each element in `collection` through
50214          * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
50215          * arguments: (value, index|key, collection).
50216          * 
50217          * If a property name is provided for `iteratee` the created `_.property` style
50218          * callback returns the property value of the given element.
50219          * 
50220          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50221          * style callback returns `true` for elements that have a matching property
50222          * value, else `false`.
50223          * 
50224          * If an object is provided for `iteratee` the created `_.matches` style
50225          * callback returns `true` for elements that have the properties of the given
50226          * object, else `false`.
50227          * 
50228          * Many lodash methods are guarded to work as iteratees for methods like
50229          * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
50230          * 
50231          * The guarded methods are: `ary`, `callback`, `chunk`, `clone`, `create`,
50232          * `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `flatten`,
50233          * `invert`, `max`, `min`, `parseInt`, `slice`, `sortBy`, `take`, `takeRight`,
50234          * `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `random`, `range`,
50235          * `sample`, `some`, `sum`, `uniq`, and `words`
50236          * 
50237          * @static
50238          * @memberOf _
50239          * @alias collect
50240          * @category Collection
50241          * @param {Array|Object|string}
50242          *            collection The collection to iterate over.
50243          * @param {Function|Object|string}
50244          *            [iteratee=_.identity] The function invoked per iteration.
50245          * @param {*}
50246          *            [thisArg] The `this` binding of `iteratee`.
50247          * @returns {Array} Returns the new mapped array.
50248          * @example
50249          * 
50250          * function timesThree(n) { return n * 3; }
50251          * 
50252          * _.map([1, 2], timesThree); // => [3, 6]
50253          * 
50254          * _.map({ 'a': 1, 'b': 2 }, timesThree); // => [3, 6] (iteration order is not
50255          * guaranteed)
50256          * 
50257          * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
50258          *  // using the `_.property` callback shorthand _.map(users, 'user'); // =>
50259          * ['barney', 'fred']
50260          */
50261         function map(collection, iteratee, thisArg) {
50262             var func = isArray(collection) ? arrayMap : baseMap;
50263             iteratee = baseCallback(iteratee, thisArg, 3);
50264             return func(collection, iteratee);
50265         }
50266
50267         module.exports = map;
50268
50269     }, {
50270         "../internal/arrayMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js",
50271         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50272         "../internal/baseMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js",
50273         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
50274     }],
50275     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js": [function(require, module, exports) {
50276         var arrayReduce = require('../internal/arrayReduce'),
50277             baseEach = require('../internal/baseEach'),
50278             createReduce = require('../internal/createReduce');
50279
50280         /**
50281          * Reduces `collection` to a value which is the accumulated result of running
50282          * each element in `collection` through `iteratee`, where each successive
50283          * invocation is supplied the return value of the previous. If `accumulator` is
50284          * not provided the first element of `collection` is used as the initial value.
50285          * The `iteratee` is bound to `thisArg` and invoked with four arguments:
50286          * (accumulator, value, index|key, collection).
50287          * 
50288          * Many lodash methods are guarded to work as iteratees for methods like
50289          * `_.reduce`, `_.reduceRight`, and `_.transform`.
50290          * 
50291          * The guarded methods are: `assign`, `defaults`, `defaultsDeep`, `includes`,
50292          * `merge`, `sortByAll`, and `sortByOrder`
50293          * 
50294          * @static
50295          * @memberOf _
50296          * @alias foldl, inject
50297          * @category Collection
50298          * @param {Array|Object|string}
50299          *            collection The collection to iterate over.
50300          * @param {Function}
50301          *            [iteratee=_.identity] The function invoked per iteration.
50302          * @param {*}
50303          *            [accumulator] The initial value.
50304          * @param {*}
50305          *            [thisArg] The `this` binding of `iteratee`.
50306          * @returns {*} Returns the accumulated value.
50307          * @example
50308          * 
50309          * _.reduce([1, 2], function(total, n) { return total + n; }); // => 3
50310          * 
50311          * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] = n * 3;
50312          * return result; }, {}); // => { 'a': 3, 'b': 6 } (iteration order is not
50313          * guaranteed)
50314          */
50315         var reduce = createReduce(arrayReduce, baseEach);
50316
50317         module.exports = reduce;
50318
50319     }, {
50320         "../internal/arrayReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayReduce.js",
50321         "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
50322         "../internal/createReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createReduce.js"
50323     }],
50324     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\size.js": [function(require, module, exports) {
50325         var getLength = require('../internal/getLength'),
50326             isLength = require('../internal/isLength'),
50327             keys = require('../object/keys');
50328
50329         /**
50330          * Gets the size of `collection` by returning its length for array-like values
50331          * or the number of own enumerable properties for objects.
50332          * 
50333          * @static
50334          * @memberOf _
50335          * @category Collection
50336          * @param {Array|Object|string}
50337          *            collection The collection to inspect.
50338          * @returns {number} Returns the size of `collection`.
50339          * @example
50340          * 
50341          * _.size([1, 2, 3]); // => 3
50342          * 
50343          * _.size({ 'a': 1, 'b': 2 }); // => 2
50344          * 
50345          * _.size('pebbles'); // => 7
50346          */
50347         function size(collection) {
50348             var length = collection ? getLength(collection) : 0;
50349             return isLength(length) ? length : keys(collection).length;
50350         }
50351
50352         module.exports = size;
50353
50354     }, {
50355         "../internal/getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
50356         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
50357         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
50358     }],
50359     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\some.js": [function(require, module, exports) {
50360         var arraySome = require('../internal/arraySome'),
50361             baseCallback = require('../internal/baseCallback'),
50362             baseSome = require('../internal/baseSome'),
50363             isArray = require('../lang/isArray'),
50364             isIterateeCall = require('../internal/isIterateeCall');
50365
50366         /**
50367          * Checks if `predicate` returns truthy for **any** element of `collection`. The
50368          * function returns as soon as it finds a passing value and does not iterate
50369          * over the entire collection. The predicate is bound to `thisArg` and invoked
50370          * with three arguments: (value, index|key, collection).
50371          * 
50372          * If a property name is provided for `predicate` the created `_.property` style
50373          * callback returns the property value of the given element.
50374          * 
50375          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50376          * style callback returns `true` for elements that have a matching property
50377          * value, else `false`.
50378          * 
50379          * If an object is provided for `predicate` the created `_.matches` style
50380          * callback returns `true` for elements that have the properties of the given
50381          * object, else `false`.
50382          * 
50383          * @static
50384          * @memberOf _
50385          * @alias any
50386          * @category Collection
50387          * @param {Array|Object|string}
50388          *            collection The collection to iterate over.
50389          * @param {Function|Object|string}
50390          *            [predicate=_.identity] The function invoked per iteration.
50391          * @param {*}
50392          *            [thisArg] The `this` binding of `predicate`.
50393          * @returns {boolean} Returns `true` if any element passes the predicate check,
50394          *          else `false`.
50395          * @example
50396          * 
50397          * _.some([null, 0, 'yes', false], Boolean); // => true
50398          * 
50399          * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
50400          * 'active': false } ];
50401          *  // using the `_.matches` callback shorthand _.some(users, { 'user':
50402          * 'barney', 'active': false }); // => false
50403          *  // using the `_.matchesProperty` callback shorthand _.some(users, 'active',
50404          * false); // => true
50405          *  // using the `_.property` callback shorthand _.some(users, 'active'); // =>
50406          * true
50407          */
50408         function some(collection, predicate, thisArg) {
50409             var func = isArray(collection) ? arraySome : baseSome;
50410             if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
50411                 predicate = undefined;
50412             }
50413             if (typeof predicate != 'function' || thisArg !== undefined) {
50414                 predicate = baseCallback(predicate, thisArg, 3);
50415             }
50416             return func(collection, predicate);
50417         }
50418
50419         module.exports = some;
50420
50421     }, {
50422         "../internal/arraySome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js",
50423         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50424         "../internal/baseSome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSome.js",
50425         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
50426         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
50427     }],
50428     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\sortBy.js": [function(require, module, exports) {
50429         var baseCallback = require('../internal/baseCallback'),
50430             baseMap = require('../internal/baseMap'),
50431             baseSortBy = require('../internal/baseSortBy'),
50432             compareAscending = require('../internal/compareAscending'),
50433             isIterateeCall = require('../internal/isIterateeCall');
50434
50435         /**
50436          * Creates an array of elements, sorted in ascending order by the results of
50437          * running each element in a collection through `iteratee`. This method performs
50438          * a stable sort, that is, it preserves the original sort order of equal
50439          * elements. The `iteratee` is bound to `thisArg` and invoked with three
50440          * arguments: (value, index|key, collection).
50441          * 
50442          * If a property name is provided for `iteratee` the created `_.property` style
50443          * callback returns the property value of the given element.
50444          * 
50445          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50446          * style callback returns `true` for elements that have a matching property
50447          * value, else `false`.
50448          * 
50449          * If an object is provided for `iteratee` the created `_.matches` style
50450          * callback returns `true` for elements that have the properties of the given
50451          * object, else `false`.
50452          * 
50453          * @static
50454          * @memberOf _
50455          * @category Collection
50456          * @param {Array|Object|string}
50457          *            collection The collection to iterate over.
50458          * @param {Function|Object|string}
50459          *            [iteratee=_.identity] The function invoked per iteration.
50460          * @param {*}
50461          *            [thisArg] The `this` binding of `iteratee`.
50462          * @returns {Array} Returns the new sorted array.
50463          * @example
50464          * 
50465          * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); // => [3, 1, 2]
50466          * 
50467          * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); // => [3, 1,
50468          * 2]
50469          * 
50470          * var users = [ { 'user': 'fred' }, { 'user': 'pebbles' }, { 'user': 'barney' } ];
50471          *  // using the `_.property` callback shorthand _.pluck(_.sortBy(users,
50472          * 'user'), 'user'); // => ['barney', 'fred', 'pebbles']
50473          */
50474         function sortBy(collection, iteratee, thisArg) {
50475             if (collection == null) {
50476                 return [];
50477             }
50478             if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
50479                 iteratee = undefined;
50480             }
50481             var index = -1;
50482             iteratee = baseCallback(iteratee, thisArg, 3);
50483
50484             var result = baseMap(collection, function(value, key, collection) {
50485                 return {
50486                     'criteria': iteratee(value, key, collection),
50487                     'index': ++index,
50488                     'value': value
50489                 };
50490             });
50491             return baseSortBy(result, compareAscending);
50492         }
50493
50494         module.exports = sortBy;
50495
50496     }, {
50497         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50498         "../internal/baseMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js",
50499         "../internal/baseSortBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSortBy.js",
50500         "../internal/compareAscending": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\compareAscending.js",
50501         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
50502     }],
50503     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js": [function(require, module, exports) {
50504         var getNative = require('../internal/getNative');
50505
50506         /*
50507          * Native method references for those with the same name as other `lodash`
50508          * methods.
50509          */
50510         var nativeNow = getNative(Date, 'now');
50511
50512         /**
50513          * Gets the number of milliseconds that have elapsed since the Unix epoch (1
50514          * January 1970 00:00:00 UTC).
50515          * 
50516          * @static
50517          * @memberOf _
50518          * @category Date
50519          * @example
50520          * 
50521          * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // =>
50522          * logs the number of milliseconds it took for the deferred function to be
50523          * invoked
50524          */
50525         var now = nativeNow || function() {
50526             return new Date().getTime();
50527         };
50528
50529         module.exports = now;
50530
50531     }, {
50532         "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
50533     }],
50534     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\bind.js": [function(require, module, exports) {
50535         var createWrapper = require('../internal/createWrapper'),
50536             replaceHolders = require('../internal/replaceHolders'),
50537             restParam = require('./restParam');
50538
50539         /** Used to compose bitmasks for wrapper metadata. */
50540         var BIND_FLAG = 1,
50541             PARTIAL_FLAG = 32;
50542
50543         /**
50544          * Creates a function that invokes `func` with the `this` binding of `thisArg`
50545          * and prepends any additional `_.bind` arguments to those provided to the bound
50546          * function.
50547          * 
50548          * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
50549          * may be used as a placeholder for partially applied arguments.
50550          * 
50551          * **Note:** Unlike native `Function#bind` this method does not set the "length"
50552          * property of bound functions.
50553          * 
50554          * @static
50555          * @memberOf _
50556          * @category Function
50557          * @param {Function}
50558          *            func The function to bind.
50559          * @param {*}
50560          *            thisArg The `this` binding of `func`.
50561          * @param {...*}
50562          *            [partials] The arguments to be partially applied.
50563          * @returns {Function} Returns the new bound function.
50564          * @example
50565          * 
50566          * var greet = function(greeting, punctuation) { return greeting + ' ' +
50567          * this.user + punctuation; };
50568          * 
50569          * var object = { 'user': 'fred' };
50570          * 
50571          * var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!'
50572          *  // using placeholders var bound = _.bind(greet, object, _, '!');
50573          * bound('hi'); // => 'hi fred!'
50574          */
50575         var bind = restParam(function(func, thisArg, partials) {
50576             var bitmask = BIND_FLAG;
50577             if (partials.length) {
50578                 var holders = replaceHolders(partials, bind.placeholder);
50579                 bitmask |= PARTIAL_FLAG;
50580             }
50581             return createWrapper(func, bitmask, thisArg, partials, holders);
50582         });
50583
50584         // Assign default placeholders.
50585         bind.placeholder = {};
50586
50587         module.exports = bind;
50588
50589     }, {
50590         "../internal/createWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createWrapper.js",
50591         "../internal/replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js",
50592         "./restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js"
50593     }],
50594     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js": [function(require, module, exports) {
50595         var isObject = require('../lang/isObject'),
50596             now = require('../date/now');
50597
50598         /** Used as the `TypeError` message for "Functions" methods. */
50599         var FUNC_ERROR_TEXT = 'Expected a function';
50600
50601         /*
50602          * Native method references for those with the same name as other `lodash`
50603          * methods.
50604          */
50605         var nativeMax = Math.max;
50606
50607         /**
50608          * Creates a debounced function that delays invoking `func` until after `wait`
50609          * milliseconds have elapsed since the last time the debounced function was
50610          * invoked. The debounced function comes with a `cancel` method to cancel
50611          * delayed invocations. Provide an options object to indicate that `func` should
50612          * be invoked on the leading and/or trailing edge of the `wait` timeout.
50613          * Subsequent calls to the debounced function return the result of the last
50614          * `func` invocation.
50615          * 
50616          * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
50617          * on the trailing edge of the timeout only if the the debounced function is
50618          * invoked more than once during the `wait` timeout.
50619          * 
50620          * See [David Corbacho's
50621          * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
50622          * for details over the differences between `_.debounce` and `_.throttle`.
50623          * 
50624          * @static
50625          * @memberOf _
50626          * @category Function
50627          * @param {Function}
50628          *            func The function to debounce.
50629          * @param {number}
50630          *            [wait=0] The number of milliseconds to delay.
50631          * @param {Object}
50632          *            [options] The options object.
50633          * @param {boolean}
50634          *            [options.leading=false] Specify invoking on the leading edge of
50635          *            the timeout.
50636          * @param {number}
50637          *            [options.maxWait] The maximum time `func` is allowed to be delayed
50638          *            before it's invoked.
50639          * @param {boolean}
50640          *            [options.trailing=true] Specify invoking on the trailing edge of
50641          *            the timeout.
50642          * @returns {Function} Returns the new debounced function.
50643          * @example
50644          *  // avoid costly calculations while the window size is in flux
50645          * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
50646          *  // invoke `sendMail` when the click event is fired, debouncing subsequent
50647          * calls jQuery('#postbox').on('click', _.debounce(sendMail, 300, { 'leading':
50648          * true, 'trailing': false }));
50649          *  // ensure `batchLog` is invoked once after 1 second of debounced calls var
50650          * source = new EventSource('/stream'); jQuery(source).on('message',
50651          * _.debounce(batchLog, 250, { 'maxWait': 1000 }));
50652          *  // cancel a debounced call var todoChanges = _.debounce(batchLog, 1000);
50653          * Object.observe(models.todo, todoChanges);
50654          * 
50655          * Object.observe(models, function(changes) { if (_.find(changes, { 'user':
50656          * 'todo', 'type': 'delete'})) { todoChanges.cancel(); } }, ['delete']);
50657          *  // ...at some point `models.todo` is changed models.todo.completed = true;
50658          *  // ...before 1 second has passed `models.todo` is deleted // which cancels
50659          * the debounced `todoChanges` call delete models.todo;
50660          */
50661         function debounce(func, wait, options) {
50662             var args,
50663                 maxTimeoutId,
50664                 result,
50665                 stamp,
50666                 thisArg,
50667                 timeoutId,
50668                 trailingCall,
50669                 lastCalled = 0,
50670                 maxWait = false,
50671                 trailing = true;
50672
50673             if (typeof func != 'function') {
50674                 throw new TypeError(FUNC_ERROR_TEXT);
50675             }
50676             wait = wait < 0 ? 0 : (+wait || 0);
50677             if (options === true) {
50678                 var leading = true;
50679                 trailing = false;
50680             } else if (isObject(options)) {
50681                 leading = !!options.leading;
50682                 maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
50683                 trailing = 'trailing' in options ? !!options.trailing : trailing;
50684             }
50685
50686             function cancel() {
50687                 if (timeoutId) {
50688                     clearTimeout(timeoutId);
50689                 }
50690                 if (maxTimeoutId) {
50691                     clearTimeout(maxTimeoutId);
50692                 }
50693                 lastCalled = 0;
50694                 maxTimeoutId = timeoutId = trailingCall = undefined;
50695             }
50696
50697             function complete(isCalled, id) {
50698                 if (id) {
50699                     clearTimeout(id);
50700                 }
50701                 maxTimeoutId = timeoutId = trailingCall = undefined;
50702                 if (isCalled) {
50703                     lastCalled = now();
50704                     result = func.apply(thisArg, args);
50705                     if (!timeoutId && !maxTimeoutId) {
50706                         args = thisArg = undefined;
50707                     }
50708                 }
50709             }
50710
50711             function delayed() {
50712                 var remaining = wait - (now() - stamp);
50713                 if (remaining <= 0 || remaining > wait) {
50714                     complete(trailingCall, maxTimeoutId);
50715                 } else {
50716                     timeoutId = setTimeout(delayed, remaining);
50717                 }
50718             }
50719
50720             function maxDelayed() {
50721                 complete(trailing, timeoutId);
50722             }
50723
50724             function debounced() {
50725                 args = arguments;
50726                 stamp = now();
50727                 thisArg = this;
50728                 trailingCall = trailing && (timeoutId || !leading);
50729
50730                 if (maxWait === false) {
50731                     var leadingCall = leading && !timeoutId;
50732                 } else {
50733                     if (!maxTimeoutId && !leading) {
50734                         lastCalled = stamp;
50735                     }
50736                     var remaining = maxWait - (stamp - lastCalled),
50737                         isCalled = remaining <= 0 || remaining > maxWait;
50738
50739                     if (isCalled) {
50740                         if (maxTimeoutId) {
50741                             maxTimeoutId = clearTimeout(maxTimeoutId);
50742                         }
50743                         lastCalled = stamp;
50744                         result = func.apply(thisArg, args);
50745                     } else if (!maxTimeoutId) {
50746                         maxTimeoutId = setTimeout(maxDelayed, remaining);
50747                     }
50748                 }
50749                 if (isCalled && timeoutId) {
50750                     timeoutId = clearTimeout(timeoutId);
50751                 } else if (!timeoutId && wait !== maxWait) {
50752                     timeoutId = setTimeout(delayed, wait);
50753                 }
50754                 if (leadingCall) {
50755                     isCalled = true;
50756                     result = func.apply(thisArg, args);
50757                 }
50758                 if (isCalled && !timeoutId && !maxTimeoutId) {
50759                     args = thisArg = undefined;
50760                 }
50761                 return result;
50762             }
50763             debounced.cancel = cancel;
50764             return debounced;
50765         }
50766
50767         module.exports = debounce;
50768
50769     }, {
50770         "../date/now": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js",
50771         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
50772     }],
50773     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\defer.js": [function(require, module, exports) {
50774         var baseDelay = require('../internal/baseDelay'),
50775             restParam = require('./restParam');
50776
50777         /**
50778          * Defers invoking the `func` until the current call stack has cleared. Any
50779          * additional arguments are provided to `func` when it's invoked.
50780          * 
50781          * @static
50782          * @memberOf _
50783          * @category Function
50784          * @param {Function}
50785          *            func The function to defer.
50786          * @param {...*}
50787          *            [args] The arguments to invoke the function with.
50788          * @returns {number} Returns the timer id.
50789          * @example
50790          * 
50791          * _.defer(function(text) { console.log(text); }, 'deferred'); // logs
50792          * 'deferred' after one or more milliseconds
50793          */
50794         var defer = restParam(function(func, args) {
50795             return baseDelay(func, 1, args);
50796         });
50797
50798         module.exports = defer;
50799
50800     }, {
50801         "../internal/baseDelay": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDelay.js",
50802         "./restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js"
50803     }],
50804     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js": [function(require, module, exports) {
50805         /** Used as the `TypeError` message for "Functions" methods. */
50806         var FUNC_ERROR_TEXT = 'Expected a function';
50807
50808         /*
50809          * Native method references for those with the same name as other `lodash`
50810          * methods.
50811          */
50812         var nativeMax = Math.max;
50813
50814         /**
50815          * Creates a function that invokes `func` with the `this` binding of the created
50816          * function and arguments from `start` and beyond provided as an array.
50817          * 
50818          * **Note:** This method is based on the [rest
50819          * parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
50820          * 
50821          * @static
50822          * @memberOf _
50823          * @category Function
50824          * @param {Function}
50825          *            func The function to apply a rest parameter to.
50826          * @param {number}
50827          *            [start=func.length-1] The start position of the rest parameter.
50828          * @returns {Function} Returns the new function.
50829          * @example
50830          * 
50831          * var say = _.restParam(function(what, names) { return what + ' ' +
50832          * _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') +
50833          * _.last(names); });
50834          * 
50835          * say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, &
50836          * pebbles'
50837          */
50838         function restParam(func, start) {
50839             if (typeof func != 'function') {
50840                 throw new TypeError(FUNC_ERROR_TEXT);
50841             }
50842             start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
50843             return function() {
50844                 var args = arguments,
50845                     index = -1,
50846                     length = nativeMax(args.length - start, 0),
50847                     rest = Array(length);
50848
50849                 while (++index < length) {
50850                     rest[index] = args[start + index];
50851                 }
50852                 switch (start) {
50853                     case 0:
50854                         return func.call(this, rest);
50855                     case 1:
50856                         return func.call(this, args[0], rest);
50857                     case 2:
50858                         return func.call(this, args[0], args[1], rest);
50859                 }
50860                 var otherArgs = Array(start + 1);
50861                 index = -1;
50862                 while (++index < start) {
50863                     otherArgs[index] = args[index];
50864                 }
50865                 otherArgs[start] = rest;
50866                 return func.apply(this, otherArgs);
50867             };
50868         }
50869
50870         module.exports = restParam;
50871
50872     }, {}],
50873     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\index.js": [function(require, module, exports) {
50874         (function(global) {
50875             /**
50876              * @license lodash 3.10.1 (Custom Build) <https://lodash.com/> Build: `lodash
50877              *          modern -d -o ./index.js` Copyright 2012-2015 The Dojo Foundation
50878              *          <http://dojofoundation.org/> Based on Underscore.js 1.8.3
50879              *          <http://underscorejs.org/LICENSE> Copyright 2009-2015 Jeremy
50880              *          Ashkenas, DocumentCloud and Investigative Reporters & Editors
50881              *          Available under MIT license <https://lodash.com/license>
50882              */
50883             ;
50884             (function() {
50885
50886                 /** Used as a safe reference for `undefined` in pre-ES5 environments. */
50887                 var undefined;
50888
50889                 /** Used as the semantic version number. */
50890                 var VERSION = '3.10.1';
50891
50892                 /** Used to compose bitmasks for wrapper metadata. */
50893                 var BIND_FLAG = 1,
50894                     BIND_KEY_FLAG = 2,
50895                     CURRY_BOUND_FLAG = 4,
50896                     CURRY_FLAG = 8,
50897                     CURRY_RIGHT_FLAG = 16,
50898                     PARTIAL_FLAG = 32,
50899                     PARTIAL_RIGHT_FLAG = 64,
50900                     ARY_FLAG = 128,
50901                     REARG_FLAG = 256;
50902
50903                 /** Used as default options for `_.trunc`. */
50904                 var DEFAULT_TRUNC_LENGTH = 30,
50905                     DEFAULT_TRUNC_OMISSION = '...';
50906
50907                 /** Used to detect when a function becomes hot. */
50908                 var HOT_COUNT = 150,
50909                     HOT_SPAN = 16;
50910
50911                 /** Used as the size to enable large array optimizations. */
50912                 var LARGE_ARRAY_SIZE = 200;
50913
50914                 /** Used to indicate the type of lazy iteratees. */
50915                 var LAZY_FILTER_FLAG = 1,
50916                     LAZY_MAP_FLAG = 2;
50917
50918                 /** Used as the `TypeError` message for "Functions" methods. */
50919                 var FUNC_ERROR_TEXT = 'Expected a function';
50920
50921                 /** Used as the internal argument placeholder. */
50922                 var PLACEHOLDER = '__lodash_placeholder__';
50923
50924                 /** `Object#toString` result references. */
50925                 var argsTag = '[object Arguments]',
50926                     arrayTag = '[object Array]',
50927                     boolTag = '[object Boolean]',
50928                     dateTag = '[object Date]',
50929                     errorTag = '[object Error]',
50930                     funcTag = '[object Function]',
50931                     mapTag = '[object Map]',
50932                     numberTag = '[object Number]',
50933                     objectTag = '[object Object]',
50934                     regexpTag = '[object RegExp]',
50935                     setTag = '[object Set]',
50936                     stringTag = '[object String]',
50937                     weakMapTag = '[object WeakMap]';
50938
50939                 var arrayBufferTag = '[object ArrayBuffer]',
50940                     float32Tag = '[object Float32Array]',
50941                     float64Tag = '[object Float64Array]',
50942                     int8Tag = '[object Int8Array]',
50943                     int16Tag = '[object Int16Array]',
50944                     int32Tag = '[object Int32Array]',
50945                     uint8Tag = '[object Uint8Array]',
50946                     uint8ClampedTag = '[object Uint8ClampedArray]',
50947                     uint16Tag = '[object Uint16Array]',
50948                     uint32Tag = '[object Uint32Array]';
50949
50950                 /** Used to match empty string literals in compiled template source. */
50951                 var reEmptyStringLeading = /\b__p \+= '';/g,
50952                     reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
50953                     reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
50954
50955                 /** Used to match HTML entities and HTML characters. */
50956                 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
50957                     reUnescapedHtml = /[&<>"'`]/g,
50958                     reHasEscapedHtml = RegExp(reEscapedHtml.source),
50959                     reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
50960
50961                 /** Used to match template delimiters. */
50962                 var reEscape = /<%-([\s\S]+?)%>/g,
50963                     reEvaluate = /<%([\s\S]+?)%>/g,
50964                     reInterpolate = /<%=([\s\S]+?)%>/g;
50965
50966                 /** Used to match property names within property paths. */
50967                 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
50968                     reIsPlainProp = /^\w*$/,
50969                     rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
50970
50971                 /**
50972                  * Used to match `RegExp` [syntax
50973                  * characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns) and
50974                  * those outlined by
50975                  * [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).
50976                  */
50977                 var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,
50978                     reHasRegExpChars = RegExp(reRegExpChars.source);
50979
50980                 /**
50981                  * Used to match [combining diacritical
50982                  * marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
50983                  */
50984                 var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
50985
50986                 /** Used to match backslashes in property paths. */
50987                 var reEscapeChar = /\\(\\)?/g;
50988
50989                 /**
50990                  * Used to match [ES template
50991                  * delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components).
50992                  */
50993                 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
50994
50995                 /** Used to match `RegExp` flags from their coerced string values. */
50996                 var reFlags = /\w*$/;
50997
50998                 /** Used to detect hexadecimal string values. */
50999                 var reHasHexPrefix = /^0[xX]/;
51000
51001                 /** Used to detect host constructors (Safari > 5). */
51002                 var reIsHostCtor = /^\[object .+?Constructor\]$/;
51003
51004                 /** Used to detect unsigned integer values. */
51005                 var reIsUint = /^\d+$/;
51006
51007                 /**
51008                  * Used to match latin-1 supplementary letters (excluding mathematical
51009                  * operators).
51010                  */
51011                 var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
51012
51013                 /** Used to ensure capturing order of template delimiters. */
51014                 var reNoMatch = /($^)/;
51015
51016                 /** Used to match unescaped characters in compiled string literals. */
51017                 var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
51018
51019                 /** Used to match words to create compound words. */
51020                 var reWords = (function() {
51021                     var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
51022                         lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
51023
51024                     return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
51025                 }());
51026
51027                 /** Used to assign default `context` object properties. */
51028                 var contextProps = [
51029                     'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
51030                     'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
51031                     'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',
51032                     'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
51033                     'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'
51034                 ];
51035
51036                 /** Used to make template sourceURLs easier to identify. */
51037                 var templateCounter = -1;
51038
51039                 /** Used to identify `toStringTag` values of typed arrays. */
51040                 var typedArrayTags = {};
51041                 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
51042                     typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
51043                     typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
51044                     typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
51045                     typedArrayTags[uint32Tag] = true;
51046                 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
51047                     typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
51048                     typedArrayTags[dateTag] = typedArrayTags[errorTag] =
51049                     typedArrayTags[funcTag] = typedArrayTags[mapTag] =
51050                     typedArrayTags[numberTag] = typedArrayTags[objectTag] =
51051                     typedArrayTags[regexpTag] = typedArrayTags[setTag] =
51052                     typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
51053
51054                 /** Used to identify `toStringTag` values supported by `_.clone`. */
51055                 var cloneableTags = {};
51056                 cloneableTags[argsTag] = cloneableTags[arrayTag] =
51057                     cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
51058                     cloneableTags[dateTag] = cloneableTags[float32Tag] =
51059                     cloneableTags[float64Tag] = cloneableTags[int8Tag] =
51060                     cloneableTags[int16Tag] = cloneableTags[int32Tag] =
51061                     cloneableTags[numberTag] = cloneableTags[objectTag] =
51062                     cloneableTags[regexpTag] = cloneableTags[stringTag] =
51063                     cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
51064                     cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
51065                 cloneableTags[errorTag] = cloneableTags[funcTag] =
51066                     cloneableTags[mapTag] = cloneableTags[setTag] =
51067                     cloneableTags[weakMapTag] = false;
51068
51069                 /** Used to map latin-1 supplementary letters to basic latin letters. */
51070                 var deburredLetters = {
51071                     '\xc0': 'A',
51072                     '\xc1': 'A',
51073                     '\xc2': 'A',
51074                     '\xc3': 'A',
51075                     '\xc4': 'A',
51076                     '\xc5': 'A',
51077                     '\xe0': 'a',
51078                     '\xe1': 'a',
51079                     '\xe2': 'a',
51080                     '\xe3': 'a',
51081                     '\xe4': 'a',
51082                     '\xe5': 'a',
51083                     '\xc7': 'C',
51084                     '\xe7': 'c',
51085                     '\xd0': 'D',
51086                     '\xf0': 'd',
51087                     '\xc8': 'E',
51088                     '\xc9': 'E',
51089                     '\xca': 'E',
51090                     '\xcb': 'E',
51091                     '\xe8': 'e',
51092                     '\xe9': 'e',
51093                     '\xea': 'e',
51094                     '\xeb': 'e',
51095                     '\xcC': 'I',
51096                     '\xcd': 'I',
51097                     '\xce': 'I',
51098                     '\xcf': 'I',
51099                     '\xeC': 'i',
51100                     '\xed': 'i',
51101                     '\xee': 'i',
51102                     '\xef': 'i',
51103                     '\xd1': 'N',
51104                     '\xf1': 'n',
51105                     '\xd2': 'O',
51106                     '\xd3': 'O',
51107                     '\xd4': 'O',
51108                     '\xd5': 'O',
51109                     '\xd6': 'O',
51110                     '\xd8': 'O',
51111                     '\xf2': 'o',
51112                     '\xf3': 'o',
51113                     '\xf4': 'o',
51114                     '\xf5': 'o',
51115                     '\xf6': 'o',
51116                     '\xf8': 'o',
51117                     '\xd9': 'U',
51118                     '\xda': 'U',
51119                     '\xdb': 'U',
51120                     '\xdc': 'U',
51121                     '\xf9': 'u',
51122                     '\xfa': 'u',
51123                     '\xfb': 'u',
51124                     '\xfc': 'u',
51125                     '\xdd': 'Y',
51126                     '\xfd': 'y',
51127                     '\xff': 'y',
51128                     '\xc6': 'Ae',
51129                     '\xe6': 'ae',
51130                     '\xde': 'Th',
51131                     '\xfe': 'th',
51132                     '\xdf': 'ss'
51133                 };
51134
51135                 /** Used to map characters to HTML entities. */
51136                 var htmlEscapes = {
51137                     '&': '&amp;',
51138                     '<': '&lt;',
51139                     '>': '&gt;',
51140                     '"': '&quot;',
51141                     "'": '&#39;',
51142                     '`': '&#96;'
51143                 };
51144
51145                 /** Used to map HTML entities to characters. */
51146                 var htmlUnescapes = {
51147                     '&amp;': '&',
51148                     '&lt;': '<',
51149                     '&gt;': '>',
51150                     '&quot;': '"',
51151                     '&#39;': "'",
51152                     '&#96;': '`'
51153                 };
51154
51155                 /** Used to determine if values are of the language type `Object`. */
51156                 var objectTypes = {
51157                     'function': true,
51158                     'object': true
51159                 };
51160
51161                 /** Used to escape characters for inclusion in compiled regexes. */
51162                 var regexpEscapes = {
51163                     '0': 'x30',
51164                     '1': 'x31',
51165                     '2': 'x32',
51166                     '3': 'x33',
51167                     '4': 'x34',
51168                     '5': 'x35',
51169                     '6': 'x36',
51170                     '7': 'x37',
51171                     '8': 'x38',
51172                     '9': 'x39',
51173                     'A': 'x41',
51174                     'B': 'x42',
51175                     'C': 'x43',
51176                     'D': 'x44',
51177                     'E': 'x45',
51178                     'F': 'x46',
51179                     'a': 'x61',
51180                     'b': 'x62',
51181                     'c': 'x63',
51182                     'd': 'x64',
51183                     'e': 'x65',
51184                     'f': 'x66',
51185                     'n': 'x6e',
51186                     'r': 'x72',
51187                     't': 'x74',
51188                     'u': 'x75',
51189                     'v': 'x76',
51190                     'x': 'x78'
51191                 };
51192
51193                 /** Used to escape characters for inclusion in compiled string literals. */
51194                 var stringEscapes = {
51195                     '\\': '\\',
51196                     "'": "'",
51197                     '\n': 'n',
51198                     '\r': 'r',
51199                     '\u2028': 'u2028',
51200                     '\u2029': 'u2029'
51201                 };
51202
51203                 /** Detect free variable `exports`. */
51204                 var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
51205
51206                 /** Detect free variable `module`. */
51207                 var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
51208
51209                 /** Detect free variable `global` from Node.js. */
51210                 var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
51211
51212                 /** Detect free variable `self`. */
51213                 var freeSelf = objectTypes[typeof self] && self && self.Object && self;
51214
51215                 /** Detect free variable `window`. */
51216                 var freeWindow = objectTypes[typeof window] && window && window.Object && window;
51217
51218                 /** Detect the popular CommonJS extension `module.exports`. */
51219                 var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
51220
51221                 /**
51222                  * Used as a reference to the global object.
51223                  * 
51224                  * The `this` value is used if it's the global object to avoid
51225                  * Greasemonkey's restricted `window` object, otherwise the `window` object
51226                  * is used.
51227                  */
51228                 var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
51229
51230                 /*--------------------------------------------------------------------------*/
51231
51232                 /**
51233                  * The base implementation of `compareAscending` which compares values and
51234                  * sorts them in ascending order without guaranteeing a stable sort.
51235                  * 
51236                  * @private
51237                  * @param {*}
51238                  *            value The value to compare.
51239                  * @param {*}
51240                  *            other The other value to compare.
51241                  * @returns {number} Returns the sort order indicator for `value`.
51242                  */
51243                 function baseCompareAscending(value, other) {
51244                     if (value !== other) {
51245                         var valIsNull = value === null,
51246                             valIsUndef = value === undefined,
51247                             valIsReflexive = value === value;
51248
51249                         var othIsNull = other === null,
51250                             othIsUndef = other === undefined,
51251                             othIsReflexive = other === other;
51252
51253                         if ((value > other && !othIsNull) || !valIsReflexive ||
51254                             (valIsNull && !othIsUndef && othIsReflexive) ||
51255                             (valIsUndef && othIsReflexive)) {
51256                             return 1;
51257                         }
51258                         if ((value < other && !valIsNull) || !othIsReflexive ||
51259                             (othIsNull && !valIsUndef && valIsReflexive) ||
51260                             (othIsUndef && valIsReflexive)) {
51261                             return -1;
51262                         }
51263                     }
51264                     return 0;
51265                 }
51266
51267                 /**
51268                  * The base implementation of `_.findIndex` and `_.findLastIndex` without
51269                  * support for callback shorthands and `this` binding.
51270                  * 
51271                  * @private
51272                  * @param {Array}
51273                  *            array The array to search.
51274                  * @param {Function}
51275                  *            predicate The function invoked per iteration.
51276                  * @param {boolean}
51277                  *            [fromRight] Specify iterating from right to left.
51278                  * @returns {number} Returns the index of the matched value, else `-1`.
51279                  */
51280                 function baseFindIndex(array, predicate, fromRight) {
51281                     var length = array.length,
51282                         index = fromRight ? length : -1;
51283
51284                     while ((fromRight ? index-- : ++index < length)) {
51285                         if (predicate(array[index], index, array)) {
51286                             return index;
51287                         }
51288                     }
51289                     return -1;
51290                 }
51291
51292                 /**
51293                  * The base implementation of `_.indexOf` without support for binary
51294                  * searches.
51295                  * 
51296                  * @private
51297                  * @param {Array}
51298                  *            array The array to search.
51299                  * @param {*}
51300                  *            value The value to search for.
51301                  * @param {number}
51302                  *            fromIndex The index to search from.
51303                  * @returns {number} Returns the index of the matched value, else `-1`.
51304                  */
51305                 function baseIndexOf(array, value, fromIndex) {
51306                     if (value !== value) {
51307                         return indexOfNaN(array, fromIndex);
51308                     }
51309                     var index = fromIndex - 1,
51310                         length = array.length;
51311
51312                     while (++index < length) {
51313                         if (array[index] === value) {
51314                             return index;
51315                         }
51316                     }
51317                     return -1;
51318                 }
51319
51320                 /**
51321                  * The base implementation of `_.isFunction` without support for
51322                  * environments with incorrect `typeof` results.
51323                  * 
51324                  * @private
51325                  * @param {*}
51326                  *            value The value to check.
51327                  * @returns {boolean} Returns `true` if `value` is correctly classified,
51328                  *          else `false`.
51329                  */
51330                 function baseIsFunction(value) {
51331                     // Avoid a Chakra JIT bug in compatibility modes of IE 11.
51332                     // See https://github.com/jashkenas/underscore/issues/1621 for more details.
51333                     return typeof value == 'function' || false;
51334                 }
51335
51336                 /**
51337                  * Converts `value` to a string if it's not one. An empty string is returned
51338                  * for `null` or `undefined` values.
51339                  * 
51340                  * @private
51341                  * @param {*}
51342                  *            value The value to process.
51343                  * @returns {string} Returns the string.
51344                  */
51345                 function baseToString(value) {
51346                     return value == null ? '' : (value + '');
51347                 }
51348
51349                 /**
51350                  * Used by `_.trim` and `_.trimLeft` to get the index of the first character
51351                  * of `string` that is not found in `chars`.
51352                  * 
51353                  * @private
51354                  * @param {string}
51355                  *            string The string to inspect.
51356                  * @param {string}
51357                  *            chars The characters to find.
51358                  * @returns {number} Returns the index of the first character not found in
51359                  *          `chars`.
51360                  */
51361                 function charsLeftIndex(string, chars) {
51362                     var index = -1,
51363                         length = string.length;
51364
51365                     while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
51366                     return index;
51367                 }
51368
51369                 /**
51370                  * Used by `_.trim` and `_.trimRight` to get the index of the last character
51371                  * of `string` that is not found in `chars`.
51372                  * 
51373                  * @private
51374                  * @param {string}
51375                  *            string The string to inspect.
51376                  * @param {string}
51377                  *            chars The characters to find.
51378                  * @returns {number} Returns the index of the last character not found in
51379                  *          `chars`.
51380                  */
51381                 function charsRightIndex(string, chars) {
51382                     var index = string.length;
51383
51384                     while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
51385                     return index;
51386                 }
51387
51388                 /**
51389                  * Used by `_.sortBy` to compare transformed elements of a collection and
51390                  * stable sort them in ascending order.
51391                  * 
51392                  * @private
51393                  * @param {Object}
51394                  *            object The object to compare.
51395                  * @param {Object}
51396                  *            other The other object to compare.
51397                  * @returns {number} Returns the sort order indicator for `object`.
51398                  */
51399                 function compareAscending(object, other) {
51400                     return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
51401                 }
51402
51403                 /**
51404                  * Used by `_.sortByOrder` to compare multiple properties of a value to
51405                  * another and stable sort them.
51406                  * 
51407                  * If `orders` is unspecified, all valuess are sorted in ascending order.
51408                  * Otherwise, a value is sorted in ascending order if its corresponding
51409                  * order is "asc", and descending if "desc".
51410                  * 
51411                  * @private
51412                  * @param {Object}
51413                  *            object The object to compare.
51414                  * @param {Object}
51415                  *            other The other object to compare.
51416                  * @param {boolean[]}
51417                  *            orders The order to sort by for each property.
51418                  * @returns {number} Returns the sort order indicator for `object`.
51419                  */
51420                 function compareMultiple(object, other, orders) {
51421                     var index = -1,
51422                         objCriteria = object.criteria,
51423                         othCriteria = other.criteria,
51424                         length = objCriteria.length,
51425                         ordersLength = orders.length;
51426
51427                     while (++index < length) {
51428                         var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
51429                         if (result) {
51430                             if (index >= ordersLength) {
51431                                 return result;
51432                             }
51433                             var order = orders[index];
51434                             return result * ((order === 'asc' || order === true) ? 1 : -1);
51435                         }
51436                     }
51437                     // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
51438                     // that causes it, under certain circumstances, to provide the same value
51439                     // for
51440                     // `object` and `other`. See
51441                     // https://github.com/jashkenas/underscore/pull/1247
51442                     // for more details.
51443                     //
51444                     // This also ensures a stable sort in V8 and other engines.
51445                     // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
51446                     return object.index - other.index;
51447                 }
51448
51449                 /**
51450                  * Used by `_.deburr` to convert latin-1 supplementary letters to basic
51451                  * latin letters.
51452                  * 
51453                  * @private
51454                  * @param {string}
51455                  *            letter The matched letter to deburr.
51456                  * @returns {string} Returns the deburred letter.
51457                  */
51458                 function deburrLetter(letter) {
51459                     return deburredLetters[letter];
51460                 }
51461
51462                 /**
51463                  * Used by `_.escape` to convert characters to HTML entities.
51464                  * 
51465                  * @private
51466                  * @param {string}
51467                  *            chr The matched character to escape.
51468                  * @returns {string} Returns the escaped character.
51469                  */
51470                 function escapeHtmlChar(chr) {
51471                     return htmlEscapes[chr];
51472                 }
51473
51474                 /**
51475                  * Used by `_.escapeRegExp` to escape characters for inclusion in compiled
51476                  * regexes.
51477                  * 
51478                  * @private
51479                  * @param {string}
51480                  *            chr The matched character to escape.
51481                  * @param {string}
51482                  *            leadingChar The capture group for a leading character.
51483                  * @param {string}
51484                  *            whitespaceChar The capture group for a whitespace character.
51485                  * @returns {string} Returns the escaped character.
51486                  */
51487                 function escapeRegExpChar(chr, leadingChar, whitespaceChar) {
51488                     if (leadingChar) {
51489                         chr = regexpEscapes[chr];
51490                     } else if (whitespaceChar) {
51491                         chr = stringEscapes[chr];
51492                     }
51493                     return '\\' + chr;
51494                 }
51495
51496                 /**
51497                  * Used by `_.template` to escape characters for inclusion in compiled
51498                  * string literals.
51499                  * 
51500                  * @private
51501                  * @param {string}
51502                  *            chr The matched character to escape.
51503                  * @returns {string} Returns the escaped character.
51504                  */
51505                 function escapeStringChar(chr) {
51506                     return '\\' + stringEscapes[chr];
51507                 }
51508
51509                 /**
51510                  * Gets the index at which the first occurrence of `NaN` is found in
51511                  * `array`.
51512                  * 
51513                  * @private
51514                  * @param {Array}
51515                  *            array The array to search.
51516                  * @param {number}
51517                  *            fromIndex The index to search from.
51518                  * @param {boolean}
51519                  *            [fromRight] Specify iterating from right to left.
51520                  * @returns {number} Returns the index of the matched `NaN`, else `-1`.
51521                  */
51522                 function indexOfNaN(array, fromIndex, fromRight) {
51523                     var length = array.length,
51524                         index = fromIndex + (fromRight ? 0 : -1);
51525
51526                     while ((fromRight ? index-- : ++index < length)) {
51527                         var other = array[index];
51528                         if (other !== other) {
51529                             return index;
51530                         }
51531                     }
51532                     return -1;
51533                 }
51534
51535                 /**
51536                  * Checks if `value` is object-like.
51537                  * 
51538                  * @private
51539                  * @param {*}
51540                  *            value The value to check.
51541                  * @returns {boolean} Returns `true` if `value` is object-like, else
51542                  *          `false`.
51543                  */
51544                 function isObjectLike(value) {
51545                     return !!value && typeof value == 'object';
51546                 }
51547
51548                 /**
51549                  * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
51550                  * character code is whitespace.
51551                  * 
51552                  * @private
51553                  * @param {number}
51554                  *            charCode The character code to inspect.
51555                  * @returns {boolean} Returns `true` if `charCode` is whitespace, else
51556                  *          `false`.
51557                  */
51558                 function isSpace(charCode) {
51559                     return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
51560                         (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
51561                 }
51562
51563                 /**
51564                  * Replaces all `placeholder` elements in `array` with an internal
51565                  * placeholder and returns an array of their indexes.
51566                  * 
51567                  * @private
51568                  * @param {Array}
51569                  *            array The array to modify.
51570                  * @param {*}
51571                  *            placeholder The placeholder to replace.
51572                  * @returns {Array} Returns the new array of placeholder indexes.
51573                  */
51574                 function replaceHolders(array, placeholder) {
51575                     var index = -1,
51576                         length = array.length,
51577                         resIndex = -1,
51578                         result = [];
51579
51580                     while (++index < length) {
51581                         if (array[index] === placeholder) {
51582                             array[index] = PLACEHOLDER;
51583                             result[++resIndex] = index;
51584                         }
51585                     }
51586                     return result;
51587                 }
51588
51589                 /**
51590                  * An implementation of `_.uniq` optimized for sorted arrays without support
51591                  * for callback shorthands and `this` binding.
51592                  * 
51593                  * @private
51594                  * @param {Array}
51595                  *            array The array to inspect.
51596                  * @param {Function}
51597                  *            [iteratee] The function invoked per iteration.
51598                  * @returns {Array} Returns the new duplicate-value-free array.
51599                  */
51600                 function sortedUniq(array, iteratee) {
51601                     var seen,
51602                         index = -1,
51603                         length = array.length,
51604                         resIndex = -1,
51605                         result = [];
51606
51607                     while (++index < length) {
51608                         var value = array[index],
51609                             computed = iteratee ? iteratee(value, index, array) : value;
51610
51611                         if (!index || seen !== computed) {
51612                             seen = computed;
51613                             result[++resIndex] = value;
51614                         }
51615                     }
51616                     return result;
51617                 }
51618
51619                 /**
51620                  * Used by `_.trim` and `_.trimLeft` to get the index of the first
51621                  * non-whitespace character of `string`.
51622                  * 
51623                  * @private
51624                  * @param {string}
51625                  *            string The string to inspect.
51626                  * @returns {number} Returns the index of the first non-whitespace
51627                  *          character.
51628                  */
51629                 function trimmedLeftIndex(string) {
51630                     var index = -1,
51631                         length = string.length;
51632
51633                     while (++index < length && isSpace(string.charCodeAt(index))) {}
51634                     return index;
51635                 }
51636
51637                 /**
51638                  * Used by `_.trim` and `_.trimRight` to get the index of the last
51639                  * non-whitespace character of `string`.
51640                  * 
51641                  * @private
51642                  * @param {string}
51643                  *            string The string to inspect.
51644                  * @returns {number} Returns the index of the last non-whitespace character.
51645                  */
51646                 function trimmedRightIndex(string) {
51647                     var index = string.length;
51648
51649                     while (index-- && isSpace(string.charCodeAt(index))) {}
51650                     return index;
51651                 }
51652
51653                 /**
51654                  * Used by `_.unescape` to convert HTML entities to characters.
51655                  * 
51656                  * @private
51657                  * @param {string}
51658                  *            chr The matched character to unescape.
51659                  * @returns {string} Returns the unescaped character.
51660                  */
51661                 function unescapeHtmlChar(chr) {
51662                     return htmlUnescapes[chr];
51663                 }
51664
51665                 /*--------------------------------------------------------------------------*/
51666
51667                 /**
51668                  * Create a new pristine `lodash` function using the given `context` object.
51669                  * 
51670                  * @static
51671                  * @memberOf _
51672                  * @category Utility
51673                  * @param {Object}
51674                  *            [context=root] The context object.
51675                  * @returns {Function} Returns a new `lodash` function.
51676                  * @example
51677                  * 
51678                  * _.mixin({ 'foo': _.constant('foo') });
51679                  * 
51680                  * var lodash = _.runInContext(); lodash.mixin({ 'bar':
51681                  * lodash.constant('bar') });
51682                  * 
51683                  * _.isFunction(_.foo); // => true _.isFunction(_.bar); // => false
51684                  * 
51685                  * lodash.isFunction(lodash.foo); // => false lodash.isFunction(lodash.bar); // =>
51686                  * true
51687                  *  // using `context` to mock `Date#getTime` use in `_.now` var mock =
51688                  * _.runInContext({ 'Date': function() { return { 'getTime': getTimeMock }; }
51689                  * });
51690                  *  // or creating a suped-up `defer` in Node.js var defer =
51691                  * _.runInContext({ 'setTimeout': setImmediate }).defer;
51692                  */
51693                 function runInContext(context) {
51694                     // Avoid issues with some ES3 environments that attempt to use values, named
51695                     // after built-in constructors like `Object`, for the creation of literals.
51696                     // ES5 clears this up by stating that literals must use built-in
51697                     // constructors.
51698                     // See https://es5.github.io/#x11.1.5 for more details.
51699                     context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
51700
51701                     /** Native constructor references. */
51702                     var Array = context.Array,
51703                         Date = context.Date,
51704                         Error = context.Error,
51705                         Function = context.Function,
51706                         Math = context.Math,
51707                         Number = context.Number,
51708                         Object = context.Object,
51709                         RegExp = context.RegExp,
51710                         String = context.String,
51711                         TypeError = context.TypeError;
51712
51713                     /** Used for native method references. */
51714                     var arrayProto = Array.prototype,
51715                         objectProto = Object.prototype,
51716                         stringProto = String.prototype;
51717
51718                     /** Used to resolve the decompiled source of functions. */
51719                     var fnToString = Function.prototype.toString;
51720
51721                     /** Used to check objects for own properties. */
51722                     var hasOwnProperty = objectProto.hasOwnProperty;
51723
51724                     /** Used to generate unique IDs. */
51725                     var idCounter = 0;
51726
51727                     /**
51728                      * Used to resolve the
51729                      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
51730                      * of values.
51731                      */
51732                     var objToString = objectProto.toString;
51733
51734                     /** Used to restore the original `_` reference in `_.noConflict`. */
51735                     var oldDash = root._;
51736
51737                     /** Used to detect if a method is native. */
51738                     var reIsNative = RegExp('^' +
51739                         fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
51740                         .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
51741                     );
51742
51743                     /** Native method references. */
51744                     var ArrayBuffer = context.ArrayBuffer,
51745                         clearTimeout = context.clearTimeout,
51746                         parseFloat = context.parseFloat,
51747                         pow = Math.pow,
51748                         propertyIsEnumerable = objectProto.propertyIsEnumerable,
51749                         Set = getNative(context, 'Set'),
51750                         setTimeout = context.setTimeout,
51751                         splice = arrayProto.splice,
51752                         Uint8Array = context.Uint8Array,
51753                         WeakMap = getNative(context, 'WeakMap');
51754
51755                     /*
51756                      * Native method references for those with the same name as other `lodash`
51757                      * methods.
51758                      */
51759                     var nativeCeil = Math.ceil,
51760                         nativeCreate = getNative(Object, 'create'),
51761                         nativeFloor = Math.floor,
51762                         nativeIsArray = getNative(Array, 'isArray'),
51763                         nativeIsFinite = context.isFinite,
51764                         nativeKeys = getNative(Object, 'keys'),
51765                         nativeMax = Math.max,
51766                         nativeMin = Math.min,
51767                         nativeNow = getNative(Date, 'now'),
51768                         nativeParseInt = context.parseInt,
51769                         nativeRandom = Math.random;
51770
51771                     /** Used as references for `-Infinity` and `Infinity`. */
51772                     var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
51773                         POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
51774
51775                     /** Used as references for the maximum length and index of an array. */
51776                     var MAX_ARRAY_LENGTH = 4294967295,
51777                         MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
51778                         HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
51779
51780                     /**
51781                      * Used as the [maximum
51782                      * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
51783                      * of an array-like value.
51784                      */
51785                     var MAX_SAFE_INTEGER = 9007199254740991;
51786
51787                     /** Used to store function metadata. */
51788                     var metaMap = WeakMap && new WeakMap;
51789
51790                     /** Used to lookup unminified function names. */
51791                     var realNames = {};
51792
51793                     /*------------------------------------------------------------------------*/
51794
51795                     /**
51796                      * Creates a `lodash` object which wraps `value` to enable implicit
51797                      * chaining. Methods that operate on and return arrays, collections, and
51798                      * functions can be chained together. Methods that retrieve a single value
51799                      * or may return a primitive value will automatically end the chain
51800                      * returning the unwrapped value. Explicit chaining may be enabled using
51801                      * `_.chain`. The execution of chained methods is lazy, that is, execution
51802                      * is deferred until `_#value` is implicitly or explicitly called.
51803                      * 
51804                      * Lazy evaluation allows several methods to support shortcut fusion.
51805                      * Shortcut fusion is an optimization strategy which merge iteratee calls;
51806                      * this can help to avoid the creation of intermediate data structures and
51807                      * greatly reduce the number of iteratee executions.
51808                      * 
51809                      * Chaining is supported in custom builds as long as the `_#value` method is
51810                      * directly or indirectly included in the build.
51811                      * 
51812                      * In addition to lodash methods, wrappers have `Array` and `String`
51813                      * methods.
51814                      * 
51815                      * The wrapper `Array` methods are: `concat`, `join`, `pop`, `push`,
51816                      * `reverse`, `shift`, `slice`, `sort`, `splice`, and `unshift`
51817                      * 
51818                      * The wrapper `String` methods are: `replace` and `split`
51819                      * 
51820                      * The wrapper methods that support shortcut fusion are: `compact`, `drop`,
51821                      * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, `initial`,
51822                      * `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, `take`,
51823                      * `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, and `where`
51824                      * 
51825                      * The chainable wrapper methods are: `after`, `ary`, `assign`, `at`,
51826                      * `before`, `bind`, `bindAll`, `bindKey`, `callback`, `chain`, `chunk`,
51827                      * `commit`, `compact`, `concat`, `constant`, `countBy`, `create`, `curry`,
51828                      * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
51829                      * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`,
51830                      * `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`,
51831                      * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`,
51832                      * `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
51833                      * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
51834                      * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `modArgs`, `negate`,
51835                      * `omit`, `once`, `pairs`, `partial`, `partialRight`, `partition`, `pick`,
51836                      * `plant`, `pluck`, `property`, `propertyOf`, `pull`, `pullAt`, `push`,
51837                      * `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, `reverse`,
51838                      * `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`,
51839                      * `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`,
51840                      * `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
51841                      * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
51842                      * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`,
51843                      * `zipWith`
51844                      * 
51845                      * The wrapper methods that are **not** chainable by default are: `add`,
51846                      * `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
51847                      * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`,
51848                      * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`,
51849                      * `findWhere`, `first`, `floor`, `get`, `gt`, `gte`, `has`, `identity`,
51850                      * `includes`, `indexOf`, `inRange`, `isArguments`, `isArray`, `isBoolean`,
51851                      * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`
51852                      * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`,
51853                      * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`,
51854                      * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`,
51855                      * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`,
51856                      * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`,
51857                      * `round`, `runInContext`, `shift`, `size`, `snakeCase`, `some`,
51858                      * `sortedIndex`, `sortedLastIndex`, `startCase`, `startsWith`, `sum`,
51859                      * `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`,
51860                      * `uniqueId`, `value`, and `words`
51861                      * 
51862                      * The wrapper method `sample` will return a wrapped value when `n` is
51863                      * provided, otherwise an unwrapped value is returned.
51864                      * 
51865                      * @name _
51866                      * @constructor
51867                      * @category Chain
51868                      * @param {*}
51869                      *            value The value to wrap in a `lodash` instance.
51870                      * @returns {Object} Returns the new `lodash` wrapper instance.
51871                      * @example
51872                      * 
51873                      * var wrapped = _([1, 2, 3]);
51874                      *  // returns an unwrapped value wrapped.reduce(function(total, n) { return
51875                      * total + n; }); // => 6
51876                      *  // returns a wrapped value var squares = wrapped.map(function(n) {
51877                      * return n * n; });
51878                      * 
51879                      * _.isArray(squares); // => false
51880                      * 
51881                      * _.isArray(squares.value()); // => true
51882                      */
51883                     function lodash(value) {
51884                         if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
51885                             if (value instanceof LodashWrapper) {
51886                                 return value;
51887                             }
51888                             if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
51889                                 return wrapperClone(value);
51890                             }
51891                         }
51892                         return new LodashWrapper(value);
51893                     }
51894
51895                     /**
51896                      * The function whose prototype all chaining wrappers inherit from.
51897                      * 
51898                      * @private
51899                      */
51900                     function baseLodash() {
51901                         // No operation performed.
51902                     }
51903
51904                     /**
51905                      * The base constructor for creating `lodash` wrapper objects.
51906                      * 
51907                      * @private
51908                      * @param {*}
51909                      *            value The value to wrap.
51910                      * @param {boolean}
51911                      *            [chainAll] Enable chaining for all wrapper methods.
51912                      * @param {Array}
51913                      *            [actions=[]] Actions to peform to resolve the unwrapped value.
51914                      */
51915                     function LodashWrapper(value, chainAll, actions) {
51916                         this.__wrapped__ = value;
51917                         this.__actions__ = actions || [];
51918                         this.__chain__ = !!chainAll;
51919                     }
51920
51921                     /**
51922                      * An object environment feature flags.
51923                      * 
51924                      * @static
51925                      * @memberOf _
51926                      * @type Object
51927                      */
51928                     var support = lodash.support = {};
51929
51930                     /**
51931                      * By default, the template delimiters used by lodash are like those in
51932                      * embedded Ruby (ERB). Change the following template settings to use
51933                      * alternative delimiters.
51934                      * 
51935                      * @static
51936                      * @memberOf _
51937                      * @type Object
51938                      */
51939                     lodash.templateSettings = {
51940
51941                         /**
51942                          * Used to detect `data` property values to be HTML-escaped.
51943                          * 
51944                          * @memberOf _.templateSettings
51945                          * @type RegExp
51946                          */
51947                         'escape': reEscape,
51948
51949                         /**
51950                          * Used to detect code to be evaluated.
51951                          * 
51952                          * @memberOf _.templateSettings
51953                          * @type RegExp
51954                          */
51955                         'evaluate': reEvaluate,
51956
51957                         /**
51958                          * Used to detect `data` property values to inject.
51959                          * 
51960                          * @memberOf _.templateSettings
51961                          * @type RegExp
51962                          */
51963                         'interpolate': reInterpolate,
51964
51965                         /**
51966                          * Used to reference the data object in the template text.
51967                          * 
51968                          * @memberOf _.templateSettings
51969                          * @type string
51970                          */
51971                         'variable': '',
51972
51973                         /**
51974                          * Used to import variables into the compiled template.
51975                          * 
51976                          * @memberOf _.templateSettings
51977                          * @type Object
51978                          */
51979                         'imports': {
51980
51981                             /**
51982                              * A reference to the `lodash` function.
51983                              * 
51984                              * @memberOf _.templateSettings.imports
51985                              * @type Function
51986                              */
51987                             '_': lodash
51988                         }
51989                     };
51990
51991                     /*------------------------------------------------------------------------*/
51992
51993                     /**
51994                      * Creates a lazy wrapper object which wraps `value` to enable lazy
51995                      * evaluation.
51996                      * 
51997                      * @private
51998                      * @param {*}
51999                      *            value The value to wrap.
52000                      */
52001                     function LazyWrapper(value) {
52002                         this.__wrapped__ = value;
52003                         this.__actions__ = [];
52004                         this.__dir__ = 1;
52005                         this.__filtered__ = false;
52006                         this.__iteratees__ = [];
52007                         this.__takeCount__ = POSITIVE_INFINITY;
52008                         this.__views__ = [];
52009                     }
52010
52011                     /**
52012                      * Creates a clone of the lazy wrapper object.
52013                      * 
52014                      * @private
52015                      * @name clone
52016                      * @memberOf LazyWrapper
52017                      * @returns {Object} Returns the cloned `LazyWrapper` object.
52018                      */
52019                     function lazyClone() {
52020                         var result = new LazyWrapper(this.__wrapped__);
52021                         result.__actions__ = arrayCopy(this.__actions__);
52022                         result.__dir__ = this.__dir__;
52023                         result.__filtered__ = this.__filtered__;
52024                         result.__iteratees__ = arrayCopy(this.__iteratees__);
52025                         result.__takeCount__ = this.__takeCount__;
52026                         result.__views__ = arrayCopy(this.__views__);
52027                         return result;
52028                     }
52029
52030                     /**
52031                      * Reverses the direction of lazy iteration.
52032                      * 
52033                      * @private
52034                      * @name reverse
52035                      * @memberOf LazyWrapper
52036                      * @returns {Object} Returns the new reversed `LazyWrapper` object.
52037                      */
52038                     function lazyReverse() {
52039                         if (this.__filtered__) {
52040                             var result = new LazyWrapper(this);
52041                             result.__dir__ = -1;
52042                             result.__filtered__ = true;
52043                         } else {
52044                             result = this.clone();
52045                             result.__dir__ *= -1;
52046                         }
52047                         return result;
52048                     }
52049
52050                     /**
52051                      * Extracts the unwrapped value from its lazy wrapper.
52052                      * 
52053                      * @private
52054                      * @name value
52055                      * @memberOf LazyWrapper
52056                      * @returns {*} Returns the unwrapped value.
52057                      */
52058                     function lazyValue() {
52059                         var array = this.__wrapped__.value(),
52060                             dir = this.__dir__,
52061                             isArr = isArray(array),
52062                             isRight = dir < 0,
52063                             arrLength = isArr ? array.length : 0,
52064                             view = getView(0, arrLength, this.__views__),
52065                             start = view.start,
52066                             end = view.end,
52067                             length = end - start,
52068                             index = isRight ? end : (start - 1),
52069                             iteratees = this.__iteratees__,
52070                             iterLength = iteratees.length,
52071                             resIndex = 0,
52072                             takeCount = nativeMin(length, this.__takeCount__);
52073
52074                         if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
52075                             return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__);
52076                         }
52077                         var result = [];
52078
52079                         outer:
52080                             while (length-- && resIndex < takeCount) {
52081                                 index += dir;
52082
52083                                 var iterIndex = -1,
52084                                     value = array[index];
52085
52086                                 while (++iterIndex < iterLength) {
52087                                     var data = iteratees[iterIndex],
52088                                         iteratee = data.iteratee,
52089                                         type = data.type,
52090                                         computed = iteratee(value);
52091
52092                                     if (type == LAZY_MAP_FLAG) {
52093                                         value = computed;
52094                                     } else if (!computed) {
52095                                         if (type == LAZY_FILTER_FLAG) {
52096                                             continue outer;
52097                                         } else {
52098                                             break outer;
52099                                         }
52100                                     }
52101                                 }
52102                                 result[resIndex++] = value;
52103                             }
52104                         return result;
52105                     }
52106
52107                     /*------------------------------------------------------------------------*/
52108
52109                     /**
52110                      * Creates a cache object to store key/value pairs.
52111                      * 
52112                      * @private
52113                      * @static
52114                      * @name Cache
52115                      * @memberOf _.memoize
52116                      */
52117                     function MapCache() {
52118                         this.__data__ = {};
52119                     }
52120
52121                     /**
52122                      * Removes `key` and its value from the cache.
52123                      * 
52124                      * @private
52125                      * @name delete
52126                      * @memberOf _.memoize.Cache
52127                      * @param {string}
52128                      *            key The key of the value to remove.
52129                      * @returns {boolean} Returns `true` if the entry was removed successfully,
52130                      *          else `false`.
52131                      */
52132                     function mapDelete(key) {
52133                         return this.has(key) && delete this.__data__[key];
52134                     }
52135
52136                     /**
52137                      * Gets the cached value for `key`.
52138                      * 
52139                      * @private
52140                      * @name get
52141                      * @memberOf _.memoize.Cache
52142                      * @param {string}
52143                      *            key The key of the value to get.
52144                      * @returns {*} Returns the cached value.
52145                      */
52146                     function mapGet(key) {
52147                         return key == '__proto__' ? undefined : this.__data__[key];
52148                     }
52149
52150                     /**
52151                      * Checks if a cached value for `key` exists.
52152                      * 
52153                      * @private
52154                      * @name has
52155                      * @memberOf _.memoize.Cache
52156                      * @param {string}
52157                      *            key The key of the entry to check.
52158                      * @returns {boolean} Returns `true` if an entry for `key` exists, else
52159                      *          `false`.
52160                      */
52161                     function mapHas(key) {
52162                         return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
52163                     }
52164
52165                     /**
52166                      * Sets `value` to `key` of the cache.
52167                      * 
52168                      * @private
52169                      * @name set
52170                      * @memberOf _.memoize.Cache
52171                      * @param {string}
52172                      *            key The key of the value to cache.
52173                      * @param {*}
52174                      *            value The value to cache.
52175                      * @returns {Object} Returns the cache object.
52176                      */
52177                     function mapSet(key, value) {
52178                         if (key != '__proto__') {
52179                             this.__data__[key] = value;
52180                         }
52181                         return this;
52182                     }
52183
52184                     /*------------------------------------------------------------------------*/
52185
52186                     /**
52187                      * 
52188                      * Creates a cache object to store unique values.
52189                      * 
52190                      * @private
52191                      * @param {Array}
52192                      *            [values] The values to cache.
52193                      */
52194                     function SetCache(values) {
52195                         var length = values ? values.length : 0;
52196
52197                         this.data = {
52198                             'hash': nativeCreate(null),
52199                             'set': new Set
52200                         };
52201                         while (length--) {
52202                             this.push(values[length]);
52203                         }
52204                     }
52205
52206                     /**
52207                      * Checks if `value` is in `cache` mimicking the return signature of
52208                      * `_.indexOf` by returning `0` if the value is found, else `-1`.
52209                      * 
52210                      * @private
52211                      * @param {Object}
52212                      *            cache The cache to search.
52213                      * @param {*}
52214                      *            value The value to search for.
52215                      * @returns {number} Returns `0` if `value` is found, else `-1`.
52216                      */
52217                     function cacheIndexOf(cache, value) {
52218                         var data = cache.data,
52219                             result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
52220
52221                         return result ? 0 : -1;
52222                     }
52223
52224                     /**
52225                      * Adds `value` to the cache.
52226                      * 
52227                      * @private
52228                      * @name push
52229                      * @memberOf SetCache
52230                      * @param {*}
52231                      *            value The value to cache.
52232                      */
52233                     function cachePush(value) {
52234                         var data = this.data;
52235                         if (typeof value == 'string' || isObject(value)) {
52236                             data.set.add(value);
52237                         } else {
52238                             data.hash[value] = true;
52239                         }
52240                     }
52241
52242                     /*------------------------------------------------------------------------*/
52243
52244                     /**
52245                      * Creates a new array joining `array` with `other`.
52246                      * 
52247                      * @private
52248                      * @param {Array}
52249                      *            array The array to join.
52250                      * @param {Array}
52251                      *            other The other array to join.
52252                      * @returns {Array} Returns the new concatenated array.
52253                      */
52254                     function arrayConcat(array, other) {
52255                         var index = -1,
52256                             length = array.length,
52257                             othIndex = -1,
52258                             othLength = other.length,
52259                             result = Array(length + othLength);
52260
52261                         while (++index < length) {
52262                             result[index] = array[index];
52263                         }
52264                         while (++othIndex < othLength) {
52265                             result[index++] = other[othIndex];
52266                         }
52267                         return result;
52268                     }
52269
52270                     /**
52271                      * Copies the values of `source` to `array`.
52272                      * 
52273                      * @private
52274                      * @param {Array}
52275                      *            source The array to copy values from.
52276                      * @param {Array}
52277                      *            [array=[]] The array to copy values to.
52278                      * @returns {Array} Returns `array`.
52279                      */
52280                     function arrayCopy(source, array) {
52281                         var index = -1,
52282                             length = source.length;
52283
52284                         array || (array = Array(length));
52285                         while (++index < length) {
52286                             array[index] = source[index];
52287                         }
52288                         return array;
52289                     }
52290
52291                     /**
52292                      * A specialized version of `_.forEach` for arrays without support for
52293                      * callback shorthands and `this` binding.
52294                      * 
52295                      * @private
52296                      * @param {Array}
52297                      *            array The array to iterate over.
52298                      * @param {Function}
52299                      *            iteratee The function invoked per iteration.
52300                      * @returns {Array} Returns `array`.
52301                      */
52302                     function arrayEach(array, iteratee) {
52303                         var index = -1,
52304                             length = array.length;
52305
52306                         while (++index < length) {
52307                             if (iteratee(array[index], index, array) === false) {
52308                                 break;
52309                             }
52310                         }
52311                         return array;
52312                     }
52313
52314                     /**
52315                      * A specialized version of `_.forEachRight` for arrays without support for
52316                      * callback shorthands and `this` binding.
52317                      * 
52318                      * @private
52319                      * @param {Array}
52320                      *            array The array to iterate over.
52321                      * @param {Function}
52322                      *            iteratee The function invoked per iteration.
52323                      * @returns {Array} Returns `array`.
52324                      */
52325                     function arrayEachRight(array, iteratee) {
52326                         var length = array.length;
52327
52328                         while (length--) {
52329                             if (iteratee(array[length], length, array) === false) {
52330                                 break;
52331                             }
52332                         }
52333                         return array;
52334                     }
52335
52336                     /**
52337                      * A specialized version of `_.every` for arrays without support for
52338                      * callback shorthands and `this` binding.
52339                      * 
52340                      * @private
52341                      * @param {Array}
52342                      *            array The array to iterate over.
52343                      * @param {Function}
52344                      *            predicate The function invoked per iteration.
52345                      * @returns {boolean} Returns `true` if all elements pass the predicate
52346                      *          check, else `false`.
52347                      */
52348                     function arrayEvery(array, predicate) {
52349                         var index = -1,
52350                             length = array.length;
52351
52352                         while (++index < length) {
52353                             if (!predicate(array[index], index, array)) {
52354                                 return false;
52355                             }
52356                         }
52357                         return true;
52358                     }
52359
52360                     /**
52361                      * A specialized version of `baseExtremum` for arrays which invokes
52362                      * `iteratee` with one argument: (value).
52363                      * 
52364                      * @private
52365                      * @param {Array}
52366                      *            array The array to iterate over.
52367                      * @param {Function}
52368                      *            iteratee The function invoked per iteration.
52369                      * @param {Function}
52370                      *            comparator The function used to compare values.
52371                      * @param {*}
52372                      *            exValue The initial extremum value.
52373                      * @returns {*} Returns the extremum value.
52374                      */
52375                     function arrayExtremum(array, iteratee, comparator, exValue) {
52376                         var index = -1,
52377                             length = array.length,
52378                             computed = exValue,
52379                             result = computed;
52380
52381                         while (++index < length) {
52382                             var value = array[index],
52383                                 current = +iteratee(value);
52384
52385                             if (comparator(current, computed)) {
52386                                 computed = current;
52387                                 result = value;
52388                             }
52389                         }
52390                         return result;
52391                     }
52392
52393                     /**
52394                      * A specialized version of `_.filter` for arrays without support for
52395                      * callback shorthands and `this` binding.
52396                      * 
52397                      * @private
52398                      * @param {Array}
52399                      *            array The array to iterate over.
52400                      * @param {Function}
52401                      *            predicate The function invoked per iteration.
52402                      * @returns {Array} Returns the new filtered array.
52403                      */
52404                     function arrayFilter(array, predicate) {
52405                         var index = -1,
52406                             length = array.length,
52407                             resIndex = -1,
52408                             result = [];
52409
52410                         while (++index < length) {
52411                             var value = array[index];
52412                             if (predicate(value, index, array)) {
52413                                 result[++resIndex] = value;
52414                             }
52415                         }
52416                         return result;
52417                     }
52418
52419                     /**
52420                      * A specialized version of `_.map` for arrays without support for callback
52421                      * shorthands and `this` binding.
52422                      * 
52423                      * @private
52424                      * @param {Array}
52425                      *            array The array to iterate over.
52426                      * @param {Function}
52427                      *            iteratee The function invoked per iteration.
52428                      * @returns {Array} Returns the new mapped array.
52429                      */
52430                     function arrayMap(array, iteratee) {
52431                         var index = -1,
52432                             length = array.length,
52433                             result = Array(length);
52434
52435                         while (++index < length) {
52436                             result[index] = iteratee(array[index], index, array);
52437                         }
52438                         return result;
52439                     }
52440
52441                     /**
52442                      * Appends the elements of `values` to `array`.
52443                      * 
52444                      * @private
52445                      * @param {Array}
52446                      *            array The array to modify.
52447                      * @param {Array}
52448                      *            values The values to append.
52449                      * @returns {Array} Returns `array`.
52450                      */
52451                     function arrayPush(array, values) {
52452                         var index = -1,
52453                             length = values.length,
52454                             offset = array.length;
52455
52456                         while (++index < length) {
52457                             array[offset + index] = values[index];
52458                         }
52459                         return array;
52460                     }
52461
52462                     /**
52463                      * A specialized version of `_.reduce` for arrays without support for
52464                      * callback shorthands and `this` binding.
52465                      * 
52466                      * @private
52467                      * @param {Array}
52468                      *            array The array to iterate over.
52469                      * @param {Function}
52470                      *            iteratee The function invoked per iteration.
52471                      * @param {*}
52472                      *            [accumulator] The initial value.
52473                      * @param {boolean}
52474                      *            [initFromArray] Specify using the first element of `array` as
52475                      *            the initial value.
52476                      * @returns {*} Returns the accumulated value.
52477                      */
52478                     function arrayReduce(array, iteratee, accumulator, initFromArray) {
52479                         var index = -1,
52480                             length = array.length;
52481
52482                         if (initFromArray && length) {
52483                             accumulator = array[++index];
52484                         }
52485                         while (++index < length) {
52486                             accumulator = iteratee(accumulator, array[index], index, array);
52487                         }
52488                         return accumulator;
52489                     }
52490
52491                     /**
52492                      * A specialized version of `_.reduceRight` for arrays without support for
52493                      * callback shorthands and `this` binding.
52494                      * 
52495                      * @private
52496                      * @param {Array}
52497                      *            array The array to iterate over.
52498                      * @param {Function}
52499                      *            iteratee The function invoked per iteration.
52500                      * @param {*}
52501                      *            [accumulator] The initial value.
52502                      * @param {boolean}
52503                      *            [initFromArray] Specify using the last element of `array` as
52504                      *            the initial value.
52505                      * @returns {*} Returns the accumulated value.
52506                      */
52507                     function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
52508                         var length = array.length;
52509                         if (initFromArray && length) {
52510                             accumulator = array[--length];
52511                         }
52512                         while (length--) {
52513                             accumulator = iteratee(accumulator, array[length], length, array);
52514                         }
52515                         return accumulator;
52516                     }
52517
52518                     /**
52519                      * A specialized version of `_.some` for arrays without support for callback
52520                      * shorthands and `this` binding.
52521                      * 
52522                      * @private
52523                      * @param {Array}
52524                      *            array The array to iterate over.
52525                      * @param {Function}
52526                      *            predicate The function invoked per iteration.
52527                      * @returns {boolean} Returns `true` if any element passes the predicate
52528                      *          check, else `false`.
52529                      */
52530                     function arraySome(array, predicate) {
52531                         var index = -1,
52532                             length = array.length;
52533
52534                         while (++index < length) {
52535                             if (predicate(array[index], index, array)) {
52536                                 return true;
52537                             }
52538                         }
52539                         return false;
52540                     }
52541
52542                     /**
52543                      * A specialized version of `_.sum` for arrays without support for callback
52544                      * shorthands and `this` binding..
52545                      * 
52546                      * @private
52547                      * @param {Array}
52548                      *            array The array to iterate over.
52549                      * @param {Function}
52550                      *            iteratee The function invoked per iteration.
52551                      * @returns {number} Returns the sum.
52552                      */
52553                     function arraySum(array, iteratee) {
52554                         var length = array.length,
52555                             result = 0;
52556
52557                         while (length--) {
52558                             result += +iteratee(array[length]) || 0;
52559                         }
52560                         return result;
52561                     }
52562
52563                     /**
52564                      * Used by `_.defaults` to customize its `_.assign` use.
52565                      * 
52566                      * @private
52567                      * @param {*}
52568                      *            objectValue The destination object property value.
52569                      * @param {*}
52570                      *            sourceValue The source object property value.
52571                      * @returns {*} Returns the value to assign to the destination object.
52572                      */
52573                     function assignDefaults(objectValue, sourceValue) {
52574                         return objectValue === undefined ? sourceValue : objectValue;
52575                     }
52576
52577                     /**
52578                      * Used by `_.template` to customize its `_.assign` use.
52579                      * 
52580                      * **Note:** This function is like `assignDefaults` except that it ignores
52581                      * inherited property values when checking if a property is `undefined`.
52582                      * 
52583                      * @private
52584                      * @param {*}
52585                      *            objectValue The destination object property value.
52586                      * @param {*}
52587                      *            sourceValue The source object property value.
52588                      * @param {string}
52589                      *            key The key associated with the object and source values.
52590                      * @param {Object}
52591                      *            object The destination object.
52592                      * @returns {*} Returns the value to assign to the destination object.
52593                      */
52594                     function assignOwnDefaults(objectValue, sourceValue, key, object) {
52595                         return (objectValue === undefined || !hasOwnProperty.call(object, key)) ? sourceValue : objectValue;
52596                     }
52597
52598                     /**
52599                      * A specialized version of `_.assign` for customizing assigned values
52600                      * without support for argument juggling, multiple sources, and `this`
52601                      * binding `customizer` functions.
52602                      * 
52603                      * @private
52604                      * @param {Object}
52605                      *            object The destination object.
52606                      * @param {Object}
52607                      *            source The source object.
52608                      * @param {Function}
52609                      *            customizer The function to customize assigned values.
52610                      * @returns {Object} Returns `object`.
52611                      */
52612                     function assignWith(object, source, customizer) {
52613                         var index = -1,
52614                             props = keys(source),
52615                             length = props.length;
52616
52617                         while (++index < length) {
52618                             var key = props[index],
52619                                 value = object[key],
52620                                 result = customizer(value, source[key], key, object, source);
52621
52622                             if ((result === result ? (result !== value) : (value === value)) ||
52623                                 (value === undefined && !(key in object))) {
52624                                 object[key] = result;
52625                             }
52626                         }
52627                         return object;
52628                     }
52629
52630                     /**
52631                      * The base implementation of `_.assign` without support for argument
52632                      * juggling, multiple sources, and `customizer` functions.
52633                      * 
52634                      * @private
52635                      * @param {Object}
52636                      *            object The destination object.
52637                      * @param {Object}
52638                      *            source The source object.
52639                      * @returns {Object} Returns `object`.
52640                      */
52641                     function baseAssign(object, source) {
52642                         return source == null ? object : baseCopy(source, keys(source), object);
52643                     }
52644
52645                     /**
52646                      * The base implementation of `_.at` without support for string collections
52647                      * and individual key arguments.
52648                      * 
52649                      * @private
52650                      * @param {Array|Object}
52651                      *            collection The collection to iterate over.
52652                      * @param {number[]|string[]}
52653                      *            props The property names or indexes of elements to pick.
52654                      * @returns {Array} Returns the new array of picked elements.
52655                      */
52656                     function baseAt(collection, props) {
52657                         var index = -1,
52658                             isNil = collection == null,
52659                             isArr = !isNil && isArrayLike(collection),
52660                             length = isArr ? collection.length : 0,
52661                             propsLength = props.length,
52662                             result = Array(propsLength);
52663
52664                         while (++index < propsLength) {
52665                             var key = props[index];
52666                             if (isArr) {
52667                                 result[index] = isIndex(key, length) ? collection[key] : undefined;
52668                             } else {
52669                                 result[index] = isNil ? undefined : collection[key];
52670                             }
52671                         }
52672                         return result;
52673                     }
52674
52675                     /**
52676                      * Copies properties of `source` to `object`.
52677                      * 
52678                      * @private
52679                      * @param {Object}
52680                      *            source The object to copy properties from.
52681                      * @param {Array}
52682                      *            props The property names to copy.
52683                      * @param {Object}
52684                      *            [object={}] The object to copy properties to.
52685                      * @returns {Object} Returns `object`.
52686                      */
52687                     function baseCopy(source, props, object) {
52688                         object || (object = {});
52689
52690                         var index = -1,
52691                             length = props.length;
52692
52693                         while (++index < length) {
52694                             var key = props[index];
52695                             object[key] = source[key];
52696                         }
52697                         return object;
52698                     }
52699
52700                     /**
52701                      * The base implementation of `_.callback` which supports specifying the
52702                      * number of arguments to provide to `func`.
52703                      * 
52704                      * @private
52705                      * @param {*}
52706                      *            [func=_.identity] The value to convert to a callback.
52707                      * @param {*}
52708                      *            [thisArg] The `this` binding of `func`.
52709                      * @param {number}
52710                      *            [argCount] The number of arguments to provide to `func`.
52711                      * @returns {Function} Returns the callback.
52712                      */
52713                     function baseCallback(func, thisArg, argCount) {
52714                         var type = typeof func;
52715                         if (type == 'function') {
52716                             return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
52717                         }
52718                         if (func == null) {
52719                             return identity;
52720                         }
52721                         if (type == 'object') {
52722                             return baseMatches(func);
52723                         }
52724                         return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
52725                     }
52726
52727                     /**
52728                      * The base implementation of `_.clone` without support for argument
52729                      * juggling and `this` binding `customizer` functions.
52730                      * 
52731                      * @private
52732                      * @param {*}
52733                      *            value The value to clone.
52734                      * @param {boolean}
52735                      *            [isDeep] Specify a deep clone.
52736                      * @param {Function}
52737                      *            [customizer] The function to customize cloning values.
52738                      * @param {string}
52739                      *            [key] The key of `value`.
52740                      * @param {Object}
52741                      *            [object] The object `value` belongs to.
52742                      * @param {Array}
52743                      *            [stackA=[]] Tracks traversed source objects.
52744                      * @param {Array}
52745                      *            [stackB=[]] Associates clones with source counterparts.
52746                      * @returns {*} Returns the cloned value.
52747                      */
52748                     function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
52749                         var result;
52750                         if (customizer) {
52751                             result = object ? customizer(value, key, object) : customizer(value);
52752                         }
52753                         if (result !== undefined) {
52754                             return result;
52755                         }
52756                         if (!isObject(value)) {
52757                             return value;
52758                         }
52759                         var isArr = isArray(value);
52760                         if (isArr) {
52761                             result = initCloneArray(value);
52762                             if (!isDeep) {
52763                                 return arrayCopy(value, result);
52764                             }
52765                         } else {
52766                             var tag = objToString.call(value),
52767                                 isFunc = tag == funcTag;
52768
52769                             if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
52770                                 result = initCloneObject(isFunc ? {} : value);
52771                                 if (!isDeep) {
52772                                     return baseAssign(result, value);
52773                                 }
52774                             } else {
52775                                 return cloneableTags[tag] ? initCloneByTag(value, tag, isDeep) : (object ? value : {});
52776                             }
52777                         }
52778                         // Check for circular references and return its corresponding clone.
52779                         stackA || (stackA = []);
52780                         stackB || (stackB = []);
52781
52782                         var length = stackA.length;
52783                         while (length--) {
52784                             if (stackA[length] == value) {
52785                                 return stackB[length];
52786                             }
52787                         }
52788                         // Add the source value to the stack of traversed objects and associate
52789                         // it with its clone.
52790                         stackA.push(value);
52791                         stackB.push(result);
52792
52793                         // Recursively populate clone (susceptible to call stack limits).
52794                         (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
52795                             result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
52796                         });
52797                         return result;
52798                     }
52799
52800                     /**
52801                      * The base implementation of `_.create` without support for assigning
52802                      * properties to the created object.
52803                      * 
52804                      * @private
52805                      * @param {Object}
52806                      *            prototype The object to inherit from.
52807                      * @returns {Object} Returns the new object.
52808                      */
52809                     var baseCreate = (function() {
52810                         function object() {}
52811                         return function(prototype) {
52812                             if (isObject(prototype)) {
52813                                 object.prototype = prototype;
52814                                 var result = new object;
52815                                 object.prototype = undefined;
52816                             }
52817                             return result || {};
52818                         };
52819                     }());
52820
52821                     /**
52822                      * The base implementation of `_.delay` and `_.defer` which accepts an index
52823                      * of where to slice the arguments to provide to `func`.
52824                      * 
52825                      * @private
52826                      * @param {Function}
52827                      *            func The function to delay.
52828                      * @param {number}
52829                      *            wait The number of milliseconds to delay invocation.
52830                      * @param {Object}
52831                      *            args The arguments provide to `func`.
52832                      * @returns {number} Returns the timer id.
52833                      */
52834                     function baseDelay(func, wait, args) {
52835                         if (typeof func != 'function') {
52836                             throw new TypeError(FUNC_ERROR_TEXT);
52837                         }
52838                         return setTimeout(function() {
52839                             func.apply(undefined, args);
52840                         }, wait);
52841                     }
52842
52843                     /**
52844                      * The base implementation of `_.difference` which accepts a single array of
52845                      * values to exclude.
52846                      * 
52847                      * @private
52848                      * @param {Array}
52849                      *            array The array to inspect.
52850                      * @param {Array}
52851                      *            values The values to exclude.
52852                      * @returns {Array} Returns the new array of filtered values.
52853                      */
52854                     function baseDifference(array, values) {
52855                         var length = array ? array.length : 0,
52856                             result = [];
52857
52858                         if (!length) {
52859                             return result;
52860                         }
52861                         var index = -1,
52862                             indexOf = getIndexOf(),
52863                             isCommon = indexOf == baseIndexOf,
52864                             cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
52865                             valuesLength = values.length;
52866
52867                         if (cache) {
52868                             indexOf = cacheIndexOf;
52869                             isCommon = false;
52870                             values = cache;
52871                         }
52872                         outer:
52873                             while (++index < length) {
52874                                 var value = array[index];
52875
52876                                 if (isCommon && value === value) {
52877                                     var valuesIndex = valuesLength;
52878                                     while (valuesIndex--) {
52879                                         if (values[valuesIndex] === value) {
52880                                             continue outer;
52881                                         }
52882                                     }
52883                                     result.push(value);
52884                                 } else if (indexOf(values, value, 0) < 0) {
52885                                     result.push(value);
52886                                 }
52887                             }
52888                         return result;
52889                     }
52890
52891                     /**
52892                      * The base implementation of `_.forEach` without support for callback
52893                      * shorthands and `this` binding.
52894                      * 
52895                      * @private
52896                      * @param {Array|Object|string}
52897                      *            collection The collection to iterate over.
52898                      * @param {Function}
52899                      *            iteratee The function invoked per iteration.
52900                      * @returns {Array|Object|string} Returns `collection`.
52901                      */
52902                     var baseEach = createBaseEach(baseForOwn);
52903
52904                     /**
52905                      * The base implementation of `_.forEachRight` without support for callback
52906                      * shorthands and `this` binding.
52907                      * 
52908                      * @private
52909                      * @param {Array|Object|string}
52910                      *            collection The collection to iterate over.
52911                      * @param {Function}
52912                      *            iteratee The function invoked per iteration.
52913                      * @returns {Array|Object|string} Returns `collection`.
52914                      */
52915                     var baseEachRight = createBaseEach(baseForOwnRight, true);
52916
52917                     /**
52918                      * The base implementation of `_.every` without support for callback
52919                      * shorthands and `this` binding.
52920                      * 
52921                      * @private
52922                      * @param {Array|Object|string}
52923                      *            collection The collection to iterate over.
52924                      * @param {Function}
52925                      *            predicate The function invoked per iteration.
52926                      * @returns {boolean} Returns `true` if all elements pass the predicate
52927                      *          check, else `false`
52928                      */
52929                     function baseEvery(collection, predicate) {
52930                         var result = true;
52931                         baseEach(collection, function(value, index, collection) {
52932                             result = !!predicate(value, index, collection);
52933                             return result;
52934                         });
52935                         return result;
52936                     }
52937
52938                     /**
52939                      * Gets the extremum value of `collection` invoking `iteratee` for each
52940                      * value in `collection` to generate the criterion by which the value is
52941                      * ranked. The `iteratee` is invoked with three arguments: (value,
52942                      * index|key, collection).
52943                      * 
52944                      * @private
52945                      * @param {Array|Object|string}
52946                      *            collection The collection to iterate over.
52947                      * @param {Function}
52948                      *            iteratee The function invoked per iteration.
52949                      * @param {Function}
52950                      *            comparator The function used to compare values.
52951                      * @param {*}
52952                      *            exValue The initial extremum value.
52953                      * @returns {*} Returns the extremum value.
52954                      */
52955                     function baseExtremum(collection, iteratee, comparator, exValue) {
52956                         var computed = exValue,
52957                             result = computed;
52958
52959                         baseEach(collection, function(value, index, collection) {
52960                             var current = +iteratee(value, index, collection);
52961                             if (comparator(current, computed) || (current === exValue && current === result)) {
52962                                 computed = current;
52963                                 result = value;
52964                             }
52965                         });
52966                         return result;
52967                     }
52968
52969                     /**
52970                      * The base implementation of `_.fill` without an iteratee call guard.
52971                      * 
52972                      * @private
52973                      * @param {Array}
52974                      *            array The array to fill.
52975                      * @param {*}
52976                      *            value The value to fill `array` with.
52977                      * @param {number}
52978                      *            [start=0] The start position.
52979                      * @param {number}
52980                      *            [end=array.length] The end position.
52981                      * @returns {Array} Returns `array`.
52982                      */
52983                     function baseFill(array, value, start, end) {
52984                         var length = array.length;
52985
52986                         start = start == null ? 0 : (+start || 0);
52987                         if (start < 0) {
52988                             start = -start > length ? 0 : (length + start);
52989                         }
52990                         end = (end === undefined || end > length) ? length : (+end || 0);
52991                         if (end < 0) {
52992                             end += length;
52993                         }
52994                         length = start > end ? 0 : (end >>> 0);
52995                         start >>>= 0;
52996
52997                         while (start < length) {
52998                             array[start++] = value;
52999                         }
53000                         return array;
53001                     }
53002
53003                     /**
53004                      * The base implementation of `_.filter` without support for callback
53005                      * shorthands and `this` binding.
53006                      * 
53007                      * @private
53008                      * @param {Array|Object|string}
53009                      *            collection The collection to iterate over.
53010                      * @param {Function}
53011                      *            predicate The function invoked per iteration.
53012                      * @returns {Array} Returns the new filtered array.
53013                      */
53014                     function baseFilter(collection, predicate) {
53015                         var result = [];
53016                         baseEach(collection, function(value, index, collection) {
53017                             if (predicate(value, index, collection)) {
53018                                 result.push(value);
53019                             }
53020                         });
53021                         return result;
53022                     }
53023
53024                     /**
53025                      * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and
53026                      * `_.findLastKey`, without support for callback shorthands and `this`
53027                      * binding, which iterates over `collection` using the provided `eachFunc`.
53028                      * 
53029                      * @private
53030                      * @param {Array|Object|string}
53031                      *            collection The collection to search.
53032                      * @param {Function}
53033                      *            predicate The function invoked per iteration.
53034                      * @param {Function}
53035                      *            eachFunc The function to iterate over `collection`.
53036                      * @param {boolean}
53037                      *            [retKey] Specify returning the key of the found element
53038                      *            instead of the element itself.
53039                      * @returns {*} Returns the found element or its key, else `undefined`.
53040                      */
53041                     function baseFind(collection, predicate, eachFunc, retKey) {
53042                         var result;
53043                         eachFunc(collection, function(value, key, collection) {
53044                             if (predicate(value, key, collection)) {
53045                                 result = retKey ? key : value;
53046                                 return false;
53047                             }
53048                         });
53049                         return result;
53050                     }
53051
53052                     /**
53053                      * The base implementation of `_.flatten` with added support for restricting
53054                      * flattening and specifying the start index.
53055                      * 
53056                      * @private
53057                      * @param {Array}
53058                      *            array The array to flatten.
53059                      * @param {boolean}
53060                      *            [isDeep] Specify a deep flatten.
53061                      * @param {boolean}
53062                      *            [isStrict] Restrict flattening to arrays-like objects.
53063                      * @param {Array}
53064                      *            [result=[]] The initial result value.
53065                      * @returns {Array} Returns the new flattened array.
53066                      */
53067                     function baseFlatten(array, isDeep, isStrict, result) {
53068                         result || (result = []);
53069
53070                         var index = -1,
53071                             length = array.length;
53072
53073                         while (++index < length) {
53074                             var value = array[index];
53075                             if (isObjectLike(value) && isArrayLike(value) &&
53076                                 (isStrict || isArray(value) || isArguments(value))) {
53077                                 if (isDeep) {
53078                                     // Recursively flatten arrays (susceptible to call stack limits).
53079                                     baseFlatten(value, isDeep, isStrict, result);
53080                                 } else {
53081                                     arrayPush(result, value);
53082                                 }
53083                             } else if (!isStrict) {
53084                                 result[result.length] = value;
53085                             }
53086                         }
53087                         return result;
53088                     }
53089
53090                     /**
53091                      * The base implementation of `baseForIn` and `baseForOwn` which iterates
53092                      * over `object` properties returned by `keysFunc` invoking `iteratee` for
53093                      * each property. Iteratee functions may exit iteration early by explicitly
53094                      * returning `false`.
53095                      * 
53096                      * @private
53097                      * @param {Object}
53098                      *            object The object to iterate over.
53099                      * @param {Function}
53100                      *            iteratee The function invoked per iteration.
53101                      * @param {Function}
53102                      *            keysFunc The function to get the keys of `object`.
53103                      * @returns {Object} Returns `object`.
53104                      */
53105                     var baseFor = createBaseFor();
53106
53107                     /**
53108                      * This function is like `baseFor` except that it iterates over properties
53109                      * in the opposite order.
53110                      * 
53111                      * @private
53112                      * @param {Object}
53113                      *            object The object to iterate over.
53114                      * @param {Function}
53115                      *            iteratee The function invoked per iteration.
53116                      * @param {Function}
53117                      *            keysFunc The function to get the keys of `object`.
53118                      * @returns {Object} Returns `object`.
53119                      */
53120                     var baseForRight = createBaseFor(true);
53121
53122                     /**
53123                      * The base implementation of `_.forIn` without support for callback
53124                      * shorthands and `this` binding.
53125                      * 
53126                      * @private
53127                      * @param {Object}
53128                      *            object The object to iterate over.
53129                      * @param {Function}
53130                      *            iteratee The function invoked per iteration.
53131                      * @returns {Object} Returns `object`.
53132                      */
53133                     function baseForIn(object, iteratee) {
53134                         return baseFor(object, iteratee, keysIn);
53135                     }
53136
53137                     /**
53138                      * The base implementation of `_.forOwn` without support for callback
53139                      * shorthands and `this` binding.
53140                      * 
53141                      * @private
53142                      * @param {Object}
53143                      *            object The object to iterate over.
53144                      * @param {Function}
53145                      *            iteratee The function invoked per iteration.
53146                      * @returns {Object} Returns `object`.
53147                      */
53148                     function baseForOwn(object, iteratee) {
53149                         return baseFor(object, iteratee, keys);
53150                     }
53151
53152                     /**
53153                      * The base implementation of `_.forOwnRight` without support for callback
53154                      * shorthands and `this` binding.
53155                      * 
53156                      * @private
53157                      * @param {Object}
53158                      *            object The object to iterate over.
53159                      * @param {Function}
53160                      *            iteratee The function invoked per iteration.
53161                      * @returns {Object} Returns `object`.
53162                      */
53163                     function baseForOwnRight(object, iteratee) {
53164                         return baseForRight(object, iteratee, keys);
53165                     }
53166
53167                     /**
53168                      * The base implementation of `_.functions` which creates an array of
53169                      * `object` function property names filtered from those provided.
53170                      * 
53171                      * @private
53172                      * @param {Object}
53173                      *            object The object to inspect.
53174                      * @param {Array}
53175                      *            props The property names to filter.
53176                      * @returns {Array} Returns the new array of filtered property names.
53177                      */
53178                     function baseFunctions(object, props) {
53179                         var index = -1,
53180                             length = props.length,
53181                             resIndex = -1,
53182                             result = [];
53183
53184                         while (++index < length) {
53185                             var key = props[index];
53186                             if (isFunction(object[key])) {
53187                                 result[++resIndex] = key;
53188                             }
53189                         }
53190                         return result;
53191                     }
53192
53193                     /**
53194                      * The base implementation of `get` without support for string paths and
53195                      * default values.
53196                      * 
53197                      * @private
53198                      * @param {Object}
53199                      *            object The object to query.
53200                      * @param {Array}
53201                      *            path The path of the property to get.
53202                      * @param {string}
53203                      *            [pathKey] The key representation of path.
53204                      * @returns {*} Returns the resolved value.
53205                      */
53206                     function baseGet(object, path, pathKey) {
53207                         if (object == null) {
53208                             return;
53209                         }
53210                         if (pathKey !== undefined && pathKey in toObject(object)) {
53211                             path = [pathKey];
53212                         }
53213                         var index = 0,
53214                             length = path.length;
53215
53216                         while (object != null && index < length) {
53217                             object = object[path[index++]];
53218                         }
53219                         return (index && index == length) ? object : undefined;
53220                     }
53221
53222                     /**
53223                      * The base implementation of `_.isEqual` without support for `this` binding
53224                      * `customizer` functions.
53225                      * 
53226                      * @private
53227                      * @param {*}
53228                      *            value The value to compare.
53229                      * @param {*}
53230                      *            other The other value to compare.
53231                      * @param {Function}
53232                      *            [customizer] The function to customize comparing values.
53233                      * @param {boolean}
53234                      *            [isLoose] Specify performing partial comparisons.
53235                      * @param {Array}
53236                      *            [stackA] Tracks traversed `value` objects.
53237                      * @param {Array}
53238                      *            [stackB] Tracks traversed `other` objects.
53239                      * @returns {boolean} Returns `true` if the values are equivalent, else
53240                      *          `false`.
53241                      */
53242                     function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
53243                         if (value === other) {
53244                             return true;
53245                         }
53246                         if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
53247                             return value !== value && other !== other;
53248                         }
53249                         return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
53250                     }
53251
53252                     /**
53253                      * A specialized version of `baseIsEqual` for arrays and objects which
53254                      * performs deep comparisons and tracks traversed objects enabling objects
53255                      * with circular references to be compared.
53256                      * 
53257                      * @private
53258                      * @param {Object}
53259                      *            object The object to compare.
53260                      * @param {Object}
53261                      *            other The other object to compare.
53262                      * @param {Function}
53263                      *            equalFunc The function to determine equivalents of values.
53264                      * @param {Function}
53265                      *            [customizer] The function to customize comparing objects.
53266                      * @param {boolean}
53267                      *            [isLoose] Specify performing partial comparisons.
53268                      * @param {Array}
53269                      *            [stackA=[]] Tracks traversed `value` objects.
53270                      * @param {Array}
53271                      *            [stackB=[]] Tracks traversed `other` objects.
53272                      * @returns {boolean} Returns `true` if the objects are equivalent, else
53273                      *          `false`.
53274                      */
53275                     function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
53276                         var objIsArr = isArray(object),
53277                             othIsArr = isArray(other),
53278                             objTag = arrayTag,
53279                             othTag = arrayTag;
53280
53281                         if (!objIsArr) {
53282                             objTag = objToString.call(object);
53283                             if (objTag == argsTag) {
53284                                 objTag = objectTag;
53285                             } else if (objTag != objectTag) {
53286                                 objIsArr = isTypedArray(object);
53287                             }
53288                         }
53289                         if (!othIsArr) {
53290                             othTag = objToString.call(other);
53291                             if (othTag == argsTag) {
53292                                 othTag = objectTag;
53293                             } else if (othTag != objectTag) {
53294                                 othIsArr = isTypedArray(other);
53295                             }
53296                         }
53297                         var objIsObj = objTag == objectTag,
53298                             othIsObj = othTag == objectTag,
53299                             isSameTag = objTag == othTag;
53300
53301                         if (isSameTag && !(objIsArr || objIsObj)) {
53302                             return equalByTag(object, other, objTag);
53303                         }
53304                         if (!isLoose) {
53305                             var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
53306                                 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
53307
53308                             if (objIsWrapped || othIsWrapped) {
53309                                 return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
53310                             }
53311                         }
53312                         if (!isSameTag) {
53313                             return false;
53314                         }
53315                         // Assume cyclic values are equal.
53316                         // For more information on detecting circular references see
53317                         // https://es5.github.io/#JO.
53318                         stackA || (stackA = []);
53319                         stackB || (stackB = []);
53320
53321                         var length = stackA.length;
53322                         while (length--) {
53323                             if (stackA[length] == object) {
53324                                 return stackB[length] == other;
53325                             }
53326                         }
53327                         // Add `object` and `other` to the stack of traversed objects.
53328                         stackA.push(object);
53329                         stackB.push(other);
53330
53331                         var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
53332
53333                         stackA.pop();
53334                         stackB.pop();
53335
53336                         return result;
53337                     }
53338
53339                     /**
53340                      * The base implementation of `_.isMatch` without support for callback
53341                      * shorthands and `this` binding.
53342                      * 
53343                      * @private
53344                      * @param {Object}
53345                      *            object The object to inspect.
53346                      * @param {Array}
53347                      *            matchData The propery names, values, and compare flags to
53348                      *            match.
53349                      * @param {Function}
53350                      *            [customizer] The function to customize comparing objects.
53351                      * @returns {boolean} Returns `true` if `object` is a match, else `false`.
53352                      */
53353                     function baseIsMatch(object, matchData, customizer) {
53354                         var index = matchData.length,
53355                             length = index,
53356                             noCustomizer = !customizer;
53357
53358                         if (object == null) {
53359                             return !length;
53360                         }
53361                         object = toObject(object);
53362                         while (index--) {
53363                             var data = matchData[index];
53364                             if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) {
53365                                 return false;
53366                             }
53367                         }
53368                         while (++index < length) {
53369                             data = matchData[index];
53370                             var key = data[0],
53371                                 objValue = object[key],
53372                                 srcValue = data[1];
53373
53374                             if (noCustomizer && data[2]) {
53375                                 if (objValue === undefined && !(key in object)) {
53376                                     return false;
53377                                 }
53378                             } else {
53379                                 var result = customizer ? customizer(objValue, srcValue, key) : undefined;
53380                                 if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
53381                                     return false;
53382                                 }
53383                             }
53384                         }
53385                         return true;
53386                     }
53387
53388                     /**
53389                      * The base implementation of `_.map` without support for callback
53390                      * shorthands and `this` binding.
53391                      * 
53392                      * @private
53393                      * @param {Array|Object|string}
53394                      *            collection The collection to iterate over.
53395                      * @param {Function}
53396                      *            iteratee The function invoked per iteration.
53397                      * @returns {Array} Returns the new mapped array.
53398                      */
53399                     function baseMap(collection, iteratee) {
53400                         var index = -1,
53401                             result = isArrayLike(collection) ? Array(collection.length) : [];
53402
53403                         baseEach(collection, function(value, key, collection) {
53404                             result[++index] = iteratee(value, key, collection);
53405                         });
53406                         return result;
53407                     }
53408
53409                     /**
53410                      * The base implementation of `_.matches` which does not clone `source`.
53411                      * 
53412                      * @private
53413                      * @param {Object}
53414                      *            source The object of property values to match.
53415                      * @returns {Function} Returns the new function.
53416                      */
53417                     function baseMatches(source) {
53418                         var matchData = getMatchData(source);
53419                         if (matchData.length == 1 && matchData[0][2]) {
53420                             var key = matchData[0][0],
53421                                 value = matchData[0][1];
53422
53423                             return function(object) {
53424                                 if (object == null) {
53425                                     return false;
53426                                 }
53427                                 return object[key] === value && (value !== undefined || (key in toObject(object)));
53428                             };
53429                         }
53430                         return function(object) {
53431                             return baseIsMatch(object, matchData);
53432                         };
53433                     }
53434
53435                     /**
53436                      * The base implementation of `_.matchesProperty` which does not clone
53437                      * `srcValue`.
53438                      * 
53439                      * @private
53440                      * @param {string}
53441                      *            path The path of the property to get.
53442                      * @param {*}
53443                      *            srcValue The value to compare.
53444                      * @returns {Function} Returns the new function.
53445                      */
53446                     function baseMatchesProperty(path, srcValue) {
53447                         var isArr = isArray(path),
53448                             isCommon = isKey(path) && isStrictComparable(srcValue),
53449                             pathKey = (path + '');
53450
53451                         path = toPath(path);
53452                         return function(object) {
53453                             if (object == null) {
53454                                 return false;
53455                             }
53456                             var key = pathKey;
53457                             object = toObject(object);
53458                             if ((isArr || !isCommon) && !(key in object)) {
53459                                 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
53460                                 if (object == null) {
53461                                     return false;
53462                                 }
53463                                 key = last(path);
53464                                 object = toObject(object);
53465                             }
53466                             return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true);
53467                         };
53468                     }
53469
53470                     /**
53471                      * The base implementation of `_.merge` without support for argument
53472                      * juggling, multiple sources, and `this` binding `customizer` functions.
53473                      * 
53474                      * @private
53475                      * @param {Object}
53476                      *            object The destination object.
53477                      * @param {Object}
53478                      *            source The source object.
53479                      * @param {Function}
53480                      *            [customizer] The function to customize merged values.
53481                      * @param {Array}
53482                      *            [stackA=[]] Tracks traversed source objects.
53483                      * @param {Array}
53484                      *            [stackB=[]] Associates values with source counterparts.
53485                      * @returns {Object} Returns `object`.
53486                      */
53487                     function baseMerge(object, source, customizer, stackA, stackB) {
53488                         if (!isObject(object)) {
53489                             return object;
53490                         }
53491                         var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
53492                             props = isSrcArr ? undefined : keys(source);
53493
53494                         arrayEach(props || source, function(srcValue, key) {
53495                             if (props) {
53496                                 key = srcValue;
53497                                 srcValue = source[key];
53498                             }
53499                             if (isObjectLike(srcValue)) {
53500                                 stackA || (stackA = []);
53501                                 stackB || (stackB = []);
53502                                 baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
53503                             } else {
53504                                 var value = object[key],
53505                                     result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
53506                                     isCommon = result === undefined;
53507
53508                                 if (isCommon) {
53509                                     result = srcValue;
53510                                 }
53511                                 if ((result !== undefined || (isSrcArr && !(key in object))) &&
53512                                     (isCommon || (result === result ? (result !== value) : (value === value)))) {
53513                                     object[key] = result;
53514                                 }
53515                             }
53516                         });
53517                         return object;
53518                     }
53519
53520                     /**
53521                      * A specialized version of `baseMerge` for arrays and objects which
53522                      * performs deep merges and tracks traversed objects enabling objects with
53523                      * circular references to be merged.
53524                      * 
53525                      * @private
53526                      * @param {Object}
53527                      *            object The destination object.
53528                      * @param {Object}
53529                      *            source The source object.
53530                      * @param {string}
53531                      *            key The key of the value to merge.
53532                      * @param {Function}
53533                      *            mergeFunc The function to merge values.
53534                      * @param {Function}
53535                      *            [customizer] The function to customize merged values.
53536                      * @param {Array}
53537                      *            [stackA=[]] Tracks traversed source objects.
53538                      * @param {Array}
53539                      *            [stackB=[]] Associates values with source counterparts.
53540                      * @returns {boolean} Returns `true` if the objects are equivalent, else
53541                      *          `false`.
53542                      */
53543                     function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
53544                         var length = stackA.length,
53545                             srcValue = source[key];
53546
53547                         while (length--) {
53548                             if (stackA[length] == srcValue) {
53549                                 object[key] = stackB[length];
53550                                 return;
53551                             }
53552                         }
53553                         var value = object[key],
53554                             result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
53555                             isCommon = result === undefined;
53556
53557                         if (isCommon) {
53558                             result = srcValue;
53559                             if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
53560                                 result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []);
53561                             } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
53562                                 result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {});
53563                             } else {
53564                                 isCommon = false;
53565                             }
53566                         }
53567                         // Add the source value to the stack of traversed objects and associate
53568                         // it with its merged value.
53569                         stackA.push(srcValue);
53570                         stackB.push(result);
53571
53572                         if (isCommon) {
53573                             // Recursively merge objects and arrays (susceptible to call stack
53574                             // limits).
53575                             object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
53576                         } else if (result === result ? (result !== value) : (value === value)) {
53577                             object[key] = result;
53578                         }
53579                     }
53580
53581                     /**
53582                      * The base implementation of `_.property` without support for deep paths.
53583                      * 
53584                      * @private
53585                      * @param {string}
53586                      *            key The key of the property to get.
53587                      * @returns {Function} Returns the new function.
53588                      */
53589                     function baseProperty(key) {
53590                         return function(object) {
53591                             return object == null ? undefined : object[key];
53592                         };
53593                     }
53594
53595                     /**
53596                      * A specialized version of `baseProperty` which supports deep paths.
53597                      * 
53598                      * @private
53599                      * @param {Array|string}
53600                      *            path The path of the property to get.
53601                      * @returns {Function} Returns the new function.
53602                      */
53603                     function basePropertyDeep(path) {
53604                         var pathKey = (path + '');
53605                         path = toPath(path);
53606                         return function(object) {
53607                             return baseGet(object, path, pathKey);
53608                         };
53609                     }
53610
53611                     /**
53612                      * The base implementation of `_.pullAt` without support for individual
53613                      * index arguments and capturing the removed elements.
53614                      * 
53615                      * @private
53616                      * @param {Array}
53617                      *            array The array to modify.
53618                      * @param {number[]}
53619                      *            indexes The indexes of elements to remove.
53620                      * @returns {Array} Returns `array`.
53621                      */
53622                     function basePullAt(array, indexes) {
53623                         var length = array ? indexes.length : 0;
53624                         while (length--) {
53625                             var index = indexes[length];
53626                             if (index != previous && isIndex(index)) {
53627                                 var previous = index;
53628                                 splice.call(array, index, 1);
53629                             }
53630                         }
53631                         return array;
53632                     }
53633
53634                     /**
53635                      * The base implementation of `_.random` without support for argument
53636                      * juggling and returning floating-point numbers.
53637                      * 
53638                      * @private
53639                      * @param {number}
53640                      *            min The minimum possible value.
53641                      * @param {number}
53642                      *            max The maximum possible value.
53643                      * @returns {number} Returns the random number.
53644                      */
53645                     function baseRandom(min, max) {
53646                         return min + nativeFloor(nativeRandom() * (max - min + 1));
53647                     }
53648
53649                     /**
53650                      * The base implementation of `_.reduce` and `_.reduceRight` without support
53651                      * for callback shorthands and `this` binding, which iterates over
53652                      * `collection` using the provided `eachFunc`.
53653                      * 
53654                      * @private
53655                      * @param {Array|Object|string}
53656                      *            collection The collection to iterate over.
53657                      * @param {Function}
53658                      *            iteratee The function invoked per iteration.
53659                      * @param {*}
53660                      *            accumulator The initial value.
53661                      * @param {boolean}
53662                      *            initFromCollection Specify using the first or last element of
53663                      *            `collection` as the initial value.
53664                      * @param {Function}
53665                      *            eachFunc The function to iterate over `collection`.
53666                      * @returns {*} Returns the accumulated value.
53667                      */
53668                     function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
53669                         eachFunc(collection, function(value, index, collection) {
53670                             accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
53671                         });
53672                         return accumulator;
53673                     }
53674
53675                     /**
53676                      * The base implementation of `setData` without support for hot loop
53677                      * detection.
53678                      * 
53679                      * @private
53680                      * @param {Function}
53681                      *            func The function to associate metadata with.
53682                      * @param {*}
53683                      *            data The metadata.
53684                      * @returns {Function} Returns `func`.
53685                      */
53686                     var baseSetData = !metaMap ? identity : function(func, data) {
53687                         metaMap.set(func, data);
53688                         return func;
53689                     };
53690
53691                     /**
53692                      * The base implementation of `_.slice` without an iteratee call guard.
53693                      * 
53694                      * @private
53695                      * @param {Array}
53696                      *            array The array to slice.
53697                      * @param {number}
53698                      *            [start=0] The start position.
53699                      * @param {number}
53700                      *            [end=array.length] The end position.
53701                      * @returns {Array} Returns the slice of `array`.
53702                      */
53703                     function baseSlice(array, start, end) {
53704                         var index = -1,
53705                             length = array.length;
53706
53707                         start = start == null ? 0 : (+start || 0);
53708                         if (start < 0) {
53709                             start = -start > length ? 0 : (length + start);
53710                         }
53711                         end = (end === undefined || end > length) ? length : (+end || 0);
53712                         if (end < 0) {
53713                             end += length;
53714                         }
53715                         length = start > end ? 0 : ((end - start) >>> 0);
53716                         start >>>= 0;
53717
53718                         var result = Array(length);
53719                         while (++index < length) {
53720                             result[index] = array[index + start];
53721                         }
53722                         return result;
53723                     }
53724
53725                     /**
53726                      * The base implementation of `_.some` without support for callback
53727                      * shorthands and `this` binding.
53728                      * 
53729                      * @private
53730                      * @param {Array|Object|string}
53731                      *            collection The collection to iterate over.
53732                      * @param {Function}
53733                      *            predicate The function invoked per iteration.
53734                      * @returns {boolean} Returns `true` if any element passes the predicate
53735                      *          check, else `false`.
53736                      */
53737                     function baseSome(collection, predicate) {
53738                         var result;
53739
53740                         baseEach(collection, function(value, index, collection) {
53741                             result = predicate(value, index, collection);
53742                             return !result;
53743                         });
53744                         return !!result;
53745                     }
53746
53747                     /**
53748                      * The base implementation of `_.sortBy` which uses `comparer` to define the
53749                      * sort order of `array` and replaces criteria objects with their
53750                      * corresponding values.
53751                      * 
53752                      * @private
53753                      * @param {Array}
53754                      *            array The array to sort.
53755                      * @param {Function}
53756                      *            comparer The function to define sort order.
53757                      * @returns {Array} Returns `array`.
53758                      */
53759                     function baseSortBy(array, comparer) {
53760                         var length = array.length;
53761
53762                         array.sort(comparer);
53763                         while (length--) {
53764                             array[length] = array[length].value;
53765                         }
53766                         return array;
53767                     }
53768
53769                     /**
53770                      * The base implementation of `_.sortByOrder` without param guards.
53771                      * 
53772                      * @private
53773                      * @param {Array|Object|string}
53774                      *            collection The collection to iterate over.
53775                      * @param {Function[]|Object[]|string[]}
53776                      *            iteratees The iteratees to sort by.
53777                      * @param {boolean[]}
53778                      *            orders The sort orders of `iteratees`.
53779                      * @returns {Array} Returns the new sorted array.
53780                      */
53781                     function baseSortByOrder(collection, iteratees, orders) {
53782                         var callback = getCallback(),
53783                             index = -1;
53784
53785                         iteratees = arrayMap(iteratees, function(iteratee) {
53786                             return callback(iteratee);
53787                         });
53788
53789                         var result = baseMap(collection, function(value) {
53790                             var criteria = arrayMap(iteratees, function(iteratee) {
53791                                 return iteratee(value);
53792                             });
53793                             return {
53794                                 'criteria': criteria,
53795                                 'index': ++index,
53796                                 'value': value
53797                             };
53798                         });
53799
53800                         return baseSortBy(result, function(object, other) {
53801                             return compareMultiple(object, other, orders);
53802                         });
53803                     }
53804
53805                     /**
53806                      * The base implementation of `_.sum` without support for callback
53807                      * shorthands and `this` binding.
53808                      * 
53809                      * @private
53810                      * @param {Array|Object|string}
53811                      *            collection The collection to iterate over.
53812                      * @param {Function}
53813                      *            iteratee The function invoked per iteration.
53814                      * @returns {number} Returns the sum.
53815                      */
53816                     function baseSum(collection, iteratee) {
53817                         var result = 0;
53818                         baseEach(collection, function(value, index, collection) {
53819                             result += +iteratee(value, index, collection) || 0;
53820                         });
53821                         return result;
53822                     }
53823
53824                     /**
53825                      * The base implementation of `_.uniq` without support for callback
53826                      * shorthands and `this` binding.
53827                      * 
53828                      * @private
53829                      * @param {Array}
53830                      *            array The array to inspect.
53831                      * @param {Function}
53832                      *            [iteratee] The function invoked per iteration.
53833                      * @returns {Array} Returns the new duplicate-value-free array.
53834                      */
53835                     function baseUniq(array, iteratee) {
53836                         var index = -1,
53837                             indexOf = getIndexOf(),
53838                             length = array.length,
53839                             isCommon = indexOf == baseIndexOf,
53840                             isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
53841                             seen = isLarge ? createCache() : null,
53842                             result = [];
53843
53844                         if (seen) {
53845                             indexOf = cacheIndexOf;
53846                             isCommon = false;
53847                         } else {
53848                             isLarge = false;
53849                             seen = iteratee ? [] : result;
53850                         }
53851                         outer:
53852                             while (++index < length) {
53853                                 var value = array[index],
53854                                     computed = iteratee ? iteratee(value, index, array) : value;
53855
53856                                 if (isCommon && value === value) {
53857                                     var seenIndex = seen.length;
53858                                     while (seenIndex--) {
53859                                         if (seen[seenIndex] === computed) {
53860                                             continue outer;
53861                                         }
53862                                     }
53863                                     if (iteratee) {
53864                                         seen.push(computed);
53865                                     }
53866                                     result.push(value);
53867                                 } else if (indexOf(seen, computed, 0) < 0) {
53868                                     if (iteratee || isLarge) {
53869                                         seen.push(computed);
53870                                     }
53871                                     result.push(value);
53872                                 }
53873                             }
53874                         return result;
53875                     }
53876
53877                     /**
53878                      * The base implementation of `_.values` and `_.valuesIn` which creates an
53879                      * array of `object` property values corresponding to the property names of
53880                      * `props`.
53881                      * 
53882                      * @private
53883                      * @param {Object}
53884                      *            object The object to query.
53885                      * @param {Array}
53886                      *            props The property names to get values for.
53887                      * @returns {Object} Returns the array of property values.
53888                      */
53889                     function baseValues(object, props) {
53890                         var index = -1,
53891                             length = props.length,
53892                             result = Array(length);
53893
53894                         while (++index < length) {
53895                             result[index] = object[props[index]];
53896                         }
53897                         return result;
53898                     }
53899
53900                     /**
53901                      * The base implementation of `_.dropRightWhile`, `_.dropWhile`,
53902                      * `_.takeRightWhile`, and `_.takeWhile` without support for callback
53903                      * shorthands and `this` binding.
53904                      * 
53905                      * @private
53906                      * @param {Array}
53907                      *            array The array to query.
53908                      * @param {Function}
53909                      *            predicate The function invoked per iteration.
53910                      * @param {boolean}
53911                      *            [isDrop] Specify dropping elements instead of taking them.
53912                      * @param {boolean}
53913                      *            [fromRight] Specify iterating from right to left.
53914                      * @returns {Array} Returns the slice of `array`.
53915                      */
53916                     function baseWhile(array, predicate, isDrop, fromRight) {
53917                         var length = array.length,
53918                             index = fromRight ? length : -1;
53919
53920                         while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
53921                         return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
53922                     }
53923
53924                     /**
53925                      * The base implementation of `wrapperValue` which returns the result of
53926                      * performing a sequence of actions on the unwrapped `value`, where each
53927                      * successive action is supplied the return value of the previous.
53928                      * 
53929                      * @private
53930                      * @param {*}
53931                      *            value The unwrapped value.
53932                      * @param {Array}
53933                      *            actions Actions to peform to resolve the unwrapped value.
53934                      * @returns {*} Returns the resolved value.
53935                      */
53936                     function baseWrapperValue(value, actions) {
53937                         var result = value;
53938                         if (result instanceof LazyWrapper) {
53939                             result = result.value();
53940                         }
53941                         var index = -1,
53942                             length = actions.length;
53943
53944                         while (++index < length) {
53945                             var action = actions[index];
53946                             result = action.func.apply(action.thisArg, arrayPush([result], action.args));
53947                         }
53948                         return result;
53949                     }
53950
53951                     /**
53952                      * Performs a binary search of `array` to determine the index at which
53953                      * `value` should be inserted into `array` in order to maintain its sort
53954                      * order.
53955                      * 
53956                      * @private
53957                      * @param {Array}
53958                      *            array The sorted array to inspect.
53959                      * @param {*}
53960                      *            value The value to evaluate.
53961                      * @param {boolean}
53962                      *            [retHighest] Specify returning the highest qualified index.
53963                      * @returns {number} Returns the index at which `value` should be inserted
53964                      *          into `array`.
53965                      */
53966                     function binaryIndex(array, value, retHighest) {
53967                         var low = 0,
53968                             high = array ? array.length : low;
53969
53970                         if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
53971                             while (low < high) {
53972                                 var mid = (low + high) >>> 1,
53973                                     computed = array[mid];
53974
53975                                 if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
53976                                     low = mid + 1;
53977                                 } else {
53978                                     high = mid;
53979                                 }
53980                             }
53981                             return high;
53982                         }
53983                         return binaryIndexBy(array, value, identity, retHighest);
53984                     }
53985
53986                     /**
53987                      * This function is like `binaryIndex` except that it invokes `iteratee` for
53988                      * `value` and each element of `array` to compute their sort ranking. The
53989                      * iteratee is invoked with one argument; (value).
53990                      * 
53991                      * @private
53992                      * @param {Array}
53993                      *            array The sorted array to inspect.
53994                      * @param {*}
53995                      *            value The value to evaluate.
53996                      * @param {Function}
53997                      *            iteratee The function invoked per iteration.
53998                      * @param {boolean}
53999                      *            [retHighest] Specify returning the highest qualified index.
54000                      * @returns {number} Returns the index at which `value` should be inserted
54001                      *          into `array`.
54002                      */
54003                     function binaryIndexBy(array, value, iteratee, retHighest) {
54004                         value = iteratee(value);
54005
54006                         var low = 0,
54007                             high = array ? array.length : 0,
54008                             valIsNaN = value !== value,
54009                             valIsNull = value === null,
54010                             valIsUndef = value === undefined;
54011
54012                         while (low < high) {
54013                             var mid = nativeFloor((low + high) / 2),
54014                                 computed = iteratee(array[mid]),
54015                                 isDef = computed !== undefined,
54016                                 isReflexive = computed === computed;
54017
54018                             if (valIsNaN) {
54019                                 var setLow = isReflexive || retHighest;
54020                             } else if (valIsNull) {
54021                                 setLow = isReflexive && isDef && (retHighest || computed != null);
54022                             } else if (valIsUndef) {
54023                                 setLow = isReflexive && (retHighest || isDef);
54024                             } else if (computed == null) {
54025                                 setLow = false;
54026                             } else {
54027                                 setLow = retHighest ? (computed <= value) : (computed < value);
54028                             }
54029                             if (setLow) {
54030                                 low = mid + 1;
54031                             } else {
54032                                 high = mid;
54033                             }
54034                         }
54035                         return nativeMin(high, MAX_ARRAY_INDEX);
54036                     }
54037
54038                     /**
54039                      * A specialized version of `baseCallback` which only supports `this`
54040                      * binding and specifying the number of arguments to provide to `func`.
54041                      * 
54042                      * @private
54043                      * @param {Function}
54044                      *            func The function to bind.
54045                      * @param {*}
54046                      *            thisArg The `this` binding of `func`.
54047                      * @param {number}
54048                      *            [argCount] The number of arguments to provide to `func`.
54049                      * @returns {Function} Returns the callback.
54050                      */
54051                     function bindCallback(func, thisArg, argCount) {
54052                         if (typeof func != 'function') {
54053                             return identity;
54054                         }
54055                         if (thisArg === undefined) {
54056                             return func;
54057                         }
54058                         switch (argCount) {
54059                             case 1:
54060                                 return function(value) {
54061                                     return func.call(thisArg, value);
54062                                 };
54063                             case 3:
54064                                 return function(value, index, collection) {
54065                                     return func.call(thisArg, value, index, collection);
54066                                 };
54067                             case 4:
54068                                 return function(accumulator, value, index, collection) {
54069                                     return func.call(thisArg, accumulator, value, index, collection);
54070                                 };
54071                             case 5:
54072                                 return function(value, other, key, object, source) {
54073                                     return func.call(thisArg, value, other, key, object, source);
54074                                 };
54075                         }
54076                         return function() {
54077                             return func.apply(thisArg, arguments);
54078                         };
54079                     }
54080
54081                     /**
54082                      * Creates a clone of the given array buffer.
54083                      * 
54084                      * @private
54085                      * @param {ArrayBuffer}
54086                      *            buffer The array buffer to clone.
54087                      * @returns {ArrayBuffer} Returns the cloned array buffer.
54088                      */
54089                     function bufferClone(buffer) {
54090                         var result = new ArrayBuffer(buffer.byteLength),
54091                             view = new Uint8Array(result);
54092
54093                         view.set(new Uint8Array(buffer));
54094                         return result;
54095                     }
54096
54097                     /**
54098                      * Creates an array that is the composition of partially applied arguments,
54099                      * placeholders, and provided arguments into a single array of arguments.
54100                      * 
54101                      * @private
54102                      * @param {Array|Object}
54103                      *            args The provided arguments.
54104                      * @param {Array}
54105                      *            partials The arguments to prepend to those provided.
54106                      * @param {Array}
54107                      *            holders The `partials` placeholder indexes.
54108                      * @returns {Array} Returns the new array of composed arguments.
54109                      */
54110                     function composeArgs(args, partials, holders) {
54111                         var holdersLength = holders.length,
54112                             argsIndex = -1,
54113                             argsLength = nativeMax(args.length - holdersLength, 0),
54114                             leftIndex = -1,
54115                             leftLength = partials.length,
54116                             result = Array(leftLength + argsLength);
54117
54118                         while (++leftIndex < leftLength) {
54119                             result[leftIndex] = partials[leftIndex];
54120                         }
54121                         while (++argsIndex < holdersLength) {
54122                             result[holders[argsIndex]] = args[argsIndex];
54123                         }
54124                         while (argsLength--) {
54125                             result[leftIndex++] = args[argsIndex++];
54126                         }
54127                         return result;
54128                     }
54129
54130                     /**
54131                      * This function is like `composeArgs` except that the arguments composition
54132                      * is tailored for `_.partialRight`.
54133                      * 
54134                      * @private
54135                      * @param {Array|Object}
54136                      *            args The provided arguments.
54137                      * @param {Array}
54138                      *            partials The arguments to append to those provided.
54139                      * @param {Array}
54140                      *            holders The `partials` placeholder indexes.
54141                      * @returns {Array} Returns the new array of composed arguments.
54142                      */
54143                     function composeArgsRight(args, partials, holders) {
54144                         var holdersIndex = -1,
54145                             holdersLength = holders.length,
54146                             argsIndex = -1,
54147                             argsLength = nativeMax(args.length - holdersLength, 0),
54148                             rightIndex = -1,
54149                             rightLength = partials.length,
54150                             result = Array(argsLength + rightLength);
54151
54152                         while (++argsIndex < argsLength) {
54153                             result[argsIndex] = args[argsIndex];
54154                         }
54155                         var offset = argsIndex;
54156                         while (++rightIndex < rightLength) {
54157                             result[offset + rightIndex] = partials[rightIndex];
54158                         }
54159                         while (++holdersIndex < holdersLength) {
54160                             result[offset + holders[holdersIndex]] = args[argsIndex++];
54161                         }
54162                         return result;
54163                     }
54164
54165                     /**
54166                      * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition`
54167                      * function.
54168                      * 
54169                      * @private
54170                      * @param {Function}
54171                      *            setter The function to set keys and values of the accumulator
54172                      *            object.
54173                      * @param {Function}
54174                      *            [initializer] The function to initialize the accumulator
54175                      *            object.
54176                      * @returns {Function} Returns the new aggregator function.
54177                      */
54178                     function createAggregator(setter, initializer) {
54179                         return function(collection, iteratee, thisArg) {
54180                             var result = initializer ? initializer() : {};
54181                             iteratee = getCallback(iteratee, thisArg, 3);
54182
54183                             if (isArray(collection)) {
54184                                 var index = -1,
54185                                     length = collection.length;
54186
54187                                 while (++index < length) {
54188                                     var value = collection[index];
54189                                     setter(result, value, iteratee(value, index, collection), collection);
54190                                 }
54191                             } else {
54192                                 baseEach(collection, function(value, key, collection) {
54193                                     setter(result, value, iteratee(value, key, collection), collection);
54194                                 });
54195                             }
54196                             return result;
54197                         };
54198                     }
54199
54200                     /**
54201                      * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
54202                      * 
54203                      * @private
54204                      * @param {Function}
54205                      *            assigner The function to assign values.
54206                      * @returns {Function} Returns the new assigner function.
54207                      */
54208                     function createAssigner(assigner) {
54209                         return restParam(function(object, sources) {
54210                             var index = -1,
54211                                 length = object == null ? 0 : sources.length,
54212                                 customizer = length > 2 ? sources[length - 2] : undefined,
54213                                 guard = length > 2 ? sources[2] : undefined,
54214                                 thisArg = length > 1 ? sources[length - 1] : undefined;
54215
54216                             if (typeof customizer == 'function') {
54217                                 customizer = bindCallback(customizer, thisArg, 5);
54218                                 length -= 2;
54219                             } else {
54220                                 customizer = typeof thisArg == 'function' ? thisArg : undefined;
54221                                 length -= (customizer ? 1 : 0);
54222                             }
54223                             if (guard && isIterateeCall(sources[0], sources[1], guard)) {
54224                                 customizer = length < 3 ? undefined : customizer;
54225                                 length = 1;
54226                             }
54227                             while (++index < length) {
54228                                 var source = sources[index];
54229                                 if (source) {
54230                                     assigner(object, source, customizer);
54231                                 }
54232                             }
54233                             return object;
54234                         });
54235                     }
54236
54237                     /**
54238                      * Creates a `baseEach` or `baseEachRight` function.
54239                      * 
54240                      * @private
54241                      * @param {Function}
54242                      *            eachFunc The function to iterate over a collection.
54243                      * @param {boolean}
54244                      *            [fromRight] Specify iterating from right to left.
54245                      * @returns {Function} Returns the new base function.
54246                      */
54247                     function createBaseEach(eachFunc, fromRight) {
54248                         return function(collection, iteratee) {
54249                             var length = collection ? getLength(collection) : 0;
54250                             if (!isLength(length)) {
54251                                 return eachFunc(collection, iteratee);
54252                             }
54253                             var index = fromRight ? length : -1,
54254                                 iterable = toObject(collection);
54255
54256                             while ((fromRight ? index-- : ++index < length)) {
54257                                 if (iteratee(iterable[index], index, iterable) === false) {
54258                                     break;
54259                                 }
54260                             }
54261                             return collection;
54262                         };
54263                     }
54264
54265                     /**
54266                      * Creates a base function for `_.forIn` or `_.forInRight`.
54267                      * 
54268                      * @private
54269                      * @param {boolean}
54270                      *            [fromRight] Specify iterating from right to left.
54271                      * @returns {Function} Returns the new base function.
54272                      */
54273                     function createBaseFor(fromRight) {
54274                         return function(object, iteratee, keysFunc) {
54275                             var iterable = toObject(object),
54276                                 props = keysFunc(object),
54277                                 length = props.length,
54278                                 index = fromRight ? length : -1;
54279
54280                             while ((fromRight ? index-- : ++index < length)) {
54281                                 var key = props[index];
54282                                 if (iteratee(iterable[key], key, iterable) === false) {
54283                                     break;
54284                                 }
54285                             }
54286                             return object;
54287                         };
54288                     }
54289
54290                     /**
54291                      * Creates a function that wraps `func` and invokes it with the `this`
54292                      * binding of `thisArg`.
54293                      * 
54294                      * @private
54295                      * @param {Function}
54296                      *            func The function to bind.
54297                      * @param {*}
54298                      *            [thisArg] The `this` binding of `func`.
54299                      * @returns {Function} Returns the new bound function.
54300                      */
54301                     function createBindWrapper(func, thisArg) {
54302                         var Ctor = createCtorWrapper(func);
54303
54304                         function wrapper() {
54305                             var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
54306                             return fn.apply(thisArg, arguments);
54307                         }
54308                         return wrapper;
54309                     }
54310
54311                     /**
54312                      * Creates a `Set` cache object to optimize linear searches of large arrays.
54313                      * 
54314                      * @private
54315                      * @param {Array}
54316                      *            [values] The values to cache.
54317                      * @returns {null|Object} Returns the new cache object if `Set` is
54318                      *          supported, else `null`.
54319                      */
54320                     function createCache(values) {
54321                         return (nativeCreate && Set) ? new SetCache(values) : null;
54322                     }
54323
54324                     /**
54325                      * Creates a function that produces compound words out of the words in a
54326                      * given string.
54327                      * 
54328                      * @private
54329                      * @param {Function}
54330                      *            callback The function to combine each word.
54331                      * @returns {Function} Returns the new compounder function.
54332                      */
54333                     function createCompounder(callback) {
54334                         return function(string) {
54335                             var index = -1,
54336                                 array = words(deburr(string)),
54337                                 length = array.length,
54338                                 result = '';
54339
54340                             while (++index < length) {
54341                                 result = callback(result, array[index], index);
54342                             }
54343                             return result;
54344                         };
54345                     }
54346
54347                     /**
54348                      * Creates a function that produces an instance of `Ctor` regardless of
54349                      * whether it was invoked as part of a `new` expression or by `call` or
54350                      * `apply`.
54351                      * 
54352                      * @private
54353                      * @param {Function}
54354                      *            Ctor The constructor to wrap.
54355                      * @returns {Function} Returns the new wrapped function.
54356                      */
54357                     function createCtorWrapper(Ctor) {
54358                         return function() {
54359                             // Use a `switch` statement to work with class constructors.
54360                             // See
54361                             // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
54362                             // for more details.
54363                             var args = arguments;
54364                             switch (args.length) {
54365                                 case 0:
54366                                     return new Ctor;
54367                                 case 1:
54368                                     return new Ctor(args[0]);
54369                                 case 2:
54370                                     return new Ctor(args[0], args[1]);
54371                                 case 3:
54372                                     return new Ctor(args[0], args[1], args[2]);
54373                                 case 4:
54374                                     return new Ctor(args[0], args[1], args[2], args[3]);
54375                                 case 5:
54376                                     return new Ctor(args[0], args[1], args[2], args[3], args[4]);
54377                                 case 6:
54378                                     return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
54379                                 case 7:
54380                                     return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
54381                             }
54382                             var thisBinding = baseCreate(Ctor.prototype),
54383                                 result = Ctor.apply(thisBinding, args);
54384
54385                             // Mimic the constructor's `return` behavior.
54386                             // See https://es5.github.io/#x13.2.2 for more details.
54387                             return isObject(result) ? result : thisBinding;
54388                         };
54389                     }
54390
54391                     /**
54392                      * Creates a `_.curry` or `_.curryRight` function.
54393                      * 
54394                      * @private
54395                      * @param {boolean}
54396                      *            flag The curry bit flag.
54397                      * @returns {Function} Returns the new curry function.
54398                      */
54399                     function createCurry(flag) {
54400                         function curryFunc(func, arity, guard) {
54401                             if (guard && isIterateeCall(func, arity, guard)) {
54402                                 arity = undefined;
54403                             }
54404                             var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
54405                             result.placeholder = curryFunc.placeholder;
54406                             return result;
54407                         }
54408                         return curryFunc;
54409                     }
54410
54411                     /**
54412                      * Creates a `_.defaults` or `_.defaultsDeep` function.
54413                      * 
54414                      * @private
54415                      * @param {Function}
54416                      *            assigner The function to assign values.
54417                      * @param {Function}
54418                      *            customizer The function to customize assigned values.
54419                      * @returns {Function} Returns the new defaults function.
54420                      */
54421                     function createDefaults(assigner, customizer) {
54422                         return restParam(function(args) {
54423                             var object = args[0];
54424                             if (object == null) {
54425                                 return object;
54426                             }
54427                             args.push(customizer);
54428                             return assigner.apply(undefined, args);
54429                         });
54430                     }
54431
54432                     /**
54433                      * Creates a `_.max` or `_.min` function.
54434                      * 
54435                      * @private
54436                      * @param {Function}
54437                      *            comparator The function used to compare values.
54438                      * @param {*}
54439                      *            exValue The initial extremum value.
54440                      * @returns {Function} Returns the new extremum function.
54441                      */
54442                     function createExtremum(comparator, exValue) {
54443                         return function(collection, iteratee, thisArg) {
54444                             if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
54445                                 iteratee = undefined;
54446                             }
54447                             iteratee = getCallback(iteratee, thisArg, 3);
54448                             if (iteratee.length == 1) {
54449                                 collection = isArray(collection) ? collection : toIterable(collection);
54450                                 var result = arrayExtremum(collection, iteratee, comparator, exValue);
54451                                 if (!(collection.length && result === exValue)) {
54452                                     return result;
54453                                 }
54454                             }
54455                             return baseExtremum(collection, iteratee, comparator, exValue);
54456                         };
54457                     }
54458
54459                     /**
54460                      * Creates a `_.find` or `_.findLast` function.
54461                      * 
54462                      * @private
54463                      * @param {Function}
54464                      *            eachFunc The function to iterate over a collection.
54465                      * @param {boolean}
54466                      *            [fromRight] Specify iterating from right to left.
54467                      * @returns {Function} Returns the new find function.
54468                      */
54469                     function createFind(eachFunc, fromRight) {
54470                         return function(collection, predicate, thisArg) {
54471                             predicate = getCallback(predicate, thisArg, 3);
54472                             if (isArray(collection)) {
54473                                 var index = baseFindIndex(collection, predicate, fromRight);
54474                                 return index > -1 ? collection[index] : undefined;
54475                             }
54476                             return baseFind(collection, predicate, eachFunc);
54477                         };
54478                     }
54479
54480                     /**
54481                      * Creates a `_.findIndex` or `_.findLastIndex` function.
54482                      * 
54483                      * @private
54484                      * @param {boolean}
54485                      *            [fromRight] Specify iterating from right to left.
54486                      * @returns {Function} Returns the new find function.
54487                      */
54488                     function createFindIndex(fromRight) {
54489                         return function(array, predicate, thisArg) {
54490                             if (!(array && array.length)) {
54491                                 return -1;
54492                             }
54493                             predicate = getCallback(predicate, thisArg, 3);
54494                             return baseFindIndex(array, predicate, fromRight);
54495                         };
54496                     }
54497
54498                     /**
54499                      * Creates a `_.findKey` or `_.findLastKey` function.
54500                      * 
54501                      * @private
54502                      * @param {Function}
54503                      *            objectFunc The function to iterate over an object.
54504                      * @returns {Function} Returns the new find function.
54505                      */
54506                     function createFindKey(objectFunc) {
54507                         return function(object, predicate, thisArg) {
54508                             predicate = getCallback(predicate, thisArg, 3);
54509                             return baseFind(object, predicate, objectFunc, true);
54510                         };
54511                     }
54512
54513                     /**
54514                      * Creates a `_.flow` or `_.flowRight` function.
54515                      * 
54516                      * @private
54517                      * @param {boolean}
54518                      *            [fromRight] Specify iterating from right to left.
54519                      * @returns {Function} Returns the new flow function.
54520                      */
54521                     function createFlow(fromRight) {
54522                         return function() {
54523                             var wrapper,
54524                                 length = arguments.length,
54525                                 index = fromRight ? length : -1,
54526                                 leftIndex = 0,
54527                                 funcs = Array(length);
54528
54529                             while ((fromRight ? index-- : ++index < length)) {
54530                                 var func = funcs[leftIndex++] = arguments[index];
54531                                 if (typeof func != 'function') {
54532                                     throw new TypeError(FUNC_ERROR_TEXT);
54533                                 }
54534                                 if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
54535                                     wrapper = new LodashWrapper([], true);
54536                                 }
54537                             }
54538                             index = wrapper ? -1 : length;
54539                             while (++index < length) {
54540                                 func = funcs[index];
54541
54542                                 var funcName = getFuncName(func),
54543                                     data = funcName == 'wrapper' ? getData(func) : undefined;
54544
54545                                 if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
54546                                     wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
54547                                 } else {
54548                                     wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
54549                                 }
54550                             }
54551                             return function() {
54552                                 var args = arguments,
54553                                     value = args[0];
54554
54555                                 if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
54556                                     return wrapper.plant(value).value();
54557                                 }
54558                                 var index = 0,
54559                                     result = length ? funcs[index].apply(this, args) : value;
54560
54561                                 while (++index < length) {
54562                                     result = funcs[index].call(this, result);
54563                                 }
54564                                 return result;
54565                             };
54566                         };
54567                     }
54568
54569                     /**
54570                      * Creates a function for `_.forEach` or `_.forEachRight`.
54571                      * 
54572                      * @private
54573                      * @param {Function}
54574                      *            arrayFunc The function to iterate over an array.
54575                      * @param {Function}
54576                      *            eachFunc The function to iterate over a collection.
54577                      * @returns {Function} Returns the new each function.
54578                      */
54579                     function createForEach(arrayFunc, eachFunc) {
54580                         return function(collection, iteratee, thisArg) {
54581                             return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
54582                         };
54583                     }
54584
54585                     /**
54586                      * Creates a function for `_.forIn` or `_.forInRight`.
54587                      * 
54588                      * @private
54589                      * @param {Function}
54590                      *            objectFunc The function to iterate over an object.
54591                      * @returns {Function} Returns the new each function.
54592                      */
54593                     function createForIn(objectFunc) {
54594                         return function(object, iteratee, thisArg) {
54595                             if (typeof iteratee != 'function' || thisArg !== undefined) {
54596                                 iteratee = bindCallback(iteratee, thisArg, 3);
54597                             }
54598                             return objectFunc(object, iteratee, keysIn);
54599                         };
54600                     }
54601
54602                     /**
54603                      * Creates a function for `_.forOwn` or `_.forOwnRight`.
54604                      * 
54605                      * @private
54606                      * @param {Function}
54607                      *            objectFunc The function to iterate over an object.
54608                      * @returns {Function} Returns the new each function.
54609                      */
54610                     function createForOwn(objectFunc) {
54611                         return function(object, iteratee, thisArg) {
54612                             if (typeof iteratee != 'function' || thisArg !== undefined) {
54613                                 iteratee = bindCallback(iteratee, thisArg, 3);
54614                             }
54615                             return objectFunc(object, iteratee);
54616                         };
54617                     }
54618
54619                     /**
54620                      * Creates a function for `_.mapKeys` or `_.mapValues`.
54621                      * 
54622                      * @private
54623                      * @param {boolean}
54624                      *            [isMapKeys] Specify mapping keys instead of values.
54625                      * @returns {Function} Returns the new map function.
54626                      */
54627                     function createObjectMapper(isMapKeys) {
54628                         return function(object, iteratee, thisArg) {
54629                             var result = {};
54630                             iteratee = getCallback(iteratee, thisArg, 3);
54631
54632                             baseForOwn(object, function(value, key, object) {
54633                                 var mapped = iteratee(value, key, object);
54634                                 key = isMapKeys ? mapped : key;
54635                                 value = isMapKeys ? value : mapped;
54636                                 result[key] = value;
54637                             });
54638                             return result;
54639                         };
54640                     }
54641
54642                     /**
54643                      * Creates a function for `_.padLeft` or `_.padRight`.
54644                      * 
54645                      * @private
54646                      * @param {boolean}
54647                      *            [fromRight] Specify padding from the right.
54648                      * @returns {Function} Returns the new pad function.
54649                      */
54650                     function createPadDir(fromRight) {
54651                         return function(string, length, chars) {
54652                             string = baseToString(string);
54653                             return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
54654                         };
54655                     }
54656
54657                     /**
54658                      * Creates a `_.partial` or `_.partialRight` function.
54659                      * 
54660                      * @private
54661                      * @param {boolean}
54662                      *            flag The partial bit flag.
54663                      * @returns {Function} Returns the new partial function.
54664                      */
54665                     function createPartial(flag) {
54666                         var partialFunc = restParam(function(func, partials) {
54667                             var holders = replaceHolders(partials, partialFunc.placeholder);
54668                             return createWrapper(func, flag, undefined, partials, holders);
54669                         });
54670                         return partialFunc;
54671                     }
54672
54673                     /**
54674                      * Creates a function for `_.reduce` or `_.reduceRight`.
54675                      * 
54676                      * @private
54677                      * @param {Function}
54678                      *            arrayFunc The function to iterate over an array.
54679                      * @param {Function}
54680                      *            eachFunc The function to iterate over a collection.
54681                      * @returns {Function} Returns the new each function.
54682                      */
54683                     function createReduce(arrayFunc, eachFunc) {
54684                         return function(collection, iteratee, accumulator, thisArg) {
54685                             var initFromArray = arguments.length < 3;
54686                             return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
54687                         };
54688                     }
54689
54690                     /**
54691                      * Creates a function that wraps `func` and invokes it with optional `this`
54692                      * binding of, partial application, and currying.
54693                      * 
54694                      * @private
54695                      * @param {Function|string}
54696                      *            func The function or method name to reference.
54697                      * @param {number}
54698                      *            bitmask The bitmask of flags. See `createWrapper` for more
54699                      *            details.
54700                      * @param {*}
54701                      *            [thisArg] The `this` binding of `func`.
54702                      * @param {Array}
54703                      *            [partials] The arguments to prepend to those provided to the
54704                      *            new function.
54705                      * @param {Array}
54706                      *            [holders] The `partials` placeholder indexes.
54707                      * @param {Array}
54708                      *            [partialsRight] The arguments to append to those provided to
54709                      *            the new function.
54710                      * @param {Array}
54711                      *            [holdersRight] The `partialsRight` placeholder indexes.
54712                      * @param {Array}
54713                      *            [argPos] The argument positions of the new function.
54714                      * @param {number}
54715                      *            [ary] The arity cap of `func`.
54716                      * @param {number}
54717                      *            [arity] The arity of `func`.
54718                      * @returns {Function} Returns the new wrapped function.
54719                      */
54720                     function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
54721                         var isAry = bitmask & ARY_FLAG,
54722                             isBind = bitmask & BIND_FLAG,
54723                             isBindKey = bitmask & BIND_KEY_FLAG,
54724                             isCurry = bitmask & CURRY_FLAG,
54725                             isCurryBound = bitmask & CURRY_BOUND_FLAG,
54726                             isCurryRight = bitmask & CURRY_RIGHT_FLAG,
54727                             Ctor = isBindKey ? undefined : createCtorWrapper(func);
54728
54729                         function wrapper() {
54730                             // Avoid `arguments` object use disqualifying optimizations by
54731                             // converting it to an array before providing it to other functions.
54732                             var length = arguments.length,
54733                                 index = length,
54734                                 args = Array(length);
54735
54736                             while (index--) {
54737                                 args[index] = arguments[index];
54738                             }
54739                             if (partials) {
54740                                 args = composeArgs(args, partials, holders);
54741                             }
54742                             if (partialsRight) {
54743                                 args = composeArgsRight(args, partialsRight, holdersRight);
54744                             }
54745                             if (isCurry || isCurryRight) {
54746                                 var placeholder = wrapper.placeholder,
54747                                     argsHolders = replaceHolders(args, placeholder);
54748
54749                                 length -= argsHolders.length;
54750                                 if (length < arity) {
54751                                     var newArgPos = argPos ? arrayCopy(argPos) : undefined,
54752                                         newArity = nativeMax(arity - length, 0),
54753                                         newsHolders = isCurry ? argsHolders : undefined,
54754                                         newHoldersRight = isCurry ? undefined : argsHolders,
54755                                         newPartials = isCurry ? args : undefined,
54756                                         newPartialsRight = isCurry ? undefined : args;
54757
54758                                     bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
54759                                     bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
54760
54761                                     if (!isCurryBound) {
54762                                         bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
54763                                     }
54764                                     var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
54765                                         result = createHybridWrapper.apply(undefined, newData);
54766
54767                                     if (isLaziable(func)) {
54768                                         setData(result, newData);
54769                                     }
54770                                     result.placeholder = placeholder;
54771                                     return result;
54772                                 }
54773                             }
54774                             var thisBinding = isBind ? thisArg : this,
54775                                 fn = isBindKey ? thisBinding[func] : func;
54776
54777                             if (argPos) {
54778                                 args = reorder(args, argPos);
54779                             }
54780                             if (isAry && ary < args.length) {
54781                                 args.length = ary;
54782                             }
54783                             if (this && this !== root && this instanceof wrapper) {
54784                                 fn = Ctor || createCtorWrapper(func);
54785                             }
54786                             return fn.apply(thisBinding, args);
54787                         }
54788                         return wrapper;
54789                     }
54790
54791                     /**
54792                      * Creates the padding required for `string` based on the given `length`.
54793                      * The `chars` string is truncated if the number of characters exceeds
54794                      * `length`.
54795                      * 
54796                      * @private
54797                      * @param {string}
54798                      *            string The string to create padding for.
54799                      * @param {number}
54800                      *            [length=0] The padding length.
54801                      * @param {string}
54802                      *            [chars=' '] The string used as padding.
54803                      * @returns {string} Returns the pad for `string`.
54804                      */
54805                     function createPadding(string, length, chars) {
54806                         var strLength = string.length;
54807                         length = +length;
54808
54809                         if (strLength >= length || !nativeIsFinite(length)) {
54810                             return '';
54811                         }
54812                         var padLength = length - strLength;
54813                         chars = chars == null ? ' ' : (chars + '');
54814                         return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
54815                     }
54816
54817                     /**
54818                      * Creates a function that wraps `func` and invokes it with the optional
54819                      * `this` binding of `thisArg` and the `partials` prepended to those
54820                      * provided to the wrapper.
54821                      * 
54822                      * @private
54823                      * @param {Function}
54824                      *            func The function to partially apply arguments to.
54825                      * @param {number}
54826                      *            bitmask The bitmask of flags. See `createWrapper` for more
54827                      *            details.
54828                      * @param {*}
54829                      *            thisArg The `this` binding of `func`.
54830                      * @param {Array}
54831                      *            partials The arguments to prepend to those provided to the new
54832                      *            function.
54833                      * @returns {Function} Returns the new bound function.
54834                      */
54835                     function createPartialWrapper(func, bitmask, thisArg, partials) {
54836                         var isBind = bitmask & BIND_FLAG,
54837                             Ctor = createCtorWrapper(func);
54838
54839                         function wrapper() {
54840                             // Avoid `arguments` object use disqualifying optimizations by
54841                             // converting it to an array before providing it `func`.
54842                             var argsIndex = -1,
54843                                 argsLength = arguments.length,
54844                                 leftIndex = -1,
54845                                 leftLength = partials.length,
54846                                 args = Array(leftLength + argsLength);
54847
54848                             while (++leftIndex < leftLength) {
54849                                 args[leftIndex] = partials[leftIndex];
54850                             }
54851                             while (argsLength--) {
54852                                 args[leftIndex++] = arguments[++argsIndex];
54853                             }
54854                             var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
54855                             return fn.apply(isBind ? thisArg : this, args);
54856                         }
54857                         return wrapper;
54858                     }
54859
54860                     /**
54861                      * Creates a `_.ceil`, `_.floor`, or `_.round` function.
54862                      * 
54863                      * @private
54864                      * @param {string}
54865                      *            methodName The name of the `Math` method to use when rounding.
54866                      * @returns {Function} Returns the new round function.
54867                      */
54868                     function createRound(methodName) {
54869                         var func = Math[methodName];
54870                         return function(number, precision) {
54871                             precision = precision === undefined ? 0 : (+precision || 0);
54872                             if (precision) {
54873                                 precision = pow(10, precision);
54874                                 return func(number * precision) / precision;
54875                             }
54876                             return func(number);
54877                         };
54878                     }
54879
54880                     /**
54881                      * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
54882                      * 
54883                      * @private
54884                      * @param {boolean}
54885                      *            [retHighest] Specify returning the highest qualified index.
54886                      * @returns {Function} Returns the new index function.
54887                      */
54888                     function createSortedIndex(retHighest) {
54889                         return function(array, value, iteratee, thisArg) {
54890                             var callback = getCallback(iteratee);
54891                             return (iteratee == null && callback === baseCallback) ? binaryIndex(array, value, retHighest) : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
54892                         };
54893                     }
54894
54895                     /**
54896                      * Creates a function that either curries or invokes `func` with optional
54897                      * `this` binding and partially applied arguments.
54898                      * 
54899                      * @private
54900                      * @param {Function|string}
54901                      *            func The function or method name to reference.
54902                      * @param {number}
54903                      *            bitmask The bitmask of flags. The bitmask may be composed of
54904                      *            the following flags: 1 - `_.bind` 2 - `_.bindKey` 4 -
54905                      *            `_.curry` or `_.curryRight` of a bound function 8 - `_.curry`
54906                      *            16 - `_.curryRight` 32 - `_.partial` 64 - `_.partialRight` 128 -
54907                      *            `_.rearg` 256 - `_.ary`
54908                      * @param {*}
54909                      *            [thisArg] The `this` binding of `func`.
54910                      * @param {Array}
54911                      *            [partials] The arguments to be partially applied.
54912                      * @param {Array}
54913                      *            [holders] The `partials` placeholder indexes.
54914                      * @param {Array}
54915                      *            [argPos] The argument positions of the new function.
54916                      * @param {number}
54917                      *            [ary] The arity cap of `func`.
54918                      * @param {number}
54919                      *            [arity] The arity of `func`.
54920                      * @returns {Function} Returns the new wrapped function.
54921                      */
54922                     function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
54923                         var isBindKey = bitmask & BIND_KEY_FLAG;
54924                         if (!isBindKey && typeof func != 'function') {
54925                             throw new TypeError(FUNC_ERROR_TEXT);
54926                         }
54927                         var length = partials ? partials.length : 0;
54928                         if (!length) {
54929                             bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
54930                             partials = holders = undefined;
54931                         }
54932                         length -= (holders ? holders.length : 0);
54933                         if (bitmask & PARTIAL_RIGHT_FLAG) {
54934                             var partialsRight = partials,
54935                                 holdersRight = holders;
54936
54937                             partials = holders = undefined;
54938                         }
54939                         var data = isBindKey ? undefined : getData(func),
54940                             newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
54941
54942                         if (data) {
54943                             mergeData(newData, data);
54944                             bitmask = newData[1];
54945                             arity = newData[9];
54946                         }
54947                         newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0);
54948
54949                         if (bitmask == BIND_FLAG) {
54950                             var result = createBindWrapper(newData[0], newData[2]);
54951                         } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
54952                             result = createPartialWrapper.apply(undefined, newData);
54953                         } else {
54954                             result = createHybridWrapper.apply(undefined, newData);
54955                         }
54956                         var setter = data ? baseSetData : setData;
54957                         return setter(result, newData);
54958                     }
54959
54960                     /**
54961                      * A specialized version of `baseIsEqualDeep` for arrays with support for
54962                      * partial deep comparisons.
54963                      * 
54964                      * @private
54965                      * @param {Array}
54966                      *            array The array to compare.
54967                      * @param {Array}
54968                      *            other The other array to compare.
54969                      * @param {Function}
54970                      *            equalFunc The function to determine equivalents of values.
54971                      * @param {Function}
54972                      *            [customizer] The function to customize comparing arrays.
54973                      * @param {boolean}
54974                      *            [isLoose] Specify performing partial comparisons.
54975                      * @param {Array}
54976                      *            [stackA] Tracks traversed `value` objects.
54977                      * @param {Array}
54978                      *            [stackB] Tracks traversed `other` objects.
54979                      * @returns {boolean} Returns `true` if the arrays are equivalent, else
54980                      *          `false`.
54981                      */
54982                     function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
54983                         var index = -1,
54984                             arrLength = array.length,
54985                             othLength = other.length;
54986
54987                         if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
54988                             return false;
54989                         }
54990                         // Ignore non-index properties.
54991                         while (++index < arrLength) {
54992                             var arrValue = array[index],
54993                                 othValue = other[index],
54994                                 result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
54995
54996                             if (result !== undefined) {
54997                                 if (result) {
54998                                     continue;
54999                                 }
55000                                 return false;
55001                             }
55002                             // Recursively compare arrays (susceptible to call stack limits).
55003                             if (isLoose) {
55004                                 if (!arraySome(other, function(othValue) {
55005                                         return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
55006                                     })) {
55007                                     return false;
55008                                 }
55009                             } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
55010                                 return false;
55011                             }
55012                         }
55013                         return true;
55014                     }
55015
55016                     /**
55017                      * A specialized version of `baseIsEqualDeep` for comparing objects of the
55018                      * same `toStringTag`.
55019                      * 
55020                      * **Note:** This function only supports comparing values with tags of
55021                      * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
55022                      * 
55023                      * @private
55024                      * @param {Object}
55025                      *            object The object to compare.
55026                      * @param {Object}
55027                      *            other The other object to compare.
55028                      * @param {string}
55029                      *            tag The `toStringTag` of the objects to compare.
55030                      * @returns {boolean} Returns `true` if the objects are equivalent, else
55031                      *          `false`.
55032                      */
55033                     function equalByTag(object, other, tag) {
55034                         switch (tag) {
55035                             case boolTag:
55036                             case dateTag:
55037                                 // Coerce dates and booleans to numbers, dates to milliseconds and
55038                                 // booleans
55039                                 // to `1` or `0` treating invalid dates coerced to `NaN` as not
55040                                 // equal.
55041                                 return +object == +other;
55042
55043                             case errorTag:
55044                                 return object.name == other.name && object.message == other.message;
55045
55046                             case numberTag:
55047                                 // Treat `NaN` vs. `NaN` as equal.
55048                                 return (object != +object) ? other != +other : object == +other;
55049
55050                             case regexpTag:
55051                             case stringTag:
55052                                 // Coerce regexes to strings and treat strings primitives and string
55053                                 // objects as equal. See https://es5.github.io/#x15.10.6.4 for more
55054                                 // details.
55055                                 return object == (other + '');
55056                         }
55057                         return false;
55058                     }
55059
55060                     /**
55061                      * A specialized version of `baseIsEqualDeep` for objects with support for
55062                      * partial deep comparisons.
55063                      * 
55064                      * @private
55065                      * @param {Object}
55066                      *            object The object to compare.
55067                      * @param {Object}
55068                      *            other The other object to compare.
55069                      * @param {Function}
55070                      *            equalFunc The function to determine equivalents of values.
55071                      * @param {Function}
55072                      *            [customizer] The function to customize comparing values.
55073                      * @param {boolean}
55074                      *            [isLoose] Specify performing partial comparisons.
55075                      * @param {Array}
55076                      *            [stackA] Tracks traversed `value` objects.
55077                      * @param {Array}
55078                      *            [stackB] Tracks traversed `other` objects.
55079                      * @returns {boolean} Returns `true` if the objects are equivalent, else
55080                      *          `false`.
55081                      */
55082                     function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
55083                         var objProps = keys(object),
55084                             objLength = objProps.length,
55085                             othProps = keys(other),
55086                             othLength = othProps.length;
55087
55088                         if (objLength != othLength && !isLoose) {
55089                             return false;
55090                         }
55091                         var index = objLength;
55092                         while (index--) {
55093                             var key = objProps[index];
55094                             if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
55095                                 return false;
55096                             }
55097                         }
55098                         var skipCtor = isLoose;
55099                         while (++index < objLength) {
55100                             key = objProps[index];
55101                             var objValue = object[key],
55102                                 othValue = other[key],
55103                                 result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
55104
55105                             // Recursively compare objects (susceptible to call stack limits).
55106                             if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
55107                                 return false;
55108                             }
55109                             skipCtor || (skipCtor = key == 'constructor');
55110                         }
55111                         if (!skipCtor) {
55112                             var objCtor = object.constructor,
55113                                 othCtor = other.constructor;
55114
55115                             // Non `Object` object instances with different constructors are not
55116                             // equal.
55117                             if (objCtor != othCtor &&
55118                                 ('constructor' in object && 'constructor' in other) &&
55119                                 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
55120                                     typeof othCtor == 'function' && othCtor instanceof othCtor)) {
55121                                 return false;
55122                             }
55123                         }
55124                         return true;
55125                     }
55126
55127                     /**
55128                      * Gets the appropriate "callback" function. If the `_.callback` method is
55129                      * customized this function returns the custom method, otherwise it returns
55130                      * the `baseCallback` function. If arguments are provided the chosen
55131                      * function is invoked with them and its result is returned.
55132                      * 
55133                      * @private
55134                      * @returns {Function} Returns the chosen function or its result.
55135                      */
55136                     function getCallback(func, thisArg, argCount) {
55137                         var result = lodash.callback || callback;
55138                         result = result === callback ? baseCallback : result;
55139                         return argCount ? result(func, thisArg, argCount) : result;
55140                     }
55141
55142                     /**
55143                      * Gets metadata for `func`.
55144                      * 
55145                      * @private
55146                      * @param {Function}
55147                      *            func The function to query.
55148                      * @returns {*} Returns the metadata for `func`.
55149                      */
55150                     var getData = !metaMap ? noop : function(func) {
55151                         return metaMap.get(func);
55152                     };
55153
55154                     /**
55155                      * Gets the name of `func`.
55156                      * 
55157                      * @private
55158                      * @param {Function}
55159                      *            func The function to query.
55160                      * @returns {string} Returns the function name.
55161                      */
55162                     function getFuncName(func) {
55163                         var result = func.name,
55164                             array = realNames[result],
55165                             length = array ? array.length : 0;
55166
55167                         while (length--) {
55168                             var data = array[length],
55169                                 otherFunc = data.func;
55170                             if (otherFunc == null || otherFunc == func) {
55171                                 return data.name;
55172                             }
55173                         }
55174                         return result;
55175                     }
55176
55177                     /**
55178                      * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
55179                      * customized this function returns the custom method, otherwise it returns
55180                      * the `baseIndexOf` function. If arguments are provided the chosen function
55181                      * is invoked with them and its result is returned.
55182                      * 
55183                      * @private
55184                      * @returns {Function|number} Returns the chosen function or its result.
55185                      */
55186                     function getIndexOf(collection, target, fromIndex) {
55187                         var result = lodash.indexOf || indexOf;
55188                         result = result === indexOf ? baseIndexOf : result;
55189                         return collection ? result(collection, target, fromIndex) : result;
55190                     }
55191
55192                     /**
55193                      * Gets the "length" property value of `object`.
55194                      * 
55195                      * **Note:** This function is used to avoid a [JIT
55196                      * bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects Safari
55197                      * on at least iOS 8.1-8.3 ARM64.
55198                      * 
55199                      * @private
55200                      * @param {Object}
55201                      *            object The object to query.
55202                      * @returns {*} Returns the "length" value.
55203                      */
55204                     var getLength = baseProperty('length');
55205
55206                     /**
55207                      * Gets the propery names, values, and compare flags of `object`.
55208                      * 
55209                      * @private
55210                      * @param {Object}
55211                      *            object The object to query.
55212                      * @returns {Array} Returns the match data of `object`.
55213                      */
55214                     function getMatchData(object) {
55215                         var result = pairs(object),
55216                             length = result.length;
55217
55218                         while (length--) {
55219                             result[length][2] = isStrictComparable(result[length][1]);
55220                         }
55221                         return result;
55222                     }
55223
55224                     /**
55225                      * Gets the native function at `key` of `object`.
55226                      * 
55227                      * @private
55228                      * @param {Object}
55229                      *            object The object to query.
55230                      * @param {string}
55231                      *            key The key of the method to get.
55232                      * @returns {*} Returns the function if it's native, else `undefined`.
55233                      */
55234                     function getNative(object, key) {
55235                         var value = object == null ? undefined : object[key];
55236                         return isNative(value) ? value : undefined;
55237                     }
55238
55239                     /**
55240                      * Gets the view, applying any `transforms` to the `start` and `end`
55241                      * positions.
55242                      * 
55243                      * @private
55244                      * @param {number}
55245                      *            start The start of the view.
55246                      * @param {number}
55247                      *            end The end of the view.
55248                      * @param {Array}
55249                      *            transforms The transformations to apply to the view.
55250                      * @returns {Object} Returns an object containing the `start` and `end`
55251                      *          positions of the view.
55252                      */
55253                     function getView(start, end, transforms) {
55254                         var index = -1,
55255                             length = transforms.length;
55256
55257                         while (++index < length) {
55258                             var data = transforms[index],
55259                                 size = data.size;
55260
55261                             switch (data.type) {
55262                                 case 'drop':
55263                                     start += size;
55264                                     break;
55265                                 case 'dropRight':
55266                                     end -= size;
55267                                     break;
55268                                 case 'take':
55269                                     end = nativeMin(end, start + size);
55270                                     break;
55271                                 case 'takeRight':
55272                                     start = nativeMax(start, end - size);
55273                                     break;
55274                             }
55275                         }
55276                         return {
55277                             'start': start,
55278                             'end': end
55279                         };
55280                     }
55281
55282                     /**
55283                      * Initializes an array clone.
55284                      * 
55285                      * @private
55286                      * @param {Array}
55287                      *            array The array to clone.
55288                      * @returns {Array} Returns the initialized clone.
55289                      */
55290                     function initCloneArray(array) {
55291                         var length = array.length,
55292                             result = new array.constructor(length);
55293
55294                         // Add array properties assigned by `RegExp#exec`.
55295                         if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
55296                             result.index = array.index;
55297                             result.input = array.input;
55298                         }
55299                         return result;
55300                     }
55301
55302                     /**
55303                      * Initializes an object clone.
55304                      * 
55305                      * @private
55306                      * @param {Object}
55307                      *            object The object to clone.
55308                      * @returns {Object} Returns the initialized clone.
55309                      */
55310                     function initCloneObject(object) {
55311                         var Ctor = object.constructor;
55312                         if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
55313                             Ctor = Object;
55314                         }
55315                         return new Ctor;
55316                     }
55317
55318                     /**
55319                      * Initializes an object clone based on its `toStringTag`.
55320                      * 
55321                      * **Note:** This function only supports cloning values with tags of
55322                      * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
55323                      * 
55324                      * @private
55325                      * @param {Object}
55326                      *            object The object to clone.
55327                      * @param {string}
55328                      *            tag The `toStringTag` of the object to clone.
55329                      * @param {boolean}
55330                      *            [isDeep] Specify a deep clone.
55331                      * @returns {Object} Returns the initialized clone.
55332                      */
55333                     function initCloneByTag(object, tag, isDeep) {
55334                         var Ctor = object.constructor;
55335                         switch (tag) {
55336                             case arrayBufferTag:
55337                                 return bufferClone(object);
55338
55339                             case boolTag:
55340                             case dateTag:
55341                                 return new Ctor(+object);
55342
55343                             case float32Tag:
55344                             case float64Tag:
55345                             case int8Tag:
55346                             case int16Tag:
55347                             case int32Tag:
55348                             case uint8Tag:
55349                             case uint8ClampedTag:
55350                             case uint16Tag:
55351                             case uint32Tag:
55352                                 var buffer = object.buffer;
55353                                 return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
55354
55355                             case numberTag:
55356                             case stringTag:
55357                                 return new Ctor(object);
55358
55359                             case regexpTag:
55360                                 var result = new Ctor(object.source, reFlags.exec(object));
55361                                 result.lastIndex = object.lastIndex;
55362                         }
55363                         return result;
55364                     }
55365
55366                     /**
55367                      * Invokes the method at `path` on `object`.
55368                      * 
55369                      * @private
55370                      * @param {Object}
55371                      *            object The object to query.
55372                      * @param {Array|string}
55373                      *            path The path of the method to invoke.
55374                      * @param {Array}
55375                      *            args The arguments to invoke the method with.
55376                      * @returns {*} Returns the result of the invoked method.
55377                      */
55378                     function invokePath(object, path, args) {
55379                         if (object != null && !isKey(path, object)) {
55380                             path = toPath(path);
55381                             object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
55382                             path = last(path);
55383                         }
55384                         var func = object == null ? object : object[path];
55385                         return func == null ? undefined : func.apply(object, args);
55386                     }
55387
55388                     /**
55389                      * Checks if `value` is array-like.
55390                      * 
55391                      * @private
55392                      * @param {*}
55393                      *            value The value to check.
55394                      * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
55395                      */
55396                     function isArrayLike(value) {
55397                         return value != null && isLength(getLength(value));
55398                     }
55399
55400                     /**
55401                      * Checks if `value` is a valid array-like index.
55402                      * 
55403                      * @private
55404                      * @param {*}
55405                      *            value The value to check.
55406                      * @param {number}
55407                      *            [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
55408                      * @returns {boolean} Returns `true` if `value` is a valid index, else
55409                      *          `false`.
55410                      */
55411                     function isIndex(value, length) {
55412                         value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
55413                         length = length == null ? MAX_SAFE_INTEGER : length;
55414                         return value > -1 && value % 1 == 0 && value < length;
55415                     }
55416
55417                     /**
55418                      * Checks if the provided arguments are from an iteratee call.
55419                      * 
55420                      * @private
55421                      * @param {*}
55422                      *            value The potential iteratee value argument.
55423                      * @param {*}
55424                      *            index The potential iteratee index or key argument.
55425                      * @param {*}
55426                      *            object The potential iteratee object argument.
55427                      * @returns {boolean} Returns `true` if the arguments are from an iteratee
55428                      *          call, else `false`.
55429                      */
55430                     function isIterateeCall(value, index, object) {
55431                         if (!isObject(object)) {
55432                             return false;
55433                         }
55434                         var type = typeof index;
55435                         if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) {
55436                             var other = object[index];
55437                             return value === value ? (value === other) : (other !== other);
55438                         }
55439                         return false;
55440                     }
55441
55442                     /**
55443                      * Checks if `value` is a property name and not a property path.
55444                      * 
55445                      * @private
55446                      * @param {*}
55447                      *            value The value to check.
55448                      * @param {Object}
55449                      *            [object] The object to query keys on.
55450                      * @returns {boolean} Returns `true` if `value` is a property name, else
55451                      *          `false`.
55452                      */
55453                     function isKey(value, object) {
55454                         var type = typeof value;
55455                         if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
55456                             return true;
55457                         }
55458                         if (isArray(value)) {
55459                             return false;
55460                         }
55461                         var result = !reIsDeepProp.test(value);
55462                         return result || (object != null && value in toObject(object));
55463                     }
55464
55465                     /**
55466                      * Checks if `func` has a lazy counterpart.
55467                      * 
55468                      * @private
55469                      * @param {Function}
55470                      *            func The function to check.
55471                      * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else
55472                      *          `false`.
55473                      */
55474                     function isLaziable(func) {
55475                         var funcName = getFuncName(func);
55476                         if (!(funcName in LazyWrapper.prototype)) {
55477                             return false;
55478                         }
55479                         var other = lodash[funcName];
55480                         if (func === other) {
55481                             return true;
55482                         }
55483                         var data = getData(other);
55484                         return !!data && func === data[0];
55485                     }
55486
55487                     /**
55488                      * Checks if `value` is a valid array-like length.
55489                      * 
55490                      * **Note:** This function is based on
55491                      * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
55492                      * 
55493                      * @private
55494                      * @param {*}
55495                      *            value The value to check.
55496                      * @returns {boolean} Returns `true` if `value` is a valid length, else
55497                      *          `false`.
55498                      */
55499                     function isLength(value) {
55500                         return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
55501                     }
55502
55503                     /**
55504                      * Checks if `value` is suitable for strict equality comparisons, i.e.
55505                      * `===`.
55506                      * 
55507                      * @private
55508                      * @param {*}
55509                      *            value The value to check.
55510                      * @returns {boolean} Returns `true` if `value` if suitable for strict
55511                      *          equality comparisons, else `false`.
55512                      */
55513                     function isStrictComparable(value) {
55514                         return value === value && !isObject(value);
55515                     }
55516
55517                     /**
55518                      * Merges the function metadata of `source` into `data`.
55519                      * 
55520                      * Merging metadata reduces the number of wrappers required to invoke a
55521                      * function. This is possible because methods like `_.bind`, `_.curry`, and
55522                      * `_.partial` may be applied regardless of execution order. Methods like
55523                      * `_.ary` and `_.rearg` augment function arguments, making the order in
55524                      * which they are executed important, preventing the merging of metadata.
55525                      * However, we make an exception for a safe common case where curried
55526                      * functions have `_.ary` and or `_.rearg` applied.
55527                      * 
55528                      * @private
55529                      * @param {Array}
55530                      *            data The destination metadata.
55531                      * @param {Array}
55532                      *            source The source metadata.
55533                      * @returns {Array} Returns `data`.
55534                      */
55535                     function mergeData(data, source) {
55536                         var bitmask = data[1],
55537                             srcBitmask = source[1],
55538                             newBitmask = bitmask | srcBitmask,
55539                             isCommon = newBitmask < ARY_FLAG;
55540
55541                         var isCombo =
55542                             (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
55543                             (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
55544                             (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
55545
55546                         // Exit early if metadata can't be merged.
55547                         if (!(isCommon || isCombo)) {
55548                             return data;
55549                         }
55550                         // Use source `thisArg` if available.
55551                         if (srcBitmask & BIND_FLAG) {
55552                             data[2] = source[2];
55553                             // Set when currying a bound function.
55554                             newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
55555                         }
55556                         // Compose partial arguments.
55557                         var value = source[3];
55558                         if (value) {
55559                             var partials = data[3];
55560                             data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
55561                             data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
55562                         }
55563                         // Compose partial right arguments.
55564                         value = source[5];
55565                         if (value) {
55566                             partials = data[5];
55567                             data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
55568                             data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
55569                         }
55570                         // Use source `argPos` if available.
55571                         value = source[7];
55572                         if (value) {
55573                             data[7] = arrayCopy(value);
55574                         }
55575                         // Use source `ary` if it's smaller.
55576                         if (srcBitmask & ARY_FLAG) {
55577                             data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
55578                         }
55579                         // Use source `arity` if one is not provided.
55580                         if (data[9] == null) {
55581                             data[9] = source[9];
55582                         }
55583                         // Use source `func` and merge bitmasks.
55584                         data[0] = source[0];
55585                         data[1] = newBitmask;
55586
55587                         return data;
55588                     }
55589
55590                     /**
55591                      * Used by `_.defaultsDeep` to customize its `_.merge` use.
55592                      * 
55593                      * @private
55594                      * @param {*}
55595                      *            objectValue The destination object property value.
55596                      * @param {*}
55597                      *            sourceValue The source object property value.
55598                      * @returns {*} Returns the value to assign to the destination object.
55599                      */
55600                     function mergeDefaults(objectValue, sourceValue) {
55601                         return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);
55602                     }
55603
55604                     /**
55605                      * A specialized version of `_.pick` which picks `object` properties
55606                      * specified by `props`.
55607                      * 
55608                      * @private
55609                      * @param {Object}
55610                      *            object The source object.
55611                      * @param {string[]}
55612                      *            props The property names to pick.
55613                      * @returns {Object} Returns the new object.
55614                      */
55615                     function pickByArray(object, props) {
55616                         object = toObject(object);
55617
55618                         var index = -1,
55619                             length = props.length,
55620                             result = {};
55621
55622                         while (++index < length) {
55623                             var key = props[index];
55624                             if (key in object) {
55625                                 result[key] = object[key];
55626                             }
55627                         }
55628                         return result;
55629                     }
55630
55631                     /**
55632                      * A specialized version of `_.pick` which picks `object` properties
55633                      * `predicate` returns truthy for.
55634                      * 
55635                      * @private
55636                      * @param {Object}
55637                      *            object The source object.
55638                      * @param {Function}
55639                      *            predicate The function invoked per iteration.
55640                      * @returns {Object} Returns the new object.
55641                      */
55642                     function pickByCallback(object, predicate) {
55643                         var result = {};
55644                         baseForIn(object, function(value, key, object) {
55645                             if (predicate(value, key, object)) {
55646                                 result[key] = value;
55647                             }
55648                         });
55649                         return result;
55650                     }
55651
55652                     /**
55653                      * Reorder `array` according to the specified indexes where the element at
55654                      * the first index is assigned as the first element, the element at the
55655                      * second index is assigned as the second element, and so on.
55656                      * 
55657                      * @private
55658                      * @param {Array}
55659                      *            array The array to reorder.
55660                      * @param {Array}
55661                      *            indexes The arranged array indexes.
55662                      * @returns {Array} Returns `array`.
55663                      */
55664                     function reorder(array, indexes) {
55665                         var arrLength = array.length,
55666                             length = nativeMin(indexes.length, arrLength),
55667                             oldArray = arrayCopy(array);
55668
55669                         while (length--) {
55670                             var index = indexes[length];
55671                             array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
55672                         }
55673                         return array;
55674                     }
55675
55676                     /**
55677                      * Sets metadata for `func`.
55678                      * 
55679                      * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
55680                      * period of time, it will trip its breaker and transition to an identity
55681                      * function to avoid garbage collection pauses in V8. See [V8 issue
55682                      * 2070](https://code.google.com/p/v8/issues/detail?id=2070) for more
55683                      * details.
55684                      * 
55685                      * @private
55686                      * @param {Function}
55687                      *            func The function to associate metadata with.
55688                      * @param {*}
55689                      *            data The metadata.
55690                      * @returns {Function} Returns `func`.
55691                      */
55692                     var setData = (function() {
55693                         var count = 0,
55694                             lastCalled = 0;
55695
55696                         return function(key, value) {
55697                             var stamp = now(),
55698                                 remaining = HOT_SPAN - (stamp - lastCalled);
55699
55700                             lastCalled = stamp;
55701                             if (remaining > 0) {
55702                                 if (++count >= HOT_COUNT) {
55703                                     return key;
55704                                 }
55705                             } else {
55706                                 count = 0;
55707                             }
55708                             return baseSetData(key, value);
55709                         };
55710                     }());
55711
55712                     /**
55713                      * A fallback implementation of `Object.keys` which creates an array of the
55714                      * own enumerable property names of `object`.
55715                      * 
55716                      * @private
55717                      * @param {Object}
55718                      *            object The object to query.
55719                      * @returns {Array} Returns the array of property names.
55720                      */
55721                     function shimKeys(object) {
55722                         var props = keysIn(object),
55723                             propsLength = props.length,
55724                             length = propsLength && object.length;
55725
55726                         var allowIndexes = !!length && isLength(length) &&
55727                             (isArray(object) || isArguments(object));
55728
55729                         var index = -1,
55730                             result = [];
55731
55732                         while (++index < propsLength) {
55733                             var key = props[index];
55734                             if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
55735                                 result.push(key);
55736                             }
55737                         }
55738                         return result;
55739                     }
55740
55741                     /**
55742                      * Converts `value` to an array-like object if it's not one.
55743                      * 
55744                      * @private
55745                      * @param {*}
55746                      *            value The value to process.
55747                      * @returns {Array|Object} Returns the array-like object.
55748                      */
55749                     function toIterable(value) {
55750                         if (value == null) {
55751                             return [];
55752                         }
55753                         if (!isArrayLike(value)) {
55754                             return values(value);
55755                         }
55756                         return isObject(value) ? value : Object(value);
55757                     }
55758
55759                     /**
55760                      * Converts `value` to an object if it's not one.
55761                      * 
55762                      * @private
55763                      * @param {*}
55764                      *            value The value to process.
55765                      * @returns {Object} Returns the object.
55766                      */
55767                     function toObject(value) {
55768                         return isObject(value) ? value : Object(value);
55769                     }
55770
55771                     /**
55772                      * Converts `value` to property path array if it's not one.
55773                      * 
55774                      * @private
55775                      * @param {*}
55776                      *            value The value to process.
55777                      * @returns {Array} Returns the property path array.
55778                      */
55779                     function toPath(value) {
55780                         if (isArray(value)) {
55781                             return value;
55782                         }
55783                         var result = [];
55784                         baseToString(value).replace(rePropName, function(match, number, quote, string) {
55785                             result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
55786                         });
55787                         return result;
55788                     }
55789
55790                     /**
55791                      * Creates a clone of `wrapper`.
55792                      * 
55793                      * @private
55794                      * @param {Object}
55795                      *            wrapper The wrapper to clone.
55796                      * @returns {Object} Returns the cloned wrapper.
55797                      */
55798                     function wrapperClone(wrapper) {
55799                         return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
55800                     }
55801
55802                     /*------------------------------------------------------------------------*/
55803
55804                     /**
55805                      * Creates an array of elements split into groups the length of `size`. If
55806                      * `collection` can't be split evenly, the final chunk will be the remaining
55807                      * elements.
55808                      * 
55809                      * @static
55810                      * @memberOf _
55811                      * @category Array
55812                      * @param {Array}
55813                      *            array The array to process.
55814                      * @param {number}
55815                      *            [size=1] The length of each chunk.
55816                      * @param- {Object} [guard] Enables use as a callback for functions like
55817                      *         `_.map`.
55818                      * @returns {Array} Returns the new array containing chunks.
55819                      * @example
55820                      * 
55821                      * _.chunk(['a', 'b', 'c', 'd'], 2); // => [['a', 'b'], ['c', 'd']]
55822                      * 
55823                      * _.chunk(['a', 'b', 'c', 'd'], 3); // => [['a', 'b', 'c'], ['d']]
55824                      */
55825                     function chunk(array, size, guard) {
55826                         if (guard ? isIterateeCall(array, size, guard) : size == null) {
55827                             size = 1;
55828                         } else {
55829                             size = nativeMax(nativeFloor(size) || 1, 1);
55830                         }
55831                         var index = 0,
55832                             length = array ? array.length : 0,
55833                             resIndex = -1,
55834                             result = Array(nativeCeil(length / size));
55835
55836                         while (index < length) {
55837                             result[++resIndex] = baseSlice(array, index, (index += size));
55838                         }
55839                         return result;
55840                     }
55841
55842                     /**
55843                      * Creates an array with all falsey values removed. The values `false`,
55844                      * `null`, `0`, `""`, `undefined`, and `NaN` are falsey.
55845                      * 
55846                      * @static
55847                      * @memberOf _
55848                      * @category Array
55849                      * @param {Array}
55850                      *            array The array to compact.
55851                      * @returns {Array} Returns the new array of filtered values.
55852                      * @example
55853                      * 
55854                      * _.compact([0, 1, false, 2, '', 3]); // => [1, 2, 3]
55855                      */
55856                     function compact(array) {
55857                         var index = -1,
55858                             length = array ? array.length : 0,
55859                             resIndex = -1,
55860                             result = [];
55861
55862                         while (++index < length) {
55863                             var value = array[index];
55864                             if (value) {
55865                                 result[++resIndex] = value;
55866                             }
55867                         }
55868                         return result;
55869                     }
55870
55871                     /**
55872                      * Creates an array of unique `array` values not included in the other
55873                      * provided arrays using
55874                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
55875                      * for equality comparisons.
55876                      * 
55877                      * @static
55878                      * @memberOf _
55879                      * @category Array
55880                      * @param {Array}
55881                      *            array The array to inspect.
55882                      * @param {...Array}
55883                      *            [values] The arrays of values to exclude.
55884                      * @returns {Array} Returns the new array of filtered values.
55885                      * @example
55886                      * 
55887                      * _.difference([1, 2, 3], [4, 2]); // => [1, 3]
55888                      */
55889                     var difference = restParam(function(array, values) {
55890                         return (isObjectLike(array) && isArrayLike(array)) ? baseDifference(array, baseFlatten(values, false, true)) : [];
55891                     });
55892
55893                     /**
55894                      * Creates a slice of `array` with `n` elements dropped from the beginning.
55895                      * 
55896                      * @static
55897                      * @memberOf _
55898                      * @category Array
55899                      * @param {Array}
55900                      *            array The array to query.
55901                      * @param {number}
55902                      *            [n=1] The number of elements to drop.
55903                      * @param- {Object} [guard] Enables use as a callback for functions like
55904                      *         `_.map`.
55905                      * @returns {Array} Returns the slice of `array`.
55906                      * @example
55907                      * 
55908                      * _.drop([1, 2, 3]); // => [2, 3]
55909                      * 
55910                      * _.drop([1, 2, 3], 2); // => [3]
55911                      * 
55912                      * _.drop([1, 2, 3], 5); // => []
55913                      * 
55914                      * _.drop([1, 2, 3], 0); // => [1, 2, 3]
55915                      */
55916                     function drop(array, n, guard) {
55917                         var length = array ? array.length : 0;
55918                         if (!length) {
55919                             return [];
55920                         }
55921                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
55922                             n = 1;
55923                         }
55924                         return baseSlice(array, n < 0 ? 0 : n);
55925                     }
55926
55927                     /**
55928                      * Creates a slice of `array` with `n` elements dropped from the end.
55929                      * 
55930                      * @static
55931                      * @memberOf _
55932                      * @category Array
55933                      * @param {Array}
55934                      *            array The array to query.
55935                      * @param {number}
55936                      *            [n=1] The number of elements to drop.
55937                      * @param- {Object} [guard] Enables use as a callback for functions like
55938                      *         `_.map`.
55939                      * @returns {Array} Returns the slice of `array`.
55940                      * @example
55941                      * 
55942                      * _.dropRight([1, 2, 3]); // => [1, 2]
55943                      * 
55944                      * _.dropRight([1, 2, 3], 2); // => [1]
55945                      * 
55946                      * _.dropRight([1, 2, 3], 5); // => []
55947                      * 
55948                      * _.dropRight([1, 2, 3], 0); // => [1, 2, 3]
55949                      */
55950                     function dropRight(array, n, guard) {
55951                         var length = array ? array.length : 0;
55952                         if (!length) {
55953                             return [];
55954                         }
55955                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
55956                             n = 1;
55957                         }
55958                         n = length - (+n || 0);
55959                         return baseSlice(array, 0, n < 0 ? 0 : n);
55960                     }
55961
55962                     /**
55963                      * Creates a slice of `array` excluding elements dropped from the end.
55964                      * Elements are dropped until `predicate` returns falsey. The predicate is
55965                      * bound to `thisArg` and invoked with three arguments: (value, index,
55966                      * array).
55967                      * 
55968                      * If a property name is provided for `predicate` the created `_.property`
55969                      * style callback returns the property value of the given element.
55970                      * 
55971                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
55972                      * style callback returns `true` for elements that have a matching property
55973                      * value, else `false`.
55974                      * 
55975                      * If an object is provided for `predicate` the created `_.matches` style
55976                      * callback returns `true` for elements that match the properties of the
55977                      * given object, else `false`.
55978                      * 
55979                      * @static
55980                      * @memberOf _
55981                      * @category Array
55982                      * @param {Array}
55983                      *            array The array to query.
55984                      * @param {Function|Object|string}
55985                      *            [predicate=_.identity] The function invoked per iteration.
55986                      * @param {*}
55987                      *            [thisArg] The `this` binding of `predicate`.
55988                      * @returns {Array} Returns the slice of `array`.
55989                      * @example
55990                      * 
55991                      * _.dropRightWhile([1, 2, 3], function(n) { return n > 1; }); // => [1]
55992                      * 
55993                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
55994                      * 'active': false }, { 'user': 'pebbles', 'active': false } ];
55995                      *  // using the `_.matches` callback shorthand
55996                      * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }),
55997                      * 'user'); // => ['barney', 'fred']
55998                      *  // using the `_.matchesProperty` callback shorthand
55999                      * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); // =>
56000                      * ['barney']
56001                      *  // using the `_.property` callback shorthand
56002                      * _.pluck(_.dropRightWhile(users, 'active'), 'user'); // => ['barney',
56003                      * 'fred', 'pebbles']
56004                      */
56005                     function dropRightWhile(array, predicate, thisArg) {
56006                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) : [];
56007                     }
56008
56009                     /**
56010                      * Creates a slice of `array` excluding elements dropped from the beginning.
56011                      * Elements are dropped until `predicate` returns falsey. The predicate is
56012                      * bound to `thisArg` and invoked with three arguments: (value, index,
56013                      * array).
56014                      * 
56015                      * If a property name is provided for `predicate` the created `_.property`
56016                      * style callback returns the property value of the given element.
56017                      * 
56018                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56019                      * style callback returns `true` for elements that have a matching property
56020                      * value, else `false`.
56021                      * 
56022                      * If an object is provided for `predicate` the created `_.matches` style
56023                      * callback returns `true` for elements that have the properties of the
56024                      * given object, else `false`.
56025                      * 
56026                      * @static
56027                      * @memberOf _
56028                      * @category Array
56029                      * @param {Array}
56030                      *            array The array to query.
56031                      * @param {Function|Object|string}
56032                      *            [predicate=_.identity] The function invoked per iteration.
56033                      * @param {*}
56034                      *            [thisArg] The `this` binding of `predicate`.
56035                      * @returns {Array} Returns the slice of `array`.
56036                      * @example
56037                      * 
56038                      * _.dropWhile([1, 2, 3], function(n) { return n < 3; }); // => [3]
56039                      * 
56040                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
56041                      * 'active': false }, { 'user': 'pebbles', 'active': true } ];
56042                      *  // using the `_.matches` callback shorthand _.pluck(_.dropWhile(users, {
56043                      * 'user': 'barney', 'active': false }), 'user'); // => ['fred', 'pebbles']
56044                      *  // using the `_.matchesProperty` callback shorthand
56045                      * _.pluck(_.dropWhile(users, 'active', false), 'user'); // => ['pebbles']
56046                      *  // using the `_.property` callback shorthand _.pluck(_.dropWhile(users,
56047                      * 'active'), 'user'); // => ['barney', 'fred', 'pebbles']
56048                      */
56049                     function dropWhile(array, predicate, thisArg) {
56050                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true) : [];
56051                     }
56052
56053                     /**
56054                      * Fills elements of `array` with `value` from `start` up to, but not
56055                      * including, `end`.
56056                      * 
56057                      * **Note:** This method mutates `array`.
56058                      * 
56059                      * @static
56060                      * @memberOf _
56061                      * @category Array
56062                      * @param {Array}
56063                      *            array The array to fill.
56064                      * @param {*}
56065                      *            value The value to fill `array` with.
56066                      * @param {number}
56067                      *            [start=0] The start position.
56068                      * @param {number}
56069                      *            [end=array.length] The end position.
56070                      * @returns {Array} Returns `array`.
56071                      * @example
56072                      * 
56073                      * var array = [1, 2, 3];
56074                      * 
56075                      * _.fill(array, 'a'); console.log(array); // => ['a', 'a', 'a']
56076                      * 
56077                      * _.fill(Array(3), 2); // => [2, 2, 2]
56078                      * 
56079                      * _.fill([4, 6, 8], '*', 1, 2); // => [4, '*', 8]
56080                      */
56081                     function fill(array, value, start, end) {
56082                         var length = array ? array.length : 0;
56083                         if (!length) {
56084                             return [];
56085                         }
56086                         if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
56087                             start = 0;
56088                             end = length;
56089                         }
56090                         return baseFill(array, value, start, end);
56091                     }
56092
56093                     /**
56094                      * This method is like `_.find` except that it returns the index of the
56095                      * first element `predicate` returns truthy for instead of the element
56096                      * itself.
56097                      * 
56098                      * If a property name is provided for `predicate` the created `_.property`
56099                      * style callback returns the property value of the given element.
56100                      * 
56101                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56102                      * style callback returns `true` for elements that have a matching property
56103                      * value, else `false`.
56104                      * 
56105                      * If an object is provided for `predicate` the created `_.matches` style
56106                      * callback returns `true` for elements that have the properties of the
56107                      * given object, else `false`.
56108                      * 
56109                      * @static
56110                      * @memberOf _
56111                      * @category Array
56112                      * @param {Array}
56113                      *            array The array to search.
56114                      * @param {Function|Object|string}
56115                      *            [predicate=_.identity] The function invoked per iteration.
56116                      * @param {*}
56117                      *            [thisArg] The `this` binding of `predicate`.
56118                      * @returns {number} Returns the index of the found element, else `-1`.
56119                      * @example
56120                      * 
56121                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
56122                      * 'active': false }, { 'user': 'pebbles', 'active': true } ];
56123                      * 
56124                      * _.findIndex(users, function(chr) { return chr.user == 'barney'; }); // =>
56125                      * 0
56126                      *  // using the `_.matches` callback shorthand _.findIndex(users, { 'user':
56127                      * 'fred', 'active': false }); // => 1
56128                      *  // using the `_.matchesProperty` callback shorthand _.findIndex(users,
56129                      * 'active', false); // => 0
56130                      *  // using the `_.property` callback shorthand _.findIndex(users,
56131                      * 'active'); // => 2
56132                      */
56133                     var findIndex = createFindIndex();
56134
56135                     /**
56136                      * This method is like `_.findIndex` except that it iterates over elements
56137                      * of `collection` from right to left.
56138                      * 
56139                      * If a property name is provided for `predicate` the created `_.property`
56140                      * style callback returns the property value of the given element.
56141                      * 
56142                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56143                      * style callback returns `true` for elements that have a matching property
56144                      * value, else `false`.
56145                      * 
56146                      * If an object is provided for `predicate` the created `_.matches` style
56147                      * callback returns `true` for elements that have the properties of the
56148                      * given object, else `false`.
56149                      * 
56150                      * @static
56151                      * @memberOf _
56152                      * @category Array
56153                      * @param {Array}
56154                      *            array The array to search.
56155                      * @param {Function|Object|string}
56156                      *            [predicate=_.identity] The function invoked per iteration.
56157                      * @param {*}
56158                      *            [thisArg] The `this` binding of `predicate`.
56159                      * @returns {number} Returns the index of the found element, else `-1`.
56160                      * @example
56161                      * 
56162                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56163                      * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56164                      * 
56165                      * _.findLastIndex(users, function(chr) { return chr.user == 'pebbles'; }); // =>
56166                      * 2
56167                      *  // using the `_.matches` callback shorthand _.findLastIndex(users, {
56168                      * 'user': 'barney', 'active': true }); // => 0
56169                      *  // using the `_.matchesProperty` callback shorthand
56170                      * _.findLastIndex(users, 'active', false); // => 2
56171                      *  // using the `_.property` callback shorthand _.findLastIndex(users,
56172                      * 'active'); // => 0
56173                      */
56174                     var findLastIndex = createFindIndex(true);
56175
56176                     /**
56177                      * Gets the first element of `array`.
56178                      * 
56179                      * @static
56180                      * @memberOf _
56181                      * @alias head
56182                      * @category Array
56183                      * @param {Array}
56184                      *            array The array to query.
56185                      * @returns {*} Returns the first element of `array`.
56186                      * @example
56187                      * 
56188                      * _.first([1, 2, 3]); // => 1
56189                      * 
56190                      * _.first([]); // => undefined
56191                      */
56192                     function first(array) {
56193                         return array ? array[0] : undefined;
56194                     }
56195
56196                     /**
56197                      * Flattens a nested array. If `isDeep` is `true` the array is recursively
56198                      * flattened, otherwise it is only flattened a single level.
56199                      * 
56200                      * @static
56201                      * @memberOf _
56202                      * @category Array
56203                      * @param {Array}
56204                      *            array The array to flatten.
56205                      * @param {boolean}
56206                      *            [isDeep] Specify a deep flatten.
56207                      * @param- {Object} [guard] Enables use as a callback for functions like
56208                      *         `_.map`.
56209                      * @returns {Array} Returns the new flattened array.
56210                      * @example
56211                      * 
56212                      * _.flatten([1, [2, 3, [4]]]); // => [1, 2, 3, [4]]
56213                      *  // using `isDeep` _.flatten([1, [2, 3, [4]]], true); // => [1, 2, 3, 4]
56214                      */
56215                     function flatten(array, isDeep, guard) {
56216                         var length = array ? array.length : 0;
56217                         if (guard && isIterateeCall(array, isDeep, guard)) {
56218                             isDeep = false;
56219                         }
56220                         return length ? baseFlatten(array, isDeep) : [];
56221                     }
56222
56223                     /**
56224                      * Recursively flattens a nested array.
56225                      * 
56226                      * @static
56227                      * @memberOf _
56228                      * @category Array
56229                      * @param {Array}
56230                      *            array The array to recursively flatten.
56231                      * @returns {Array} Returns the new flattened array.
56232                      * @example
56233                      * 
56234                      * _.flattenDeep([1, [2, 3, [4]]]); // => [1, 2, 3, 4]
56235                      */
56236                     function flattenDeep(array) {
56237                         var length = array ? array.length : 0;
56238                         return length ? baseFlatten(array, true) : [];
56239                     }
56240
56241                     /**
56242                      * Gets the index at which the first occurrence of `value` is found in
56243                      * `array` using
56244                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56245                      * for equality comparisons. If `fromIndex` is negative, it is used as the
56246                      * offset from the end of `array`. If `array` is sorted providing `true` for
56247                      * `fromIndex` performs a faster binary search.
56248                      * 
56249                      * @static
56250                      * @memberOf _
56251                      * @category Array
56252                      * @param {Array}
56253                      *            array The array to search.
56254                      * @param {*}
56255                      *            value The value to search for.
56256                      * @param {boolean|number}
56257                      *            [fromIndex=0] The index to search from or `true` to perform a
56258                      *            binary search on a sorted array.
56259                      * @returns {number} Returns the index of the matched value, else `-1`.
56260                      * @example
56261                      * 
56262                      * _.indexOf([1, 2, 1, 2], 2); // => 1
56263                      *  // using `fromIndex` _.indexOf([1, 2, 1, 2], 2, 2); // => 3
56264                      *  // performing a binary search _.indexOf([1, 1, 2, 2], 2, true); // => 2
56265                      */
56266                     function indexOf(array, value, fromIndex) {
56267                         var length = array ? array.length : 0;
56268                         if (!length) {
56269                             return -1;
56270                         }
56271                         if (typeof fromIndex == 'number') {
56272                             fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
56273                         } else if (fromIndex) {
56274                             var index = binaryIndex(array, value);
56275                             if (index < length &&
56276                                 (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
56277                                 return index;
56278                             }
56279                             return -1;
56280                         }
56281                         return baseIndexOf(array, value, fromIndex || 0);
56282                     }
56283
56284                     /**
56285                      * Gets all but the last element of `array`.
56286                      * 
56287                      * @static
56288                      * @memberOf _
56289                      * @category Array
56290                      * @param {Array}
56291                      *            array The array to query.
56292                      * @returns {Array} Returns the slice of `array`.
56293                      * @example
56294                      * 
56295                      * _.initial([1, 2, 3]); // => [1, 2]
56296                      */
56297                     function initial(array) {
56298                         return dropRight(array, 1);
56299                     }
56300
56301                     /**
56302                      * Creates an array of unique values that are included in all of the
56303                      * provided arrays using
56304                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56305                      * for equality comparisons.
56306                      * 
56307                      * @static
56308                      * @memberOf _
56309                      * @category Array
56310                      * @param {...Array}
56311                      *            [arrays] The arrays to inspect.
56312                      * @returns {Array} Returns the new array of shared values.
56313                      * @example _.intersection([1, 2], [4, 2], [2, 1]); // => [2]
56314                      */
56315                     var intersection = restParam(function(arrays) {
56316                         var othLength = arrays.length,
56317                             othIndex = othLength,
56318                             caches = Array(length),
56319                             indexOf = getIndexOf(),
56320                             isCommon = indexOf == baseIndexOf,
56321                             result = [];
56322
56323                         while (othIndex--) {
56324                             var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
56325                             caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
56326                         }
56327                         var array = arrays[0],
56328                             index = -1,
56329                             length = array ? array.length : 0,
56330                             seen = caches[0];
56331
56332                         outer:
56333                             while (++index < length) {
56334                                 value = array[index];
56335                                 if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
56336                                     var othIndex = othLength;
56337                                     while (--othIndex) {
56338                                         var cache = caches[othIndex];
56339                                         if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
56340                                             continue outer;
56341                                         }
56342                                     }
56343                                     if (seen) {
56344                                         seen.push(value);
56345                                     }
56346                                     result.push(value);
56347                                 }
56348                             }
56349                         return result;
56350                     });
56351
56352                     /**
56353                      * Gets the last element of `array`.
56354                      * 
56355                      * @static
56356                      * @memberOf _
56357                      * @category Array
56358                      * @param {Array}
56359                      *            array The array to query.
56360                      * @returns {*} Returns the last element of `array`.
56361                      * @example
56362                      * 
56363                      * _.last([1, 2, 3]); // => 3
56364                      */
56365                     function last(array) {
56366                         var length = array ? array.length : 0;
56367                         return length ? array[length - 1] : undefined;
56368                     }
56369
56370                     /**
56371                      * This method is like `_.indexOf` except that it iterates over elements of
56372                      * `array` from right to left.
56373                      * 
56374                      * @static
56375                      * @memberOf _
56376                      * @category Array
56377                      * @param {Array}
56378                      *            array The array to search.
56379                      * @param {*}
56380                      *            value The value to search for.
56381                      * @param {boolean|number}
56382                      *            [fromIndex=array.length-1] The index to search from or `true`
56383                      *            to perform a binary search on a sorted array.
56384                      * @returns {number} Returns the index of the matched value, else `-1`.
56385                      * @example
56386                      * 
56387                      * _.lastIndexOf([1, 2, 1, 2], 2); // => 3
56388                      *  // using `fromIndex` _.lastIndexOf([1, 2, 1, 2], 2, 2); // => 1
56389                      *  // performing a binary search _.lastIndexOf([1, 1, 2, 2], 2, true); // =>
56390                      * 3
56391                      */
56392                     function lastIndexOf(array, value, fromIndex) {
56393                         var length = array ? array.length : 0;
56394                         if (!length) {
56395                             return -1;
56396                         }
56397                         var index = length;
56398                         if (typeof fromIndex == 'number') {
56399                             index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
56400                         } else if (fromIndex) {
56401                             index = binaryIndex(array, value, true) - 1;
56402                             var other = array[index];
56403                             if (value === value ? (value === other) : (other !== other)) {
56404                                 return index;
56405                             }
56406                             return -1;
56407                         }
56408                         if (value !== value) {
56409                             return indexOfNaN(array, index, true);
56410                         }
56411                         while (index--) {
56412                             if (array[index] === value) {
56413                                 return index;
56414                             }
56415                         }
56416                         return -1;
56417                     }
56418
56419                     /**
56420                      * Removes all provided values from `array` using
56421                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56422                      * for equality comparisons.
56423                      * 
56424                      * **Note:** Unlike `_.without`, this method mutates `array`.
56425                      * 
56426                      * @static
56427                      * @memberOf _
56428                      * @category Array
56429                      * @param {Array}
56430                      *            array The array to modify.
56431                      * @param {...*}
56432                      *            [values] The values to remove.
56433                      * @returns {Array} Returns `array`.
56434                      * @example
56435                      * 
56436                      * var array = [1, 2, 3, 1, 2, 3];
56437                      * 
56438                      * _.pull(array, 2, 3); console.log(array); // => [1, 1]
56439                      */
56440                     function pull() {
56441                         var args = arguments,
56442                             array = args[0];
56443
56444                         if (!(array && array.length)) {
56445                             return array;
56446                         }
56447                         var index = 0,
56448                             indexOf = getIndexOf(),
56449                             length = args.length;
56450
56451                         while (++index < length) {
56452                             var fromIndex = 0,
56453                                 value = args[index];
56454
56455                             while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
56456                                 splice.call(array, fromIndex, 1);
56457                             }
56458                         }
56459                         return array;
56460                     }
56461
56462                     /**
56463                      * Removes elements from `array` corresponding to the given indexes and
56464                      * returns an array of the removed elements. Indexes may be specified as an
56465                      * array of indexes or as individual arguments.
56466                      * 
56467                      * **Note:** Unlike `_.at`, this method mutates `array`.
56468                      * 
56469                      * @static
56470                      * @memberOf _
56471                      * @category Array
56472                      * @param {Array}
56473                      *            array The array to modify.
56474                      * @param {...(number|number[])}
56475                      *            [indexes] The indexes of elements to remove, specified as
56476                      *            individual indexes or arrays of indexes.
56477                      * @returns {Array} Returns the new array of removed elements.
56478                      * @example
56479                      * 
56480                      * var array = [5, 10, 15, 20]; var evens = _.pullAt(array, 1, 3);
56481                      * 
56482                      * console.log(array); // => [5, 15]
56483                      * 
56484                      * console.log(evens); // => [10, 20]
56485                      */
56486                     var pullAt = restParam(function(array, indexes) {
56487                         indexes = baseFlatten(indexes);
56488
56489                         var result = baseAt(array, indexes);
56490                         basePullAt(array, indexes.sort(baseCompareAscending));
56491                         return result;
56492                     });
56493
56494                     /**
56495                      * Removes all elements from `array` that `predicate` returns truthy for and
56496                      * returns an array of the removed elements. The predicate is bound to
56497                      * `thisArg` and invoked with three arguments: (value, index, array).
56498                      * 
56499                      * If a property name is provided for `predicate` the created `_.property`
56500                      * style callback returns the property value of the given element.
56501                      * 
56502                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56503                      * style callback returns `true` for elements that have a matching property
56504                      * value, else `false`.
56505                      * 
56506                      * If an object is provided for `predicate` the created `_.matches` style
56507                      * callback returns `true` for elements that have the properties of the
56508                      * given object, else `false`.
56509                      * 
56510                      * **Note:** Unlike `_.filter`, this method mutates `array`.
56511                      * 
56512                      * @static
56513                      * @memberOf _
56514                      * @category Array
56515                      * @param {Array}
56516                      *            array The array to modify.
56517                      * @param {Function|Object|string}
56518                      *            [predicate=_.identity] The function invoked per iteration.
56519                      * @param {*}
56520                      *            [thisArg] The `this` binding of `predicate`.
56521                      * @returns {Array} Returns the new array of removed elements.
56522                      * @example
56523                      * 
56524                      * var array = [1, 2, 3, 4]; var evens = _.remove(array, function(n) {
56525                      * return n % 2 == 0; });
56526                      * 
56527                      * console.log(array); // => [1, 3]
56528                      * 
56529                      * console.log(evens); // => [2, 4]
56530                      */
56531                     function remove(array, predicate, thisArg) {
56532                         var result = [];
56533                         if (!(array && array.length)) {
56534                             return result;
56535                         }
56536                         var index = -1,
56537                             indexes = [],
56538                             length = array.length;
56539
56540                         predicate = getCallback(predicate, thisArg, 3);
56541                         while (++index < length) {
56542                             var value = array[index];
56543                             if (predicate(value, index, array)) {
56544                                 result.push(value);
56545                                 indexes.push(index);
56546                             }
56547                         }
56548                         basePullAt(array, indexes);
56549                         return result;
56550                     }
56551
56552                     /**
56553                      * Gets all but the first element of `array`.
56554                      * 
56555                      * @static
56556                      * @memberOf _
56557                      * @alias tail
56558                      * @category Array
56559                      * @param {Array}
56560                      *            array The array to query.
56561                      * @returns {Array} Returns the slice of `array`.
56562                      * @example
56563                      * 
56564                      * _.rest([1, 2, 3]); // => [2, 3]
56565                      */
56566                     function rest(array) {
56567                         return drop(array, 1);
56568                     }
56569
56570                     /**
56571                      * Creates a slice of `array` from `start` up to, but not including, `end`.
56572                      * 
56573                      * **Note:** This method is used instead of `Array#slice` to support node
56574                      * lists in IE < 9 and to ensure dense arrays are returned.
56575                      * 
56576                      * @static
56577                      * @memberOf _
56578                      * @category Array
56579                      * @param {Array}
56580                      *            array The array to slice.
56581                      * @param {number}
56582                      *            [start=0] The start position.
56583                      * @param {number}
56584                      *            [end=array.length] The end position.
56585                      * @returns {Array} Returns the slice of `array`.
56586                      */
56587                     function slice(array, start, end) {
56588                         var length = array ? array.length : 0;
56589                         if (!length) {
56590                             return [];
56591                         }
56592                         if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
56593                             start = 0;
56594                             end = length;
56595                         }
56596                         return baseSlice(array, start, end);
56597                     }
56598
56599                     /**
56600                      * Uses a binary search to determine the lowest index at which `value`
56601                      * should be inserted into `array` in order to maintain its sort order. If
56602                      * an iteratee function is provided it is invoked for `value` and each
56603                      * element of `array` to compute their sort ranking. The iteratee is bound
56604                      * to `thisArg` and invoked with one argument; (value).
56605                      * 
56606                      * If a property name is provided for `iteratee` the created `_.property`
56607                      * style callback returns the property value of the given element.
56608                      * 
56609                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56610                      * style callback returns `true` for elements that have a matching property
56611                      * value, else `false`.
56612                      * 
56613                      * If an object is provided for `iteratee` the created `_.matches` style
56614                      * callback returns `true` for elements that have the properties of the
56615                      * given object, else `false`.
56616                      * 
56617                      * @static
56618                      * @memberOf _
56619                      * @category Array
56620                      * @param {Array}
56621                      *            array The sorted array to inspect.
56622                      * @param {*}
56623                      *            value The value to evaluate.
56624                      * @param {Function|Object|string}
56625                      *            [iteratee=_.identity] The function invoked per iteration.
56626                      * @param {*}
56627                      *            [thisArg] The `this` binding of `iteratee`.
56628                      * @returns {number} Returns the index at which `value` should be inserted
56629                      *          into `array`.
56630                      * @example
56631                      * 
56632                      * _.sortedIndex([30, 50], 40); // => 1
56633                      * 
56634                      * _.sortedIndex([4, 4, 5, 5], 5); // => 2
56635                      * 
56636                      * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
56637                      *  // using an iteratee function _.sortedIndex(['thirty', 'fifty'],
56638                      * 'forty', function(word) { return this.data[word]; }, dict); // => 1
56639                      *  // using the `_.property` callback shorthand _.sortedIndex([{ 'x': 30 }, {
56640                      * 'x': 50 }], { 'x': 40 }, 'x'); // => 1
56641                      */
56642                     var sortedIndex = createSortedIndex();
56643
56644                     /**
56645                      * This method is like `_.sortedIndex` except that it returns the highest
56646                      * index at which `value` should be inserted into `array` in order to
56647                      * maintain its sort order.
56648                      * 
56649                      * @static
56650                      * @memberOf _
56651                      * @category Array
56652                      * @param {Array}
56653                      *            array The sorted array to inspect.
56654                      * @param {*}
56655                      *            value The value to evaluate.
56656                      * @param {Function|Object|string}
56657                      *            [iteratee=_.identity] The function invoked per iteration.
56658                      * @param {*}
56659                      *            [thisArg] The `this` binding of `iteratee`.
56660                      * @returns {number} Returns the index at which `value` should be inserted
56661                      *          into `array`.
56662                      * @example
56663                      * 
56664                      * _.sortedLastIndex([4, 4, 5, 5], 5); // => 4
56665                      */
56666                     var sortedLastIndex = createSortedIndex(true);
56667
56668                     /**
56669                      * Creates a slice of `array` with `n` elements taken from the beginning.
56670                      * 
56671                      * @static
56672                      * @memberOf _
56673                      * @category Array
56674                      * @param {Array}
56675                      *            array The array to query.
56676                      * @param {number}
56677                      *            [n=1] The number of elements to take.
56678                      * @param- {Object} [guard] Enables use as a callback for functions like
56679                      *         `_.map`.
56680                      * @returns {Array} Returns the slice of `array`.
56681                      * @example
56682                      * 
56683                      * _.take([1, 2, 3]); // => [1]
56684                      * 
56685                      * _.take([1, 2, 3], 2); // => [1, 2]
56686                      * 
56687                      * _.take([1, 2, 3], 5); // => [1, 2, 3]
56688                      * 
56689                      * _.take([1, 2, 3], 0); // => []
56690                      */
56691                     function take(array, n, guard) {
56692                         var length = array ? array.length : 0;
56693                         if (!length) {
56694                             return [];
56695                         }
56696                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
56697                             n = 1;
56698                         }
56699                         return baseSlice(array, 0, n < 0 ? 0 : n);
56700                     }
56701
56702                     /**
56703                      * Creates a slice of `array` with `n` elements taken from the end.
56704                      * 
56705                      * @static
56706                      * @memberOf _
56707                      * @category Array
56708                      * @param {Array}
56709                      *            array The array to query.
56710                      * @param {number}
56711                      *            [n=1] The number of elements to take.
56712                      * @param- {Object} [guard] Enables use as a callback for functions like
56713                      *         `_.map`.
56714                      * @returns {Array} Returns the slice of `array`.
56715                      * @example
56716                      * 
56717                      * _.takeRight([1, 2, 3]); // => [3]
56718                      * 
56719                      * _.takeRight([1, 2, 3], 2); // => [2, 3]
56720                      * 
56721                      * _.takeRight([1, 2, 3], 5); // => [1, 2, 3]
56722                      * 
56723                      * _.takeRight([1, 2, 3], 0); // => []
56724                      */
56725                     function takeRight(array, n, guard) {
56726                         var length = array ? array.length : 0;
56727                         if (!length) {
56728                             return [];
56729                         }
56730                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
56731                             n = 1;
56732                         }
56733                         n = length - (+n || 0);
56734                         return baseSlice(array, n < 0 ? 0 : n);
56735                     }
56736
56737                     /**
56738                      * Creates a slice of `array` with elements taken from the end. Elements are
56739                      * taken until `predicate` returns falsey. The predicate is bound to
56740                      * `thisArg` and invoked with three arguments: (value, index, array).
56741                      * 
56742                      * If a property name is provided for `predicate` the created `_.property`
56743                      * style callback returns the property value of the given element.
56744                      * 
56745                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56746                      * style callback returns `true` for elements that have a matching property
56747                      * value, else `false`.
56748                      * 
56749                      * If an object is provided for `predicate` the created `_.matches` style
56750                      * callback returns `true` for elements that have the properties of the
56751                      * given object, else `false`.
56752                      * 
56753                      * @static
56754                      * @memberOf _
56755                      * @category Array
56756                      * @param {Array}
56757                      *            array The array to query.
56758                      * @param {Function|Object|string}
56759                      *            [predicate=_.identity] The function invoked per iteration.
56760                      * @param {*}
56761                      *            [thisArg] The `this` binding of `predicate`.
56762                      * @returns {Array} Returns the slice of `array`.
56763                      * @example
56764                      * 
56765                      * _.takeRightWhile([1, 2, 3], function(n) { return n > 1; }); // => [2, 3]
56766                      * 
56767                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56768                      * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56769                      *  // using the `_.matches` callback shorthand
56770                      * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }),
56771                      * 'user'); // => ['pebbles']
56772                      *  // using the `_.matchesProperty` callback shorthand
56773                      * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); // => ['fred',
56774                      * 'pebbles']
56775                      *  // using the `_.property` callback shorthand
56776                      * _.pluck(_.takeRightWhile(users, 'active'), 'user'); // => []
56777                      */
56778                     function takeRightWhile(array, predicate, thisArg) {
56779                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) : [];
56780                     }
56781
56782                     /**
56783                      * Creates a slice of `array` with elements taken from the beginning.
56784                      * Elements are taken until `predicate` returns falsey. The predicate is
56785                      * bound to `thisArg` and invoked with three arguments: (value, index,
56786                      * array).
56787                      * 
56788                      * If a property name is provided for `predicate` the created `_.property`
56789                      * style callback returns the property value of the given element.
56790                      * 
56791                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56792                      * style callback returns `true` for elements that have a matching property
56793                      * value, else `false`.
56794                      * 
56795                      * If an object is provided for `predicate` the created `_.matches` style
56796                      * callback returns `true` for elements that have the properties of the
56797                      * given object, else `false`.
56798                      * 
56799                      * @static
56800                      * @memberOf _
56801                      * @category Array
56802                      * @param {Array}
56803                      *            array The array to query.
56804                      * @param {Function|Object|string}
56805                      *            [predicate=_.identity] The function invoked per iteration.
56806                      * @param {*}
56807                      *            [thisArg] The `this` binding of `predicate`.
56808                      * @returns {Array} Returns the slice of `array`.
56809                      * @example
56810                      * 
56811                      * _.takeWhile([1, 2, 3], function(n) { return n < 3; }); // => [1, 2]
56812                      * 
56813                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
56814                      * 'active': false}, { 'user': 'pebbles', 'active': true } ];
56815                      *  // using the `_.matches` callback shorthand _.pluck(_.takeWhile(users, {
56816                      * 'user': 'barney', 'active': false }), 'user'); // => ['barney']
56817                      *  // using the `_.matchesProperty` callback shorthand
56818                      * _.pluck(_.takeWhile(users, 'active', false), 'user'); // => ['barney',
56819                      * 'fred']
56820                      *  // using the `_.property` callback shorthand _.pluck(_.takeWhile(users,
56821                      * 'active'), 'user'); // => []
56822                      */
56823                     function takeWhile(array, predicate, thisArg) {
56824                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3)) : [];
56825                     }
56826
56827                     /**
56828                      * Creates an array of unique values, in order, from all of the provided
56829                      * arrays using
56830                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56831                      * for equality comparisons.
56832                      * 
56833                      * @static
56834                      * @memberOf _
56835                      * @category Array
56836                      * @param {...Array}
56837                      *            [arrays] The arrays to inspect.
56838                      * @returns {Array} Returns the new array of combined values.
56839                      * @example
56840                      * 
56841                      * _.union([1, 2], [4, 2], [2, 1]); // => [1, 2, 4]
56842                      */
56843                     var union = restParam(function(arrays) {
56844                         return baseUniq(baseFlatten(arrays, false, true));
56845                     });
56846
56847                     /**
56848                      * Creates a duplicate-free version of an array, using
56849                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56850                      * for equality comparisons, in which only the first occurence of each
56851                      * element is kept. Providing `true` for `isSorted` performs a faster search
56852                      * algorithm for sorted arrays. If an iteratee function is provided it is
56853                      * invoked for each element in the array to generate the criterion by which
56854                      * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked
56855                      * with three arguments: (value, index, array).
56856                      * 
56857                      * If a property name is provided for `iteratee` the created `_.property`
56858                      * style callback returns the property value of the given element.
56859                      * 
56860                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56861                      * style callback returns `true` for elements that have a matching property
56862                      * value, else `false`.
56863                      * 
56864                      * If an object is provided for `iteratee` the created `_.matches` style
56865                      * callback returns `true` for elements that have the properties of the
56866                      * given object, else `false`.
56867                      * 
56868                      * @static
56869                      * @memberOf _
56870                      * @alias unique
56871                      * @category Array
56872                      * @param {Array}
56873                      *            array The array to inspect.
56874                      * @param {boolean}
56875                      *            [isSorted] Specify the array is sorted.
56876                      * @param {Function|Object|string}
56877                      *            [iteratee] The function invoked per iteration.
56878                      * @param {*}
56879                      *            [thisArg] The `this` binding of `iteratee`.
56880                      * @returns {Array} Returns the new duplicate-value-free array.
56881                      * @example
56882                      * 
56883                      * _.uniq([2, 1, 2]); // => [2, 1]
56884                      *  // using `isSorted` _.uniq([1, 1, 2], true); // => [1, 2]
56885                      *  // using an iteratee function _.uniq([1, 2.5, 1.5, 2], function(n) {
56886                      * return this.floor(n); }, Math); // => [1, 2.5]
56887                      *  // using the `_.property` callback shorthand _.uniq([{ 'x': 1 }, { 'x':
56888                      * 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }]
56889                      */
56890                     function uniq(array, isSorted, iteratee, thisArg) {
56891                         var length = array ? array.length : 0;
56892                         if (!length) {
56893                             return [];
56894                         }
56895                         if (isSorted != null && typeof isSorted != 'boolean') {
56896                             thisArg = iteratee;
56897                             iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
56898                             isSorted = false;
56899                         }
56900                         var callback = getCallback();
56901                         if (!(iteratee == null && callback === baseCallback)) {
56902                             iteratee = callback(iteratee, thisArg, 3);
56903                         }
56904                         return (isSorted && getIndexOf() == baseIndexOf) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
56905                     }
56906
56907                     /**
56908                      * This method is like `_.zip` except that it accepts an array of grouped
56909                      * elements and creates an array regrouping the elements to their pre-zip
56910                      * configuration.
56911                      * 
56912                      * @static
56913                      * @memberOf _
56914                      * @category Array
56915                      * @param {Array}
56916                      *            array The array of grouped elements to process.
56917                      * @returns {Array} Returns the new array of regrouped elements.
56918                      * @example
56919                      * 
56920                      * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); // =>
56921                      * [['fred', 30, true], ['barney', 40, false]]
56922                      * 
56923                      * _.unzip(zipped); // => [['fred', 'barney'], [30, 40], [true, false]]
56924                      */
56925                     function unzip(array) {
56926                         if (!(array && array.length)) {
56927                             return [];
56928                         }
56929                         var index = -1,
56930                             length = 0;
56931
56932                         array = arrayFilter(array, function(group) {
56933                             if (isArrayLike(group)) {
56934                                 length = nativeMax(group.length, length);
56935                                 return true;
56936                             }
56937                         });
56938                         var result = Array(length);
56939                         while (++index < length) {
56940                             result[index] = arrayMap(array, baseProperty(index));
56941                         }
56942                         return result;
56943                     }
56944
56945                     /**
56946                      * This method is like `_.unzip` except that it accepts an iteratee to
56947                      * specify how regrouped values should be combined. The `iteratee` is bound
56948                      * to `thisArg` and invoked with four arguments: (accumulator, value, index,
56949                      * group).
56950                      * 
56951                      * @static
56952                      * @memberOf _
56953                      * @category Array
56954                      * @param {Array}
56955                      *            array The array of grouped elements to process.
56956                      * @param {Function}
56957                      *            [iteratee] The function to combine regrouped values.
56958                      * @param {*}
56959                      *            [thisArg] The `this` binding of `iteratee`.
56960                      * @returns {Array} Returns the new array of regrouped elements.
56961                      * @example
56962                      * 
56963                      * var zipped = _.zip([1, 2], [10, 20], [100, 200]); // => [[1, 10, 100],
56964                      * [2, 20, 200]]
56965                      * 
56966                      * _.unzipWith(zipped, _.add); // => [3, 30, 300]
56967                      */
56968                     function unzipWith(array, iteratee, thisArg) {
56969                         var length = array ? array.length : 0;
56970                         if (!length) {
56971                             return [];
56972                         }
56973                         var result = unzip(array);
56974                         if (iteratee == null) {
56975                             return result;
56976                         }
56977                         iteratee = bindCallback(iteratee, thisArg, 4);
56978                         return arrayMap(result, function(group) {
56979                             return arrayReduce(group, iteratee, undefined, true);
56980                         });
56981                     }
56982
56983                     /**
56984                      * Creates an array excluding all provided values using
56985                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56986                      * for equality comparisons.
56987                      * 
56988                      * @static
56989                      * @memberOf _
56990                      * @category Array
56991                      * @param {Array}
56992                      *            array The array to filter.
56993                      * @param {...*}
56994                      *            [values] The values to exclude.
56995                      * @returns {Array} Returns the new array of filtered values.
56996                      * @example
56997                      * 
56998                      * _.without([1, 2, 1, 3], 1, 2); // => [3]
56999                      */
57000                     var without = restParam(function(array, values) {
57001                         return isArrayLike(array) ? baseDifference(array, values) : [];
57002                     });
57003
57004                     /**
57005                      * Creates an array of unique values that is the [symmetric
57006                      * difference](https://en.wikipedia.org/wiki/Symmetric_difference) of the
57007                      * provided arrays.
57008                      * 
57009                      * @static
57010                      * @memberOf _
57011                      * @category Array
57012                      * @param {...Array}
57013                      *            [arrays] The arrays to inspect.
57014                      * @returns {Array} Returns the new array of values.
57015                      * @example
57016                      * 
57017                      * _.xor([1, 2], [4, 2]); // => [1, 4]
57018                      */
57019                     function xor() {
57020                         var index = -1,
57021                             length = arguments.length;
57022
57023                         while (++index < length) {
57024                             var array = arguments[index];
57025                             if (isArrayLike(array)) {
57026                                 var result = result ? arrayPush(baseDifference(result, array), baseDifference(array, result)) : array;
57027                             }
57028                         }
57029                         return result ? baseUniq(result) : [];
57030                     }
57031
57032                     /**
57033                      * Creates an array of grouped elements, the first of which contains the
57034                      * first elements of the given arrays, the second of which contains the
57035                      * second elements of the given arrays, and so on.
57036                      * 
57037                      * @static
57038                      * @memberOf _
57039                      * @category Array
57040                      * @param {...Array}
57041                      *            [arrays] The arrays to process.
57042                      * @returns {Array} Returns the new array of grouped elements.
57043                      * @example
57044                      * 
57045                      * _.zip(['fred', 'barney'], [30, 40], [true, false]); // => [['fred', 30,
57046                      * true], ['barney', 40, false]]
57047                      */
57048                     var zip = restParam(unzip);
57049
57050                     /**
57051                      * The inverse of `_.pairs`; this method returns an object composed from
57052                      * arrays of property names and values. Provide either a single two
57053                      * dimensional array, e.g. `[[key1, value1], [key2, value2]]` or two arrays,
57054                      * one of property names and one of corresponding values.
57055                      * 
57056                      * @static
57057                      * @memberOf _
57058                      * @alias object
57059                      * @category Array
57060                      * @param {Array}
57061                      *            props The property names.
57062                      * @param {Array}
57063                      *            [values=[]] The property values.
57064                      * @returns {Object} Returns the new object.
57065                      * @example
57066                      * 
57067                      * _.zipObject([['fred', 30], ['barney', 40]]); // => { 'fred': 30,
57068                      * 'barney': 40 }
57069                      * 
57070                      * _.zipObject(['fred', 'barney'], [30, 40]); // => { 'fred': 30, 'barney':
57071                      * 40 }
57072                      */
57073                     function zipObject(props, values) {
57074                         var index = -1,
57075                             length = props ? props.length : 0,
57076                             result = {};
57077
57078                         if (length && !values && !isArray(props[0])) {
57079                             values = [];
57080                         }
57081                         while (++index < length) {
57082                             var key = props[index];
57083                             if (values) {
57084                                 result[key] = values[index];
57085                             } else if (key) {
57086                                 result[key[0]] = key[1];
57087                             }
57088                         }
57089                         return result;
57090                     }
57091
57092                     /**
57093                      * This method is like `_.zip` except that it accepts an iteratee to specify
57094                      * how grouped values should be combined. The `iteratee` is bound to
57095                      * `thisArg` and invoked with four arguments: (accumulator, value, index,
57096                      * group).
57097                      * 
57098                      * @static
57099                      * @memberOf _
57100                      * @category Array
57101                      * @param {...Array}
57102                      *            [arrays] The arrays to process.
57103                      * @param {Function}
57104                      *            [iteratee] The function to combine grouped values.
57105                      * @param {*}
57106                      *            [thisArg] The `this` binding of `iteratee`.
57107                      * @returns {Array} Returns the new array of grouped elements.
57108                      * @example
57109                      * 
57110                      * _.zipWith([1, 2], [10, 20], [100, 200], _.add); // => [111, 222]
57111                      */
57112                     var zipWith = restParam(function(arrays) {
57113                         var length = arrays.length,
57114                             iteratee = length > 2 ? arrays[length - 2] : undefined,
57115                             thisArg = length > 1 ? arrays[length - 1] : undefined;
57116
57117                         if (length > 2 && typeof iteratee == 'function') {
57118                             length -= 2;
57119                         } else {
57120                             iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
57121                             thisArg = undefined;
57122                         }
57123                         arrays.length = length;
57124                         return unzipWith(arrays, iteratee, thisArg);
57125                     });
57126
57127                     /*------------------------------------------------------------------------*/
57128
57129                     /**
57130                      * Creates a `lodash` object that wraps `value` with explicit method
57131                      * chaining enabled.
57132                      * 
57133                      * @static
57134                      * @memberOf _
57135                      * @category Chain
57136                      * @param {*}
57137                      *            value The value to wrap.
57138                      * @returns {Object} Returns the new `lodash` wrapper instance.
57139                      * @example
57140                      * 
57141                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57142                      * 40 }, { 'user': 'pebbles', 'age': 1 } ];
57143                      * 
57144                      * var youngest = _.chain(users) .sortBy('age') .map(function(chr) { return
57145                      * chr.user + ' is ' + chr.age; }) .first() .value(); // => 'pebbles is 1'
57146                      */
57147                     function chain(value) {
57148                         var result = lodash(value);
57149                         result.__chain__ = true;
57150                         return result;
57151                     }
57152
57153                     /**
57154                      * This method invokes `interceptor` and returns `value`. The interceptor is
57155                      * bound to `thisArg` and invoked with one argument; (value). The purpose of
57156                      * this method is to "tap into" a method chain in order to perform
57157                      * operations on intermediate results within the chain.
57158                      * 
57159                      * @static
57160                      * @memberOf _
57161                      * @category Chain
57162                      * @param {*}
57163                      *            value The value to provide to `interceptor`.
57164                      * @param {Function}
57165                      *            interceptor The function to invoke.
57166                      * @param {*}
57167                      *            [thisArg] The `this` binding of `interceptor`.
57168                      * @returns {*} Returns `value`.
57169                      * @example
57170                      * 
57171                      * _([1, 2, 3]) .tap(function(array) { array.pop(); }) .reverse() .value(); // =>
57172                      * [2, 1]
57173                      */
57174                     function tap(value, interceptor, thisArg) {
57175                         interceptor.call(thisArg, value);
57176                         return value;
57177                     }
57178
57179                     /**
57180                      * This method is like `_.tap` except that it returns the result of
57181                      * `interceptor`.
57182                      * 
57183                      * @static
57184                      * @memberOf _
57185                      * @category Chain
57186                      * @param {*}
57187                      *            value The value to provide to `interceptor`.
57188                      * @param {Function}
57189                      *            interceptor The function to invoke.
57190                      * @param {*}
57191                      *            [thisArg] The `this` binding of `interceptor`.
57192                      * @returns {*} Returns the result of `interceptor`.
57193                      * @example
57194                      * 
57195                      * _(' abc ') .chain() .trim() .thru(function(value) { return [value]; })
57196                      * .value(); // => ['abc']
57197                      */
57198                     function thru(value, interceptor, thisArg) {
57199                         return interceptor.call(thisArg, value);
57200                     }
57201
57202                     /**
57203                      * Enables explicit method chaining on the wrapper object.
57204                      * 
57205                      * @name chain
57206                      * @memberOf _
57207                      * @category Chain
57208                      * @returns {Object} Returns the new `lodash` wrapper instance.
57209                      * @example
57210                      * 
57211                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57212                      * 40 } ];
57213                      *  // without explicit chaining _(users).first(); // => { 'user': 'barney',
57214                      * 'age': 36 }
57215                      *  // with explicit chaining _(users).chain() .first() .pick('user')
57216                      * .value(); // => { 'user': 'barney' }
57217                      */
57218                     function wrapperChain() {
57219                         return chain(this);
57220                     }
57221
57222                     /**
57223                      * Executes the chained sequence and returns the wrapped result.
57224                      * 
57225                      * @name commit
57226                      * @memberOf _
57227                      * @category Chain
57228                      * @returns {Object} Returns the new `lodash` wrapper instance.
57229                      * @example
57230                      * 
57231                      * var array = [1, 2]; var wrapped = _(array).push(3);
57232                      * 
57233                      * console.log(array); // => [1, 2]
57234                      * 
57235                      * wrapped = wrapped.commit(); console.log(array); // => [1, 2, 3]
57236                      * 
57237                      * wrapped.last(); // => 3
57238                      * 
57239                      * console.log(array); // => [1, 2, 3]
57240                      */
57241                     function wrapperCommit() {
57242                         return new LodashWrapper(this.value(), this.__chain__);
57243                     }
57244
57245                     /**
57246                      * Creates a new array joining a wrapped array with any additional arrays
57247                      * and/or values.
57248                      * 
57249                      * @name concat
57250                      * @memberOf _
57251                      * @category Chain
57252                      * @param {...*}
57253                      *            [values] The values to concatenate.
57254                      * @returns {Array} Returns the new concatenated array.
57255                      * @example
57256                      * 
57257                      * var array = [1]; var wrapped = _(array).concat(2, [3], [[4]]);
57258                      * 
57259                      * console.log(wrapped.value()); // => [1, 2, 3, [4]]
57260                      * 
57261                      * console.log(array); // => [1]
57262                      */
57263                     var wrapperConcat = restParam(function(values) {
57264                         values = baseFlatten(values);
57265                         return this.thru(function(array) {
57266                             return arrayConcat(isArray(array) ? array : [toObject(array)], values);
57267                         });
57268                     });
57269
57270                     /**
57271                      * Creates a clone of the chained sequence planting `value` as the wrapped
57272                      * value.
57273                      * 
57274                      * @name plant
57275                      * @memberOf _
57276                      * @category Chain
57277                      * @returns {Object} Returns the new `lodash` wrapper instance.
57278                      * @example
57279                      * 
57280                      * var array = [1, 2]; var wrapped = _(array).map(function(value) { return
57281                      * Math.pow(value, 2); });
57282                      * 
57283                      * var other = [3, 4]; var otherWrapped = wrapped.plant(other);
57284                      * 
57285                      * otherWrapped.value(); // => [9, 16]
57286                      * 
57287                      * wrapped.value(); // => [1, 4]
57288                      */
57289                     function wrapperPlant(value) {
57290                         var result,
57291                             parent = this;
57292
57293                         while (parent instanceof baseLodash) {
57294                             var clone = wrapperClone(parent);
57295                             if (result) {
57296                                 previous.__wrapped__ = clone;
57297                             } else {
57298                                 result = clone;
57299                             }
57300                             var previous = clone;
57301                             parent = parent.__wrapped__;
57302                         }
57303                         previous.__wrapped__ = value;
57304                         return result;
57305                     }
57306
57307                     /**
57308                      * Reverses the wrapped array so the first element becomes the last, the
57309                      * second element becomes the second to last, and so on.
57310                      * 
57311                      * **Note:** This method mutates the wrapped array.
57312                      * 
57313                      * @name reverse
57314                      * @memberOf _
57315                      * @category Chain
57316                      * @returns {Object} Returns the new reversed `lodash` wrapper instance.
57317                      * @example
57318                      * 
57319                      * var array = [1, 2, 3];
57320                      * 
57321                      * _(array).reverse().value() // => [3, 2, 1]
57322                      * 
57323                      * console.log(array); // => [3, 2, 1]
57324                      */
57325                     function wrapperReverse() {
57326                         var value = this.__wrapped__;
57327
57328                         var interceptor = function(value) {
57329                             return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();
57330                         };
57331                         if (value instanceof LazyWrapper) {
57332                             var wrapped = value;
57333                             if (this.__actions__.length) {
57334                                 wrapped = new LazyWrapper(this);
57335                             }
57336                             wrapped = wrapped.reverse();
57337                             wrapped.__actions__.push({
57338                                 'func': thru,
57339                                 'args': [interceptor],
57340                                 'thisArg': undefined
57341                             });
57342                             return new LodashWrapper(wrapped, this.__chain__);
57343                         }
57344                         return this.thru(interceptor);
57345                     }
57346
57347                     /**
57348                      * Produces the result of coercing the unwrapped value to a string.
57349                      * 
57350                      * @name toString
57351                      * @memberOf _
57352                      * @category Chain
57353                      * @returns {string} Returns the coerced string value.
57354                      * @example
57355                      * 
57356                      * _([1, 2, 3]).toString(); // => '1,2,3'
57357                      */
57358                     function wrapperToString() {
57359                         return (this.value() + '');
57360                     }
57361
57362                     /**
57363                      * Executes the chained sequence to extract the unwrapped value.
57364                      * 
57365                      * @name value
57366                      * @memberOf _
57367                      * @alias run, toJSON, valueOf
57368                      * @category Chain
57369                      * @returns {*} Returns the resolved unwrapped value.
57370                      * @example
57371                      * 
57372                      * _([1, 2, 3]).value(); // => [1, 2, 3]
57373                      */
57374                     function wrapperValue() {
57375                         return baseWrapperValue(this.__wrapped__, this.__actions__);
57376                     }
57377
57378                     /*------------------------------------------------------------------------*/
57379
57380                     /**
57381                      * Creates an array of elements corresponding to the given keys, or indexes,
57382                      * of `collection`. Keys may be specified as individual arguments or as
57383                      * arrays of keys.
57384                      * 
57385                      * @static
57386                      * @memberOf _
57387                      * @category Collection
57388                      * @param {Array|Object|string}
57389                      *            collection The collection to iterate over.
57390                      * @param {...(number|number[]|string|string[])}
57391                      *            [props] The property names or indexes of elements to pick,
57392                      *            specified individually or in arrays.
57393                      * @returns {Array} Returns the new array of picked elements.
57394                      * @example
57395                      * 
57396                      * _.at(['a', 'b', 'c'], [0, 2]); // => ['a', 'c']
57397                      * 
57398                      * _.at(['barney', 'fred', 'pebbles'], 0, 2); // => ['barney', 'pebbles']
57399                      */
57400                     var at = restParam(function(collection, props) {
57401                         return baseAt(collection, baseFlatten(props));
57402                     });
57403
57404                     /**
57405                      * Creates an object composed of keys generated from the results of running
57406                      * each element of `collection` through `iteratee`. The corresponding value
57407                      * of each key is the number of times the key was returned by `iteratee`.
57408                      * The `iteratee` is bound to `thisArg` and invoked with three arguments:
57409                      * (value, index|key, collection).
57410                      * 
57411                      * If a property name is provided for `iteratee` the created `_.property`
57412                      * style callback returns the property value of the given element.
57413                      * 
57414                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57415                      * style callback returns `true` for elements that have a matching property
57416                      * value, else `false`.
57417                      * 
57418                      * If an object is provided for `iteratee` the created `_.matches` style
57419                      * callback returns `true` for elements that have the properties of the
57420                      * given object, else `false`.
57421                      * 
57422                      * @static
57423                      * @memberOf _
57424                      * @category Collection
57425                      * @param {Array|Object|string}
57426                      *            collection The collection to iterate over.
57427                      * @param {Function|Object|string}
57428                      *            [iteratee=_.identity] The function invoked per iteration.
57429                      * @param {*}
57430                      *            [thisArg] The `this` binding of `iteratee`.
57431                      * @returns {Object} Returns the composed aggregate object.
57432                      * @example
57433                      * 
57434                      * _.countBy([4.3, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
57435                      * '4': 1, '6': 2 }
57436                      * 
57437                      * _.countBy([4.3, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
57438                      * '4': 1, '6': 2 }
57439                      * 
57440                      * _.countBy(['one', 'two', 'three'], 'length'); // => { '3': 2, '5': 1 }
57441                      */
57442                     var countBy = createAggregator(function(result, value, key) {
57443                         hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
57444                     });
57445
57446                     /**
57447                      * Checks if `predicate` returns truthy for **all** elements of
57448                      * `collection`. The predicate is bound to `thisArg` and invoked with three
57449                      * arguments: (value, index|key, collection).
57450                      * 
57451                      * If a property name is provided for `predicate` the created `_.property`
57452                      * style callback returns the property value of the given element.
57453                      * 
57454                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57455                      * style callback returns `true` for elements that have a matching property
57456                      * value, else `false`.
57457                      * 
57458                      * If an object is provided for `predicate` the created `_.matches` style
57459                      * callback returns `true` for elements that have the properties of the
57460                      * given object, else `false`.
57461                      * 
57462                      * @static
57463                      * @memberOf _
57464                      * @alias all
57465                      * @category Collection
57466                      * @param {Array|Object|string}
57467                      *            collection The collection to iterate over.
57468                      * @param {Function|Object|string}
57469                      *            [predicate=_.identity] The function invoked per iteration.
57470                      * @param {*}
57471                      *            [thisArg] The `this` binding of `predicate`.
57472                      * @returns {boolean} Returns `true` if all elements pass the predicate
57473                      *          check, else `false`.
57474                      * @example
57475                      * 
57476                      * _.every([true, 1, null, 'yes'], Boolean); // => false
57477                      * 
57478                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
57479                      * 'active': false } ];
57480                      *  // using the `_.matches` callback shorthand _.every(users, { 'user':
57481                      * 'barney', 'active': false }); // => false
57482                      *  // using the `_.matchesProperty` callback shorthand _.every(users,
57483                      * 'active', false); // => true
57484                      *  // using the `_.property` callback shorthand _.every(users, 'active'); // =>
57485                      * false
57486                      */
57487                     function every(collection, predicate, thisArg) {
57488                         var func = isArray(collection) ? arrayEvery : baseEvery;
57489                         if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
57490                             predicate = undefined;
57491                         }
57492                         if (typeof predicate != 'function' || thisArg !== undefined) {
57493                             predicate = getCallback(predicate, thisArg, 3);
57494                         }
57495                         return func(collection, predicate);
57496                     }
57497
57498                     /**
57499                      * Iterates over elements of `collection`, returning an array of all
57500                      * elements `predicate` returns truthy for. The predicate is bound to
57501                      * `thisArg` and invoked with three arguments: (value, index|key,
57502                      * collection).
57503                      * 
57504                      * If a property name is provided for `predicate` the created `_.property`
57505                      * style callback returns the property value of the given element.
57506                      * 
57507                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57508                      * style callback returns `true` for elements that have a matching property
57509                      * value, else `false`.
57510                      * 
57511                      * If an object is provided for `predicate` the created `_.matches` style
57512                      * callback returns `true` for elements that have the properties of the
57513                      * given object, else `false`.
57514                      * 
57515                      * @static
57516                      * @memberOf _
57517                      * @alias select
57518                      * @category Collection
57519                      * @param {Array|Object|string}
57520                      *            collection The collection to iterate over.
57521                      * @param {Function|Object|string}
57522                      *            [predicate=_.identity] The function invoked per iteration.
57523                      * @param {*}
57524                      *            [thisArg] The `this` binding of `predicate`.
57525                      * @returns {Array} Returns the new filtered array.
57526                      * @example
57527                      * 
57528                      * _.filter([4, 5, 6], function(n) { return n % 2 == 0; }); // => [4, 6]
57529                      * 
57530                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57531                      * 'fred', 'age': 40, 'active': false } ];
57532                      *  // using the `_.matches` callback shorthand _.pluck(_.filter(users, {
57533                      * 'age': 36, 'active': true }), 'user'); // => ['barney']
57534                      *  // using the `_.matchesProperty` callback shorthand
57535                      * _.pluck(_.filter(users, 'active', false), 'user'); // => ['fred']
57536                      *  // using the `_.property` callback shorthand _.pluck(_.filter(users,
57537                      * 'active'), 'user'); // => ['barney']
57538                      */
57539                     function filter(collection, predicate, thisArg) {
57540                         var func = isArray(collection) ? arrayFilter : baseFilter;
57541                         predicate = getCallback(predicate, thisArg, 3);
57542                         return func(collection, predicate);
57543                     }
57544
57545                     /**
57546                      * Iterates over elements of `collection`, returning the first element
57547                      * `predicate` returns truthy for. The predicate is bound to `thisArg` and
57548                      * invoked with three arguments: (value, index|key, collection).
57549                      * 
57550                      * If a property name is provided for `predicate` the created `_.property`
57551                      * style callback returns the property value of the given element.
57552                      * 
57553                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57554                      * style callback returns `true` for elements that have a matching property
57555                      * value, else `false`.
57556                      * 
57557                      * If an object is provided for `predicate` the created `_.matches` style
57558                      * callback returns `true` for elements that have the properties of the
57559                      * given object, else `false`.
57560                      * 
57561                      * @static
57562                      * @memberOf _
57563                      * @alias detect
57564                      * @category Collection
57565                      * @param {Array|Object|string}
57566                      *            collection The collection to search.
57567                      * @param {Function|Object|string}
57568                      *            [predicate=_.identity] The function invoked per iteration.
57569                      * @param {*}
57570                      *            [thisArg] The `this` binding of `predicate`.
57571                      * @returns {*} Returns the matched element, else `undefined`.
57572                      * @example
57573                      * 
57574                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57575                      * 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1,
57576                      * 'active': true } ];
57577                      * 
57578                      * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); // =>
57579                      * 'barney'
57580                      *  // using the `_.matches` callback shorthand _.result(_.find(users, {
57581                      * 'age': 1, 'active': true }), 'user'); // => 'pebbles'
57582                      *  // using the `_.matchesProperty` callback shorthand
57583                      * _.result(_.find(users, 'active', false), 'user'); // => 'fred'
57584                      *  // using the `_.property` callback shorthand _.result(_.find(users,
57585                      * 'active'), 'user'); // => 'barney'
57586                      */
57587                     var find = createFind(baseEach);
57588
57589                     /**
57590                      * This method is like `_.find` except that it iterates over elements of
57591                      * `collection` from right to left.
57592                      * 
57593                      * @static
57594                      * @memberOf _
57595                      * @category Collection
57596                      * @param {Array|Object|string}
57597                      *            collection The collection to search.
57598                      * @param {Function|Object|string}
57599                      *            [predicate=_.identity] The function invoked per iteration.
57600                      * @param {*}
57601                      *            [thisArg] The `this` binding of `predicate`.
57602                      * @returns {*} Returns the matched element, else `undefined`.
57603                      * @example
57604                      * 
57605                      * _.findLast([1, 2, 3, 4], function(n) { return n % 2 == 1; }); // => 3
57606                      */
57607                     var findLast = createFind(baseEachRight, true);
57608
57609                     /**
57610                      * Performs a deep comparison between each element in `collection` and the
57611                      * source object, returning the first element that has equivalent property
57612                      * values.
57613                      * 
57614                      * **Note:** This method supports comparing arrays, booleans, `Date`
57615                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
57616                      * compared by their own, not inherited, enumerable properties. For
57617                      * comparing a single own or inherited property value see
57618                      * `_.matchesProperty`.
57619                      * 
57620                      * @static
57621                      * @memberOf _
57622                      * @category Collection
57623                      * @param {Array|Object|string}
57624                      *            collection The collection to search.
57625                      * @param {Object}
57626                      *            source The object of property values to match.
57627                      * @returns {*} Returns the matched element, else `undefined`.
57628                      * @example
57629                      * 
57630                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57631                      * 'fred', 'age': 40, 'active': false } ];
57632                      * 
57633                      * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); // =>
57634                      * 'barney'
57635                      * 
57636                      * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); // =>
57637                      * 'fred'
57638                      */
57639                     function findWhere(collection, source) {
57640                         return find(collection, baseMatches(source));
57641                     }
57642
57643                     /**
57644                      * Iterates over elements of `collection` invoking `iteratee` for each
57645                      * element. The `iteratee` is bound to `thisArg` and invoked with three
57646                      * arguments: (value, index|key, collection). Iteratee functions may exit
57647                      * iteration early by explicitly returning `false`.
57648                      * 
57649                      * **Note:** As with other "Collections" methods, objects with a "length"
57650                      * property are iterated like arrays. To avoid this behavior `_.forIn` or
57651                      * `_.forOwn` may be used for object iteration.
57652                      * 
57653                      * @static
57654                      * @memberOf _
57655                      * @alias each
57656                      * @category Collection
57657                      * @param {Array|Object|string}
57658                      *            collection The collection to iterate over.
57659                      * @param {Function}
57660                      *            [iteratee=_.identity] The function invoked per iteration.
57661                      * @param {*}
57662                      *            [thisArg] The `this` binding of `iteratee`.
57663                      * @returns {Array|Object|string} Returns `collection`.
57664                      * @example
57665                      * 
57666                      * _([1, 2]).forEach(function(n) { console.log(n); }).value(); // => logs
57667                      * each value from left to right and returns the array
57668                      * 
57669                      * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { console.log(n, key); }); // =>
57670                      * logs each value-key pair and returns the object (iteration order is not
57671                      * guaranteed)
57672                      */
57673                     var forEach = createForEach(arrayEach, baseEach);
57674
57675                     /**
57676                      * This method is like `_.forEach` except that it iterates over elements of
57677                      * `collection` from right to left.
57678                      * 
57679                      * @static
57680                      * @memberOf _
57681                      * @alias eachRight
57682                      * @category Collection
57683                      * @param {Array|Object|string}
57684                      *            collection The collection to iterate over.
57685                      * @param {Function}
57686                      *            [iteratee=_.identity] The function invoked per iteration.
57687                      * @param {*}
57688                      *            [thisArg] The `this` binding of `iteratee`.
57689                      * @returns {Array|Object|string} Returns `collection`.
57690                      * @example
57691                      * 
57692                      * _([1, 2]).forEachRight(function(n) { console.log(n); }).value(); // =>
57693                      * logs each value from right to left and returns the array
57694                      */
57695                     var forEachRight = createForEach(arrayEachRight, baseEachRight);
57696
57697                     /**
57698                      * Creates an object composed of keys generated from the results of running
57699                      * each element of `collection` through `iteratee`. The corresponding value
57700                      * of each key is an array of the elements responsible for generating the
57701                      * key. The `iteratee` is bound to `thisArg` and invoked with three
57702                      * arguments: (value, index|key, collection).
57703                      * 
57704                      * If a property name is provided for `iteratee` the created `_.property`
57705                      * style callback returns the property value of the given element.
57706                      * 
57707                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57708                      * style callback returns `true` for elements that have a matching property
57709                      * value, else `false`.
57710                      * 
57711                      * If an object is provided for `iteratee` the created `_.matches` style
57712                      * callback returns `true` for elements that have the properties of the
57713                      * given object, else `false`.
57714                      * 
57715                      * @static
57716                      * @memberOf _
57717                      * @category Collection
57718                      * @param {Array|Object|string}
57719                      *            collection The collection to iterate over.
57720                      * @param {Function|Object|string}
57721                      *            [iteratee=_.identity] The function invoked per iteration.
57722                      * @param {*}
57723                      *            [thisArg] The `this` binding of `iteratee`.
57724                      * @returns {Object} Returns the composed aggregate object.
57725                      * @example
57726                      * 
57727                      * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
57728                      * '4': [4.2], '6': [6.1, 6.4] }
57729                      * 
57730                      * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
57731                      * '4': [4.2], '6': [6.1, 6.4] }
57732                      *  // using the `_.property` callback shorthand _.groupBy(['one', 'two',
57733                      * 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] }
57734                      */
57735                     var groupBy = createAggregator(function(result, value, key) {
57736                         if (hasOwnProperty.call(result, key)) {
57737                             result[key].push(value);
57738                         } else {
57739                             result[key] = [value];
57740                         }
57741                     });
57742
57743                     /**
57744                      * Checks if `value` is in `collection` using
57745                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
57746                      * for equality comparisons. If `fromIndex` is negative, it is used as the
57747                      * offset from the end of `collection`.
57748                      * 
57749                      * @static
57750                      * @memberOf _
57751                      * @alias contains, include
57752                      * @category Collection
57753                      * @param {Array|Object|string}
57754                      *            collection The collection to search.
57755                      * @param {*}
57756                      *            target The value to search for.
57757                      * @param {number}
57758                      *            [fromIndex=0] The index to search from.
57759                      * @param- {Object} [guard] Enables use as a callback for functions like
57760                      *         `_.reduce`.
57761                      * @returns {boolean} Returns `true` if a matching element is found, else
57762                      *          `false`.
57763                      * @example
57764                      * 
57765                      * _.includes([1, 2, 3], 1); // => true
57766                      * 
57767                      * _.includes([1, 2, 3], 1, 2); // => false
57768                      * 
57769                      * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); // => true
57770                      * 
57771                      * _.includes('pebbles', 'eb'); // => true
57772                      */
57773                     function includes(collection, target, fromIndex, guard) {
57774                         var length = collection ? getLength(collection) : 0;
57775                         if (!isLength(length)) {
57776                             collection = values(collection);
57777                             length = collection.length;
57778                         }
57779                         if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
57780                             fromIndex = 0;
57781                         } else {
57782                             fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
57783                         }
57784                         return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) : (!!length && getIndexOf(collection, target, fromIndex) > -1);
57785                     }
57786
57787                     /**
57788                      * Creates an object composed of keys generated from the results of running
57789                      * each element of `collection` through `iteratee`. The corresponding value
57790                      * of each key is the last element responsible for generating the key. The
57791                      * iteratee function is bound to `thisArg` and invoked with three arguments:
57792                      * (value, index|key, collection).
57793                      * 
57794                      * If a property name is provided for `iteratee` the created `_.property`
57795                      * style callback returns the property value of the given element.
57796                      * 
57797                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57798                      * style callback returns `true` for elements that have a matching property
57799                      * value, else `false`.
57800                      * 
57801                      * If an object is provided for `iteratee` the created `_.matches` style
57802                      * callback returns `true` for elements that have the properties of the
57803                      * given object, else `false`.
57804                      * 
57805                      * @static
57806                      * @memberOf _
57807                      * @category Collection
57808                      * @param {Array|Object|string}
57809                      *            collection The collection to iterate over.
57810                      * @param {Function|Object|string}
57811                      *            [iteratee=_.identity] The function invoked per iteration.
57812                      * @param {*}
57813                      *            [thisArg] The `this` binding of `iteratee`.
57814                      * @returns {Object} Returns the composed aggregate object.
57815                      * @example
57816                      * 
57817                      * var keyData = [ { 'dir': 'left', 'code': 97 }, { 'dir': 'right', 'code':
57818                      * 100 } ];
57819                      * 
57820                      * _.indexBy(keyData, 'dir'); // => { 'left': { 'dir': 'left', 'code': 97 },
57821                      * 'right': { 'dir': 'right', 'code': 100 } }
57822                      * 
57823                      * _.indexBy(keyData, function(object) { return
57824                      * String.fromCharCode(object.code); }); // => { 'a': { 'dir': 'left',
57825                      * 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
57826                      * 
57827                      * _.indexBy(keyData, function(object) { return
57828                      * this.fromCharCode(object.code); }, String); // => { 'a': { 'dir': 'left',
57829                      * 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
57830                      */
57831                     var indexBy = createAggregator(function(result, value, key) {
57832                         result[key] = value;
57833                     });
57834
57835                     /**
57836                      * Invokes the method at `path` of each element in `collection`, returning
57837                      * an array of the results of each invoked method. Any additional arguments
57838                      * are provided to each invoked method. If `methodName` is a function it is
57839                      * invoked for, and `this` bound to, each element in `collection`.
57840                      * 
57841                      * @static
57842                      * @memberOf _
57843                      * @category Collection
57844                      * @param {Array|Object|string}
57845                      *            collection The collection to iterate over.
57846                      * @param {Array|Function|string}
57847                      *            path The path of the method to invoke or the function invoked
57848                      *            per iteration.
57849                      * @param {...*}
57850                      *            [args] The arguments to invoke the method with.
57851                      * @returns {Array} Returns the array of results.
57852                      * @example
57853                      * 
57854                      * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); // => [[1, 5, 7], [1, 2, 3]]
57855                      * 
57856                      * _.invoke([123, 456], String.prototype.split, ''); // => [['1', '2', '3'],
57857                      * ['4', '5', '6']]
57858                      */
57859                     var invoke = restParam(function(collection, path, args) {
57860                         var index = -1,
57861                             isFunc = typeof path == 'function',
57862                             isProp = isKey(path),
57863                             result = isArrayLike(collection) ? Array(collection.length) : [];
57864
57865                         baseEach(collection, function(value) {
57866                             var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
57867                             result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
57868                         });
57869                         return result;
57870                     });
57871
57872                     /**
57873                      * Creates an array of values by running each element in `collection`
57874                      * through `iteratee`. The `iteratee` is bound to `thisArg` and invoked with
57875                      * three arguments: (value, index|key, collection).
57876                      * 
57877                      * If a property name is provided for `iteratee` the created `_.property`
57878                      * style callback returns the property value of the given element.
57879                      * 
57880                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57881                      * style callback returns `true` for elements that have a matching property
57882                      * value, else `false`.
57883                      * 
57884                      * If an object is provided for `iteratee` the created `_.matches` style
57885                      * callback returns `true` for elements that have the properties of the
57886                      * given object, else `false`.
57887                      * 
57888                      * Many lodash methods are guarded to work as iteratees for methods like
57889                      * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
57890                      * 
57891                      * The guarded methods are: `ary`, `callback`, `chunk`, `clone`, `create`,
57892                      * `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `flatten`,
57893                      * `invert`, `max`, `min`, `parseInt`, `slice`, `sortBy`, `take`,
57894                      * `takeRight`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
57895                      * `random`, `range`, `sample`, `some`, `sum`, `uniq`, and `words`
57896                      * 
57897                      * @static
57898                      * @memberOf _
57899                      * @alias collect
57900                      * @category Collection
57901                      * @param {Array|Object|string}
57902                      *            collection The collection to iterate over.
57903                      * @param {Function|Object|string}
57904                      *            [iteratee=_.identity] The function invoked per iteration.
57905                      * @param {*}
57906                      *            [thisArg] The `this` binding of `iteratee`.
57907                      * @returns {Array} Returns the new mapped array.
57908                      * @example
57909                      * 
57910                      * function timesThree(n) { return n * 3; }
57911                      * 
57912                      * _.map([1, 2], timesThree); // => [3, 6]
57913                      * 
57914                      * _.map({ 'a': 1, 'b': 2 }, timesThree); // => [3, 6] (iteration order is
57915                      * not guaranteed)
57916                      * 
57917                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
57918                      *  // using the `_.property` callback shorthand _.map(users, 'user'); // =>
57919                      * ['barney', 'fred']
57920                      */
57921                     function map(collection, iteratee, thisArg) {
57922                         var func = isArray(collection) ? arrayMap : baseMap;
57923                         iteratee = getCallback(iteratee, thisArg, 3);
57924                         return func(collection, iteratee);
57925                     }
57926
57927                     /**
57928                      * Creates an array of elements split into two groups, the first of which
57929                      * contains elements `predicate` returns truthy for, while the second of
57930                      * which contains elements `predicate` returns falsey for. The predicate is
57931                      * bound to `thisArg` and invoked with three arguments: (value, index|key,
57932                      * collection).
57933                      * 
57934                      * If a property name is provided for `predicate` the created `_.property`
57935                      * style callback returns the property value of the given element.
57936                      * 
57937                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57938                      * style callback returns `true` for elements that have a matching property
57939                      * value, else `false`.
57940                      * 
57941                      * If an object is provided for `predicate` the created `_.matches` style
57942                      * callback returns `true` for elements that have the properties of the
57943                      * given object, else `false`.
57944                      * 
57945                      * @static
57946                      * @memberOf _
57947                      * @category Collection
57948                      * @param {Array|Object|string}
57949                      *            collection The collection to iterate over.
57950                      * @param {Function|Object|string}
57951                      *            [predicate=_.identity] The function invoked per iteration.
57952                      * @param {*}
57953                      *            [thisArg] The `this` binding of `predicate`.
57954                      * @returns {Array} Returns the array of grouped elements.
57955                      * @example
57956                      * 
57957                      * _.partition([1, 2, 3], function(n) { return n % 2; }); // => [[1, 3],
57958                      * [2]]
57959                      * 
57960                      * _.partition([1.2, 2.3, 3.4], function(n) { return this.floor(n) % 2; },
57961                      * Math); // => [[1.2, 3.4], [2.3]]
57962                      * 
57963                      * var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user':
57964                      * 'fred', 'age': 40, 'active': true }, { 'user': 'pebbles', 'age': 1,
57965                      * 'active': false } ];
57966                      * 
57967                      * var mapper = function(array) { return _.pluck(array, 'user'); };
57968                      *  // using the `_.matches` callback shorthand _.map(_.partition(users, {
57969                      * 'age': 1, 'active': false }), mapper); // => [['pebbles'], ['barney',
57970                      * 'fred']]
57971                      *  // using the `_.matchesProperty` callback shorthand
57972                      * _.map(_.partition(users, 'active', false), mapper); // => [['barney',
57973                      * 'pebbles'], ['fred']]
57974                      *  // using the `_.property` callback shorthand _.map(_.partition(users,
57975                      * 'active'), mapper); // => [['fred'], ['barney', 'pebbles']]
57976                      */
57977                     var partition = createAggregator(function(result, value, key) {
57978                         result[key ? 0 : 1].push(value);
57979                     }, function() {
57980                         return [
57981                             [],
57982                             []
57983                         ];
57984                     });
57985
57986                     /**
57987                      * Gets the property value of `path` from all elements in `collection`.
57988                      * 
57989                      * @static
57990                      * @memberOf _
57991                      * @category Collection
57992                      * @param {Array|Object|string}
57993                      *            collection The collection to iterate over.
57994                      * @param {Array|string}
57995                      *            path The path of the property to pluck.
57996                      * @returns {Array} Returns the property values.
57997                      * @example
57998                      * 
57999                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
58000                      * 40 } ];
58001                      * 
58002                      * _.pluck(users, 'user'); // => ['barney', 'fred']
58003                      * 
58004                      * var userIndex = _.indexBy(users, 'user'); _.pluck(userIndex, 'age'); // =>
58005                      * [36, 40] (iteration order is not guaranteed)
58006                      */
58007                     function pluck(collection, path) {
58008                         return map(collection, property(path));
58009                     }
58010
58011                     /**
58012                      * Reduces `collection` to a value which is the accumulated result of
58013                      * running each element in `collection` through `iteratee`, where each
58014                      * successive invocation is supplied the return value of the previous. If
58015                      * `accumulator` is not provided the first element of `collection` is used
58016                      * as the initial value. The `iteratee` is bound to `thisArg` and invoked
58017                      * with four arguments: (accumulator, value, index|key, collection).
58018                      * 
58019                      * Many lodash methods are guarded to work as iteratees for methods like
58020                      * `_.reduce`, `_.reduceRight`, and `_.transform`.
58021                      * 
58022                      * The guarded methods are: `assign`, `defaults`, `defaultsDeep`,
58023                      * `includes`, `merge`, `sortByAll`, and `sortByOrder`
58024                      * 
58025                      * @static
58026                      * @memberOf _
58027                      * @alias foldl, inject
58028                      * @category Collection
58029                      * @param {Array|Object|string}
58030                      *            collection The collection to iterate over.
58031                      * @param {Function}
58032                      *            [iteratee=_.identity] The function invoked per iteration.
58033                      * @param {*}
58034                      *            [accumulator] The initial value.
58035                      * @param {*}
58036                      *            [thisArg] The `this` binding of `iteratee`.
58037                      * @returns {*} Returns the accumulated value.
58038                      * @example
58039                      * 
58040                      * _.reduce([1, 2], function(total, n) { return total + n; }); // => 3
58041                      * 
58042                      * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] = n *
58043                      * 3; return result; }, {}); // => { 'a': 3, 'b': 6 } (iteration order is
58044                      * not guaranteed)
58045                      */
58046                     var reduce = createReduce(arrayReduce, baseEach);
58047
58048                     /**
58049                      * This method is like `_.reduce` except that it iterates over elements of
58050                      * `collection` from right to left.
58051                      * 
58052                      * @static
58053                      * @memberOf _
58054                      * @alias foldr
58055                      * @category Collection
58056                      * @param {Array|Object|string}
58057                      *            collection The collection to iterate over.
58058                      * @param {Function}
58059                      *            [iteratee=_.identity] The function invoked per iteration.
58060                      * @param {*}
58061                      *            [accumulator] The initial value.
58062                      * @param {*}
58063                      *            [thisArg] The `this` binding of `iteratee`.
58064                      * @returns {*} Returns the accumulated value.
58065                      * @example
58066                      * 
58067                      * var array = [[0, 1], [2, 3], [4, 5]];
58068                      * 
58069                      * _.reduceRight(array, function(flattened, other) { return
58070                      * flattened.concat(other); }, []); // => [4, 5, 2, 3, 0, 1]
58071                      */
58072                     var reduceRight = createReduce(arrayReduceRight, baseEachRight);
58073
58074                     /**
58075                      * The opposite of `_.filter`; this method returns the elements of
58076                      * `collection` that `predicate` does **not** return truthy for.
58077                      * 
58078                      * @static
58079                      * @memberOf _
58080                      * @category Collection
58081                      * @param {Array|Object|string}
58082                      *            collection The collection to iterate over.
58083                      * @param {Function|Object|string}
58084                      *            [predicate=_.identity] The function invoked per iteration.
58085                      * @param {*}
58086                      *            [thisArg] The `this` binding of `predicate`.
58087                      * @returns {Array} Returns the new filtered array.
58088                      * @example
58089                      * 
58090                      * _.reject([1, 2, 3, 4], function(n) { return n % 2 == 0; }); // => [1, 3]
58091                      * 
58092                      * var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user':
58093                      * 'fred', 'age': 40, 'active': true } ];
58094                      *  // using the `_.matches` callback shorthand _.pluck(_.reject(users, {
58095                      * 'age': 40, 'active': true }), 'user'); // => ['barney']
58096                      *  // using the `_.matchesProperty` callback shorthand
58097                      * _.pluck(_.reject(users, 'active', false), 'user'); // => ['fred']
58098                      *  // using the `_.property` callback shorthand _.pluck(_.reject(users,
58099                      * 'active'), 'user'); // => ['barney']
58100                      */
58101                     function reject(collection, predicate, thisArg) {
58102                         var func = isArray(collection) ? arrayFilter : baseFilter;
58103                         predicate = getCallback(predicate, thisArg, 3);
58104                         return func(collection, function(value, index, collection) {
58105                             return !predicate(value, index, collection);
58106                         });
58107                     }
58108
58109                     /**
58110                      * Gets a random element or `n` random elements from a collection.
58111                      * 
58112                      * @static
58113                      * @memberOf _
58114                      * @category Collection
58115                      * @param {Array|Object|string}
58116                      *            collection The collection to sample.
58117                      * @param {number}
58118                      *            [n] The number of elements to sample.
58119                      * @param- {Object} [guard] Enables use as a callback for functions like
58120                      *         `_.map`.
58121                      * @returns {*} Returns the random sample(s).
58122                      * @example
58123                      * 
58124                      * _.sample([1, 2, 3, 4]); // => 2
58125                      * 
58126                      * _.sample([1, 2, 3, 4], 2); // => [3, 1]
58127                      */
58128                     function sample(collection, n, guard) {
58129                         if (guard ? isIterateeCall(collection, n, guard) : n == null) {
58130                             collection = toIterable(collection);
58131                             var length = collection.length;
58132                             return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
58133                         }
58134                         var index = -1,
58135                             result = toArray(collection),
58136                             length = result.length,
58137                             lastIndex = length - 1;
58138
58139                         n = nativeMin(n < 0 ? 0 : (+n || 0), length);
58140                         while (++index < n) {
58141                             var rand = baseRandom(index, lastIndex),
58142                                 value = result[rand];
58143
58144                             result[rand] = result[index];
58145                             result[index] = value;
58146                         }
58147                         result.length = n;
58148                         return result;
58149                     }
58150
58151                     /**
58152                      * Creates an array of shuffled values, using a version of the [Fisher-Yates
58153                      * shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
58154                      * 
58155                      * @static
58156                      * @memberOf _
58157                      * @category Collection
58158                      * @param {Array|Object|string}
58159                      *            collection The collection to shuffle.
58160                      * @returns {Array} Returns the new shuffled array.
58161                      * @example
58162                      * 
58163                      * _.shuffle([1, 2, 3, 4]); // => [4, 1, 3, 2]
58164                      */
58165                     function shuffle(collection) {
58166                         return sample(collection, POSITIVE_INFINITY);
58167                     }
58168
58169                     /**
58170                      * Gets the size of `collection` by returning its length for array-like
58171                      * values or the number of own enumerable properties for objects.
58172                      * 
58173                      * @static
58174                      * @memberOf _
58175                      * @category Collection
58176                      * @param {Array|Object|string}
58177                      *            collection The collection to inspect.
58178                      * @returns {number} Returns the size of `collection`.
58179                      * @example
58180                      * 
58181                      * _.size([1, 2, 3]); // => 3
58182                      * 
58183                      * _.size({ 'a': 1, 'b': 2 }); // => 2
58184                      * 
58185                      * _.size('pebbles'); // => 7
58186                      */
58187                     function size(collection) {
58188                         var length = collection ? getLength(collection) : 0;
58189                         return isLength(length) ? length : keys(collection).length;
58190                     }
58191
58192                     /**
58193                      * Checks if `predicate` returns truthy for **any** element of `collection`.
58194                      * The function returns as soon as it finds a passing value and does not
58195                      * iterate over the entire collection. The predicate is bound to `thisArg`
58196                      * and invoked with three arguments: (value, index|key, collection).
58197                      * 
58198                      * If a property name is provided for `predicate` the created `_.property`
58199                      * style callback returns the property value of the given element.
58200                      * 
58201                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
58202                      * style callback returns `true` for elements that have a matching property
58203                      * value, else `false`.
58204                      * 
58205                      * If an object is provided for `predicate` the created `_.matches` style
58206                      * callback returns `true` for elements that have the properties of the
58207                      * given object, else `false`.
58208                      * 
58209                      * @static
58210                      * @memberOf _
58211                      * @alias any
58212                      * @category Collection
58213                      * @param {Array|Object|string}
58214                      *            collection The collection to iterate over.
58215                      * @param {Function|Object|string}
58216                      *            [predicate=_.identity] The function invoked per iteration.
58217                      * @param {*}
58218                      *            [thisArg] The `this` binding of `predicate`.
58219                      * @returns {boolean} Returns `true` if any element passes the predicate
58220                      *          check, else `false`.
58221                      * @example
58222                      * 
58223                      * _.some([null, 0, 'yes', false], Boolean); // => true
58224                      * 
58225                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
58226                      * 'active': false } ];
58227                      *  // using the `_.matches` callback shorthand _.some(users, { 'user':
58228                      * 'barney', 'active': false }); // => false
58229                      *  // using the `_.matchesProperty` callback shorthand _.some(users,
58230                      * 'active', false); // => true
58231                      *  // using the `_.property` callback shorthand _.some(users, 'active'); // =>
58232                      * true
58233                      */
58234                     function some(collection, predicate, thisArg) {
58235                         var func = isArray(collection) ? arraySome : baseSome;
58236                         if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
58237                             predicate = undefined;
58238                         }
58239                         if (typeof predicate != 'function' || thisArg !== undefined) {
58240                             predicate = getCallback(predicate, thisArg, 3);
58241                         }
58242                         return func(collection, predicate);
58243                     }
58244
58245                     /**
58246                      * Creates an array of elements, sorted in ascending order by the results of
58247                      * running each element in a collection through `iteratee`. This method
58248                      * performs a stable sort, that is, it preserves the original sort order of
58249                      * equal elements. The `iteratee` is bound to `thisArg` and invoked with
58250                      * three arguments: (value, index|key, collection).
58251                      * 
58252                      * If a property name is provided for `iteratee` the created `_.property`
58253                      * style callback returns the property value of the given element.
58254                      * 
58255                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
58256                      * style callback returns `true` for elements that have a matching property
58257                      * value, else `false`.
58258                      * 
58259                      * If an object is provided for `iteratee` the created `_.matches` style
58260                      * callback returns `true` for elements that have the properties of the
58261                      * given object, else `false`.
58262                      * 
58263                      * @static
58264                      * @memberOf _
58265                      * @category Collection
58266                      * @param {Array|Object|string}
58267                      *            collection The collection to iterate over.
58268                      * @param {Function|Object|string}
58269                      *            [iteratee=_.identity] The function invoked per iteration.
58270                      * @param {*}
58271                      *            [thisArg] The `this` binding of `iteratee`.
58272                      * @returns {Array} Returns the new sorted array.
58273                      * @example
58274                      * 
58275                      * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); // => [3, 1, 2]
58276                      * 
58277                      * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); // => [3,
58278                      * 1, 2]
58279                      * 
58280                      * var users = [ { 'user': 'fred' }, { 'user': 'pebbles' }, { 'user':
58281                      * 'barney' } ];
58282                      *  // using the `_.property` callback shorthand _.pluck(_.sortBy(users,
58283                      * 'user'), 'user'); // => ['barney', 'fred', 'pebbles']
58284                      */
58285                     function sortBy(collection, iteratee, thisArg) {
58286                         if (collection == null) {
58287                             return [];
58288                         }
58289                         if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
58290                             iteratee = undefined;
58291                         }
58292                         var index = -1;
58293                         iteratee = getCallback(iteratee, thisArg, 3);
58294
58295                         var result = baseMap(collection, function(value, key, collection) {
58296                             return {
58297                                 'criteria': iteratee(value, key, collection),
58298                                 'index': ++index,
58299                                 'value': value
58300                             };
58301                         });
58302                         return baseSortBy(result, compareAscending);
58303                     }
58304
58305                     /**
58306                      * This method is like `_.sortBy` except that it can sort by multiple
58307                      * iteratees or property names.
58308                      * 
58309                      * If a property name is provided for an iteratee the created `_.property`
58310                      * style callback returns the property value of the given element.
58311                      * 
58312                      * If an object is provided for an iteratee the created `_.matches` style
58313                      * callback returns `true` for elements that have the properties of the
58314                      * given object, else `false`.
58315                      * 
58316                      * @static
58317                      * @memberOf _
58318                      * @category Collection
58319                      * @param {Array|Object|string}
58320                      *            collection The collection to iterate over.
58321                      * @param {...(Function|Function[]|Object|Object[]|string|string[])}
58322                      *            iteratees The iteratees to sort by, specified as individual
58323                      *            values or arrays of values.
58324                      * @returns {Array} Returns the new sorted array.
58325                      * @example
58326                      * 
58327                      * var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age':
58328                      * 36 }, { 'user': 'fred', 'age': 42 }, { 'user': 'barney', 'age': 34 } ];
58329                      * 
58330                      * _.map(_.sortByAll(users, ['user', 'age']), _.values); // => [['barney',
58331                      * 34], ['barney', 36], ['fred', 42], ['fred', 48]]
58332                      * 
58333                      * _.map(_.sortByAll(users, 'user', function(chr) { return
58334                      * Math.floor(chr.age / 10); }), _.values); // => [['barney', 36],
58335                      * ['barney', 34], ['fred', 48], ['fred', 42]]
58336                      */
58337                     var sortByAll = restParam(function(collection, iteratees) {
58338                         if (collection == null) {
58339                             return [];
58340                         }
58341                         var guard = iteratees[2];
58342                         if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
58343                             iteratees.length = 1;
58344                         }
58345                         return baseSortByOrder(collection, baseFlatten(iteratees), []);
58346                     });
58347
58348                     /**
58349                      * This method is like `_.sortByAll` except that it allows specifying the
58350                      * sort orders of the iteratees to sort by. If `orders` is unspecified, all
58351                      * values are sorted in ascending order. Otherwise, a value is sorted in
58352                      * ascending order if its corresponding order is "asc", and descending if
58353                      * "desc".
58354                      * 
58355                      * If a property name is provided for an iteratee the created `_.property`
58356                      * style callback returns the property value of the given element.
58357                      * 
58358                      * If an object is provided for an iteratee the created `_.matches` style
58359                      * callback returns `true` for elements that have the properties of the
58360                      * given object, else `false`.
58361                      * 
58362                      * @static
58363                      * @memberOf _
58364                      * @category Collection
58365                      * @param {Array|Object|string}
58366                      *            collection The collection to iterate over.
58367                      * @param {Function[]|Object[]|string[]}
58368                      *            iteratees The iteratees to sort by.
58369                      * @param {boolean[]}
58370                      *            [orders] The sort orders of `iteratees`.
58371                      * @param- {Object} [guard] Enables use as a callback for functions like
58372                      *         `_.reduce`.
58373                      * @returns {Array} Returns the new sorted array.
58374                      * @example
58375                      * 
58376                      * var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age':
58377                      * 34 }, { 'user': 'fred', 'age': 42 }, { 'user': 'barney', 'age': 36 } ];
58378                      *  // sort by `user` in ascending order and by `age` in descending order
58379                      * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values); // =>
58380                      * [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
58381                      */
58382                     function sortByOrder(collection, iteratees, orders, guard) {
58383                         if (collection == null) {
58384                             return [];
58385                         }
58386                         if (guard && isIterateeCall(iteratees, orders, guard)) {
58387                             orders = undefined;
58388                         }
58389                         if (!isArray(iteratees)) {
58390                             iteratees = iteratees == null ? [] : [iteratees];
58391                         }
58392                         if (!isArray(orders)) {
58393                             orders = orders == null ? [] : [orders];
58394                         }
58395                         return baseSortByOrder(collection, iteratees, orders);
58396                     }
58397
58398                     /**
58399                      * Performs a deep comparison between each element in `collection` and the
58400                      * source object, returning an array of all elements that have equivalent
58401                      * property values.
58402                      * 
58403                      * **Note:** This method supports comparing arrays, booleans, `Date`
58404                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
58405                      * compared by their own, not inherited, enumerable properties. For
58406                      * comparing a single own or inherited property value see
58407                      * `_.matchesProperty`.
58408                      * 
58409                      * @static
58410                      * @memberOf _
58411                      * @category Collection
58412                      * @param {Array|Object|string}
58413                      *            collection The collection to search.
58414                      * @param {Object}
58415                      *            source The object of property values to match.
58416                      * @returns {Array} Returns the new filtered array.
58417                      * @example
58418                      * 
58419                      * var users = [ { 'user': 'barney', 'age': 36, 'active': false, 'pets':
58420                      * ['hoppy'] }, { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby
58421                      * puss', 'dino'] } ];
58422                      * 
58423                      * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); // =>
58424                      * ['barney']
58425                      * 
58426                      * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); // => ['fred']
58427                      */
58428                     function where(collection, source) {
58429                         return filter(collection, baseMatches(source));
58430                     }
58431
58432                     /*------------------------------------------------------------------------*/
58433
58434                     /**
58435                      * Gets the number of milliseconds that have elapsed since the Unix epoch (1
58436                      * January 1970 00:00:00 UTC).
58437                      * 
58438                      * @static
58439                      * @memberOf _
58440                      * @category Date
58441                      * @example
58442                      * 
58443                      * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // =>
58444                      * logs the number of milliseconds it took for the deferred function to be
58445                      * invoked
58446                      */
58447                     var now = nativeNow || function() {
58448                         return new Date().getTime();
58449                     };
58450
58451                     /*------------------------------------------------------------------------*/
58452
58453                     /**
58454                      * The opposite of `_.before`; this method creates a function that invokes
58455                      * `func` once it is called `n` or more times.
58456                      * 
58457                      * @static
58458                      * @memberOf _
58459                      * @category Function
58460                      * @param {number}
58461                      *            n The number of calls before `func` is invoked.
58462                      * @param {Function}
58463                      *            func The function to restrict.
58464                      * @returns {Function} Returns the new restricted function.
58465                      * @example
58466                      * 
58467                      * var saves = ['profile', 'settings'];
58468                      * 
58469                      * var done = _.after(saves.length, function() { console.log('done
58470                      * saving!'); });
58471                      * 
58472                      * _.forEach(saves, function(type) { asyncSave({ 'type': type, 'complete':
58473                      * done }); }); // => logs 'done saving!' after the two async saves have
58474                      * completed
58475                      */
58476                     function after(n, func) {
58477                         if (typeof func != 'function') {
58478                             if (typeof n == 'function') {
58479                                 var temp = n;
58480                                 n = func;
58481                                 func = temp;
58482                             } else {
58483                                 throw new TypeError(FUNC_ERROR_TEXT);
58484                             }
58485                         }
58486                         n = nativeIsFinite(n = +n) ? n : 0;
58487                         return function() {
58488                             if (--n < 1) {
58489                                 return func.apply(this, arguments);
58490                             }
58491                         };
58492                     }
58493
58494                     /**
58495                      * Creates a function that accepts up to `n` arguments ignoring any
58496                      * additional arguments.
58497                      * 
58498                      * @static
58499                      * @memberOf _
58500                      * @category Function
58501                      * @param {Function}
58502                      *            func The function to cap arguments for.
58503                      * @param {number}
58504                      *            [n=func.length] The arity cap.
58505                      * @param- {Object} [guard] Enables use as a callback for functions like
58506                      *         `_.map`.
58507                      * @returns {Function} Returns the new function.
58508                      * @example
58509                      * 
58510                      * _.map(['6', '8', '10'], _.ary(parseInt, 1)); // => [6, 8, 10]
58511                      */
58512                     function ary(func, n, guard) {
58513                         if (guard && isIterateeCall(func, n, guard)) {
58514                             n = undefined;
58515                         }
58516                         n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
58517                         return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
58518                     }
58519
58520                     /**
58521                      * Creates a function that invokes `func`, with the `this` binding and
58522                      * arguments of the created function, while it is called less than `n`
58523                      * times. Subsequent calls to the created function return the result of the
58524                      * last `func` invocation.
58525                      * 
58526                      * @static
58527                      * @memberOf _
58528                      * @category Function
58529                      * @param {number}
58530                      *            n The number of calls at which `func` is no longer invoked.
58531                      * @param {Function}
58532                      *            func The function to restrict.
58533                      * @returns {Function} Returns the new restricted function.
58534                      * @example
58535                      * 
58536                      * jQuery('#add').on('click', _.before(5, addContactToList)); // => allows
58537                      * adding up to 4 contacts to the list
58538                      */
58539                     function before(n, func) {
58540                         var result;
58541                         if (typeof func != 'function') {
58542                             if (typeof n == 'function') {
58543                                 var temp = n;
58544                                 n = func;
58545                                 func = temp;
58546                             } else {
58547                                 throw new TypeError(FUNC_ERROR_TEXT);
58548                             }
58549                         }
58550                         return function() {
58551                             if (--n > 0) {
58552                                 result = func.apply(this, arguments);
58553                             }
58554                             if (n <= 1) {
58555                                 func = undefined;
58556                             }
58557                             return result;
58558                         };
58559                     }
58560
58561                     /**
58562                      * Creates a function that invokes `func` with the `this` binding of
58563                      * `thisArg` and prepends any additional `_.bind` arguments to those
58564                      * provided to the bound function.
58565                      * 
58566                      * The `_.bind.placeholder` value, which defaults to `_` in monolithic
58567                      * builds, may be used as a placeholder for partially applied arguments.
58568                      * 
58569                      * **Note:** Unlike native `Function#bind` this method does not set the
58570                      * "length" property of bound functions.
58571                      * 
58572                      * @static
58573                      * @memberOf _
58574                      * @category Function
58575                      * @param {Function}
58576                      *            func The function to bind.
58577                      * @param {*}
58578                      *            thisArg The `this` binding of `func`.
58579                      * @param {...*}
58580                      *            [partials] The arguments to be partially applied.
58581                      * @returns {Function} Returns the new bound function.
58582                      * @example
58583                      * 
58584                      * var greet = function(greeting, punctuation) { return greeting + ' ' +
58585                      * this.user + punctuation; };
58586                      * 
58587                      * var object = { 'user': 'fred' };
58588                      * 
58589                      * var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!'
58590                      *  // using placeholders var bound = _.bind(greet, object, _, '!');
58591                      * bound('hi'); // => 'hi fred!'
58592                      */
58593                     var bind = restParam(function(func, thisArg, partials) {
58594                         var bitmask = BIND_FLAG;
58595                         if (partials.length) {
58596                             var holders = replaceHolders(partials, bind.placeholder);
58597                             bitmask |= PARTIAL_FLAG;
58598                         }
58599                         return createWrapper(func, bitmask, thisArg, partials, holders);
58600                     });
58601
58602                     /**
58603                      * Binds methods of an object to the object itself, overwriting the existing
58604                      * method. Method names may be specified as individual arguments or as
58605                      * arrays of method names. If no method names are provided all enumerable
58606                      * function properties, own and inherited, of `object` are bound.
58607                      * 
58608                      * **Note:** This method does not set the "length" property of bound
58609                      * functions.
58610                      * 
58611                      * @static
58612                      * @memberOf _
58613                      * @category Function
58614                      * @param {Object}
58615                      *            object The object to bind and assign the bound methods to.
58616                      * @param {...(string|string[])}
58617                      *            [methodNames] The object method names to bind, specified as
58618                      *            individual method names or arrays of method names.
58619                      * @returns {Object} Returns `object`.
58620                      * @example
58621                      * 
58622                      * var view = { 'label': 'docs', 'onClick': function() {
58623                      * console.log('clicked ' + this.label); } };
58624                      * 
58625                      * _.bindAll(view); jQuery('#docs').on('click', view.onClick); // => logs
58626                      * 'clicked docs' when the element is clicked
58627                      */
58628                     var bindAll = restParam(function(object, methodNames) {
58629                         methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
58630
58631                         var index = -1,
58632                             length = methodNames.length;
58633
58634                         while (++index < length) {
58635                             var key = methodNames[index];
58636                             object[key] = createWrapper(object[key], BIND_FLAG, object);
58637                         }
58638                         return object;
58639                     });
58640
58641                     /**
58642                      * Creates a function that invokes the method at `object[key]` and prepends
58643                      * any additional `_.bindKey` arguments to those provided to the bound
58644                      * function.
58645                      * 
58646                      * This method differs from `_.bind` by allowing bound functions to
58647                      * reference methods that may be redefined or don't yet exist. See [Peter
58648                      * Michaux's
58649                      * article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
58650                      * for more details.
58651                      * 
58652                      * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
58653                      * builds, may be used as a placeholder for partially applied arguments.
58654                      * 
58655                      * @static
58656                      * @memberOf _
58657                      * @category Function
58658                      * @param {Object}
58659                      *            object The object the method belongs to.
58660                      * @param {string}
58661                      *            key The key of the method.
58662                      * @param {...*}
58663                      *            [partials] The arguments to be partially applied.
58664                      * @returns {Function} Returns the new bound function.
58665                      * @example
58666                      * 
58667                      * var object = { 'user': 'fred', 'greet': function(greeting, punctuation) {
58668                      * return greeting + ' ' + this.user + punctuation; } };
58669                      * 
58670                      * var bound = _.bindKey(object, 'greet', 'hi'); bound('!'); // => 'hi
58671                      * fred!'
58672                      * 
58673                      * object.greet = function(greeting, punctuation) { return greeting + 'ya ' +
58674                      * this.user + punctuation; };
58675                      * 
58676                      * bound('!'); // => 'hiya fred!'
58677                      *  // using placeholders var bound = _.bindKey(object, 'greet', _, '!');
58678                      * bound('hi'); // => 'hiya fred!'
58679                      */
58680                     var bindKey = restParam(function(object, key, partials) {
58681                         var bitmask = BIND_FLAG | BIND_KEY_FLAG;
58682                         if (partials.length) {
58683                             var holders = replaceHolders(partials, bindKey.placeholder);
58684                             bitmask |= PARTIAL_FLAG;
58685                         }
58686                         return createWrapper(key, bitmask, object, partials, holders);
58687                     });
58688
58689                     /**
58690                      * Creates a function that accepts one or more arguments of `func` that when
58691                      * called either invokes `func` returning its result, if all `func`
58692                      * arguments have been provided, or returns a function that accepts one or
58693                      * more of the remaining `func` arguments, and so on. The arity of `func`
58694                      * may be specified if `func.length` is not sufficient.
58695                      * 
58696                      * The `_.curry.placeholder` value, which defaults to `_` in monolithic
58697                      * builds, may be used as a placeholder for provided arguments.
58698                      * 
58699                      * **Note:** This method does not set the "length" property of curried
58700                      * functions.
58701                      * 
58702                      * @static
58703                      * @memberOf _
58704                      * @category Function
58705                      * @param {Function}
58706                      *            func The function to curry.
58707                      * @param {number}
58708                      *            [arity=func.length] The arity of `func`.
58709                      * @param- {Object} [guard] Enables use as a callback for functions like
58710                      *         `_.map`.
58711                      * @returns {Function} Returns the new curried function.
58712                      * @example
58713                      * 
58714                      * var abc = function(a, b, c) { return [a, b, c]; };
58715                      * 
58716                      * var curried = _.curry(abc);
58717                      * 
58718                      * curried(1)(2)(3); // => [1, 2, 3]
58719                      * 
58720                      * curried(1, 2)(3); // => [1, 2, 3]
58721                      * 
58722                      * curried(1, 2, 3); // => [1, 2, 3]
58723                      *  // using placeholders curried(1)(_, 3)(2); // => [1, 2, 3]
58724                      */
58725                     var curry = createCurry(CURRY_FLAG);
58726
58727                     /**
58728                      * This method is like `_.curry` except that arguments are applied to `func`
58729                      * in the manner of `_.partialRight` instead of `_.partial`.
58730                      * 
58731                      * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
58732                      * builds, may be used as a placeholder for provided arguments.
58733                      * 
58734                      * **Note:** This method does not set the "length" property of curried
58735                      * functions.
58736                      * 
58737                      * @static
58738                      * @memberOf _
58739                      * @category Function
58740                      * @param {Function}
58741                      *            func The function to curry.
58742                      * @param {number}
58743                      *            [arity=func.length] The arity of `func`.
58744                      * @param- {Object} [guard] Enables use as a callback for functions like
58745                      *         `_.map`.
58746                      * @returns {Function} Returns the new curried function.
58747                      * @example
58748                      * 
58749                      * var abc = function(a, b, c) { return [a, b, c]; };
58750                      * 
58751                      * var curried = _.curryRight(abc);
58752                      * 
58753                      * curried(3)(2)(1); // => [1, 2, 3]
58754                      * 
58755                      * curried(2, 3)(1); // => [1, 2, 3]
58756                      * 
58757                      * curried(1, 2, 3); // => [1, 2, 3]
58758                      *  // using placeholders curried(3)(1, _)(2); // => [1, 2, 3]
58759                      */
58760                     var curryRight = createCurry(CURRY_RIGHT_FLAG);
58761
58762                     /**
58763                      * Creates a debounced function that delays invoking `func` until after
58764                      * `wait` milliseconds have elapsed since the last time the debounced
58765                      * function was invoked. The debounced function comes with a `cancel` method
58766                      * to cancel delayed invocations. Provide an options object to indicate that
58767                      * `func` should be invoked on the leading and/or trailing edge of the
58768                      * `wait` timeout. Subsequent calls to the debounced function return the
58769                      * result of the last `func` invocation.
58770                      * 
58771                      * **Note:** If `leading` and `trailing` options are `true`, `func` is
58772                      * invoked on the trailing edge of the timeout only if the the debounced
58773                      * function is invoked more than once during the `wait` timeout.
58774                      * 
58775                      * See [David Corbacho's
58776                      * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
58777                      * for details over the differences between `_.debounce` and `_.throttle`.
58778                      * 
58779                      * @static
58780                      * @memberOf _
58781                      * @category Function
58782                      * @param {Function}
58783                      *            func The function to debounce.
58784                      * @param {number}
58785                      *            [wait=0] The number of milliseconds to delay.
58786                      * @param {Object}
58787                      *            [options] The options object.
58788                      * @param {boolean}
58789                      *            [options.leading=false] Specify invoking on the leading edge
58790                      *            of the timeout.
58791                      * @param {number}
58792                      *            [options.maxWait] The maximum time `func` is allowed to be
58793                      *            delayed before it is invoked.
58794                      * @param {boolean}
58795                      *            [options.trailing=true] Specify invoking on the trailing edge
58796                      *            of the timeout.
58797                      * @returns {Function} Returns the new debounced function.
58798                      * @example
58799                      *  // avoid costly calculations while the window size is in flux
58800                      * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
58801                      *  // invoke `sendMail` when the click event is fired, debouncing
58802                      * subsequent calls jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
58803                      * 'leading': true, 'trailing': false }));
58804                      *  // ensure `batchLog` is invoked once after 1 second of debounced calls
58805                      * var source = new EventSource('/stream'); jQuery(source).on('message',
58806                      * _.debounce(batchLog, 250, { 'maxWait': 1000 }));
58807                      *  // cancel a debounced call var todoChanges = _.debounce(batchLog, 1000);
58808                      * Object.observe(models.todo, todoChanges);
58809                      * 
58810                      * Object.observe(models, function(changes) { if (_.find(changes, { 'user':
58811                      * 'todo', 'type': 'delete'})) { todoChanges.cancel(); } }, ['delete']);
58812                      *  // ...at some point `models.todo` is changed models.todo.completed =
58813                      * true;
58814                      *  // ...before 1 second has passed `models.todo` is deleted // which
58815                      * cancels the debounced `todoChanges` call delete models.todo;
58816                      */
58817                     function debounce(func, wait, options) {
58818                         var args,
58819                             maxTimeoutId,
58820                             result,
58821                             stamp,
58822                             thisArg,
58823                             timeoutId,
58824                             trailingCall,
58825                             lastCalled = 0,
58826                             maxWait = false,
58827                             trailing = true;
58828
58829                         if (typeof func != 'function') {
58830                             throw new TypeError(FUNC_ERROR_TEXT);
58831                         }
58832                         wait = wait < 0 ? 0 : (+wait || 0);
58833                         if (options === true) {
58834                             var leading = true;
58835                             trailing = false;
58836                         } else if (isObject(options)) {
58837                             leading = !!options.leading;
58838                             maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
58839                             trailing = 'trailing' in options ? !!options.trailing : trailing;
58840                         }
58841
58842                         function cancel() {
58843                             if (timeoutId) {
58844                                 clearTimeout(timeoutId);
58845                             }
58846                             if (maxTimeoutId) {
58847                                 clearTimeout(maxTimeoutId);
58848                             }
58849                             lastCalled = 0;
58850                             maxTimeoutId = timeoutId = trailingCall = undefined;
58851                         }
58852
58853                         function complete(isCalled, id) {
58854                             if (id) {
58855                                 clearTimeout(id);
58856                             }
58857                             maxTimeoutId = timeoutId = trailingCall = undefined;
58858                             if (isCalled) {
58859                                 lastCalled = now();
58860                                 result = func.apply(thisArg, args);
58861                                 if (!timeoutId && !maxTimeoutId) {
58862                                     args = thisArg = undefined;
58863                                 }
58864                             }
58865                         }
58866
58867                         function delayed() {
58868                             var remaining = wait - (now() - stamp);
58869                             if (remaining <= 0 || remaining > wait) {
58870                                 complete(trailingCall, maxTimeoutId);
58871                             } else {
58872                                 timeoutId = setTimeout(delayed, remaining);
58873                             }
58874                         }
58875
58876                         function maxDelayed() {
58877                             complete(trailing, timeoutId);
58878                         }
58879
58880                         function debounced() {
58881                             args = arguments;
58882                             stamp = now();
58883                             thisArg = this;
58884                             trailingCall = trailing && (timeoutId || !leading);
58885
58886                             if (maxWait === false) {
58887                                 var leadingCall = leading && !timeoutId;
58888                             } else {
58889                                 if (!maxTimeoutId && !leading) {
58890                                     lastCalled = stamp;
58891                                 }
58892                                 var remaining = maxWait - (stamp - lastCalled),
58893                                     isCalled = remaining <= 0 || remaining > maxWait;
58894
58895                                 if (isCalled) {
58896                                     if (maxTimeoutId) {
58897                                         maxTimeoutId = clearTimeout(maxTimeoutId);
58898                                     }
58899                                     lastCalled = stamp;
58900                                     result = func.apply(thisArg, args);
58901                                 } else if (!maxTimeoutId) {
58902                                     maxTimeoutId = setTimeout(maxDelayed, remaining);
58903                                 }
58904                             }
58905                             if (isCalled && timeoutId) {
58906                                 timeoutId = clearTimeout(timeoutId);
58907                             } else if (!timeoutId && wait !== maxWait) {
58908                                 timeoutId = setTimeout(delayed, wait);
58909                             }
58910                             if (leadingCall) {
58911                                 isCalled = true;
58912                                 result = func.apply(thisArg, args);
58913                             }
58914                             if (isCalled && !timeoutId && !maxTimeoutId) {
58915                                 args = thisArg = undefined;
58916                             }
58917                             return result;
58918                         }
58919                         debounced.cancel = cancel;
58920                         return debounced;
58921                     }
58922
58923                     /**
58924                      * Defers invoking the `func` until the current call stack has cleared. Any
58925                      * additional arguments are provided to `func` when it is invoked.
58926                      * 
58927                      * @static
58928                      * @memberOf _
58929                      * @category Function
58930                      * @param {Function}
58931                      *            func The function to defer.
58932                      * @param {...*}
58933                      *            [args] The arguments to invoke the function with.
58934                      * @returns {number} Returns the timer id.
58935                      * @example
58936                      * 
58937                      * _.defer(function(text) { console.log(text); }, 'deferred'); // logs
58938                      * 'deferred' after one or more milliseconds
58939                      */
58940                     var defer = restParam(function(func, args) {
58941                         return baseDelay(func, 1, args);
58942                     });
58943
58944                     /**
58945                      * Invokes `func` after `wait` milliseconds. Any additional arguments are
58946                      * provided to `func` when it is invoked.
58947                      * 
58948                      * @static
58949                      * @memberOf _
58950                      * @category Function
58951                      * @param {Function}
58952                      *            func The function to delay.
58953                      * @param {number}
58954                      *            wait The number of milliseconds to delay invocation.
58955                      * @param {...*}
58956                      *            [args] The arguments to invoke the function with.
58957                      * @returns {number} Returns the timer id.
58958                      * @example
58959                      * 
58960                      * _.delay(function(text) { console.log(text); }, 1000, 'later'); // => logs
58961                      * 'later' after one second
58962                      */
58963                     var delay = restParam(function(func, wait, args) {
58964                         return baseDelay(func, wait, args);
58965                     });
58966
58967                     /**
58968                      * Creates a function that returns the result of invoking the provided
58969                      * functions with the `this` binding of the created function, where each
58970                      * successive invocation is supplied the return value of the previous.
58971                      * 
58972                      * @static
58973                      * @memberOf _
58974                      * @category Function
58975                      * @param {...Function}
58976                      *            [funcs] Functions to invoke.
58977                      * @returns {Function} Returns the new function.
58978                      * @example
58979                      * 
58980                      * function square(n) { return n * n; }
58981                      * 
58982                      * var addSquare = _.flow(_.add, square); addSquare(1, 2); // => 9
58983                      */
58984                     var flow = createFlow();
58985
58986                     /**
58987                      * This method is like `_.flow` except that it creates a function that
58988                      * invokes the provided functions from right to left.
58989                      * 
58990                      * @static
58991                      * @memberOf _
58992                      * @alias backflow, compose
58993                      * @category Function
58994                      * @param {...Function}
58995                      *            [funcs] Functions to invoke.
58996                      * @returns {Function} Returns the new function.
58997                      * @example
58998                      * 
58999                      * function square(n) { return n * n; }
59000                      * 
59001                      * var addSquare = _.flowRight(square, _.add); addSquare(1, 2); // => 9
59002                      */
59003                     var flowRight = createFlow(true);
59004
59005                     /**
59006                      * Creates a function that memoizes the result of `func`. If `resolver` is
59007                      * provided it determines the cache key for storing the result based on the
59008                      * arguments provided to the memoized function. By default, the first
59009                      * argument provided to the memoized function is coerced to a string and
59010                      * used as the cache key. The `func` is invoked with the `this` binding of
59011                      * the memoized function.
59012                      * 
59013                      * **Note:** The cache is exposed as the `cache` property on the memoized
59014                      * function. Its creation may be customized by replacing the
59015                      * `_.memoize.Cache` constructor with one whose instances implement the
59016                      * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
59017                      * method interface of `get`, `has`, and `set`.
59018                      * 
59019                      * @static
59020                      * @memberOf _
59021                      * @category Function
59022                      * @param {Function}
59023                      *            func The function to have its output memoized.
59024                      * @param {Function}
59025                      *            [resolver] The function to resolve the cache key.
59026                      * @returns {Function} Returns the new memoizing function.
59027                      * @example
59028                      * 
59029                      * var upperCase = _.memoize(function(string) { return string.toUpperCase();
59030                      * });
59031                      * 
59032                      * upperCase('fred'); // => 'FRED'
59033                      *  // modifying the result cache upperCase.cache.set('fred', 'BARNEY');
59034                      * upperCase('fred'); // => 'BARNEY'
59035                      *  // replacing `_.memoize.Cache` var object = { 'user': 'fred' }; var
59036                      * other = { 'user': 'barney' }; var identity = _.memoize(_.identity);
59037                      * 
59038                      * identity(object); // => { 'user': 'fred' } identity(other); // => {
59039                      * 'user': 'fred' }
59040                      * 
59041                      * _.memoize.Cache = WeakMap; var identity = _.memoize(_.identity);
59042                      * 
59043                      * identity(object); // => { 'user': 'fred' } identity(other); // => {
59044                      * 'user': 'barney' }
59045                      */
59046                     function memoize(func, resolver) {
59047                         if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
59048                             throw new TypeError(FUNC_ERROR_TEXT);
59049                         }
59050                         var memoized = function() {
59051                             var args = arguments,
59052                                 key = resolver ? resolver.apply(this, args) : args[0],
59053                                 cache = memoized.cache;
59054
59055                             if (cache.has(key)) {
59056                                 return cache.get(key);
59057                             }
59058                             var result = func.apply(this, args);
59059                             memoized.cache = cache.set(key, result);
59060                             return result;
59061                         };
59062                         memoized.cache = new memoize.Cache;
59063                         return memoized;
59064                     }
59065
59066                     /**
59067                      * Creates a function that runs each argument through a corresponding
59068                      * transform function.
59069                      * 
59070                      * @static
59071                      * @memberOf _
59072                      * @category Function
59073                      * @param {Function}
59074                      *            func The function to wrap.
59075                      * @param {...(Function|Function[])}
59076                      *            [transforms] The functions to transform arguments, specified
59077                      *            as individual functions or arrays of functions.
59078                      * @returns {Function} Returns the new function.
59079                      * @example
59080                      * 
59081                      * function doubled(n) { return n * 2; }
59082                      * 
59083                      * function square(n) { return n * n; }
59084                      * 
59085                      * var modded = _.modArgs(function(x, y) { return [x, y]; }, square,
59086                      * doubled);
59087                      * 
59088                      * modded(1, 2); // => [1, 4]
59089                      * 
59090                      * modded(5, 10); // => [25, 20]
59091                      */
59092                     var modArgs = restParam(function(func, transforms) {
59093                         transforms = baseFlatten(transforms);
59094                         if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
59095                             throw new TypeError(FUNC_ERROR_TEXT);
59096                         }
59097                         var length = transforms.length;
59098                         return restParam(function(args) {
59099                             var index = nativeMin(args.length, length);
59100                             while (index--) {
59101                                 args[index] = transforms[index](args[index]);
59102                             }
59103                             return func.apply(this, args);
59104                         });
59105                     });
59106
59107                     /**
59108                      * Creates a function that negates the result of the predicate `func`. The
59109                      * `func` predicate is invoked with the `this` binding and arguments of the
59110                      * created function.
59111                      * 
59112                      * @static
59113                      * @memberOf _
59114                      * @category Function
59115                      * @param {Function}
59116                      *            predicate The predicate to negate.
59117                      * @returns {Function} Returns the new function.
59118                      * @example
59119                      * 
59120                      * function isEven(n) { return n % 2 == 0; }
59121                      * 
59122                      * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); // => [1, 3, 5]
59123                      */
59124                     function negate(predicate) {
59125                         if (typeof predicate != 'function') {
59126                             throw new TypeError(FUNC_ERROR_TEXT);
59127                         }
59128                         return function() {
59129                             return !predicate.apply(this, arguments);
59130                         };
59131                     }
59132
59133                     /**
59134                      * Creates a function that is restricted to invoking `func` once. Repeat
59135                      * calls to the function return the value of the first call. The `func` is
59136                      * invoked with the `this` binding and arguments of the created function.
59137                      * 
59138                      * @static
59139                      * @memberOf _
59140                      * @category Function
59141                      * @param {Function}
59142                      *            func The function to restrict.
59143                      * @returns {Function} Returns the new restricted function.
59144                      * @example
59145                      * 
59146                      * var initialize = _.once(createApplication); initialize(); initialize(); //
59147                      * `initialize` invokes `createApplication` once
59148                      */
59149                     function once(func) {
59150                         return before(2, func);
59151                     }
59152
59153                     /**
59154                      * Creates a function that invokes `func` with `partial` arguments prepended
59155                      * to those provided to the new function. This method is like `_.bind`
59156                      * except it does **not** alter the `this` binding.
59157                      * 
59158                      * The `_.partial.placeholder` value, which defaults to `_` in monolithic
59159                      * builds, may be used as a placeholder for partially applied arguments.
59160                      * 
59161                      * **Note:** This method does not set the "length" property of partially
59162                      * applied functions.
59163                      * 
59164                      * @static
59165                      * @memberOf _
59166                      * @category Function
59167                      * @param {Function}
59168                      *            func The function to partially apply arguments to.
59169                      * @param {...*}
59170                      *            [partials] The arguments to be partially applied.
59171                      * @returns {Function} Returns the new partially applied function.
59172                      * @example
59173                      * 
59174                      * var greet = function(greeting, name) { return greeting + ' ' + name; };
59175                      * 
59176                      * var sayHelloTo = _.partial(greet, 'hello'); sayHelloTo('fred'); // =>
59177                      * 'hello fred'
59178                      *  // using placeholders var greetFred = _.partial(greet, _, 'fred');
59179                      * greetFred('hi'); // => 'hi fred'
59180                      */
59181                     var partial = createPartial(PARTIAL_FLAG);
59182
59183                     /**
59184                      * This method is like `_.partial` except that partially applied arguments
59185                      * are appended to those provided to the new function.
59186                      * 
59187                      * The `_.partialRight.placeholder` value, which defaults to `_` in
59188                      * monolithic builds, may be used as a placeholder for partially applied
59189                      * arguments.
59190                      * 
59191                      * **Note:** This method does not set the "length" property of partially
59192                      * applied functions.
59193                      * 
59194                      * @static
59195                      * @memberOf _
59196                      * @category Function
59197                      * @param {Function}
59198                      *            func The function to partially apply arguments to.
59199                      * @param {...*}
59200                      *            [partials] The arguments to be partially applied.
59201                      * @returns {Function} Returns the new partially applied function.
59202                      * @example
59203                      * 
59204                      * var greet = function(greeting, name) { return greeting + ' ' + name; };
59205                      * 
59206                      * var greetFred = _.partialRight(greet, 'fred'); greetFred('hi'); // => 'hi
59207                      * fred'
59208                      *  // using placeholders var sayHelloTo = _.partialRight(greet, 'hello',
59209                      * _); sayHelloTo('fred'); // => 'hello fred'
59210                      */
59211                     var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
59212
59213                     /**
59214                      * Creates a function that invokes `func` with arguments arranged according
59215                      * to the specified indexes where the argument value at the first index is
59216                      * provided as the first argument, the argument value at the second index is
59217                      * provided as the second argument, and so on.
59218                      * 
59219                      * @static
59220                      * @memberOf _
59221                      * @category Function
59222                      * @param {Function}
59223                      *            func The function to rearrange arguments for.
59224                      * @param {...(number|number[])}
59225                      *            indexes The arranged argument indexes, specified as individual
59226                      *            indexes or arrays of indexes.
59227                      * @returns {Function} Returns the new function.
59228                      * @example
59229                      * 
59230                      * var rearged = _.rearg(function(a, b, c) { return [a, b, c]; }, 2, 0, 1);
59231                      * 
59232                      * rearged('b', 'c', 'a') // => ['a', 'b', 'c']
59233                      * 
59234                      * var map = _.rearg(_.map, [1, 0]); map(function(n) { return n * 3; }, [1,
59235                      * 2, 3]); // => [3, 6, 9]
59236                      */
59237                     var rearg = restParam(function(func, indexes) {
59238                         return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
59239                     });
59240
59241                     /**
59242                      * Creates a function that invokes `func` with the `this` binding of the
59243                      * created function and arguments from `start` and beyond provided as an
59244                      * array.
59245                      * 
59246                      * **Note:** This method is based on the [rest
59247                      * parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
59248                      * 
59249                      * @static
59250                      * @memberOf _
59251                      * @category Function
59252                      * @param {Function}
59253                      *            func The function to apply a rest parameter to.
59254                      * @param {number}
59255                      *            [start=func.length-1] The start position of the rest
59256                      *            parameter.
59257                      * @returns {Function} Returns the new function.
59258                      * @example
59259                      * 
59260                      * var say = _.restParam(function(what, names) { return what + ' ' +
59261                      * _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') +
59262                      * _.last(names); });
59263                      * 
59264                      * say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, &
59265                      * pebbles'
59266                      */
59267                     function restParam(func, start) {
59268                         if (typeof func != 'function') {
59269                             throw new TypeError(FUNC_ERROR_TEXT);
59270                         }
59271                         start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
59272                         return function() {
59273                             var args = arguments,
59274                                 index = -1,
59275                                 length = nativeMax(args.length - start, 0),
59276                                 rest = Array(length);
59277
59278                             while (++index < length) {
59279                                 rest[index] = args[start + index];
59280                             }
59281                             switch (start) {
59282                                 case 0:
59283                                     return func.call(this, rest);
59284                                 case 1:
59285                                     return func.call(this, args[0], rest);
59286                                 case 2:
59287                                     return func.call(this, args[0], args[1], rest);
59288                             }
59289                             var otherArgs = Array(start + 1);
59290                             index = -1;
59291                             while (++index < start) {
59292                                 otherArgs[index] = args[index];
59293                             }
59294                             otherArgs[start] = rest;
59295                             return func.apply(this, otherArgs);
59296                         };
59297                     }
59298
59299                     /**
59300                      * Creates a function that invokes `func` with the `this` binding of the
59301                      * created function and an array of arguments much like
59302                      * [`Function#apply`](https://es5.github.io/#x15.3.4.3).
59303                      * 
59304                      * **Note:** This method is based on the [spread
59305                      * operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
59306                      * 
59307                      * @static
59308                      * @memberOf _
59309                      * @category Function
59310                      * @param {Function}
59311                      *            func The function to spread arguments over.
59312                      * @returns {Function} Returns the new function.
59313                      * @example
59314                      * 
59315                      * var say = _.spread(function(who, what) { return who + ' says ' + what;
59316                      * });
59317                      * 
59318                      * say(['fred', 'hello']); // => 'fred says hello'
59319                      *  // with a Promise var numbers = Promise.all([ Promise.resolve(40),
59320                      * Promise.resolve(36) ]);
59321                      * 
59322                      * numbers.then(_.spread(function(x, y) { return x + y; })); // => a Promise
59323                      * of 76
59324                      */
59325                     function spread(func) {
59326                         if (typeof func != 'function') {
59327                             throw new TypeError(FUNC_ERROR_TEXT);
59328                         }
59329                         return function(array) {
59330                             return func.apply(this, array);
59331                         };
59332                     }
59333
59334                     /**
59335                      * Creates a throttled function that only invokes `func` at most once per
59336                      * every `wait` milliseconds. The throttled function comes with a `cancel`
59337                      * method to cancel delayed invocations. Provide an options object to
59338                      * indicate that `func` should be invoked on the leading and/or trailing
59339                      * edge of the `wait` timeout. Subsequent calls to the throttled function
59340                      * return the result of the last `func` call.
59341                      * 
59342                      * **Note:** If `leading` and `trailing` options are `true`, `func` is
59343                      * invoked on the trailing edge of the timeout only if the the throttled
59344                      * function is invoked more than once during the `wait` timeout.
59345                      * 
59346                      * See [David Corbacho's
59347                      * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
59348                      * for details over the differences between `_.throttle` and `_.debounce`.
59349                      * 
59350                      * @static
59351                      * @memberOf _
59352                      * @category Function
59353                      * @param {Function}
59354                      *            func The function to throttle.
59355                      * @param {number}
59356                      *            [wait=0] The number of milliseconds to throttle invocations
59357                      *            to.
59358                      * @param {Object}
59359                      *            [options] The options object.
59360                      * @param {boolean}
59361                      *            [options.leading=true] Specify invoking on the leading edge of
59362                      *            the timeout.
59363                      * @param {boolean}
59364                      *            [options.trailing=true] Specify invoking on the trailing edge
59365                      *            of the timeout.
59366                      * @returns {Function} Returns the new throttled function.
59367                      * @example
59368                      *  // avoid excessively updating the position while scrolling
59369                      * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
59370                      *  // invoke `renewToken` when the click event is fired, but not more than
59371                      * once every 5 minutes jQuery('.interactive').on('click',
59372                      * _.throttle(renewToken, 300000, { 'trailing': false }));
59373                      *  // cancel a trailing throttled call jQuery(window).on('popstate',
59374                      * throttled.cancel);
59375                      */
59376                     function throttle(func, wait, options) {
59377                         var leading = true,
59378                             trailing = true;
59379
59380                         if (typeof func != 'function') {
59381                             throw new TypeError(FUNC_ERROR_TEXT);
59382                         }
59383                         if (options === false) {
59384                             leading = false;
59385                         } else if (isObject(options)) {
59386                             leading = 'leading' in options ? !!options.leading : leading;
59387                             trailing = 'trailing' in options ? !!options.trailing : trailing;
59388                         }
59389                         return debounce(func, wait, {
59390                             'leading': leading,
59391                             'maxWait': +wait,
59392                             'trailing': trailing
59393                         });
59394                     }
59395
59396                     /**
59397                      * Creates a function that provides `value` to the wrapper function as its
59398                      * first argument. Any additional arguments provided to the function are
59399                      * appended to those provided to the wrapper function. The wrapper is
59400                      * invoked with the `this` binding of the created function.
59401                      * 
59402                      * @static
59403                      * @memberOf _
59404                      * @category Function
59405                      * @param {*}
59406                      *            value The value to wrap.
59407                      * @param {Function}
59408                      *            wrapper The wrapper function.
59409                      * @returns {Function} Returns the new function.
59410                      * @example
59411                      * 
59412                      * var p = _.wrap(_.escape, function(func, text) { return '
59413                      * <p>' + func(text) + '
59414                      * </p>'; });
59415                      * 
59416                      * p('fred, barney, & pebbles'); // => '
59417                      * <p>
59418                      * fred, barney, &amp; pebbles
59419                      * </p>'
59420                      */
59421                     function wrap(value, wrapper) {
59422                         wrapper = wrapper == null ? identity : wrapper;
59423                         return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
59424                     }
59425
59426                     /*------------------------------------------------------------------------*/
59427
59428                     /**
59429                      * Creates a clone of `value`. If `isDeep` is `true` nested objects are
59430                      * cloned, otherwise they are assigned by reference. If `customizer` is
59431                      * provided it is invoked to produce the cloned values. If `customizer`
59432                      * returns `undefined` cloning is handled by the method instead. The
59433                      * `customizer` is bound to `thisArg` and invoked with two argument; (value [,
59434                      * index|key, object]).
59435                      * 
59436                      * **Note:** This method is loosely based on the [structured clone
59437                      * algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
59438                      * The enumerable properties of `arguments` objects and objects created by
59439                      * constructors other than `Object` are cloned to plain `Object` objects. An
59440                      * empty object is returned for uncloneable values such as functions, DOM
59441                      * nodes, Maps, Sets, and WeakMaps.
59442                      * 
59443                      * @static
59444                      * @memberOf _
59445                      * @category Lang
59446                      * @param {*}
59447                      *            value The value to clone.
59448                      * @param {boolean}
59449                      *            [isDeep] Specify a deep clone.
59450                      * @param {Function}
59451                      *            [customizer] The function to customize cloning values.
59452                      * @param {*}
59453                      *            [thisArg] The `this` binding of `customizer`.
59454                      * @returns {*} Returns the cloned value.
59455                      * @example
59456                      * 
59457                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
59458                      * 
59459                      * var shallow = _.clone(users); shallow[0] === users[0]; // => true
59460                      * 
59461                      * var deep = _.clone(users, true); deep[0] === users[0]; // => false
59462                      *  // using a customizer callback var el = _.clone(document.body,
59463                      * function(value) { if (_.isElement(value)) { return
59464                      * value.cloneNode(false); } });
59465                      * 
59466                      * el === document.body // => false el.nodeName // => BODY
59467                      * el.childNodes.length; // => 0
59468                      */
59469                     function clone(value, isDeep, customizer, thisArg) {
59470                         if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
59471                             isDeep = false;
59472                         } else if (typeof isDeep == 'function') {
59473                             thisArg = customizer;
59474                             customizer = isDeep;
59475                             isDeep = false;
59476                         }
59477                         return typeof customizer == 'function' ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1)) : baseClone(value, isDeep);
59478                     }
59479
59480                     /**
59481                      * Creates a deep clone of `value`. If `customizer` is provided it is
59482                      * invoked to produce the cloned values. If `customizer` returns `undefined`
59483                      * cloning is handled by the method instead. The `customizer` is bound to
59484                      * `thisArg` and invoked with two argument; (value [, index|key, object]).
59485                      * 
59486                      * **Note:** This method is loosely based on the [structured clone
59487                      * algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
59488                      * The enumerable properties of `arguments` objects and objects created by
59489                      * constructors other than `Object` are cloned to plain `Object` objects. An
59490                      * empty object is returned for uncloneable values such as functions, DOM
59491                      * nodes, Maps, Sets, and WeakMaps.
59492                      * 
59493                      * @static
59494                      * @memberOf _
59495                      * @category Lang
59496                      * @param {*}
59497                      *            value The value to deep clone.
59498                      * @param {Function}
59499                      *            [customizer] The function to customize cloning values.
59500                      * @param {*}
59501                      *            [thisArg] The `this` binding of `customizer`.
59502                      * @returns {*} Returns the deep cloned value.
59503                      * @example
59504                      * 
59505                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
59506                      * 
59507                      * var deep = _.cloneDeep(users); deep[0] === users[0]; // => false
59508                      *  // using a customizer callback var el = _.cloneDeep(document.body,
59509                      * function(value) { if (_.isElement(value)) { return value.cloneNode(true); }
59510                      * });
59511                      * 
59512                      * el === document.body // => false el.nodeName // => BODY
59513                      * el.childNodes.length; // => 20
59514                      */
59515                     function cloneDeep(value, customizer, thisArg) {
59516                         return typeof customizer == 'function' ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) : baseClone(value, true);
59517                     }
59518
59519                     /**
59520                      * Checks if `value` is greater than `other`.
59521                      * 
59522                      * @static
59523                      * @memberOf _
59524                      * @category Lang
59525                      * @param {*}
59526                      *            value The value to compare.
59527                      * @param {*}
59528                      *            other The other value to compare.
59529                      * @returns {boolean} Returns `true` if `value` is greater than `other`,
59530                      *          else `false`.
59531                      * @example
59532                      * 
59533                      * _.gt(3, 1); // => true
59534                      * 
59535                      * _.gt(3, 3); // => false
59536                      * 
59537                      * _.gt(1, 3); // => false
59538                      */
59539                     function gt(value, other) {
59540                         return value > other;
59541                     }
59542
59543                     /**
59544                      * Checks if `value` is greater than or equal to `other`.
59545                      * 
59546                      * @static
59547                      * @memberOf _
59548                      * @category Lang
59549                      * @param {*}
59550                      *            value The value to compare.
59551                      * @param {*}
59552                      *            other The other value to compare.
59553                      * @returns {boolean} Returns `true` if `value` is greater than or equal to
59554                      *          `other`, else `false`.
59555                      * @example
59556                      * 
59557                      * _.gte(3, 1); // => true
59558                      * 
59559                      * _.gte(3, 3); // => true
59560                      * 
59561                      * _.gte(1, 3); // => false
59562                      */
59563                     function gte(value, other) {
59564                         return value >= other;
59565                     }
59566
59567                     /**
59568                      * Checks if `value` is classified as an `arguments` object.
59569                      * 
59570                      * @static
59571                      * @memberOf _
59572                      * @category Lang
59573                      * @param {*}
59574                      *            value The value to check.
59575                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59576                      *          else `false`.
59577                      * @example
59578                      * 
59579                      * _.isArguments(function() { return arguments; }()); // => true
59580                      * 
59581                      * _.isArguments([1, 2, 3]); // => false
59582                      */
59583                     function isArguments(value) {
59584                         return isObjectLike(value) && isArrayLike(value) &&
59585                             hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
59586                     }
59587
59588                     /**
59589                      * Checks if `value` is classified as an `Array` object.
59590                      * 
59591                      * @static
59592                      * @memberOf _
59593                      * @category Lang
59594                      * @param {*}
59595                      *            value The value to check.
59596                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59597                      *          else `false`.
59598                      * @example
59599                      * 
59600                      * _.isArray([1, 2, 3]); // => true
59601                      * 
59602                      * _.isArray(function() { return arguments; }()); // => false
59603                      */
59604                     var isArray = nativeIsArray || function(value) {
59605                         return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
59606                     };
59607
59608                     /**
59609                      * Checks if `value` is classified as a boolean primitive or object.
59610                      * 
59611                      * @static
59612                      * @memberOf _
59613                      * @category Lang
59614                      * @param {*}
59615                      *            value The value to check.
59616                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59617                      *          else `false`.
59618                      * @example
59619                      * 
59620                      * _.isBoolean(false); // => true
59621                      * 
59622                      * _.isBoolean(null); // => false
59623                      */
59624                     function isBoolean(value) {
59625                         return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
59626                     }
59627
59628                     /**
59629                      * Checks if `value` is classified as a `Date` object.
59630                      * 
59631                      * @static
59632                      * @memberOf _
59633                      * @category Lang
59634                      * @param {*}
59635                      *            value The value to check.
59636                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59637                      *          else `false`.
59638                      * @example
59639                      * 
59640                      * _.isDate(new Date); // => true
59641                      * 
59642                      * _.isDate('Mon April 23 2012'); // => false
59643                      */
59644                     function isDate(value) {
59645                         return isObjectLike(value) && objToString.call(value) == dateTag;
59646                     }
59647
59648                     /**
59649                      * Checks if `value` is a DOM element.
59650                      * 
59651                      * @static
59652                      * @memberOf _
59653                      * @category Lang
59654                      * @param {*}
59655                      *            value The value to check.
59656                      * @returns {boolean} Returns `true` if `value` is a DOM element, else
59657                      *          `false`.
59658                      * @example
59659                      * 
59660                      * _.isElement(document.body); // => true
59661                      * 
59662                      * _.isElement('<body>'); // => false
59663                      */
59664                     function isElement(value) {
59665                         return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
59666                     }
59667
59668                     /**
59669                      * Checks if `value` is empty. A value is considered empty unless it is an
59670                      * `arguments` object, array, string, or jQuery-like collection with a
59671                      * length greater than `0` or an object with own enumerable properties.
59672                      * 
59673                      * @static
59674                      * @memberOf _
59675                      * @category Lang
59676                      * @param {Array|Object|string}
59677                      *            value The value to inspect.
59678                      * @returns {boolean} Returns `true` if `value` is empty, else `false`.
59679                      * @example
59680                      * 
59681                      * _.isEmpty(null); // => true
59682                      * 
59683                      * _.isEmpty(true); // => true
59684                      * 
59685                      * _.isEmpty(1); // => true
59686                      * 
59687                      * _.isEmpty([1, 2, 3]); // => false
59688                      * 
59689                      * _.isEmpty({ 'a': 1 }); // => false
59690                      */
59691                     function isEmpty(value) {
59692                         if (value == null) {
59693                             return true;
59694                         }
59695                         if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
59696                                 (isObjectLike(value) && isFunction(value.splice)))) {
59697                             return !value.length;
59698                         }
59699                         return !keys(value).length;
59700                     }
59701
59702                     /**
59703                      * Performs a deep comparison between two values to determine if they are
59704                      * equivalent. If `customizer` is provided it is invoked to compare values.
59705                      * If `customizer` returns `undefined` comparisons are handled by the method
59706                      * instead. The `customizer` is bound to `thisArg` and invoked with three
59707                      * arguments: (value, other [, index|key]).
59708                      * 
59709                      * **Note:** This method supports comparing arrays, booleans, `Date`
59710                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
59711                      * compared by their own, not inherited, enumerable properties. Functions
59712                      * and DOM nodes are **not** supported. Provide a customizer function to
59713                      * extend support for comparing other values.
59714                      * 
59715                      * @static
59716                      * @memberOf _
59717                      * @alias eq
59718                      * @category Lang
59719                      * @param {*}
59720                      *            value The value to compare.
59721                      * @param {*}
59722                      *            other The other value to compare.
59723                      * @param {Function}
59724                      *            [customizer] The function to customize value comparisons.
59725                      * @param {*}
59726                      *            [thisArg] The `this` binding of `customizer`.
59727                      * @returns {boolean} Returns `true` if the values are equivalent, else
59728                      *          `false`.
59729                      * @example
59730                      * 
59731                      * var object = { 'user': 'fred' }; var other = { 'user': 'fred' };
59732                      * 
59733                      * object == other; // => false
59734                      * 
59735                      * _.isEqual(object, other); // => true
59736                      *  // using a customizer callback var array = ['hello', 'goodbye']; var
59737                      * other = ['hi', 'goodbye'];
59738                      * 
59739                      * _.isEqual(array, other, function(value, other) { if (_.every([value,
59740                      * other], RegExp.prototype.test, /^h(?:i|ello)$/)) { return true; } }); // =>
59741                      * true
59742                      */
59743                     function isEqual(value, other, customizer, thisArg) {
59744                         customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
59745                         var result = customizer ? customizer(value, other) : undefined;
59746                         return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
59747                     }
59748
59749                     /**
59750                      * Checks if `value` is an `Error`, `EvalError`, `RangeError`,
59751                      * `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object.
59752                      * 
59753                      * @static
59754                      * @memberOf _
59755                      * @category Lang
59756                      * @param {*}
59757                      *            value The value to check.
59758                      * @returns {boolean} Returns `true` if `value` is an error object, else
59759                      *          `false`.
59760                      * @example
59761                      * 
59762                      * _.isError(new Error); // => true
59763                      * 
59764                      * _.isError(Error); // => false
59765                      */
59766                     function isError(value) {
59767                         return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
59768                     }
59769
59770                     /**
59771                      * Checks if `value` is a finite primitive number.
59772                      * 
59773                      * **Note:** This method is based on
59774                      * [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).
59775                      * 
59776                      * @static
59777                      * @memberOf _
59778                      * @category Lang
59779                      * @param {*}
59780                      *            value The value to check.
59781                      * @returns {boolean} Returns `true` if `value` is a finite number, else
59782                      *          `false`.
59783                      * @example
59784                      * 
59785                      * _.isFinite(10); // => true
59786                      * 
59787                      * _.isFinite('10'); // => false
59788                      * 
59789                      * _.isFinite(true); // => false
59790                      * 
59791                      * _.isFinite(Object(10)); // => false
59792                      * 
59793                      * _.isFinite(Infinity); // => false
59794                      */
59795                     function isFinite(value) {
59796                         return typeof value == 'number' && nativeIsFinite(value);
59797                     }
59798
59799                     /**
59800                      * Checks if `value` is classified as a `Function` object.
59801                      * 
59802                      * @static
59803                      * @memberOf _
59804                      * @category Lang
59805                      * @param {*}
59806                      *            value The value to check.
59807                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59808                      *          else `false`.
59809                      * @example
59810                      * 
59811                      * _.isFunction(_); // => true
59812                      * 
59813                      * _.isFunction(/abc/); // => false
59814                      */
59815                     function isFunction(value) {
59816                         // The use of `Object#toString` avoids issues with the `typeof` operator
59817                         // in older versions of Chrome and Safari which return 'function' for
59818                         // regexes
59819                         // and Safari 8 equivalents which return 'object' for typed array
59820                         // constructors.
59821                         return isObject(value) && objToString.call(value) == funcTag;
59822                     }
59823
59824                     /**
59825                      * Checks if `value` is the [language type](https://es5.github.io/#x8) of
59826                      * `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and
59827                      * `new String('')`)
59828                      * 
59829                      * @static
59830                      * @memberOf _
59831                      * @category Lang
59832                      * @param {*}
59833                      *            value The value to check.
59834                      * @returns {boolean} Returns `true` if `value` is an object, else `false`.
59835                      * @example
59836                      * 
59837                      * _.isObject({}); // => true
59838                      * 
59839                      * _.isObject([1, 2, 3]); // => true
59840                      * 
59841                      * _.isObject(1); // => false
59842                      */
59843                     function isObject(value) {
59844                         // Avoid a V8 JIT bug in Chrome 19-20.
59845                         // See https://code.google.com/p/v8/issues/detail?id=2291 for more
59846                         // details.
59847                         var type = typeof value;
59848                         return !!value && (type == 'object' || type == 'function');
59849                     }
59850
59851                     /**
59852                      * Performs a deep comparison between `object` and `source` to determine if
59853                      * `object` contains equivalent property values. If `customizer` is provided
59854                      * it is invoked to compare values. If `customizer` returns `undefined`
59855                      * comparisons are handled by the method instead. The `customizer` is bound
59856                      * to `thisArg` and invoked with three arguments: (value, other, index|key).
59857                      * 
59858                      * **Note:** This method supports comparing properties of arrays, booleans,
59859                      * `Date` objects, numbers, `Object` objects, regexes, and strings.
59860                      * Functions and DOM nodes are **not** supported. Provide a customizer
59861                      * function to extend support for comparing other values.
59862                      * 
59863                      * @static
59864                      * @memberOf _
59865                      * @category Lang
59866                      * @param {Object}
59867                      *            object The object to inspect.
59868                      * @param {Object}
59869                      *            source The object of property values to match.
59870                      * @param {Function}
59871                      *            [customizer] The function to customize value comparisons.
59872                      * @param {*}
59873                      *            [thisArg] The `this` binding of `customizer`.
59874                      * @returns {boolean} Returns `true` if `object` is a match, else `false`.
59875                      * @example
59876                      * 
59877                      * var object = { 'user': 'fred', 'age': 40 };
59878                      * 
59879                      * _.isMatch(object, { 'age': 40 }); // => true
59880                      * 
59881                      * _.isMatch(object, { 'age': 36 }); // => false
59882                      *  // using a customizer callback var object = { 'greeting': 'hello' }; var
59883                      * source = { 'greeting': 'hi' };
59884                      * 
59885                      * _.isMatch(object, source, function(value, other) { return _.every([value,
59886                      * other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; }); // =>
59887                      * true
59888                      */
59889                     function isMatch(object, source, customizer, thisArg) {
59890                         customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
59891                         return baseIsMatch(object, getMatchData(source), customizer);
59892                     }
59893
59894                     /**
59895                      * Checks if `value` is `NaN`.
59896                      * 
59897                      * **Note:** This method is not the same as
59898                      * [`isNaN`](https://es5.github.io/#x15.1.2.4) which returns `true` for
59899                      * `undefined` and other non-numeric values.
59900                      * 
59901                      * @static
59902                      * @memberOf _
59903                      * @category Lang
59904                      * @param {*}
59905                      *            value The value to check.
59906                      * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
59907                      * @example
59908                      * 
59909                      * _.isNaN(NaN); // => true
59910                      * 
59911                      * _.isNaN(new Number(NaN)); // => true
59912                      * 
59913                      * isNaN(undefined); // => true
59914                      * 
59915                      * _.isNaN(undefined); // => false
59916                      */
59917                     function isNaN(value) {
59918                         // An `NaN` primitive is the only value that is not equal to itself.
59919                         // Perform the `toStringTag` check first to avoid errors with some host
59920                         // objects in IE.
59921                         return isNumber(value) && value != +value;
59922                     }
59923
59924                     /**
59925                      * Checks if `value` is a native function.
59926                      * 
59927                      * @static
59928                      * @memberOf _
59929                      * @category Lang
59930                      * @param {*}
59931                      *            value The value to check.
59932                      * @returns {boolean} Returns `true` if `value` is a native function, else
59933                      *          `false`.
59934                      * @example
59935                      * 
59936                      * _.isNative(Array.prototype.push); // => true
59937                      * 
59938                      * _.isNative(_); // => false
59939                      */
59940                     function isNative(value) {
59941                         if (value == null) {
59942                             return false;
59943                         }
59944                         if (isFunction(value)) {
59945                             return reIsNative.test(fnToString.call(value));
59946                         }
59947                         return isObjectLike(value) && reIsHostCtor.test(value);
59948                     }
59949
59950                     /**
59951                      * Checks if `value` is `null`.
59952                      * 
59953                      * @static
59954                      * @memberOf _
59955                      * @category Lang
59956                      * @param {*}
59957                      *            value The value to check.
59958                      * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
59959                      * @example
59960                      * 
59961                      * _.isNull(null); // => true
59962                      * 
59963                      * _.isNull(void 0); // => false
59964                      */
59965                     function isNull(value) {
59966                         return value === null;
59967                     }
59968
59969                     /**
59970                      * Checks if `value` is classified as a `Number` primitive or object.
59971                      * 
59972                      * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
59973                      * classified as numbers, use the `_.isFinite` method.
59974                      * 
59975                      * @static
59976                      * @memberOf _
59977                      * @category Lang
59978                      * @param {*}
59979                      *            value The value to check.
59980                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59981                      *          else `false`.
59982                      * @example
59983                      * 
59984                      * _.isNumber(8.4); // => true
59985                      * 
59986                      * _.isNumber(NaN); // => true
59987                      * 
59988                      * _.isNumber('8.4'); // => false
59989                      */
59990                     function isNumber(value) {
59991                         return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
59992                     }
59993
59994                     /**
59995                      * Checks if `value` is a plain object, that is, an object created by the
59996                      * `Object` constructor or one with a `[[Prototype]]` of `null`.
59997                      * 
59998                      * **Note:** This method assumes objects created by the `Object` constructor
59999                      * have no inherited enumerable properties.
60000                      * 
60001                      * @static
60002                      * @memberOf _
60003                      * @category Lang
60004                      * @param {*}
60005                      *            value The value to check.
60006                      * @returns {boolean} Returns `true` if `value` is a plain object, else
60007                      *          `false`.
60008                      * @example
60009                      * 
60010                      * function Foo() { this.a = 1; }
60011                      * 
60012                      * _.isPlainObject(new Foo); // => false
60013                      * 
60014                      * _.isPlainObject([1, 2, 3]); // => false
60015                      * 
60016                      * _.isPlainObject({ 'x': 0, 'y': 0 }); // => true
60017                      * 
60018                      * _.isPlainObject(Object.create(null)); // => true
60019                      */
60020                     function isPlainObject(value) {
60021                         var Ctor;
60022
60023                         // Exit early for non `Object` objects.
60024                         if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
60025                             (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
60026                             return false;
60027                         }
60028                         // IE < 9 iterates inherited properties before own properties. If the
60029                         // first
60030                         // iterated property is an object's own property then there are no
60031                         // inherited
60032                         // enumerable properties.
60033                         var result;
60034                         // In most environments an object's own properties are iterated before
60035                         // its inherited properties. If the last iterated property is an
60036                         // object's
60037                         // own property then there are no inherited enumerable properties.
60038                         baseForIn(value, function(subValue, key) {
60039                             result = key;
60040                         });
60041                         return result === undefined || hasOwnProperty.call(value, result);
60042                     }
60043
60044                     /**
60045                      * Checks if `value` is classified as a `RegExp` object.
60046                      * 
60047                      * @static
60048                      * @memberOf _
60049                      * @category Lang
60050                      * @param {*}
60051                      *            value The value to check.
60052                      * @returns {boolean} Returns `true` if `value` is correctly classified,
60053                      *          else `false`.
60054                      * @example
60055                      * 
60056                      * _.isRegExp(/abc/); // => true
60057                      * 
60058                      * _.isRegExp('/abc/'); // => false
60059                      */
60060                     function isRegExp(value) {
60061                         return isObject(value) && objToString.call(value) == regexpTag;
60062                     }
60063
60064                     /**
60065                      * Checks if `value` is classified as a `String` primitive or object.
60066                      * 
60067                      * @static
60068                      * @memberOf _
60069                      * @category Lang
60070                      * @param {*}
60071                      *            value The value to check.
60072                      * @returns {boolean} Returns `true` if `value` is correctly classified,
60073                      *          else `false`.
60074                      * @example
60075                      * 
60076                      * _.isString('abc'); // => true
60077                      * 
60078                      * _.isString(1); // => false
60079                      */
60080                     function isString(value) {
60081                         return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
60082                     }
60083
60084                     /**
60085                      * Checks if `value` is classified as a typed array.
60086                      * 
60087                      * @static
60088                      * @memberOf _
60089                      * @category Lang
60090                      * @param {*}
60091                      *            value The value to check.
60092                      * @returns {boolean} Returns `true` if `value` is correctly classified,
60093                      *          else `false`.
60094                      * @example
60095                      * 
60096                      * _.isTypedArray(new Uint8Array); // => true
60097                      * 
60098                      * _.isTypedArray([]); // => false
60099                      */
60100                     function isTypedArray(value) {
60101                         return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
60102                     }
60103
60104                     /**
60105                      * Checks if `value` is `undefined`.
60106                      * 
60107                      * @static
60108                      * @memberOf _
60109                      * @category Lang
60110                      * @param {*}
60111                      *            value The value to check.
60112                      * @returns {boolean} Returns `true` if `value` is `undefined`, else
60113                      *          `false`.
60114                      * @example
60115                      * 
60116                      * _.isUndefined(void 0); // => true
60117                      * 
60118                      * _.isUndefined(null); // => false
60119                      */
60120                     function isUndefined(value) {
60121                         return value === undefined;
60122                     }
60123
60124                     /**
60125                      * Checks if `value` is less than `other`.
60126                      * 
60127                      * @static
60128                      * @memberOf _
60129                      * @category Lang
60130                      * @param {*}
60131                      *            value The value to compare.
60132                      * @param {*}
60133                      *            other The other value to compare.
60134                      * @returns {boolean} Returns `true` if `value` is less than `other`, else
60135                      *          `false`.
60136                      * @example
60137                      * 
60138                      * _.lt(1, 3); // => true
60139                      * 
60140                      * _.lt(3, 3); // => false
60141                      * 
60142                      * _.lt(3, 1); // => false
60143                      */
60144                     function lt(value, other) {
60145                         return value < other;
60146                     }
60147
60148                     /**
60149                      * Checks if `value` is less than or equal to `other`.
60150                      * 
60151                      * @static
60152                      * @memberOf _
60153                      * @category Lang
60154                      * @param {*}
60155                      *            value The value to compare.
60156                      * @param {*}
60157                      *            other The other value to compare.
60158                      * @returns {boolean} Returns `true` if `value` is less than or equal to
60159                      *          `other`, else `false`.
60160                      * @example
60161                      * 
60162                      * _.lte(1, 3); // => true
60163                      * 
60164                      * _.lte(3, 3); // => true
60165                      * 
60166                      * _.lte(3, 1); // => false
60167                      */
60168                     function lte(value, other) {
60169                         return value <= other;
60170                     }
60171
60172                     /**
60173                      * Converts `value` to an array.
60174                      * 
60175                      * @static
60176                      * @memberOf _
60177                      * @category Lang
60178                      * @param {*}
60179                      *            value The value to convert.
60180                      * @returns {Array} Returns the converted array.
60181                      * @example
60182                      * 
60183                      * (function() { return _.toArray(arguments).slice(1); }(1, 2, 3)); // =>
60184                      * [2, 3]
60185                      */
60186                     function toArray(value) {
60187                         var length = value ? getLength(value) : 0;
60188                         if (!isLength(length)) {
60189                             return values(value);
60190                         }
60191                         if (!length) {
60192                             return [];
60193                         }
60194                         return arrayCopy(value);
60195                     }
60196
60197                     /**
60198                      * Converts `value` to a plain object flattening inherited enumerable
60199                      * properties of `value` to own properties of the plain object.
60200                      * 
60201                      * @static
60202                      * @memberOf _
60203                      * @category Lang
60204                      * @param {*}
60205                      *            value The value to convert.
60206                      * @returns {Object} Returns the converted plain object.
60207                      * @example
60208                      * 
60209                      * function Foo() { this.b = 2; }
60210                      * 
60211                      * Foo.prototype.c = 3;
60212                      * 
60213                      * _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 }
60214                      * 
60215                      * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2,
60216                      * 'c': 3 }
60217                      */
60218                     function toPlainObject(value) {
60219                         return baseCopy(value, keysIn(value));
60220                     }
60221
60222                     /*------------------------------------------------------------------------*/
60223
60224                     /**
60225                      * Recursively merges own enumerable properties of the source object(s),
60226                      * that don't resolve to `undefined` into the destination object. Subsequent
60227                      * sources overwrite property assignments of previous sources. If
60228                      * `customizer` is provided it is invoked to produce the merged values of
60229                      * the destination and source properties. If `customizer` returns
60230                      * `undefined` merging is handled by the method instead. The `customizer` is
60231                      * bound to `thisArg` and invoked with five arguments: (objectValue,
60232                      * sourceValue, key, object, source).
60233                      * 
60234                      * @static
60235                      * @memberOf _
60236                      * @category Object
60237                      * @param {Object}
60238                      *            object The destination object.
60239                      * @param {...Object}
60240                      *            [sources] The source objects.
60241                      * @param {Function}
60242                      *            [customizer] The function to customize assigned values.
60243                      * @param {*}
60244                      *            [thisArg] The `this` binding of `customizer`.
60245                      * @returns {Object} Returns `object`.
60246                      * @example
60247                      * 
60248                      * var users = { 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] };
60249                      * 
60250                      * var ages = { 'data': [{ 'age': 36 }, { 'age': 40 }] };
60251                      * 
60252                      * _.merge(users, ages); // => { 'data': [{ 'user': 'barney', 'age': 36 }, {
60253                      * 'user': 'fred', 'age': 40 }] }
60254                      *  // using a customizer callback var object = { 'fruits': ['apple'],
60255                      * 'vegetables': ['beet'] };
60256                      * 
60257                      * var other = { 'fruits': ['banana'], 'vegetables': ['carrot'] };
60258                      * 
60259                      * _.merge(object, other, function(a, b) { if (_.isArray(a)) { return
60260                      * a.concat(b); } }); // => { 'fruits': ['apple', 'banana'], 'vegetables':
60261                      * ['beet', 'carrot'] }
60262                      */
60263                     var merge = createAssigner(baseMerge);
60264
60265                     /**
60266                      * Assigns own enumerable properties of source object(s) to the destination
60267                      * object. Subsequent sources overwrite property assignments of previous
60268                      * sources. If `customizer` is provided it is invoked to produce the
60269                      * assigned values. The `customizer` is bound to `thisArg` and invoked with
60270                      * five arguments: (objectValue, sourceValue, key, object, source).
60271                      * 
60272                      * **Note:** This method mutates `object` and is based on
60273                      * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
60274                      * 
60275                      * @static
60276                      * @memberOf _
60277                      * @alias extend
60278                      * @category Object
60279                      * @param {Object}
60280                      *            object The destination object.
60281                      * @param {...Object}
60282                      *            [sources] The source objects.
60283                      * @param {Function}
60284                      *            [customizer] The function to customize assigned values.
60285                      * @param {*}
60286                      *            [thisArg] The `this` binding of `customizer`.
60287                      * @returns {Object} Returns `object`.
60288                      * @example
60289                      * 
60290                      * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); // => {
60291                      * 'user': 'fred', 'age': 40 }
60292                      *  // using a customizer callback var defaults = _.partialRight(_.assign,
60293                      * function(value, other) { return _.isUndefined(value) ? other : value; });
60294                      * 
60295                      * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
60296                      * 'user': 'barney', 'age': 36 }
60297                      */
60298                     var assign = createAssigner(function(object, source, customizer) {
60299                         return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
60300                     });
60301
60302                     /**
60303                      * Creates an object that inherits from the given `prototype` object. If a
60304                      * `properties` object is provided its own enumerable properties are
60305                      * assigned to the created object.
60306                      * 
60307                      * @static
60308                      * @memberOf _
60309                      * @category Object
60310                      * @param {Object}
60311                      *            prototype The object to inherit from.
60312                      * @param {Object}
60313                      *            [properties] The properties to assign to the object.
60314                      * @param- {Object} [guard] Enables use as a callback for functions like
60315                      *         `_.map`.
60316                      * @returns {Object} Returns the new object.
60317                      * @example
60318                      * 
60319                      * function Shape() { this.x = 0; this.y = 0; }
60320                      * 
60321                      * function Circle() { Shape.call(this); }
60322                      * 
60323                      * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle });
60324                      * 
60325                      * var circle = new Circle; circle instanceof Circle; // => true
60326                      * 
60327                      * circle instanceof Shape; // => true
60328                      */
60329                     function create(prototype, properties, guard) {
60330                         var result = baseCreate(prototype);
60331                         if (guard && isIterateeCall(prototype, properties, guard)) {
60332                             properties = undefined;
60333                         }
60334                         return properties ? baseAssign(result, properties) : result;
60335                     }
60336
60337                     /**
60338                      * Assigns own enumerable properties of source object(s) to the destination
60339                      * object for all destination properties that resolve to `undefined`. Once a
60340                      * property is set, additional values of the same property are ignored.
60341                      * 
60342                      * **Note:** This method mutates `object`.
60343                      * 
60344                      * @static
60345                      * @memberOf _
60346                      * @category Object
60347                      * @param {Object}
60348                      *            object The destination object.
60349                      * @param {...Object}
60350                      *            [sources] The source objects.
60351                      * @returns {Object} Returns `object`.
60352                      * @example
60353                      * 
60354                      * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
60355                      * 'user': 'barney', 'age': 36 }
60356                      */
60357                     var defaults = createDefaults(assign, assignDefaults);
60358
60359                     /**
60360                      * This method is like `_.defaults` except that it recursively assigns
60361                      * default properties.
60362                      * 
60363                      * **Note:** This method mutates `object`.
60364                      * 
60365                      * @static
60366                      * @memberOf _
60367                      * @category Object
60368                      * @param {Object}
60369                      *            object The destination object.
60370                      * @param {...Object}
60371                      *            [sources] The source objects.
60372                      * @returns {Object} Returns `object`.
60373                      * @example
60374                      * 
60375                      * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name':
60376                      * 'fred', 'age': 36 } }); // => { 'user': { 'name': 'barney', 'age': 36 } }
60377                      * 
60378                      */
60379                     var defaultsDeep = createDefaults(merge, mergeDefaults);
60380
60381                     /**
60382                      * This method is like `_.find` except that it returns the key of the first
60383                      * element `predicate` returns truthy for instead of the element itself.
60384                      * 
60385                      * If a property name is provided for `predicate` the created `_.property`
60386                      * style callback returns the property value of the given element.
60387                      * 
60388                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
60389                      * style callback returns `true` for elements that have a matching property
60390                      * value, else `false`.
60391                      * 
60392                      * If an object is provided for `predicate` the created `_.matches` style
60393                      * callback returns `true` for elements that have the properties of the
60394                      * given object, else `false`.
60395                      * 
60396                      * @static
60397                      * @memberOf _
60398                      * @category Object
60399                      * @param {Object}
60400                      *            object The object to search.
60401                      * @param {Function|Object|string}
60402                      *            [predicate=_.identity] The function invoked per iteration.
60403                      * @param {*}
60404                      *            [thisArg] The `this` binding of `predicate`.
60405                      * @returns {string|undefined} Returns the key of the matched element, else
60406                      *          `undefined`.
60407                      * @example
60408                      * 
60409                      * var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age':
60410                      * 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } };
60411                      * 
60412                      * _.findKey(users, function(chr) { return chr.age < 40; }); // => 'barney'
60413                      * (iteration order is not guaranteed)
60414                      *  // using the `_.matches` callback shorthand _.findKey(users, { 'age': 1,
60415                      * 'active': true }); // => 'pebbles'
60416                      *  // using the `_.matchesProperty` callback shorthand _.findKey(users,
60417                      * 'active', false); // => 'fred'
60418                      *  // using the `_.property` callback shorthand _.findKey(users, 'active'); // =>
60419                      * 'barney'
60420                      */
60421                     var findKey = createFindKey(baseForOwn);
60422
60423                     /**
60424                      * This method is like `_.findKey` except that it iterates over elements of
60425                      * a collection in the opposite order.
60426                      * 
60427                      * If a property name is provided for `predicate` the created `_.property`
60428                      * style callback returns the property value of the given element.
60429                      * 
60430                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
60431                      * style callback returns `true` for elements that have a matching property
60432                      * value, else `false`.
60433                      * 
60434                      * If an object is provided for `predicate` the created `_.matches` style
60435                      * callback returns `true` for elements that have the properties of the
60436                      * given object, else `false`.
60437                      * 
60438                      * @static
60439                      * @memberOf _
60440                      * @category Object
60441                      * @param {Object}
60442                      *            object The object to search.
60443                      * @param {Function|Object|string}
60444                      *            [predicate=_.identity] The function invoked per iteration.
60445                      * @param {*}
60446                      *            [thisArg] The `this` binding of `predicate`.
60447                      * @returns {string|undefined} Returns the key of the matched element, else
60448                      *          `undefined`.
60449                      * @example
60450                      * 
60451                      * var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age':
60452                      * 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } };
60453                      * 
60454                      * _.findLastKey(users, function(chr) { return chr.age < 40; }); // =>
60455                      * returns `pebbles` assuming `_.findKey` returns `barney`
60456                      *  // using the `_.matches` callback shorthand _.findLastKey(users, {
60457                      * 'age': 36, 'active': true }); // => 'barney'
60458                      *  // using the `_.matchesProperty` callback shorthand _.findLastKey(users,
60459                      * 'active', false); // => 'fred'
60460                      *  // using the `_.property` callback shorthand _.findLastKey(users,
60461                      * 'active'); // => 'pebbles'
60462                      */
60463                     var findLastKey = createFindKey(baseForOwnRight);
60464
60465                     /**
60466                      * Iterates over own and inherited enumerable properties of an object
60467                      * invoking `iteratee` for each property. The `iteratee` is bound to
60468                      * `thisArg` and invoked with three arguments: (value, key, object).
60469                      * Iteratee functions may exit iteration early by explicitly returning
60470                      * `false`.
60471                      * 
60472                      * @static
60473                      * @memberOf _
60474                      * @category Object
60475                      * @param {Object}
60476                      *            object The object to iterate over.
60477                      * @param {Function}
60478                      *            [iteratee=_.identity] The function invoked per iteration.
60479                      * @param {*}
60480                      *            [thisArg] The `this` binding of `iteratee`.
60481                      * @returns {Object} Returns `object`.
60482                      * @example
60483                      * 
60484                      * function Foo() { this.a = 1; this.b = 2; }
60485                      * 
60486                      * Foo.prototype.c = 3;
60487                      * 
60488                      * _.forIn(new Foo, function(value, key) { console.log(key); }); // => logs
60489                      * 'a', 'b', and 'c' (iteration order is not guaranteed)
60490                      */
60491                     var forIn = createForIn(baseFor);
60492
60493                     /**
60494                      * This method is like `_.forIn` except that it iterates over properties of
60495                      * `object` in the opposite order.
60496                      * 
60497                      * @static
60498                      * @memberOf _
60499                      * @category Object
60500                      * @param {Object}
60501                      *            object The object to iterate over.
60502                      * @param {Function}
60503                      *            [iteratee=_.identity] The function invoked per iteration.
60504                      * @param {*}
60505                      *            [thisArg] The `this` binding of `iteratee`.
60506                      * @returns {Object} Returns `object`.
60507                      * @example
60508                      * 
60509                      * function Foo() { this.a = 1; this.b = 2; }
60510                      * 
60511                      * Foo.prototype.c = 3;
60512                      * 
60513                      * _.forInRight(new Foo, function(value, key) { console.log(key); }); // =>
60514                      * logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
60515                      */
60516                     var forInRight = createForIn(baseForRight);
60517
60518                     /**
60519                      * Iterates over own enumerable properties of an object invoking `iteratee`
60520                      * for each property. The `iteratee` is bound to `thisArg` and invoked with
60521                      * three arguments: (value, key, object). Iteratee functions may exit
60522                      * iteration early by explicitly returning `false`.
60523                      * 
60524                      * @static
60525                      * @memberOf _
60526                      * @category Object
60527                      * @param {Object}
60528                      *            object The object to iterate over.
60529                      * @param {Function}
60530                      *            [iteratee=_.identity] The function invoked per iteration.
60531                      * @param {*}
60532                      *            [thisArg] The `this` binding of `iteratee`.
60533                      * @returns {Object} Returns `object`.
60534                      * @example
60535                      * 
60536                      * function Foo() { this.a = 1; this.b = 2; }
60537                      * 
60538                      * Foo.prototype.c = 3;
60539                      * 
60540                      * _.forOwn(new Foo, function(value, key) { console.log(key); }); // => logs
60541                      * 'a' and 'b' (iteration order is not guaranteed)
60542                      */
60543                     var forOwn = createForOwn(baseForOwn);
60544
60545                     /**
60546                      * This method is like `_.forOwn` except that it iterates over properties of
60547                      * `object` in the opposite order.
60548                      * 
60549                      * @static
60550                      * @memberOf _
60551                      * @category Object
60552                      * @param {Object}
60553                      *            object The object to iterate over.
60554                      * @param {Function}
60555                      *            [iteratee=_.identity] The function invoked per iteration.
60556                      * @param {*}
60557                      *            [thisArg] The `this` binding of `iteratee`.
60558                      * @returns {Object} Returns `object`.
60559                      * @example
60560                      * 
60561                      * function Foo() { this.a = 1; this.b = 2; }
60562                      * 
60563                      * Foo.prototype.c = 3;
60564                      * 
60565                      * _.forOwnRight(new Foo, function(value, key) { console.log(key); }); // =>
60566                      * logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
60567                      */
60568                     var forOwnRight = createForOwn(baseForOwnRight);
60569
60570                     /**
60571                      * Creates an array of function property names from all enumerable
60572                      * properties, own and inherited, of `object`.
60573                      * 
60574                      * @static
60575                      * @memberOf _
60576                      * @alias methods
60577                      * @category Object
60578                      * @param {Object}
60579                      *            object The object to inspect.
60580                      * @returns {Array} Returns the new array of property names.
60581                      * @example
60582                      * 
60583                      * _.functions(_); // => ['after', 'ary', 'assign', ...]
60584                      */
60585                     function functions(object) {
60586                         return baseFunctions(object, keysIn(object));
60587                     }
60588
60589                     /**
60590                      * Gets the property value at `path` of `object`. If the resolved value is
60591                      * `undefined` the `defaultValue` is used in its place.
60592                      * 
60593                      * @static
60594                      * @memberOf _
60595                      * @category Object
60596                      * @param {Object}
60597                      *            object The object to query.
60598                      * @param {Array|string}
60599                      *            path The path of the property to get.
60600                      * @param {*}
60601                      *            [defaultValue] The value returned if the resolved value is
60602                      *            `undefined`.
60603                      * @returns {*} Returns the resolved value.
60604                      * @example
60605                      * 
60606                      * var object = { 'a': [{ 'b': { 'c': 3 } }] };
60607                      * 
60608                      * _.get(object, 'a[0].b.c'); // => 3
60609                      * 
60610                      * _.get(object, ['a', '0', 'b', 'c']); // => 3
60611                      * 
60612                      * _.get(object, 'a.b.c', 'default'); // => 'default'
60613                      */
60614                     function get(object, path, defaultValue) {
60615                         var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
60616                         return result === undefined ? defaultValue : result;
60617                     }
60618
60619                     /**
60620                      * Checks if `path` is a direct property.
60621                      * 
60622                      * @static
60623                      * @memberOf _
60624                      * @category Object
60625                      * @param {Object}
60626                      *            object The object to query.
60627                      * @param {Array|string}
60628                      *            path The path to check.
60629                      * @returns {boolean} Returns `true` if `path` is a direct property, else
60630                      *          `false`.
60631                      * @example
60632                      * 
60633                      * var object = { 'a': { 'b': { 'c': 3 } } };
60634                      * 
60635                      * _.has(object, 'a'); // => true
60636                      * 
60637                      * _.has(object, 'a.b.c'); // => true
60638                      * 
60639                      * _.has(object, ['a', 'b', 'c']); // => true
60640                      */
60641                     function has(object, path) {
60642                         if (object == null) {
60643                             return false;
60644                         }
60645                         var result = hasOwnProperty.call(object, path);
60646                         if (!result && !isKey(path)) {
60647                             path = toPath(path);
60648                             object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
60649                             if (object == null) {
60650                                 return false;
60651                             }
60652                             path = last(path);
60653                             result = hasOwnProperty.call(object, path);
60654                         }
60655                         return result || (isLength(object.length) && isIndex(path, object.length) &&
60656                             (isArray(object) || isArguments(object)));
60657                     }
60658
60659                     /**
60660                      * Creates an object composed of the inverted keys and values of `object`.
60661                      * If `object` contains duplicate values, subsequent values overwrite
60662                      * property assignments of previous values unless `multiValue` is `true`.
60663                      * 
60664                      * @static
60665                      * @memberOf _
60666                      * @category Object
60667                      * @param {Object}
60668                      *            object The object to invert.
60669                      * @param {boolean}
60670                      *            [multiValue] Allow multiple values per key.
60671                      * @param- {Object} [guard] Enables use as a callback for functions like
60672                      *         `_.map`.
60673                      * @returns {Object} Returns the new inverted object.
60674                      * @example
60675                      * 
60676                      * var object = { 'a': 1, 'b': 2, 'c': 1 };
60677                      * 
60678                      * _.invert(object); // => { '1': 'c', '2': 'b' }
60679                      *  // with `multiValue` _.invert(object, true); // => { '1': ['a', 'c'],
60680                      * '2': ['b'] }
60681                      */
60682                     function invert(object, multiValue, guard) {
60683                         if (guard && isIterateeCall(object, multiValue, guard)) {
60684                             multiValue = undefined;
60685                         }
60686                         var index = -1,
60687                             props = keys(object),
60688                             length = props.length,
60689                             result = {};
60690
60691                         while (++index < length) {
60692                             var key = props[index],
60693                                 value = object[key];
60694
60695                             if (multiValue) {
60696                                 if (hasOwnProperty.call(result, value)) {
60697                                     result[value].push(key);
60698                                 } else {
60699                                     result[value] = [key];
60700                                 }
60701                             } else {
60702                                 result[value] = key;
60703                             }
60704                         }
60705                         return result;
60706                     }
60707
60708                     /**
60709                      * Creates an array of the own enumerable property names of `object`.
60710                      * 
60711                      * **Note:** Non-object values are coerced to objects. See the [ES
60712                      * spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for
60713                      * more details.
60714                      * 
60715                      * @static
60716                      * @memberOf _
60717                      * @category Object
60718                      * @param {Object}
60719                      *            object The object to query.
60720                      * @returns {Array} Returns the array of property names.
60721                      * @example
60722                      * 
60723                      * function Foo() { this.a = 1; this.b = 2; }
60724                      * 
60725                      * Foo.prototype.c = 3;
60726                      * 
60727                      * _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed)
60728                      * 
60729                      * _.keys('hi'); // => ['0', '1']
60730                      */
60731                     var keys = !nativeKeys ? shimKeys : function(object) {
60732                         var Ctor = object == null ? undefined : object.constructor;
60733                         if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
60734                             (typeof object != 'function' && isArrayLike(object))) {
60735                             return shimKeys(object);
60736                         }
60737                         return isObject(object) ? nativeKeys(object) : [];
60738                     };
60739
60740                     /**
60741                      * Creates an array of the own and inherited enumerable property names of
60742                      * `object`.
60743                      * 
60744                      * **Note:** Non-object values are coerced to objects.
60745                      * 
60746                      * @static
60747                      * @memberOf _
60748                      * @category Object
60749                      * @param {Object}
60750                      *            object The object to query.
60751                      * @returns {Array} Returns the array of property names.
60752                      * @example
60753                      * 
60754                      * function Foo() { this.a = 1; this.b = 2; }
60755                      * 
60756                      * Foo.prototype.c = 3;
60757                      * 
60758                      * _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not
60759                      * guaranteed)
60760                      */
60761                     function keysIn(object) {
60762                         if (object == null) {
60763                             return [];
60764                         }
60765                         if (!isObject(object)) {
60766                             object = Object(object);
60767                         }
60768                         var length = object.length;
60769                         length = (length && isLength(length) &&
60770                             (isArray(object) || isArguments(object)) && length) || 0;
60771
60772                         var Ctor = object.constructor,
60773                             index = -1,
60774                             isProto = typeof Ctor == 'function' && Ctor.prototype === object,
60775                             result = Array(length),
60776                             skipIndexes = length > 0;
60777
60778                         while (++index < length) {
60779                             result[index] = (index + '');
60780                         }
60781                         for (var key in object) {
60782                             if (!(skipIndexes && isIndex(key, length)) &&
60783                                 !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
60784                                 result.push(key);
60785                             }
60786                         }
60787                         return result;
60788                     }
60789
60790                     /**
60791                      * The opposite of `_.mapValues`; this method creates an object with the
60792                      * same values as `object` and keys generated by running each own enumerable
60793                      * property of `object` through `iteratee`.
60794                      * 
60795                      * @static
60796                      * @memberOf _
60797                      * @category Object
60798                      * @param {Object}
60799                      *            object The object to iterate over.
60800                      * @param {Function|Object|string}
60801                      *            [iteratee=_.identity] The function invoked per iteration.
60802                      * @param {*}
60803                      *            [thisArg] The `this` binding of `iteratee`.
60804                      * @returns {Object} Returns the new mapped object.
60805                      * @example
60806                      * 
60807                      * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { return key + value;
60808                      * }); // => { 'a1': 1, 'b2': 2 }
60809                      */
60810                     var mapKeys = createObjectMapper(true);
60811
60812                     /**
60813                      * Creates an object with the same keys as `object` and values generated by
60814                      * running each own enumerable property of `object` through `iteratee`. The
60815                      * iteratee function is bound to `thisArg` and invoked with three arguments:
60816                      * (value, key, object).
60817                      * 
60818                      * If a property name is provided for `iteratee` the created `_.property`
60819                      * style callback returns the property value of the given element.
60820                      * 
60821                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
60822                      * style callback returns `true` for elements that have a matching property
60823                      * value, else `false`.
60824                      * 
60825                      * If an object is provided for `iteratee` the created `_.matches` style
60826                      * callback returns `true` for elements that have the properties of the
60827                      * given object, else `false`.
60828                      * 
60829                      * @static
60830                      * @memberOf _
60831                      * @category Object
60832                      * @param {Object}
60833                      *            object The object to iterate over.
60834                      * @param {Function|Object|string}
60835                      *            [iteratee=_.identity] The function invoked per iteration.
60836                      * @param {*}
60837                      *            [thisArg] The `this` binding of `iteratee`.
60838                      * @returns {Object} Returns the new mapped object.
60839                      * @example
60840                      * 
60841                      * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { return n * 3; }); // => {
60842                      * 'a': 3, 'b': 6 }
60843                      * 
60844                      * var users = { 'fred': { 'user': 'fred', 'age': 40 }, 'pebbles': { 'user':
60845                      * 'pebbles', 'age': 1 } };
60846                      *  // using the `_.property` callback shorthand _.mapValues(users, 'age'); // => {
60847                      * 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
60848                      */
60849                     var mapValues = createObjectMapper();
60850
60851                     /**
60852                      * The opposite of `_.pick`; this method creates an object composed of the
60853                      * own and inherited enumerable properties of `object` that are not omitted.
60854                      * 
60855                      * @static
60856                      * @memberOf _
60857                      * @category Object
60858                      * @param {Object}
60859                      *            object The source object.
60860                      * @param {Function|...(string|string[])}
60861                      *            [predicate] The function invoked per iteration or property
60862                      *            names to omit, specified as individual property names or
60863                      *            arrays of property names.
60864                      * @param {*}
60865                      *            [thisArg] The `this` binding of `predicate`.
60866                      * @returns {Object} Returns the new object.
60867                      * @example
60868                      * 
60869                      * var object = { 'user': 'fred', 'age': 40 };
60870                      * 
60871                      * _.omit(object, 'age'); // => { 'user': 'fred' }
60872                      * 
60873                      * _.omit(object, _.isNumber); // => { 'user': 'fred' }
60874                      */
60875                     var omit = restParam(function(object, props) {
60876                         if (object == null) {
60877                             return {};
60878                         }
60879                         if (typeof props[0] != 'function') {
60880                             var props = arrayMap(baseFlatten(props), String);
60881                             return pickByArray(object, baseDifference(keysIn(object), props));
60882                         }
60883                         var predicate = bindCallback(props[0], props[1], 3);
60884                         return pickByCallback(object, function(value, key, object) {
60885                             return !predicate(value, key, object);
60886                         });
60887                     });
60888
60889                     /**
60890                      * Creates a two dimensional array of the key-value pairs for `object`, e.g.
60891                      * `[[key1, value1], [key2, value2]]`.
60892                      * 
60893                      * @static
60894                      * @memberOf _
60895                      * @category Object
60896                      * @param {Object}
60897                      *            object The object to query.
60898                      * @returns {Array} Returns the new array of key-value pairs.
60899                      * @example
60900                      * 
60901                      * _.pairs({ 'barney': 36, 'fred': 40 }); // => [['barney', 36], ['fred',
60902                      * 40]] (iteration order is not guaranteed)
60903                      */
60904                     function pairs(object) {
60905                         object = toObject(object);
60906
60907                         var index = -1,
60908                             props = keys(object),
60909                             length = props.length,
60910                             result = Array(length);
60911
60912                         while (++index < length) {
60913                             var key = props[index];
60914                             result[index] = [key, object[key]];
60915                         }
60916                         return result;
60917                     }
60918
60919                     /**
60920                      * Creates an object composed of the picked `object` properties. Property
60921                      * names may be specified as individual arguments or as arrays of property
60922                      * names. If `predicate` is provided it is invoked for each property of
60923                      * `object` picking the properties `predicate` returns truthy for. The
60924                      * predicate is bound to `thisArg` and invoked with three arguments: (value,
60925                      * key, object).
60926                      * 
60927                      * @static
60928                      * @memberOf _
60929                      * @category Object
60930                      * @param {Object}
60931                      *            object The source object.
60932                      * @param {Function|...(string|string[])}
60933                      *            [predicate] The function invoked per iteration or property
60934                      *            names to pick, specified as individual property names or
60935                      *            arrays of property names.
60936                      * @param {*}
60937                      *            [thisArg] The `this` binding of `predicate`.
60938                      * @returns {Object} Returns the new object.
60939                      * @example
60940                      * 
60941                      * var object = { 'user': 'fred', 'age': 40 };
60942                      * 
60943                      * _.pick(object, 'user'); // => { 'user': 'fred' }
60944                      * 
60945                      * _.pick(object, _.isString); // => { 'user': 'fred' }
60946                      */
60947                     var pick = restParam(function(object, props) {
60948                         if (object == null) {
60949                             return {};
60950                         }
60951                         return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
60952                     });
60953
60954                     /**
60955                      * This method is like `_.get` except that if the resolved value is a
60956                      * function it is invoked with the `this` binding of its parent object and
60957                      * its result is returned.
60958                      * 
60959                      * @static
60960                      * @memberOf _
60961                      * @category Object
60962                      * @param {Object}
60963                      *            object The object to query.
60964                      * @param {Array|string}
60965                      *            path The path of the property to resolve.
60966                      * @param {*}
60967                      *            [defaultValue] The value returned if the resolved value is
60968                      *            `undefined`.
60969                      * @returns {*} Returns the resolved value.
60970                      * @example
60971                      * 
60972                      * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
60973                      * 
60974                      * _.result(object, 'a[0].b.c1'); // => 3
60975                      * 
60976                      * _.result(object, 'a[0].b.c2'); // => 4
60977                      * 
60978                      * _.result(object, 'a.b.c', 'default'); // => 'default'
60979                      * 
60980                      * _.result(object, 'a.b.c', _.constant('default')); // => 'default'
60981                      */
60982                     function result(object, path, defaultValue) {
60983                         var result = object == null ? undefined : object[path];
60984                         if (result === undefined) {
60985                             if (object != null && !isKey(path, object)) {
60986                                 path = toPath(path);
60987                                 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
60988                                 result = object == null ? undefined : object[last(path)];
60989                             }
60990                             result = result === undefined ? defaultValue : result;
60991                         }
60992                         return isFunction(result) ? result.call(object) : result;
60993                     }
60994
60995                     /**
60996                      * Sets the property value of `path` on `object`. If a portion of `path`
60997                      * does not exist it is created.
60998                      * 
60999                      * @static
61000                      * @memberOf _
61001                      * @category Object
61002                      * @param {Object}
61003                      *            object The object to augment.
61004                      * @param {Array|string}
61005                      *            path The path of the property to set.
61006                      * @param {*}
61007                      *            value The value to set.
61008                      * @returns {Object} Returns `object`.
61009                      * @example
61010                      * 
61011                      * var object = { 'a': [{ 'b': { 'c': 3 } }] };
61012                      * 
61013                      * _.set(object, 'a[0].b.c', 4); console.log(object.a[0].b.c); // => 4
61014                      * 
61015                      * _.set(object, 'x[0].y.z', 5); console.log(object.x[0].y.z); // => 5
61016                      */
61017                     function set(object, path, value) {
61018                         if (object == null) {
61019                             return object;
61020                         }
61021                         var pathKey = (path + '');
61022                         path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);
61023
61024                         var index = -1,
61025                             length = path.length,
61026                             lastIndex = length - 1,
61027                             nested = object;
61028
61029                         while (nested != null && ++index < length) {
61030                             var key = path[index];
61031                             if (isObject(nested)) {
61032                                 if (index == lastIndex) {
61033                                     nested[key] = value;
61034                                 } else if (nested[key] == null) {
61035                                     nested[key] = isIndex(path[index + 1]) ? [] : {};
61036                                 }
61037                             }
61038                             nested = nested[key];
61039                         }
61040                         return object;
61041                     }
61042
61043                     /**
61044                      * An alternative to `_.reduce`; this method transforms `object` to a new
61045                      * `accumulator` object which is the result of running each of its own
61046                      * enumerable properties through `iteratee`, with each invocation
61047                      * potentially mutating the `accumulator` object. The `iteratee` is bound to
61048                      * `thisArg` and invoked with four arguments: (accumulator, value, key,
61049                      * object). Iteratee functions may exit iteration early by explicitly
61050                      * returning `false`.
61051                      * 
61052                      * @static
61053                      * @memberOf _
61054                      * @category Object
61055                      * @param {Array|Object}
61056                      *            object The object to iterate over.
61057                      * @param {Function}
61058                      *            [iteratee=_.identity] The function invoked per iteration.
61059                      * @param {*}
61060                      *            [accumulator] The custom accumulator value.
61061                      * @param {*}
61062                      *            [thisArg] The `this` binding of `iteratee`.
61063                      * @returns {*} Returns the accumulated value.
61064                      * @example
61065                      * 
61066                      * _.transform([2, 3, 4], function(result, n) { result.push(n *= n); return
61067                      * n % 2 == 0; }); // => [4, 9]
61068                      * 
61069                      * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] =
61070                      * n * 3; }); // => { 'a': 3, 'b': 6 }
61071                      */
61072                     function transform(object, iteratee, accumulator, thisArg) {
61073                         var isArr = isArray(object) || isTypedArray(object);
61074                         iteratee = getCallback(iteratee, thisArg, 4);
61075
61076                         if (accumulator == null) {
61077                             if (isArr || isObject(object)) {
61078                                 var Ctor = object.constructor;
61079                                 if (isArr) {
61080                                     accumulator = isArray(object) ? new Ctor : [];
61081                                 } else {
61082                                     accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
61083                                 }
61084                             } else {
61085                                 accumulator = {};
61086                             }
61087                         }
61088                         (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
61089                             return iteratee(accumulator, value, index, object);
61090                         });
61091                         return accumulator;
61092                     }
61093
61094                     /**
61095                      * Creates an array of the own enumerable property values of `object`.
61096                      * 
61097                      * **Note:** Non-object values are coerced to objects.
61098                      * 
61099                      * @static
61100                      * @memberOf _
61101                      * @category Object
61102                      * @param {Object}
61103                      *            object The object to query.
61104                      * @returns {Array} Returns the array of property values.
61105                      * @example
61106                      * 
61107                      * function Foo() { this.a = 1; this.b = 2; }
61108                      * 
61109                      * Foo.prototype.c = 3;
61110                      * 
61111                      * _.values(new Foo); // => [1, 2] (iteration order is not guaranteed)
61112                      * 
61113                      * _.values('hi'); // => ['h', 'i']
61114                      */
61115                     function values(object) {
61116                         return baseValues(object, keys(object));
61117                     }
61118
61119                     /**
61120                      * Creates an array of the own and inherited enumerable property values of
61121                      * `object`.
61122                      * 
61123                      * **Note:** Non-object values are coerced to objects.
61124                      * 
61125                      * @static
61126                      * @memberOf _
61127                      * @category Object
61128                      * @param {Object}
61129                      *            object The object to query.
61130                      * @returns {Array} Returns the array of property values.
61131                      * @example
61132                      * 
61133                      * function Foo() { this.a = 1; this.b = 2; }
61134                      * 
61135                      * Foo.prototype.c = 3;
61136                      * 
61137                      * _.valuesIn(new Foo); // => [1, 2, 3] (iteration order is not guaranteed)
61138                      */
61139                     function valuesIn(object) {
61140                         return baseValues(object, keysIn(object));
61141                     }
61142
61143                     /*------------------------------------------------------------------------*/
61144
61145                     /**
61146                      * Checks if `n` is between `start` and up to but not including, `end`. If
61147                      * `end` is not specified it is set to `start` with `start` then set to `0`.
61148                      * 
61149                      * @static
61150                      * @memberOf _
61151                      * @category Number
61152                      * @param {number}
61153                      *            n The number to check.
61154                      * @param {number}
61155                      *            [start=0] The start of the range.
61156                      * @param {number}
61157                      *            end The end of the range.
61158                      * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
61159                      * @example
61160                      * 
61161                      * _.inRange(3, 2, 4); // => true
61162                      * 
61163                      * _.inRange(4, 8); // => true
61164                      * 
61165                      * _.inRange(4, 2); // => false
61166                      * 
61167                      * _.inRange(2, 2); // => false
61168                      * 
61169                      * _.inRange(1.2, 2); // => true
61170                      * 
61171                      * _.inRange(5.2, 4); // => false
61172                      */
61173                     function inRange(value, start, end) {
61174                         start = +start || 0;
61175                         if (end === undefined) {
61176                             end = start;
61177                             start = 0;
61178                         } else {
61179                             end = +end || 0;
61180                         }
61181                         return value >= nativeMin(start, end) && value < nativeMax(start, end);
61182                     }
61183
61184                     /**
61185                      * Produces a random number between `min` and `max` (inclusive). If only one
61186                      * argument is provided a number between `0` and the given number is
61187                      * returned. If `floating` is `true`, or either `min` or `max` are floats, a
61188                      * floating-point number is returned instead of an integer.
61189                      * 
61190                      * @static
61191                      * @memberOf _
61192                      * @category Number
61193                      * @param {number}
61194                      *            [min=0] The minimum possible value.
61195                      * @param {number}
61196                      *            [max=1] The maximum possible value.
61197                      * @param {boolean}
61198                      *            [floating] Specify returning a floating-point number.
61199                      * @returns {number} Returns the random number.
61200                      * @example
61201                      * 
61202                      * _.random(0, 5); // => an integer between 0 and 5
61203                      * 
61204                      * _.random(5); // => also an integer between 0 and 5
61205                      * 
61206                      * _.random(5, true); // => a floating-point number between 0 and 5
61207                      * 
61208                      * _.random(1.2, 5.2); // => a floating-point number between 1.2 and 5.2
61209                      */
61210                     function random(min, max, floating) {
61211                         if (floating && isIterateeCall(min, max, floating)) {
61212                             max = floating = undefined;
61213                         }
61214                         var noMin = min == null,
61215                             noMax = max == null;
61216
61217                         if (floating == null) {
61218                             if (noMax && typeof min == 'boolean') {
61219                                 floating = min;
61220                                 min = 1;
61221                             } else if (typeof max == 'boolean') {
61222                                 floating = max;
61223                                 noMax = true;
61224                             }
61225                         }
61226                         if (noMin && noMax) {
61227                             max = 1;
61228                             noMax = false;
61229                         }
61230                         min = +min || 0;
61231                         if (noMax) {
61232                             max = min;
61233                             min = 0;
61234                         } else {
61235                             max = +max || 0;
61236                         }
61237                         if (floating || min % 1 || max % 1) {
61238                             var rand = nativeRandom();
61239                             return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
61240                         }
61241                         return baseRandom(min, max);
61242                     }
61243
61244                     /*------------------------------------------------------------------------*/
61245
61246                     /**
61247                      * Converts `string` to [camel
61248                      * case](https://en.wikipedia.org/wiki/CamelCase).
61249                      * 
61250                      * @static
61251                      * @memberOf _
61252                      * @category String
61253                      * @param {string}
61254                      *            [string=''] The string to convert.
61255                      * @returns {string} Returns the camel cased string.
61256                      * @example
61257                      * 
61258                      * _.camelCase('Foo Bar'); // => 'fooBar'
61259                      * 
61260                      * _.camelCase('--foo-bar'); // => 'fooBar'
61261                      * 
61262                      * _.camelCase('__foo_bar__'); // => 'fooBar'
61263                      */
61264                     var camelCase = createCompounder(function(result, word, index) {
61265                         word = word.toLowerCase();
61266                         return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
61267                     });
61268
61269                     /**
61270                      * Capitalizes the first character of `string`.
61271                      * 
61272                      * @static
61273                      * @memberOf _
61274                      * @category String
61275                      * @param {string}
61276                      *            [string=''] The string to capitalize.
61277                      * @returns {string} Returns the capitalized string.
61278                      * @example
61279                      * 
61280                      * _.capitalize('fred'); // => 'Fred'
61281                      */
61282                     function capitalize(string) {
61283                         string = baseToString(string);
61284                         return string && (string.charAt(0).toUpperCase() + string.slice(1));
61285                     }
61286
61287                     /**
61288                      * Deburrs `string` by converting [latin-1 supplementary
61289                      * letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
61290                      * to basic latin letters and removing [combining diacritical
61291                      * marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
61292                      * 
61293                      * @static
61294                      * @memberOf _
61295                      * @category String
61296                      * @param {string}
61297                      *            [string=''] The string to deburr.
61298                      * @returns {string} Returns the deburred string.
61299                      * @example
61300                      * 
61301                      * _.deburr('déjà vu'); // => 'deja vu'
61302                      */
61303                     function deburr(string) {
61304                         string = baseToString(string);
61305                         return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
61306                     }
61307
61308                     /**
61309                      * Checks if `string` ends with the given target string.
61310                      * 
61311                      * @static
61312                      * @memberOf _
61313                      * @category String
61314                      * @param {string}
61315                      *            [string=''] The string to search.
61316                      * @param {string}
61317                      *            [target] The string to search for.
61318                      * @param {number}
61319                      *            [position=string.length] The position to search from.
61320                      * @returns {boolean} Returns `true` if `string` ends with `target`, else
61321                      *          `false`.
61322                      * @example
61323                      * 
61324                      * _.endsWith('abc', 'c'); // => true
61325                      * 
61326                      * _.endsWith('abc', 'b'); // => false
61327                      * 
61328                      * _.endsWith('abc', 'b', 2); // => true
61329                      */
61330                     function endsWith(string, target, position) {
61331                         string = baseToString(string);
61332                         target = (target + '');
61333
61334                         var length = string.length;
61335                         position = position === undefined ? length : nativeMin(position < 0 ? 0 : (+position || 0), length);
61336
61337                         position -= target.length;
61338                         return position >= 0 && string.indexOf(target, position) == position;
61339                     }
61340
61341                     /**
61342                      * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string`
61343                      * to their corresponding HTML entities.
61344                      * 
61345                      * **Note:** No other characters are escaped. To escape additional
61346                      * characters use a third-party library like [_he_](https://mths.be/he).
61347                      * 
61348                      * Though the ">" character is escaped for symmetry, characters like ">" and
61349                      * "/" don't need escaping in HTML and have no special meaning unless
61350                      * they're part of a tag or unquoted attribute value. See [Mathias Bynens's
61351                      * article](https://mathiasbynens.be/notes/ambiguous-ampersands) (under
61352                      * "semi-related fun fact") for more details.
61353                      * 
61354                      * Backticks are escaped because in Internet Explorer < 9, they can break
61355                      * out of attribute values or HTML comments. See
61356                      * [#59](https://html5sec.org/#59), [#102](https://html5sec.org/#102),
61357                      * [#108](https://html5sec.org/#108), and [#133](https://html5sec.org/#133)
61358                      * of the [HTML5 Security Cheatsheet](https://html5sec.org/) for more
61359                      * details.
61360                      * 
61361                      * When working with HTML you should always [quote attribute
61362                      * values](http://wonko.com/post/html-escaping) to reduce XSS vectors.
61363                      * 
61364                      * @static
61365                      * @memberOf _
61366                      * @category String
61367                      * @param {string}
61368                      *            [string=''] The string to escape.
61369                      * @returns {string} Returns the escaped string.
61370                      * @example
61371                      * 
61372                      * _.escape('fred, barney, & pebbles'); // => 'fred, barney, &amp; pebbles'
61373                      */
61374                     function escape(string) {
61375                         // Reset `lastIndex` because in IE < 9 `String#replace` does not.
61376                         string = baseToString(string);
61377                         return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
61378                     }
61379
61380                     /**
61381                      * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|",
61382                      * "?", "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
61383                      * 
61384                      * @static
61385                      * @memberOf _
61386                      * @category String
61387                      * @param {string}
61388                      *            [string=''] The string to escape.
61389                      * @returns {string} Returns the escaped string.
61390                      * @example
61391                      * 
61392                      * _.escapeRegExp('[lodash](https://lodash.com/)'); // =>
61393                      * '\[lodash\]\(https:\/\/lodash\.com\/\)'
61394                      */
61395                     function escapeRegExp(string) {
61396                         string = baseToString(string);
61397                         return (string && reHasRegExpChars.test(string)) ? string.replace(reRegExpChars, escapeRegExpChar) : (string || '(?:)');
61398                     }
61399
61400                     /**
61401                      * Converts `string` to [kebab
61402                      * case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
61403                      * 
61404                      * @static
61405                      * @memberOf _
61406                      * @category String
61407                      * @param {string}
61408                      *            [string=''] The string to convert.
61409                      * @returns {string} Returns the kebab cased string.
61410                      * @example
61411                      * 
61412                      * _.kebabCase('Foo Bar'); // => 'foo-bar'
61413                      * 
61414                      * _.kebabCase('fooBar'); // => 'foo-bar'
61415                      * 
61416                      * _.kebabCase('__foo_bar__'); // => 'foo-bar'
61417                      */
61418                     var kebabCase = createCompounder(function(result, word, index) {
61419                         return result + (index ? '-' : '') + word.toLowerCase();
61420                     });
61421
61422                     /**
61423                      * Pads `string` on the left and right sides if it's shorter than `length`.
61424                      * Padding characters are truncated if they can't be evenly divided by
61425                      * `length`.
61426                      * 
61427                      * @static
61428                      * @memberOf _
61429                      * @category String
61430                      * @param {string}
61431                      *            [string=''] The string to pad.
61432                      * @param {number}
61433                      *            [length=0] The padding length.
61434                      * @param {string}
61435                      *            [chars=' '] The string used as padding.
61436                      * @returns {string} Returns the padded string.
61437                      * @example
61438                      * 
61439                      * _.pad('abc', 8); // => ' abc '
61440                      * 
61441                      * _.pad('abc', 8, '_-'); // => '_-abc_-_'
61442                      * 
61443                      * _.pad('abc', 3); // => 'abc'
61444                      */
61445                     function pad(string, length, chars) {
61446                         string = baseToString(string);
61447                         length = +length;
61448
61449                         var strLength = string.length;
61450                         if (strLength >= length || !nativeIsFinite(length)) {
61451                             return string;
61452                         }
61453                         var mid = (length - strLength) / 2,
61454                             leftLength = nativeFloor(mid),
61455                             rightLength = nativeCeil(mid);
61456
61457                         chars = createPadding('', rightLength, chars);
61458                         return chars.slice(0, leftLength) + string + chars;
61459                     }
61460
61461                     /**
61462                      * Pads `string` on the left side if it's shorter than `length`. Padding
61463                      * characters are truncated if they exceed `length`.
61464                      * 
61465                      * @static
61466                      * @memberOf _
61467                      * @category String
61468                      * @param {string}
61469                      *            [string=''] The string to pad.
61470                      * @param {number}
61471                      *            [length=0] The padding length.
61472                      * @param {string}
61473                      *            [chars=' '] The string used as padding.
61474                      * @returns {string} Returns the padded string.
61475                      * @example
61476                      * 
61477                      * _.padLeft('abc', 6); // => ' abc'
61478                      * 
61479                      * _.padLeft('abc', 6, '_-'); // => '_-_abc'
61480                      * 
61481                      * _.padLeft('abc', 3); // => 'abc'
61482                      */
61483                     var padLeft = createPadDir();
61484
61485                     /**
61486                      * Pads `string` on the right side if it's shorter than `length`. Padding
61487                      * characters are truncated if they exceed `length`.
61488                      * 
61489                      * @static
61490                      * @memberOf _
61491                      * @category String
61492                      * @param {string}
61493                      *            [string=''] The string to pad.
61494                      * @param {number}
61495                      *            [length=0] The padding length.
61496                      * @param {string}
61497                      *            [chars=' '] The string used as padding.
61498                      * @returns {string} Returns the padded string.
61499                      * @example
61500                      * 
61501                      * _.padRight('abc', 6); // => 'abc '
61502                      * 
61503                      * _.padRight('abc', 6, '_-'); // => 'abc_-_'
61504                      * 
61505                      * _.padRight('abc', 3); // => 'abc'
61506                      */
61507                     var padRight = createPadDir(true);
61508
61509                     /**
61510                      * Converts `string` to an integer of the specified radix. If `radix` is
61511                      * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
61512                      * hexadecimal, in which case a `radix` of `16` is used.
61513                      * 
61514                      * **Note:** This method aligns with the [ES5
61515                      * implementation](https://es5.github.io/#E) of `parseInt`.
61516                      * 
61517                      * @static
61518                      * @memberOf _
61519                      * @category String
61520                      * @param {string}
61521                      *            string The string to convert.
61522                      * @param {number}
61523                      *            [radix] The radix to interpret `value` by.
61524                      * @param- {Object} [guard] Enables use as a callback for functions like
61525                      *         `_.map`.
61526                      * @returns {number} Returns the converted integer.
61527                      * @example
61528                      * 
61529                      * _.parseInt('08'); // => 8
61530                      * 
61531                      * _.map(['6', '08', '10'], _.parseInt); // => [6, 8, 10]
61532                      */
61533                     function parseInt(string, radix, guard) {
61534                         // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
61535                         // Chrome fails to trim leading <BOM> whitespace characters.
61536                         // See https://code.google.com/p/v8/issues/detail?id=3109 for more
61537                         // details.
61538                         if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
61539                             radix = 0;
61540                         } else if (radix) {
61541                             radix = +radix;
61542                         }
61543                         string = trim(string);
61544                         return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
61545                     }
61546
61547                     /**
61548                      * Repeats the given string `n` times.
61549                      * 
61550                      * @static
61551                      * @memberOf _
61552                      * @category String
61553                      * @param {string}
61554                      *            [string=''] The string to repeat.
61555                      * @param {number}
61556                      *            [n=0] The number of times to repeat the string.
61557                      * @returns {string} Returns the repeated string.
61558                      * @example
61559                      * 
61560                      * _.repeat('*', 3); // => '***'
61561                      * 
61562                      * _.repeat('abc', 2); // => 'abcabc'
61563                      * 
61564                      * _.repeat('abc', 0); // => ''
61565                      */
61566                     function repeat(string, n) {
61567                         var result = '';
61568                         string = baseToString(string);
61569                         n = +n;
61570                         if (n < 1 || !string || !nativeIsFinite(n)) {
61571                             return result;
61572                         }
61573                         // Leverage the exponentiation by squaring algorithm for a faster
61574                         // repeat.
61575                         // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more
61576                         // details.
61577                         do {
61578                             if (n % 2) {
61579                                 result += string;
61580                             }
61581                             n = nativeFloor(n / 2);
61582                             string += string;
61583                         } while (n);
61584
61585                         return result;
61586                     }
61587
61588                     /**
61589                      * Converts `string` to [snake
61590                      * case](https://en.wikipedia.org/wiki/Snake_case).
61591                      * 
61592                      * @static
61593                      * @memberOf _
61594                      * @category String
61595                      * @param {string}
61596                      *            [string=''] The string to convert.
61597                      * @returns {string} Returns the snake cased string.
61598                      * @example
61599                      * 
61600                      * _.snakeCase('Foo Bar'); // => 'foo_bar'
61601                      * 
61602                      * _.snakeCase('fooBar'); // => 'foo_bar'
61603                      * 
61604                      * _.snakeCase('--foo-bar'); // => 'foo_bar'
61605                      */
61606                     var snakeCase = createCompounder(function(result, word, index) {
61607                         return result + (index ? '_' : '') + word.toLowerCase();
61608                     });
61609
61610                     /**
61611                      * Converts `string` to [start
61612                      * case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
61613                      * 
61614                      * @static
61615                      * @memberOf _
61616                      * @category String
61617                      * @param {string}
61618                      *            [string=''] The string to convert.
61619                      * @returns {string} Returns the start cased string.
61620                      * @example
61621                      * 
61622                      * _.startCase('--foo-bar'); // => 'Foo Bar'
61623                      * 
61624                      * _.startCase('fooBar'); // => 'Foo Bar'
61625                      * 
61626                      * _.startCase('__foo_bar__'); // => 'Foo Bar'
61627                      */
61628                     var startCase = createCompounder(function(result, word, index) {
61629                         return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
61630                     });
61631
61632                     /**
61633                      * Checks if `string` starts with the given target string.
61634                      * 
61635                      * @static
61636                      * @memberOf _
61637                      * @category String
61638                      * @param {string}
61639                      *            [string=''] The string to search.
61640                      * @param {string}
61641                      *            [target] The string to search for.
61642                      * @param {number}
61643                      *            [position=0] The position to search from.
61644                      * @returns {boolean} Returns `true` if `string` starts with `target`, else
61645                      *          `false`.
61646                      * @example
61647                      * 
61648                      * _.startsWith('abc', 'a'); // => true
61649                      * 
61650                      * _.startsWith('abc', 'b'); // => false
61651                      * 
61652                      * _.startsWith('abc', 'b', 1); // => true
61653                      */
61654                     function startsWith(string, target, position) {
61655                         string = baseToString(string);
61656                         position = position == null ? 0 : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
61657
61658                         return string.lastIndexOf(target, position) == position;
61659                     }
61660
61661                     /**
61662                      * Creates a compiled template function that can interpolate data properties
61663                      * in "interpolate" delimiters, HTML-escape interpolated data properties in
61664                      * "escape" delimiters, and execute JavaScript in "evaluate" delimiters.
61665                      * Data properties may be accessed as free variables in the template. If a
61666                      * setting object is provided it takes precedence over `_.templateSettings`
61667                      * values.
61668                      * 
61669                      * **Note:** In the development build `_.template` utilizes
61670                      * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
61671                      * for easier debugging.
61672                      * 
61673                      * For more information on precompiling templates see [lodash's custom
61674                      * builds documentation](https://lodash.com/custom-builds).
61675                      * 
61676                      * For more information on Chrome extension sandboxes see [Chrome's
61677                      * extensions
61678                      * documentation](https://developer.chrome.com/extensions/sandboxingEval).
61679                      * 
61680                      * @static
61681                      * @memberOf _
61682                      * @category String
61683                      * @param {string}
61684                      *            [string=''] The template string.
61685                      * @param {Object}
61686                      *            [options] The options object.
61687                      * @param {RegExp}
61688                      *            [options.escape] The HTML "escape" delimiter.
61689                      * @param {RegExp}
61690                      *            [options.evaluate] The "evaluate" delimiter.
61691                      * @param {Object}
61692                      *            [options.imports] An object to import into the template as
61693                      *            free variables.
61694                      * @param {RegExp}
61695                      *            [options.interpolate] The "interpolate" delimiter.
61696                      * @param {string}
61697                      *            [options.sourceURL] The sourceURL of the template's compiled
61698                      *            source.
61699                      * @param {string}
61700                      *            [options.variable] The data object variable name.
61701                      * @param- {Object} [otherOptions] Enables the legacy `options` param
61702                      *         signature.
61703                      * @returns {Function} Returns the compiled template function.
61704                      * @example
61705                      *  // using the "interpolate" delimiter to create a compiled
61706                      * template var compiled = _.template('hello <%= user %>!'); compiled({
61707                      * 'user': 'fred' }); // => 'hello fred!'
61708                      *  // using the HTML "escape" delimiter to escape data property values var
61709                      * compiled = _.template('<b><%- value %></b>'); compiled({ 'value': '<script>'
61710                      * }); // => '<b>&lt;script&gt;</b>'
61711                      *  // using the "evaluate" delimiter to execute JavaScript and generate
61712                      * HTML var compiled = _.template('<% _.forEach(users, function(user) { %>
61713                      * <li><%- user %></li><% }); %>'); compiled({ 'users': ['fred',
61714                      * 'barney'] }); // => '
61715                      * <li>fred</li>
61716                      * <li>barney</li>'
61717                      *  // using the internal `print` function in "evaluate" delimiters var
61718                      * compiled = _.template('<% print("hello " + user); %>!'); compiled({
61719                      * 'user': 'barney' }); // => 'hello barney!'
61720                      *  // using the ES delimiter as an alternative to the default "interpolate"
61721                      * delimiter var compiled = _.template('hello ${ user }!'); compiled({
61722                      * 'user': 'pebbles' }); // => 'hello pebbles!'
61723                      *  // using custom template delimiters _.templateSettings.interpolate =
61724                      * /{{([\s\S]+?)}}/g; var compiled = _.template('hello {{ user }}!');
61725                      * compiled({ 'user': 'mustache' }); // => 'hello mustache!'
61726                      *  // using backslashes to treat delimiters as plain text var compiled =
61727                      * _.template('<%= "\\<%- value %\\>" %>'); compiled({ 'value': 'ignored'
61728                      * }); // => '<%- value %>'
61729                      *  // using the `imports` option to import `jQuery` as `jq` var text = '<%
61730                      * jq.each(users, function(user) { %>
61731                      * <li><%- user %></li><% }); %>'; var compiled = _.template(text, {
61732                      * 'imports': { 'jq': jQuery } }); compiled({ 'users': ['fred', 'barney']
61733                      * }); // => '
61734                      * <li>fred</li>
61735                      * <li>barney</li>'
61736                      *  // using the `sourceURL` option to specify a custom sourceURL for the
61737                      * template var compiled = _.template('hello <%= user %>!', { 'sourceURL':
61738                      * '/basic/greeting.jst' }); compiled(data); // => find the source of
61739                      * "greeting.jst" under the Sources tab or Resources panel of the web
61740                      * inspector
61741                      *  // using the `variable` option to ensure a with-statement isn't used in
61742                      * the compiled template var compiled = _.template('hi <%= data.user %>!', {
61743                      * 'variable': 'data' }); compiled.source; // => function(data) { // var
61744                      * __t, __p = ''; // __p += 'hi ' + ((__t = ( data.user )) == null ? '' :
61745                      * __t) + '!'; // return __p; // }
61746                      *  // using the `source` property to inline compiled templates for
61747                      * meaningful // line numbers in error messages and a stack trace
61748                      * fs.writeFileSync(path.join(cwd, 'jst.js'), '\ var JST = {\ "main": ' +
61749                      * _.template(mainText).source + '\ };\ ');
61750                      */
61751                     function template(string, options, otherOptions) {
61752                         // Based on John Resig's `tmpl` implementation
61753                         // (http://ejohn.org/blog/javascript-micro-templating/)
61754                         // and Laura Doktorova's doT.js (https://github.com/olado/doT).
61755                         var settings = lodash.templateSettings;
61756
61757                         if (otherOptions && isIterateeCall(string, options, otherOptions)) {
61758                             options = otherOptions = undefined;
61759                         }
61760                         string = baseToString(string);
61761                         options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
61762
61763                         var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
61764                             importsKeys = keys(imports),
61765                             importsValues = baseValues(imports, importsKeys);
61766
61767                         var isEscaping,
61768                             isEvaluating,
61769                             index = 0,
61770                             interpolate = options.interpolate || reNoMatch,
61771                             source = "__p += '";
61772
61773                         // Compile the regexp to match each delimiter.
61774                         var reDelimiters = RegExp(
61775                             (options.escape || reNoMatch).source + '|' +
61776                             interpolate.source + '|' +
61777                             (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
61778                             (options.evaluate || reNoMatch).source + '|$', 'g');
61779
61780                         // Use a sourceURL for easier debugging.
61781                         var sourceURL = '//# sourceURL=' +
61782                             ('sourceURL' in options ? options.sourceURL : ('lodash.templateSources[' + (++templateCounter) + ']')) + '\n';
61783
61784                         string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
61785                             interpolateValue || (interpolateValue = esTemplateValue);
61786
61787                             // Escape characters that can't be included in string literals.
61788                             source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
61789
61790                             // Replace delimiters with snippets.
61791                             if (escapeValue) {
61792                                 isEscaping = true;
61793                                 source += "' +\n__e(" + escapeValue + ") +\n'";
61794                             }
61795                             if (evaluateValue) {
61796                                 isEvaluating = true;
61797                                 source += "';\n" + evaluateValue + ";\n__p += '";
61798                             }
61799                             if (interpolateValue) {
61800                                 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
61801                             }
61802                             index = offset + match.length;
61803
61804                             // The JS engine embedded in Adobe products requires returning the
61805                             // `match`
61806                             // string in order to produce the correct `offset` value.
61807                             return match;
61808                         });
61809
61810                         source += "';\n";
61811
61812                         // If `variable` is not specified wrap a with-statement around the
61813                         // generated
61814                         // code to add the data object to the top of the scope chain.
61815                         var variable = options.variable;
61816                         if (!variable) {
61817                             source = 'with (obj) {\n' + source + '\n}\n';
61818                         }
61819                         // Cleanup code by stripping empty strings.
61820                         source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
61821                             .replace(reEmptyStringMiddle, '$1')
61822                             .replace(reEmptyStringTrailing, '$1;');
61823
61824                         // Frame code as the function body.
61825                         source = 'function(' + (variable || 'obj') + ') {\n' +
61826                             (variable ? '' : 'obj || (obj = {});\n') +
61827                             "var __t, __p = ''" +
61828                             (isEscaping ? ', __e = _.escape' : '') +
61829                             (isEvaluating ? ', __j = Array.prototype.join;\n' +
61830                                 "function print() { __p += __j.call(arguments, '') }\n" : ';\n'
61831                             ) +
61832                             source +
61833                             'return __p\n}';
61834
61835                         var result = attempt(function() {
61836                             return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
61837                         });
61838
61839                         // Provide the compiled function's source by its `toString` method or
61840                         // the `source` property as a convenience for inlining compiled
61841                         // templates.
61842                         result.source = source;
61843                         if (isError(result)) {
61844                             throw result;
61845                         }
61846                         return result;
61847                     }
61848
61849                     /**
61850                      * Removes leading and trailing whitespace or specified characters from
61851                      * `string`.
61852                      * 
61853                      * @static
61854                      * @memberOf _
61855                      * @category String
61856                      * @param {string}
61857                      *            [string=''] The string to trim.
61858                      * @param {string}
61859                      *            [chars=whitespace] The characters to trim.
61860                      * @param- {Object} [guard] Enables use as a callback for functions like
61861                      *         `_.map`.
61862                      * @returns {string} Returns the trimmed string.
61863                      * @example
61864                      * 
61865                      * _.trim(' abc '); // => 'abc'
61866                      * 
61867                      * _.trim('-_-abc-_-', '_-'); // => 'abc'
61868                      * 
61869                      * _.map([' foo ', ' bar '], _.trim); // => ['foo', 'bar']
61870                      */
61871                     function trim(string, chars, guard) {
61872                         var value = string;
61873                         string = baseToString(string);
61874                         if (!string) {
61875                             return string;
61876                         }
61877                         if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61878                             return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
61879                         }
61880                         chars = (chars + '');
61881                         return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
61882                     }
61883
61884                     /**
61885                      * Removes leading whitespace or specified characters from `string`.
61886                      * 
61887                      * @static
61888                      * @memberOf _
61889                      * @category String
61890                      * @param {string}
61891                      *            [string=''] The string to trim.
61892                      * @param {string}
61893                      *            [chars=whitespace] The characters to trim.
61894                      * @param- {Object} [guard] Enables use as a callback for functions like
61895                      *         `_.map`.
61896                      * @returns {string} Returns the trimmed string.
61897                      * @example
61898                      * 
61899                      * _.trimLeft(' abc '); // => 'abc '
61900                      * 
61901                      * _.trimLeft('-_-abc-_-', '_-'); // => 'abc-_-'
61902                      */
61903                     function trimLeft(string, chars, guard) {
61904                         var value = string;
61905                         string = baseToString(string);
61906                         if (!string) {
61907                             return string;
61908                         }
61909                         if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61910                             return string.slice(trimmedLeftIndex(string));
61911                         }
61912                         return string.slice(charsLeftIndex(string, (chars + '')));
61913                     }
61914
61915                     /**
61916                      * Removes trailing whitespace or specified characters from `string`.
61917                      * 
61918                      * @static
61919                      * @memberOf _
61920                      * @category String
61921                      * @param {string}
61922                      *            [string=''] The string to trim.
61923                      * @param {string}
61924                      *            [chars=whitespace] The characters to trim.
61925                      * @param- {Object} [guard] Enables use as a callback for functions like
61926                      *         `_.map`.
61927                      * @returns {string} Returns the trimmed string.
61928                      * @example
61929                      * 
61930                      * _.trimRight(' abc '); // => ' abc'
61931                      * 
61932                      * _.trimRight('-_-abc-_-', '_-'); // => '-_-abc'
61933                      */
61934                     function trimRight(string, chars, guard) {
61935                         var value = string;
61936                         string = baseToString(string);
61937                         if (!string) {
61938                             return string;
61939                         }
61940                         if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61941                             return string.slice(0, trimmedRightIndex(string) + 1);
61942                         }
61943                         return string.slice(0, charsRightIndex(string, (chars + '')) + 1);
61944                     }
61945
61946                     /**
61947                      * Truncates `string` if it's longer than the given maximum string length.
61948                      * The last characters of the truncated string are replaced with the
61949                      * omission string which defaults to "...".
61950                      * 
61951                      * @static
61952                      * @memberOf _
61953                      * @category String
61954                      * @param {string}
61955                      *            [string=''] The string to truncate.
61956                      * @param {Object|number}
61957                      *            [options] The options object or maximum string length.
61958                      * @param {number}
61959                      *            [options.length=30] The maximum string length.
61960                      * @param {string}
61961                      *            [options.omission='...'] The string to indicate text is
61962                      *            omitted.
61963                      * @param {RegExp|string}
61964                      *            [options.separator] The separator pattern to truncate to.
61965                      * @param- {Object} [guard] Enables use as a callback for functions like
61966                      *         `_.map`.
61967                      * @returns {string} Returns the truncated string.
61968                      * @example
61969                      * 
61970                      * _.trunc('hi-diddly-ho there, neighborino'); // => 'hi-diddly-ho there,
61971                      * neighbo...'
61972                      * 
61973                      * _.trunc('hi-diddly-ho there, neighborino', 24); // => 'hi-diddly-ho
61974                      * there, n...'
61975                      * 
61976                      * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' '
61977                      * }); // => 'hi-diddly-ho there,...'
61978                      * 
61979                      * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator':
61980                      * /,? +/ }); // => 'hi-diddly-ho there...'
61981                      * 
61982                      * _.trunc('hi-diddly-ho there, neighborino', { 'omission': ' [...]' }); // =>
61983                      * 'hi-diddly-ho there, neig [...]'
61984                      */
61985                     function trunc(string, options, guard) {
61986                         if (guard && isIterateeCall(string, options, guard)) {
61987                             options = undefined;
61988                         }
61989                         var length = DEFAULT_TRUNC_LENGTH,
61990                             omission = DEFAULT_TRUNC_OMISSION;
61991
61992                         if (options != null) {
61993                             if (isObject(options)) {
61994                                 var separator = 'separator' in options ? options.separator : separator;
61995                                 length = 'length' in options ? (+options.length || 0) : length;
61996                                 omission = 'omission' in options ? baseToString(options.omission) : omission;
61997                             } else {
61998                                 length = +options || 0;
61999                             }
62000                         }
62001                         string = baseToString(string);
62002                         if (length >= string.length) {
62003                             return string;
62004                         }
62005                         var end = length - omission.length;
62006                         if (end < 1) {
62007                             return omission;
62008                         }
62009                         var result = string.slice(0, end);
62010                         if (separator == null) {
62011                             return result + omission;
62012                         }
62013                         if (isRegExp(separator)) {
62014                             if (string.slice(end).search(separator)) {
62015                                 var match,
62016                                     newEnd,
62017                                     substring = string.slice(0, end);
62018
62019                                 if (!separator.global) {
62020                                     separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
62021                                 }
62022                                 separator.lastIndex = 0;
62023                                 while ((match = separator.exec(substring))) {
62024                                     newEnd = match.index;
62025                                 }
62026                                 result = result.slice(0, newEnd == null ? end : newEnd);
62027                             }
62028                         } else if (string.indexOf(separator, end) != end) {
62029                             var index = result.lastIndexOf(separator);
62030                             if (index > -1) {
62031                                 result = result.slice(0, index);
62032                             }
62033                         }
62034                         return result + omission;
62035                     }
62036
62037                     /**
62038                      * The inverse of `_.escape`; this method converts the HTML entities
62039                      * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to
62040                      * their corresponding characters.
62041                      * 
62042                      * **Note:** No other HTML entities are unescaped. To unescape additional
62043                      * HTML entities use a third-party library like [_he_](https://mths.be/he).
62044                      * 
62045                      * @static
62046                      * @memberOf _
62047                      * @category String
62048                      * @param {string}
62049                      *            [string=''] The string to unescape.
62050                      * @returns {string} Returns the unescaped string.
62051                      * @example
62052                      * 
62053                      * _.unescape('fred, barney, &amp; pebbles'); // => 'fred, barney, &
62054                      * pebbles'
62055                      */
62056                     function unescape(string) {
62057                         string = baseToString(string);
62058                         return (string && reHasEscapedHtml.test(string)) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
62059                     }
62060
62061                     /**
62062                      * Splits `string` into an array of its words.
62063                      * 
62064                      * @static
62065                      * @memberOf _
62066                      * @category String
62067                      * @param {string}
62068                      *            [string=''] The string to inspect.
62069                      * @param {RegExp|string}
62070                      *            [pattern] The pattern to match words.
62071                      * @param- {Object} [guard] Enables use as a callback for functions like
62072                      *         `_.map`.
62073                      * @returns {Array} Returns the words of `string`.
62074                      * @example
62075                      * 
62076                      * _.words('fred, barney, & pebbles'); // => ['fred', 'barney', 'pebbles']
62077                      * 
62078                      * _.words('fred, barney, & pebbles', /[^, ]+/g); // => ['fred', 'barney',
62079                      * '&', 'pebbles']
62080                      */
62081                     function words(string, pattern, guard) {
62082                         if (guard && isIterateeCall(string, pattern, guard)) {
62083                             pattern = undefined;
62084                         }
62085                         string = baseToString(string);
62086                         return string.match(pattern || reWords) || [];
62087                     }
62088
62089                     /*------------------------------------------------------------------------*/
62090
62091                     /**
62092                      * Attempts to invoke `func`, returning either the result or the caught
62093                      * error object. Any additional arguments are provided to `func` when it is
62094                      * invoked.
62095                      * 
62096                      * @static
62097                      * @memberOf _
62098                      * @category Utility
62099                      * @param {Function}
62100                      *            func The function to attempt.
62101                      * @returns {*} Returns the `func` result or error object.
62102                      * @example
62103                      *  // avoid throwing errors for invalid selectors var elements =
62104                      * _.attempt(function(selector) { return
62105                      * document.querySelectorAll(selector); }, '>_>');
62106                      * 
62107                      * if (_.isError(elements)) { elements = []; }
62108                      */
62109                     var attempt = restParam(function(func, args) {
62110                         try {
62111                             return func.apply(undefined, args);
62112                         } catch (e) {
62113                             return isError(e) ? e : new Error(e);
62114                         }
62115                     });
62116
62117                     /**
62118                      * Creates a function that invokes `func` with the `this` binding of
62119                      * `thisArg` and arguments of the created function. If `func` is a property
62120                      * name the created callback returns the property value for a given element.
62121                      * If `func` is an object the created callback returns `true` for elements
62122                      * that contain the equivalent object properties, otherwise it returns
62123                      * `false`.
62124                      * 
62125                      * @static
62126                      * @memberOf _
62127                      * @alias iteratee
62128                      * @category Utility
62129                      * @param {*}
62130                      *            [func=_.identity] The value to convert to a callback.
62131                      * @param {*}
62132                      *            [thisArg] The `this` binding of `func`.
62133                      * @param- {Object} [guard] Enables use as a callback for functions like
62134                      *         `_.map`.
62135                      * @returns {Function} Returns the callback.
62136                      * @example
62137                      * 
62138                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62139                      * 40 } ];
62140                      *  // wrap to create custom callback shorthands _.callback =
62141                      * _.wrap(_.callback, function(callback, func, thisArg) { var match =
62142                      * /^(.+?)__([gl]t)(.+)$/.exec(func); if (!match) { return callback(func,
62143                      * thisArg); } return function(object) { return match[2] == 'gt' ?
62144                      * object[match[1]] > match[3] : object[match[1]] < match[3]; }; });
62145                      * 
62146                      * _.filter(users, 'age__gt36'); // => [{ 'user': 'fred', 'age': 40 }]
62147                      */
62148                     function callback(func, thisArg, guard) {
62149                         if (guard && isIterateeCall(func, thisArg, guard)) {
62150                             thisArg = undefined;
62151                         }
62152                         return isObjectLike(func) ? matches(func) : baseCallback(func, thisArg);
62153                     }
62154
62155                     /**
62156                      * Creates a function that returns `value`.
62157                      * 
62158                      * @static
62159                      * @memberOf _
62160                      * @category Utility
62161                      * @param {*}
62162                      *            value The value to return from the new function.
62163                      * @returns {Function} Returns the new function.
62164                      * @example
62165                      * 
62166                      * var object = { 'user': 'fred' }; var getter = _.constant(object);
62167                      * 
62168                      * getter() === object; // => true
62169                      */
62170                     function constant(value) {
62171                         return function() {
62172                             return value;
62173                         };
62174                     }
62175
62176                     /**
62177                      * This method returns the first argument provided to it.
62178                      * 
62179                      * @static
62180                      * @memberOf _
62181                      * @category Utility
62182                      * @param {*}
62183                      *            value Any value.
62184                      * @returns {*} Returns `value`.
62185                      * @example
62186                      * 
62187                      * var object = { 'user': 'fred' };
62188                      * 
62189                      * _.identity(object) === object; // => true
62190                      */
62191                     function identity(value) {
62192                         return value;
62193                     }
62194
62195                     /**
62196                      * Creates a function that performs a deep comparison between a given object
62197                      * and `source`, returning `true` if the given object has equivalent
62198                      * property values, else `false`.
62199                      * 
62200                      * **Note:** This method supports comparing arrays, booleans, `Date`
62201                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
62202                      * compared by their own, not inherited, enumerable properties. For
62203                      * comparing a single own or inherited property value see
62204                      * `_.matchesProperty`.
62205                      * 
62206                      * @static
62207                      * @memberOf _
62208                      * @category Utility
62209                      * @param {Object}
62210                      *            source The object of property values to match.
62211                      * @returns {Function} Returns the new function.
62212                      * @example
62213                      * 
62214                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
62215                      * 'fred', 'age': 40, 'active': false } ];
62216                      * 
62217                      * _.filter(users, _.matches({ 'age': 40, 'active': false })); // => [{
62218                      * 'user': 'fred', 'age': 40, 'active': false }]
62219                      */
62220                     function matches(source) {
62221                         return baseMatches(baseClone(source, true));
62222                     }
62223
62224                     /**
62225                      * Creates a function that compares the property value of `path` on a given
62226                      * object to `value`.
62227                      * 
62228                      * **Note:** This method supports comparing arrays, booleans, `Date`
62229                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
62230                      * compared by their own, not inherited, enumerable properties.
62231                      * 
62232                      * @static
62233                      * @memberOf _
62234                      * @category Utility
62235                      * @param {Array|string}
62236                      *            path The path of the property to get.
62237                      * @param {*}
62238                      *            srcValue The value to match.
62239                      * @returns {Function} Returns the new function.
62240                      * @example
62241                      * 
62242                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
62243                      * 
62244                      * _.find(users, _.matchesProperty('user', 'fred')); // => { 'user': 'fred' }
62245                      */
62246                     function matchesProperty(path, srcValue) {
62247                         return baseMatchesProperty(path, baseClone(srcValue, true));
62248                     }
62249
62250                     /**
62251                      * Creates a function that invokes the method at `path` on a given object.
62252                      * Any additional arguments are provided to the invoked method.
62253                      * 
62254                      * @static
62255                      * @memberOf _
62256                      * @category Utility
62257                      * @param {Array|string}
62258                      *            path The path of the method to invoke.
62259                      * @param {...*}
62260                      *            [args] The arguments to invoke the method with.
62261                      * @returns {Function} Returns the new function.
62262                      * @example
62263                      * 
62264                      * var objects = [ { 'a': { 'b': { 'c': _.constant(2) } } }, { 'a': { 'b': {
62265                      * 'c': _.constant(1) } } } ];
62266                      * 
62267                      * _.map(objects, _.method('a.b.c')); // => [2, 1]
62268                      * 
62269                      * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c'); // =>
62270                      * [1, 2]
62271                      */
62272                     var method = restParam(function(path, args) {
62273                         return function(object) {
62274                             return invokePath(object, path, args);
62275                         };
62276                     });
62277
62278                     /**
62279                      * The opposite of `_.method`; this method creates a function that invokes
62280                      * the method at a given path on `object`. Any additional arguments are
62281                      * provided to the invoked method.
62282                      * 
62283                      * @static
62284                      * @memberOf _
62285                      * @category Utility
62286                      * @param {Object}
62287                      *            object The object to query.
62288                      * @param {...*}
62289                      *            [args] The arguments to invoke the method with.
62290                      * @returns {Function} Returns the new function.
62291                      * @example
62292                      * 
62293                      * var array = _.times(3, _.constant), object = { 'a': array, 'b': array,
62294                      * 'c': array };
62295                      * 
62296                      * _.map(['a[2]', 'c[0]'], _.methodOf(object)); // => [2, 0]
62297                      * 
62298                      * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); // => [2, 0]
62299                      */
62300                     var methodOf = restParam(function(object, args) {
62301                         return function(path) {
62302                             return invokePath(object, path, args);
62303                         };
62304                     });
62305
62306                     /**
62307                      * Adds all own enumerable function properties of a source object to the
62308                      * destination object. If `object` is a function then methods are added to
62309                      * its prototype as well.
62310                      * 
62311                      * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
62312                      * avoid conflicts caused by modifying the original.
62313                      * 
62314                      * @static
62315                      * @memberOf _
62316                      * @category Utility
62317                      * @param {Function|Object}
62318                      *            [object=lodash] The destination object.
62319                      * @param {Object}
62320                      *            source The object of functions to add.
62321                      * @param {Object}
62322                      *            [options] The options object.
62323                      * @param {boolean}
62324                      *            [options.chain=true] Specify whether the functions added are
62325                      *            chainable.
62326                      * @returns {Function|Object} Returns `object`.
62327                      * @example
62328                      * 
62329                      * function vowels(string) { return _.filter(string, function(v) { return
62330                      * /[aeiou]/i.test(v); }); }
62331                      * 
62332                      * _.mixin({ 'vowels': vowels }); _.vowels('fred'); // => ['e']
62333                      * 
62334                      * _('fred').vowels().value(); // => ['e']
62335                      * 
62336                      * _.mixin({ 'vowels': vowels }, { 'chain': false }); _('fred').vowels(); // =>
62337                      * ['e']
62338                      */
62339                     function mixin(object, source, options) {
62340                         if (options == null) {
62341                             var isObj = isObject(source),
62342                                 props = isObj ? keys(source) : undefined,
62343                                 methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;
62344
62345                             if (!(methodNames ? methodNames.length : isObj)) {
62346                                 methodNames = false;
62347                                 options = source;
62348                                 source = object;
62349                                 object = this;
62350                             }
62351                         }
62352                         if (!methodNames) {
62353                             methodNames = baseFunctions(source, keys(source));
62354                         }
62355                         var chain = true,
62356                             index = -1,
62357                             isFunc = isFunction(object),
62358                             length = methodNames.length;
62359
62360                         if (options === false) {
62361                             chain = false;
62362                         } else if (isObject(options) && 'chain' in options) {
62363                             chain = options.chain;
62364                         }
62365                         while (++index < length) {
62366                             var methodName = methodNames[index],
62367                                 func = source[methodName];
62368
62369                             object[methodName] = func;
62370                             if (isFunc) {
62371                                 object.prototype[methodName] = (function(func) {
62372                                     return function() {
62373                                         var chainAll = this.__chain__;
62374                                         if (chain || chainAll) {
62375                                             var result = object(this.__wrapped__),
62376                                                 actions = result.__actions__ = arrayCopy(this.__actions__);
62377
62378                                             actions.push({
62379                                                 'func': func,
62380                                                 'args': arguments,
62381                                                 'thisArg': object
62382                                             });
62383                                             result.__chain__ = chainAll;
62384                                             return result;
62385                                         }
62386                                         return func.apply(object, arrayPush([this.value()], arguments));
62387                                     };
62388                                 }(func));
62389                             }
62390                         }
62391                         return object;
62392                     }
62393
62394                     /**
62395                      * Reverts the `_` variable to its previous value and returns a reference to
62396                      * the `lodash` function.
62397                      * 
62398                      * @static
62399                      * @memberOf _
62400                      * @category Utility
62401                      * @returns {Function} Returns the `lodash` function.
62402                      * @example
62403                      * 
62404                      * var lodash = _.noConflict();
62405                      */
62406                     function noConflict() {
62407                         root._ = oldDash;
62408                         return this;
62409                     }
62410
62411                     /**
62412                      * A no-operation function that returns `undefined` regardless of the
62413                      * arguments it receives.
62414                      * 
62415                      * @static
62416                      * @memberOf _
62417                      * @category Utility
62418                      * @example
62419                      * 
62420                      * var object = { 'user': 'fred' };
62421                      * 
62422                      * _.noop(object) === undefined; // => true
62423                      */
62424                     function noop() {
62425                         // No operation performed.
62426                     }
62427
62428                     /**
62429                      * Creates a function that returns the property value at `path` on a given
62430                      * object.
62431                      * 
62432                      * @static
62433                      * @memberOf _
62434                      * @category Utility
62435                      * @param {Array|string}
62436                      *            path The path of the property to get.
62437                      * @returns {Function} Returns the new function.
62438                      * @example
62439                      * 
62440                      * var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ];
62441                      * 
62442                      * _.map(objects, _.property('a.b.c')); // => [2, 1]
62443                      * 
62444                      * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // =>
62445                      * [1, 2]
62446                      */
62447                     function property(path) {
62448                         return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
62449                     }
62450
62451                     /**
62452                      * The opposite of `_.property`; this method creates a function that returns
62453                      * the property value at a given path on `object`.
62454                      * 
62455                      * @static
62456                      * @memberOf _
62457                      * @category Utility
62458                      * @param {Object}
62459                      *            object The object to query.
62460                      * @returns {Function} Returns the new function.
62461                      * @example
62462                      * 
62463                      * var array = [0, 1, 2], object = { 'a': array, 'b': array, 'c': array };
62464                      * 
62465                      * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); // => [2, 0]
62466                      * 
62467                      * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); // => [2, 0]
62468                      */
62469                     function propertyOf(object) {
62470                         return function(path) {
62471                             return baseGet(object, toPath(path), path + '');
62472                         };
62473                     }
62474
62475                     /**
62476                      * Creates an array of numbers (positive and/or negative) progressing from
62477                      * `start` up to, but not including, `end`. If `end` is not specified it is
62478                      * set to `start` with `start` then set to `0`. If `end` is less than
62479                      * `start` a zero-length range is created unless a negative `step` is
62480                      * specified.
62481                      * 
62482                      * @static
62483                      * @memberOf _
62484                      * @category Utility
62485                      * @param {number}
62486                      *            [start=0] The start of the range.
62487                      * @param {number}
62488                      *            end The end of the range.
62489                      * @param {number}
62490                      *            [step=1] The value to increment or decrement by.
62491                      * @returns {Array} Returns the new array of numbers.
62492                      * @example
62493                      * 
62494                      * _.range(4); // => [0, 1, 2, 3]
62495                      * 
62496                      * _.range(1, 5); // => [1, 2, 3, 4]
62497                      * 
62498                      * _.range(0, 20, 5); // => [0, 5, 10, 15]
62499                      * 
62500                      * _.range(0, -4, -1); // => [0, -1, -2, -3]
62501                      * 
62502                      * _.range(1, 4, 0); // => [1, 1, 1]
62503                      * 
62504                      * _.range(0); // => []
62505                      */
62506                     function range(start, end, step) {
62507                         if (step && isIterateeCall(start, end, step)) {
62508                             end = step = undefined;
62509                         }
62510                         start = +start || 0;
62511                         step = step == null ? 1 : (+step || 0);
62512
62513                         if (end == null) {
62514                             end = start;
62515                             start = 0;
62516                         } else {
62517                             end = +end || 0;
62518                         }
62519                         // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
62520                         // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
62521                         var index = -1,
62522                             length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
62523                             result = Array(length);
62524
62525                         while (++index < length) {
62526                             result[index] = start;
62527                             start += step;
62528                         }
62529                         return result;
62530                     }
62531
62532                     /**
62533                      * Invokes the iteratee function `n` times, returning an array of the
62534                      * results of each invocation. The `iteratee` is bound to `thisArg` and
62535                      * invoked with one argument; (index).
62536                      * 
62537                      * @static
62538                      * @memberOf _
62539                      * @category Utility
62540                      * @param {number}
62541                      *            n The number of times to invoke `iteratee`.
62542                      * @param {Function}
62543                      *            [iteratee=_.identity] The function invoked per iteration.
62544                      * @param {*}
62545                      *            [thisArg] The `this` binding of `iteratee`.
62546                      * @returns {Array} Returns the array of results.
62547                      * @example
62548                      * 
62549                      * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false)); // => [3,
62550                      * 6, 4]
62551                      * 
62552                      * _.times(3, function(n) { mage.castSpell(n); }); // => invokes
62553                      * `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
62554                      * 
62555                      * _.times(3, function(n) { this.cast(n); }, mage); // => also invokes
62556                      * `mage.castSpell(n)` three times
62557                      */
62558                     function times(n, iteratee, thisArg) {
62559                         n = nativeFloor(n);
62560
62561                         // Exit early to avoid a JSC JIT bug in Safari 8
62562                         // where `Array(0)` is treated as `Array(1)`.
62563                         if (n < 1 || !nativeIsFinite(n)) {
62564                             return [];
62565                         }
62566                         var index = -1,
62567                             result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
62568
62569                         iteratee = bindCallback(iteratee, thisArg, 1);
62570                         while (++index < n) {
62571                             if (index < MAX_ARRAY_LENGTH) {
62572                                 result[index] = iteratee(index);
62573                             } else {
62574                                 iteratee(index);
62575                             }
62576                         }
62577                         return result;
62578                     }
62579
62580                     /**
62581                      * Generates a unique ID. If `prefix` is provided the ID is appended to it.
62582                      * 
62583                      * @static
62584                      * @memberOf _
62585                      * @category Utility
62586                      * @param {string}
62587                      *            [prefix] The value to prefix the ID with.
62588                      * @returns {string} Returns the unique ID.
62589                      * @example
62590                      * 
62591                      * _.uniqueId('contact_'); // => 'contact_104'
62592                      * 
62593                      * _.uniqueId(); // => '105'
62594                      */
62595                     function uniqueId(prefix) {
62596                         var id = ++idCounter;
62597                         return baseToString(prefix) + id;
62598                     }
62599
62600                     /*------------------------------------------------------------------------*/
62601
62602                     /**
62603                      * Adds two numbers.
62604                      * 
62605                      * @static
62606                      * @memberOf _
62607                      * @category Math
62608                      * @param {number}
62609                      *            augend The first number to add.
62610                      * @param {number}
62611                      *            addend The second number to add.
62612                      * @returns {number} Returns the sum.
62613                      * @example
62614                      * 
62615                      * _.add(6, 4); // => 10
62616                      */
62617                     function add(augend, addend) {
62618                         return (+augend || 0) + (+addend || 0);
62619                     }
62620
62621                     /**
62622                      * Calculates `n` rounded up to `precision`.
62623                      * 
62624                      * @static
62625                      * @memberOf _
62626                      * @category Math
62627                      * @param {number}
62628                      *            n The number to round up.
62629                      * @param {number}
62630                      *            [precision=0] The precision to round up to.
62631                      * @returns {number} Returns the rounded up number.
62632                      * @example
62633                      * 
62634                      * _.ceil(4.006); // => 5
62635                      * 
62636                      * _.ceil(6.004, 2); // => 6.01
62637                      * 
62638                      * _.ceil(6040, -2); // => 6100
62639                      */
62640                     var ceil = createRound('ceil');
62641
62642                     /**
62643                      * Calculates `n` rounded down to `precision`.
62644                      * 
62645                      * @static
62646                      * @memberOf _
62647                      * @category Math
62648                      * @param {number}
62649                      *            n The number to round down.
62650                      * @param {number}
62651                      *            [precision=0] The precision to round down to.
62652                      * @returns {number} Returns the rounded down number.
62653                      * @example
62654                      * 
62655                      * _.floor(4.006); // => 4
62656                      * 
62657                      * _.floor(0.046, 2); // => 0.04
62658                      * 
62659                      * _.floor(4060, -2); // => 4000
62660                      */
62661                     var floor = createRound('floor');
62662
62663                     /**
62664                      * Gets the maximum value of `collection`. If `collection` is empty or
62665                      * falsey `-Infinity` is returned. If an iteratee function is provided it is
62666                      * invoked for each value in `collection` to generate the criterion by which
62667                      * the value is ranked. The `iteratee` is bound to `thisArg` and invoked
62668                      * with three arguments: (value, index, collection).
62669                      * 
62670                      * If a property name is provided for `iteratee` the created `_.property`
62671                      * style callback returns the property value of the given element.
62672                      * 
62673                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
62674                      * style callback returns `true` for elements that have a matching property
62675                      * value, else `false`.
62676                      * 
62677                      * If an object is provided for `iteratee` the created `_.matches` style
62678                      * callback returns `true` for elements that have the properties of the
62679                      * given object, else `false`.
62680                      * 
62681                      * @static
62682                      * @memberOf _
62683                      * @category Math
62684                      * @param {Array|Object|string}
62685                      *            collection The collection to iterate over.
62686                      * @param {Function|Object|string}
62687                      *            [iteratee] The function invoked per iteration.
62688                      * @param {*}
62689                      *            [thisArg] The `this` binding of `iteratee`.
62690                      * @returns {*} Returns the maximum value.
62691                      * @example
62692                      * 
62693                      * _.max([4, 2, 8, 6]); // => 8
62694                      * 
62695                      * _.max([]); // => -Infinity
62696                      * 
62697                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62698                      * 40 } ];
62699                      * 
62700                      * _.max(users, function(chr) { return chr.age; }); // => { 'user': 'fred',
62701                      * 'age': 40 }
62702                      *  // using the `_.property` callback shorthand _.max(users, 'age'); // => {
62703                      * 'user': 'fred', 'age': 40 }
62704                      */
62705                     var max = createExtremum(gt, NEGATIVE_INFINITY);
62706
62707                     /**
62708                      * Gets the minimum value of `collection`. If `collection` is empty or
62709                      * falsey `Infinity` is returned. If an iteratee function is provided it is
62710                      * invoked for each value in `collection` to generate the criterion by which
62711                      * the value is ranked. The `iteratee` is bound to `thisArg` and invoked
62712                      * with three arguments: (value, index, collection).
62713                      * 
62714                      * If a property name is provided for `iteratee` the created `_.property`
62715                      * style callback returns the property value of the given element.
62716                      * 
62717                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
62718                      * style callback returns `true` for elements that have a matching property
62719                      * value, else `false`.
62720                      * 
62721                      * If an object is provided for `iteratee` the created `_.matches` style
62722                      * callback returns `true` for elements that have the properties of the
62723                      * given object, else `false`.
62724                      * 
62725                      * @static
62726                      * @memberOf _
62727                      * @category Math
62728                      * @param {Array|Object|string}
62729                      *            collection The collection to iterate over.
62730                      * @param {Function|Object|string}
62731                      *            [iteratee] The function invoked per iteration.
62732                      * @param {*}
62733                      *            [thisArg] The `this` binding of `iteratee`.
62734                      * @returns {*} Returns the minimum value.
62735                      * @example
62736                      * 
62737                      * _.min([4, 2, 8, 6]); // => 2
62738                      * 
62739                      * _.min([]); // => Infinity
62740                      * 
62741                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62742                      * 40 } ];
62743                      * 
62744                      * _.min(users, function(chr) { return chr.age; }); // => { 'user':
62745                      * 'barney', 'age': 36 }
62746                      *  // using the `_.property` callback shorthand _.min(users, 'age'); // => {
62747                      * 'user': 'barney', 'age': 36 }
62748                      */
62749                     var min = createExtremum(lt, POSITIVE_INFINITY);
62750
62751                     /**
62752                      * Calculates `n` rounded to `precision`.
62753                      * 
62754                      * @static
62755                      * @memberOf _
62756                      * @category Math
62757                      * @param {number}
62758                      *            n The number to round.
62759                      * @param {number}
62760                      *            [precision=0] The precision to round to.
62761                      * @returns {number} Returns the rounded number.
62762                      * @example
62763                      * 
62764                      * _.round(4.006); // => 4
62765                      * 
62766                      * _.round(4.006, 2); // => 4.01
62767                      * 
62768                      * _.round(4060, -2); // => 4100
62769                      */
62770                     var round = createRound('round');
62771
62772                     /**
62773                      * Gets the sum of the values in `collection`.
62774                      * 
62775                      * @static
62776                      * @memberOf _
62777                      * @category Math
62778                      * @param {Array|Object|string}
62779                      *            collection The collection to iterate over.
62780                      * @param {Function|Object|string}
62781                      *            [iteratee] The function invoked per iteration.
62782                      * @param {*}
62783                      *            [thisArg] The `this` binding of `iteratee`.
62784                      * @returns {number} Returns the sum.
62785                      * @example
62786                      * 
62787                      * _.sum([4, 6]); // => 10
62788                      * 
62789                      * _.sum({ 'a': 4, 'b': 6 }); // => 10
62790                      * 
62791                      * var objects = [ { 'n': 4 }, { 'n': 6 } ];
62792                      * 
62793                      * _.sum(objects, function(object) { return object.n; }); // => 10
62794                      *  // using the `_.property` callback shorthand _.sum(objects, 'n'); // =>
62795                      * 10
62796                      */
62797                     function sum(collection, iteratee, thisArg) {
62798                         if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
62799                             iteratee = undefined;
62800                         }
62801                         iteratee = getCallback(iteratee, thisArg, 3);
62802                         return iteratee.length == 1 ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee) : baseSum(collection, iteratee);
62803                     }
62804
62805                     /*------------------------------------------------------------------------*/
62806
62807                     // Ensure wrappers are instances of `baseLodash`.
62808                     lodash.prototype = baseLodash.prototype;
62809
62810                     LodashWrapper.prototype = baseCreate(baseLodash.prototype);
62811                     LodashWrapper.prototype.constructor = LodashWrapper;
62812
62813                     LazyWrapper.prototype = baseCreate(baseLodash.prototype);
62814                     LazyWrapper.prototype.constructor = LazyWrapper;
62815
62816                     // Add functions to the `Map` cache.
62817                     MapCache.prototype['delete'] = mapDelete;
62818                     MapCache.prototype.get = mapGet;
62819                     MapCache.prototype.has = mapHas;
62820                     MapCache.prototype.set = mapSet;
62821
62822                     // Add functions to the `Set` cache.
62823                     SetCache.prototype.push = cachePush;
62824
62825                     // Assign cache to `_.memoize`.
62826                     memoize.Cache = MapCache;
62827
62828                     // Add functions that return wrapped values when chaining.
62829                     lodash.after = after;
62830                     lodash.ary = ary;
62831                     lodash.assign = assign;
62832                     lodash.at = at;
62833                     lodash.before = before;
62834                     lodash.bind = bind;
62835                     lodash.bindAll = bindAll;
62836                     lodash.bindKey = bindKey;
62837                     lodash.callback = callback;
62838                     lodash.chain = chain;
62839                     lodash.chunk = chunk;
62840                     lodash.compact = compact;
62841                     lodash.constant = constant;
62842                     lodash.countBy = countBy;
62843                     lodash.create = create;
62844                     lodash.curry = curry;
62845                     lodash.curryRight = curryRight;
62846                     lodash.debounce = debounce;
62847                     lodash.defaults = defaults;
62848                     lodash.defaultsDeep = defaultsDeep;
62849                     lodash.defer = defer;
62850                     lodash.delay = delay;
62851                     lodash.difference = difference;
62852                     lodash.drop = drop;
62853                     lodash.dropRight = dropRight;
62854                     lodash.dropRightWhile = dropRightWhile;
62855                     lodash.dropWhile = dropWhile;
62856                     lodash.fill = fill;
62857                     lodash.filter = filter;
62858                     lodash.flatten = flatten;
62859                     lodash.flattenDeep = flattenDeep;
62860                     lodash.flow = flow;
62861                     lodash.flowRight = flowRight;
62862                     lodash.forEach = forEach;
62863                     lodash.forEachRight = forEachRight;
62864                     lodash.forIn = forIn;
62865                     lodash.forInRight = forInRight;
62866                     lodash.forOwn = forOwn;
62867                     lodash.forOwnRight = forOwnRight;
62868                     lodash.functions = functions;
62869                     lodash.groupBy = groupBy;
62870                     lodash.indexBy = indexBy;
62871                     lodash.initial = initial;
62872                     lodash.intersection = intersection;
62873                     lodash.invert = invert;
62874                     lodash.invoke = invoke;
62875                     lodash.keys = keys;
62876                     lodash.keysIn = keysIn;
62877                     lodash.map = map;
62878                     lodash.mapKeys = mapKeys;
62879                     lodash.mapValues = mapValues;
62880                     lodash.matches = matches;
62881                     lodash.matchesProperty = matchesProperty;
62882                     lodash.memoize = memoize;
62883                     lodash.merge = merge;
62884                     lodash.method = method;
62885                     lodash.methodOf = methodOf;
62886                     lodash.mixin = mixin;
62887                     lodash.modArgs = modArgs;
62888                     lodash.negate = negate;
62889                     lodash.omit = omit;
62890                     lodash.once = once;
62891                     lodash.pairs = pairs;
62892                     lodash.partial = partial;
62893                     lodash.partialRight = partialRight;
62894                     lodash.partition = partition;
62895                     lodash.pick = pick;
62896                     lodash.pluck = pluck;
62897                     lodash.property = property;
62898                     lodash.propertyOf = propertyOf;
62899                     lodash.pull = pull;
62900                     lodash.pullAt = pullAt;
62901                     lodash.range = range;
62902                     lodash.rearg = rearg;
62903                     lodash.reject = reject;
62904                     lodash.remove = remove;
62905                     lodash.rest = rest;
62906                     lodash.restParam = restParam;
62907                     lodash.set = set;
62908                     lodash.shuffle = shuffle;
62909                     lodash.slice = slice;
62910                     lodash.sortBy = sortBy;
62911                     lodash.sortByAll = sortByAll;
62912                     lodash.sortByOrder = sortByOrder;
62913                     lodash.spread = spread;
62914                     lodash.take = take;
62915                     lodash.takeRight = takeRight;
62916                     lodash.takeRightWhile = takeRightWhile;
62917                     lodash.takeWhile = takeWhile;
62918                     lodash.tap = tap;
62919                     lodash.throttle = throttle;
62920                     lodash.thru = thru;
62921                     lodash.times = times;
62922                     lodash.toArray = toArray;
62923                     lodash.toPlainObject = toPlainObject;
62924                     lodash.transform = transform;
62925                     lodash.union = union;
62926                     lodash.uniq = uniq;
62927                     lodash.unzip = unzip;
62928                     lodash.unzipWith = unzipWith;
62929                     lodash.values = values;
62930                     lodash.valuesIn = valuesIn;
62931                     lodash.where = where;
62932                     lodash.without = without;
62933                     lodash.wrap = wrap;
62934                     lodash.xor = xor;
62935                     lodash.zip = zip;
62936                     lodash.zipObject = zipObject;
62937                     lodash.zipWith = zipWith;
62938
62939                     // Add aliases.
62940                     lodash.backflow = flowRight;
62941                     lodash.collect = map;
62942                     lodash.compose = flowRight;
62943                     lodash.each = forEach;
62944                     lodash.eachRight = forEachRight;
62945                     lodash.extend = assign;
62946                     lodash.iteratee = callback;
62947                     lodash.methods = functions;
62948                     lodash.object = zipObject;
62949                     lodash.select = filter;
62950                     lodash.tail = rest;
62951                     lodash.unique = uniq;
62952
62953                     // Add functions to `lodash.prototype`.
62954                     mixin(lodash, lodash);
62955
62956                     /*------------------------------------------------------------------------*/
62957
62958                     // Add functions that return unwrapped values when chaining.
62959                     lodash.add = add;
62960                     lodash.attempt = attempt;
62961                     lodash.camelCase = camelCase;
62962                     lodash.capitalize = capitalize;
62963                     lodash.ceil = ceil;
62964                     lodash.clone = clone;
62965                     lodash.cloneDeep = cloneDeep;
62966                     lodash.deburr = deburr;
62967                     lodash.endsWith = endsWith;
62968                     lodash.escape = escape;
62969                     lodash.escapeRegExp = escapeRegExp;
62970                     lodash.every = every;
62971                     lodash.find = find;
62972                     lodash.findIndex = findIndex;
62973                     lodash.findKey = findKey;
62974                     lodash.findLast = findLast;
62975                     lodash.findLastIndex = findLastIndex;
62976                     lodash.findLastKey = findLastKey;
62977                     lodash.findWhere = findWhere;
62978                     lodash.first = first;
62979                     lodash.floor = floor;
62980                     lodash.get = get;
62981                     lodash.gt = gt;
62982                     lodash.gte = gte;
62983                     lodash.has = has;
62984                     lodash.identity = identity;
62985                     lodash.includes = includes;
62986                     lodash.indexOf = indexOf;
62987                     lodash.inRange = inRange;
62988                     lodash.isArguments = isArguments;
62989                     lodash.isArray = isArray;
62990                     lodash.isBoolean = isBoolean;
62991                     lodash.isDate = isDate;
62992                     lodash.isElement = isElement;
62993                     lodash.isEmpty = isEmpty;
62994                     lodash.isEqual = isEqual;
62995                     lodash.isError = isError;
62996                     lodash.isFinite = isFinite;
62997                     lodash.isFunction = isFunction;
62998                     lodash.isMatch = isMatch;
62999                     lodash.isNaN = isNaN;
63000                     lodash.isNative = isNative;
63001                     lodash.isNull = isNull;
63002                     lodash.isNumber = isNumber;
63003                     lodash.isObject = isObject;
63004                     lodash.isPlainObject = isPlainObject;
63005                     lodash.isRegExp = isRegExp;
63006                     lodash.isString = isString;
63007                     lodash.isTypedArray = isTypedArray;
63008                     lodash.isUndefined = isUndefined;
63009                     lodash.kebabCase = kebabCase;
63010                     lodash.last = last;
63011                     lodash.lastIndexOf = lastIndexOf;
63012                     lodash.lt = lt;
63013                     lodash.lte = lte;
63014                     lodash.max = max;
63015                     lodash.min = min;
63016                     lodash.noConflict = noConflict;
63017                     lodash.noop = noop;
63018                     lodash.now = now;
63019                     lodash.pad = pad;
63020                     lodash.padLeft = padLeft;
63021                     lodash.padRight = padRight;
63022                     lodash.parseInt = parseInt;
63023                     lodash.random = random;
63024                     lodash.reduce = reduce;
63025                     lodash.reduceRight = reduceRight;
63026                     lodash.repeat = repeat;
63027                     lodash.result = result;
63028                     lodash.round = round;
63029                     lodash.runInContext = runInContext;
63030                     lodash.size = size;
63031                     lodash.snakeCase = snakeCase;
63032                     lodash.some = some;
63033                     lodash.sortedIndex = sortedIndex;
63034                     lodash.sortedLastIndex = sortedLastIndex;
63035                     lodash.startCase = startCase;
63036                     lodash.startsWith = startsWith;
63037                     lodash.sum = sum;
63038                     lodash.template = template;
63039                     lodash.trim = trim;
63040                     lodash.trimLeft = trimLeft;
63041                     lodash.trimRight = trimRight;
63042                     lodash.trunc = trunc;
63043                     lodash.unescape = unescape;
63044                     lodash.uniqueId = uniqueId;
63045                     lodash.words = words;
63046
63047                     // Add aliases.
63048                     lodash.all = every;
63049                     lodash.any = some;
63050                     lodash.contains = includes;
63051                     lodash.eq = isEqual;
63052                     lodash.detect = find;
63053                     lodash.foldl = reduce;
63054                     lodash.foldr = reduceRight;
63055                     lodash.head = first;
63056                     lodash.include = includes;
63057                     lodash.inject = reduce;
63058
63059                     mixin(lodash, (function() {
63060                         var source = {};
63061                         baseForOwn(lodash, function(func, methodName) {
63062                             if (!lodash.prototype[methodName]) {
63063                                 source[methodName] = func;
63064                             }
63065                         });
63066                         return source;
63067                     }()), false);
63068
63069                     /*------------------------------------------------------------------------*/
63070
63071                     // Add functions capable of returning wrapped and unwrapped values when
63072                     // chaining.
63073                     lodash.sample = sample;
63074
63075                     lodash.prototype.sample = function(n) {
63076                         if (!this.__chain__ && n == null) {
63077                             return sample(this.value());
63078                         }
63079                         return this.thru(function(value) {
63080                             return sample(value, n);
63081                         });
63082                     };
63083
63084                     /*------------------------------------------------------------------------*/
63085
63086                     /**
63087                      * The semantic version number.
63088                      * 
63089                      * @static
63090                      * @memberOf _
63091                      * @type string
63092                      */
63093                     lodash.VERSION = VERSION;
63094
63095                     // Assign default placeholders.
63096                     arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
63097                         lodash[methodName].placeholder = lodash;
63098                     });
63099
63100                     // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
63101                     arrayEach(['drop', 'take'], function(methodName, index) {
63102                         LazyWrapper.prototype[methodName] = function(n) {
63103                             var filtered = this.__filtered__;
63104                             if (filtered && !index) {
63105                                 return new LazyWrapper(this);
63106                             }
63107                             n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);
63108
63109                             var result = this.clone();
63110                             if (filtered) {
63111                                 result.__takeCount__ = nativeMin(result.__takeCount__, n);
63112                             } else {
63113                                 result.__views__.push({
63114                                     'size': n,
63115                                     'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
63116                                 });
63117                             }
63118                             return result;
63119                         };
63120
63121                         LazyWrapper.prototype[methodName + 'Right'] = function(n) {
63122                             return this.reverse()[methodName](n).reverse();
63123                         };
63124                     });
63125
63126                     // Add `LazyWrapper` methods that accept an `iteratee` value.
63127                     arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
63128                         var type = index + 1,
63129                             isFilter = type != LAZY_MAP_FLAG;
63130
63131                         LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
63132                             var result = this.clone();
63133                             result.__iteratees__.push({
63134                                 'iteratee': getCallback(iteratee, thisArg, 1),
63135                                 'type': type
63136                             });
63137                             result.__filtered__ = result.__filtered__ || isFilter;
63138                             return result;
63139                         };
63140                     });
63141
63142                     // Add `LazyWrapper` methods for `_.first` and `_.last`.
63143                     arrayEach(['first', 'last'], function(methodName, index) {
63144                         var takeName = 'take' + (index ? 'Right' : '');
63145
63146                         LazyWrapper.prototype[methodName] = function() {
63147                             return this[takeName](1).value()[0];
63148                         };
63149                     });
63150
63151                     // Add `LazyWrapper` methods for `_.initial` and `_.rest`.
63152                     arrayEach(['initial', 'rest'], function(methodName, index) {
63153                         var dropName = 'drop' + (index ? '' : 'Right');
63154
63155                         LazyWrapper.prototype[methodName] = function() {
63156                             return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
63157                         };
63158                     });
63159
63160                     // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
63161                     arrayEach(['pluck', 'where'], function(methodName, index) {
63162                         var operationName = index ? 'filter' : 'map',
63163                             createCallback = index ? baseMatches : property;
63164
63165                         LazyWrapper.prototype[methodName] = function(value) {
63166                             return this[operationName](createCallback(value));
63167                         };
63168                     });
63169
63170                     LazyWrapper.prototype.compact = function() {
63171                         return this.filter(identity);
63172                     };
63173
63174                     LazyWrapper.prototype.reject = function(predicate, thisArg) {
63175                         predicate = getCallback(predicate, thisArg, 1);
63176                         return this.filter(function(value) {
63177                             return !predicate(value);
63178                         });
63179                     };
63180
63181                     LazyWrapper.prototype.slice = function(start, end) {
63182                         start = start == null ? 0 : (+start || 0);
63183
63184                         var result = this;
63185                         if (result.__filtered__ && (start > 0 || end < 0)) {
63186                             return new LazyWrapper(result);
63187                         }
63188                         if (start < 0) {
63189                             result = result.takeRight(-start);
63190                         } else if (start) {
63191                             result = result.drop(start);
63192                         }
63193                         if (end !== undefined) {
63194                             end = (+end || 0);
63195                             result = end < 0 ? result.dropRight(-end) : result.take(end - start);
63196                         }
63197                         return result;
63198                     };
63199
63200                     LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) {
63201                         return this.reverse().takeWhile(predicate, thisArg).reverse();
63202                     };
63203
63204                     LazyWrapper.prototype.toArray = function() {
63205                         return this.take(POSITIVE_INFINITY);
63206                     };
63207
63208                     // Add `LazyWrapper` methods to `lodash.prototype`.
63209                     baseForOwn(LazyWrapper.prototype, function(func, methodName) {
63210                         var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),
63211                             retUnwrapped = /^(?:first|last)$/.test(methodName),
63212                             lodashFunc = lodash[retUnwrapped ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName];
63213
63214                         if (!lodashFunc) {
63215                             return;
63216                         }
63217                         lodash.prototype[methodName] = function() {
63218                             var args = retUnwrapped ? [1] : arguments,
63219                                 chainAll = this.__chain__,
63220                                 value = this.__wrapped__,
63221                                 isHybrid = !!this.__actions__.length,
63222                                 isLazy = value instanceof LazyWrapper,
63223                                 iteratee = args[0],
63224                                 useLazy = isLazy || isArray(value);
63225
63226                             if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
63227                                 // Avoid lazy use if the iteratee has a "length" value other than
63228                                 // `1`.
63229                                 isLazy = useLazy = false;
63230                             }
63231                             var interceptor = function(value) {
63232                                 return (retUnwrapped && chainAll) ? lodashFunc(value, 1)[0] : lodashFunc.apply(undefined, arrayPush([value], args));
63233                             };
63234
63235                             var action = {
63236                                     'func': thru,
63237                                     'args': [interceptor],
63238                                     'thisArg': undefined
63239                                 },
63240                                 onlyLazy = isLazy && !isHybrid;
63241
63242                             if (retUnwrapped && !chainAll) {
63243                                 if (onlyLazy) {
63244                                     value = value.clone();
63245                                     value.__actions__.push(action);
63246                                     return func.call(value);
63247                                 }
63248                                 return lodashFunc.call(undefined, this.value())[0];
63249                             }
63250                             if (!retUnwrapped && useLazy) {
63251                                 value = onlyLazy ? value : new LazyWrapper(this);
63252                                 var result = func.apply(value, args);
63253                                 result.__actions__.push(action);
63254                                 return new LodashWrapper(result, chainAll);
63255                             }
63256                             return this.thru(interceptor);
63257                         };
63258                     });
63259
63260                     // Add `Array` and `String` methods to `lodash.prototype`.
63261                     arrayEach(['join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {
63262                         var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],
63263                             chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
63264                             retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);
63265
63266                         lodash.prototype[methodName] = function() {
63267                             var args = arguments;
63268                             if (retUnwrapped && !this.__chain__) {
63269                                 return func.apply(this.value(), args);
63270                             }
63271                             return this[chainName](function(value) {
63272                                 return func.apply(value, args);
63273                             });
63274                         };
63275                     });
63276
63277                     // Map minified function names to their real names.
63278                     baseForOwn(LazyWrapper.prototype, function(func, methodName) {
63279                         var lodashFunc = lodash[methodName];
63280                         if (lodashFunc) {
63281                             var key = lodashFunc.name,
63282                                 names = realNames[key] || (realNames[key] = []);
63283
63284                             names.push({
63285                                 'name': methodName,
63286                                 'func': lodashFunc
63287                             });
63288                         }
63289                     });
63290
63291                     realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{
63292                         'name': 'wrapper',
63293                         'func': undefined
63294                     }];
63295
63296                     // Add functions to the lazy wrapper.
63297                     LazyWrapper.prototype.clone = lazyClone;
63298                     LazyWrapper.prototype.reverse = lazyReverse;
63299                     LazyWrapper.prototype.value = lazyValue;
63300
63301                     // Add chaining functions to the `lodash` wrapper.
63302                     lodash.prototype.chain = wrapperChain;
63303                     lodash.prototype.commit = wrapperCommit;
63304                     lodash.prototype.concat = wrapperConcat;
63305                     lodash.prototype.plant = wrapperPlant;
63306                     lodash.prototype.reverse = wrapperReverse;
63307                     lodash.prototype.toString = wrapperToString;
63308                     lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
63309
63310                     // Add function aliases to the `lodash` wrapper.
63311                     lodash.prototype.collect = lodash.prototype.map;
63312                     lodash.prototype.head = lodash.prototype.first;
63313                     lodash.prototype.select = lodash.prototype.filter;
63314                     lodash.prototype.tail = lodash.prototype.rest;
63315
63316                     return lodash;
63317                 }
63318
63319                 /*--------------------------------------------------------------------------*/
63320
63321                 // Export lodash.
63322                 var _ = runInContext();
63323
63324                 // Some AMD build optimizers like r.js check for condition patterns like the
63325                 // following:
63326                 if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
63327                     // Expose lodash to the global object when an AMD loader is present to avoid
63328                     // errors in cases where lodash is loaded by a script tag and not intended
63329                     // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for
63330                     // more details.
63331                     root._ = _;
63332
63333                     // Define as an anonymous module so, through path mapping, it can be
63334                     // referenced as the "underscore" module.
63335                     define(function() {
63336                         return _;
63337                     });
63338                 }
63339                 // Check for `exports` after `define` in case a build optimizer adds an
63340                 // `exports` object.
63341                 else if (freeExports && freeModule) {
63342                     // Export for Node.js or RingoJS.
63343                     if (moduleExports) {
63344                         (freeModule.exports = _)._ = _;
63345                     }
63346                     // Export for Rhino with CommonJS support.
63347                     else {
63348                         freeExports._ = _;
63349                     }
63350                 } else {
63351                     // Export for a browser or Rhino.
63352                     root._ = _;
63353                 }
63354             }.call(this));
63355
63356         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
63357     }, {}],
63358     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js": [function(require, module, exports) {
63359         var baseCreate = require('./baseCreate'),
63360             baseLodash = require('./baseLodash');
63361
63362         /** Used as references for `-Infinity` and `Infinity`. */
63363         var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
63364
63365         /**
63366          * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
63367          * 
63368          * @private
63369          * @param {*}
63370          *            value The value to wrap.
63371          */
63372         function LazyWrapper(value) {
63373             this.__wrapped__ = value;
63374             this.__actions__ = [];
63375             this.__dir__ = 1;
63376             this.__filtered__ = false;
63377             this.__iteratees__ = [];
63378             this.__takeCount__ = POSITIVE_INFINITY;
63379             this.__views__ = [];
63380         }
63381
63382         LazyWrapper.prototype = baseCreate(baseLodash.prototype);
63383         LazyWrapper.prototype.constructor = LazyWrapper;
63384
63385         module.exports = LazyWrapper;
63386
63387     }, {
63388         "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js",
63389         "./baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js"
63390     }],
63391     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js": [function(require, module, exports) {
63392         var baseCreate = require('./baseCreate'),
63393             baseLodash = require('./baseLodash');
63394
63395         /**
63396          * The base constructor for creating `lodash` wrapper objects.
63397          * 
63398          * @private
63399          * @param {*}
63400          *            value The value to wrap.
63401          * @param {boolean}
63402          *            [chainAll] Enable chaining for all wrapper methods.
63403          * @param {Array}
63404          *            [actions=[]] Actions to peform to resolve the unwrapped value.
63405          */
63406         function LodashWrapper(value, chainAll, actions) {
63407             this.__wrapped__ = value;
63408             this.__actions__ = actions || [];
63409             this.__chain__ = !!chainAll;
63410         }
63411
63412         LodashWrapper.prototype = baseCreate(baseLodash.prototype);
63413         LodashWrapper.prototype.constructor = LodashWrapper;
63414
63415         module.exports = LodashWrapper;
63416
63417     }, {
63418         "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js",
63419         "./baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js"
63420     }],
63421     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\SetCache.js": [function(require, module, exports) {
63422         (function(global) {
63423             var cachePush = require('./cachePush'),
63424                 getNative = require('./getNative');
63425
63426             /** Native method references. */
63427             var Set = getNative(global, 'Set');
63428
63429             /*
63430              * Native method references for those with the same name as other `lodash`
63431              * methods.
63432              */
63433             var nativeCreate = getNative(Object, 'create');
63434
63435             /**
63436              * 
63437              * Creates a cache object to store unique values.
63438              * 
63439              * @private
63440              * @param {Array}
63441              *            [values] The values to cache.
63442              */
63443             function SetCache(values) {
63444                 var length = values ? values.length : 0;
63445
63446                 this.data = {
63447                     'hash': nativeCreate(null),
63448                     'set': new Set
63449                 };
63450                 while (length--) {
63451                     this.push(values[length]);
63452                 }
63453             }
63454
63455             // Add functions to the `Set` cache.
63456             SetCache.prototype.push = cachePush;
63457
63458             module.exports = SetCache;
63459
63460         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
63461     }, {
63462         "./cachePush": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cachePush.js",
63463         "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
63464     }],
63465     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js": [function(require, module, exports) {
63466         /**
63467          * Copies the values of `source` to `array`.
63468          * 
63469          * @private
63470          * @param {Array}
63471          *            source The array to copy values from.
63472          * @param {Array}
63473          *            [array=[]] The array to copy values to.
63474          * @returns {Array} Returns `array`.
63475          */
63476         function arrayCopy(source, array) {
63477             var index = -1,
63478                 length = source.length;
63479
63480             array || (array = Array(length));
63481             while (++index < length) {
63482                 array[index] = source[index];
63483             }
63484             return array;
63485         }
63486
63487         module.exports = arrayCopy;
63488
63489     }, {}],
63490     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js": [function(require, module, exports) {
63491         /**
63492          * A specialized version of `_.forEach` for arrays without support for callback
63493          * shorthands and `this` binding.
63494          * 
63495          * @private
63496          * @param {Array}
63497          *            array The array to iterate over.
63498          * @param {Function}
63499          *            iteratee The function invoked per iteration.
63500          * @returns {Array} Returns `array`.
63501          */
63502         function arrayEach(array, iteratee) {
63503             var index = -1,
63504                 length = array.length;
63505
63506             while (++index < length) {
63507                 if (iteratee(array[index], index, array) === false) {
63508                     break;
63509                 }
63510             }
63511             return array;
63512         }
63513
63514         module.exports = arrayEach;
63515
63516     }, {}],
63517     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEvery.js": [function(require, module, exports) {
63518         /**
63519          * A specialized version of `_.every` for arrays without support for callback
63520          * shorthands and `this` binding.
63521          * 
63522          * @private
63523          * @param {Array}
63524          *            array The array to iterate over.
63525          * @param {Function}
63526          *            predicate The function invoked per iteration.
63527          * @returns {boolean} Returns `true` if all elements pass the predicate check,
63528          *          else `false`.
63529          */
63530         function arrayEvery(array, predicate) {
63531             var index = -1,
63532                 length = array.length;
63533
63534             while (++index < length) {
63535                 if (!predicate(array[index], index, array)) {
63536                     return false;
63537                 }
63538             }
63539             return true;
63540         }
63541
63542         module.exports = arrayEvery;
63543
63544     }, {}],
63545     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayFilter.js": [function(require, module, exports) {
63546         /**
63547          * A specialized version of `_.filter` for arrays without support for callback
63548          * shorthands and `this` binding.
63549          * 
63550          * @private
63551          * @param {Array}
63552          *            array The array to iterate over.
63553          * @param {Function}
63554          *            predicate The function invoked per iteration.
63555          * @returns {Array} Returns the new filtered array.
63556          */
63557         function arrayFilter(array, predicate) {
63558             var index = -1,
63559                 length = array.length,
63560                 resIndex = -1,
63561                 result = [];
63562
63563             while (++index < length) {
63564                 var value = array[index];
63565                 if (predicate(value, index, array)) {
63566                     result[++resIndex] = value;
63567                 }
63568             }
63569             return result;
63570         }
63571
63572         module.exports = arrayFilter;
63573
63574     }, {}],
63575     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js": [function(require, module, exports) {
63576         /**
63577          * A specialized version of `_.map` for arrays without support for callback
63578          * shorthands and `this` binding.
63579          * 
63580          * @private
63581          * @param {Array}
63582          *            array The array to iterate over.
63583          * @param {Function}
63584          *            iteratee The function invoked per iteration.
63585          * @returns {Array} Returns the new mapped array.
63586          */
63587         function arrayMap(array, iteratee) {
63588             var index = -1,
63589                 length = array.length,
63590                 result = Array(length);
63591
63592             while (++index < length) {
63593                 result[index] = iteratee(array[index], index, array);
63594             }
63595             return result;
63596         }
63597
63598         module.exports = arrayMap;
63599
63600     }, {}],
63601     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayPush.js": [function(require, module, exports) {
63602         /**
63603          * Appends the elements of `values` to `array`.
63604          * 
63605          * @private
63606          * @param {Array}
63607          *            array The array to modify.
63608          * @param {Array}
63609          *            values The values to append.
63610          * @returns {Array} Returns `array`.
63611          */
63612         function arrayPush(array, values) {
63613             var index = -1,
63614                 length = values.length,
63615                 offset = array.length;
63616
63617             while (++index < length) {
63618                 array[offset + index] = values[index];
63619             }
63620             return array;
63621         }
63622
63623         module.exports = arrayPush;
63624
63625     }, {}],
63626     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayReduce.js": [function(require, module, exports) {
63627         /**
63628          * A specialized version of `_.reduce` for arrays without support for callback
63629          * shorthands and `this` binding.
63630          * 
63631          * @private
63632          * @param {Array}
63633          *            array The array to iterate over.
63634          * @param {Function}
63635          *            iteratee The function invoked per iteration.
63636          * @param {*}
63637          *            [accumulator] The initial value.
63638          * @param {boolean}
63639          *            [initFromArray] Specify using the first element of `array` as the
63640          *            initial value.
63641          * @returns {*} Returns the accumulated value.
63642          */
63643         function arrayReduce(array, iteratee, accumulator, initFromArray) {
63644             var index = -1,
63645                 length = array.length;
63646
63647             if (initFromArray && length) {
63648                 accumulator = array[++index];
63649             }
63650             while (++index < length) {
63651                 accumulator = iteratee(accumulator, array[index], index, array);
63652             }
63653             return accumulator;
63654         }
63655
63656         module.exports = arrayReduce;
63657
63658     }, {}],
63659     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js": [function(require, module, exports) {
63660         /**
63661          * A specialized version of `_.some` for arrays without support for callback
63662          * shorthands and `this` binding.
63663          * 
63664          * @private
63665          * @param {Array}
63666          *            array The array to iterate over.
63667          * @param {Function}
63668          *            predicate The function invoked per iteration.
63669          * @returns {boolean} Returns `true` if any element passes the predicate check,
63670          *          else `false`.
63671          */
63672         function arraySome(array, predicate) {
63673             var index = -1,
63674                 length = array.length;
63675
63676             while (++index < length) {
63677                 if (predicate(array[index], index, array)) {
63678                     return true;
63679                 }
63680             }
63681             return false;
63682         }
63683
63684         module.exports = arraySome;
63685
63686     }, {}],
63687     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\assignWith.js": [function(require, module, exports) {
63688         var keys = require('../object/keys');
63689
63690         /**
63691          * A specialized version of `_.assign` for customizing assigned values without
63692          * support for argument juggling, multiple sources, and `this` binding
63693          * `customizer` functions.
63694          * 
63695          * @private
63696          * @param {Object}
63697          *            object The destination object.
63698          * @param {Object}
63699          *            source The source object.
63700          * @param {Function}
63701          *            customizer The function to customize assigned values.
63702          * @returns {Object} Returns `object`.
63703          */
63704         function assignWith(object, source, customizer) {
63705             var index = -1,
63706                 props = keys(source),
63707                 length = props.length;
63708
63709             while (++index < length) {
63710                 var key = props[index],
63711                     value = object[key],
63712                     result = customizer(value, source[key], key, object, source);
63713
63714                 if ((result === result ? (result !== value) : (value === value)) ||
63715                     (value === undefined && !(key in object))) {
63716                     object[key] = result;
63717                 }
63718             }
63719             return object;
63720         }
63721
63722         module.exports = assignWith;
63723
63724     }, {
63725         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
63726     }],
63727     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseAssign.js": [function(require, module, exports) {
63728         var baseCopy = require('./baseCopy'),
63729             keys = require('../object/keys');
63730
63731         /**
63732          * The base implementation of `_.assign` without support for argument juggling,
63733          * multiple sources, and `customizer` functions.
63734          * 
63735          * @private
63736          * @param {Object}
63737          *            object The destination object.
63738          * @param {Object}
63739          *            source The source object.
63740          * @returns {Object} Returns `object`.
63741          */
63742         function baseAssign(object, source) {
63743             return source == null ? object : baseCopy(source, keys(source), object);
63744         }
63745
63746         module.exports = baseAssign;
63747
63748     }, {
63749         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
63750         "./baseCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js"
63751     }],
63752     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js": [function(require, module, exports) {
63753         var baseMatches = require('./baseMatches'),
63754             baseMatchesProperty = require('./baseMatchesProperty'),
63755             bindCallback = require('./bindCallback'),
63756             identity = require('../utility/identity'),
63757             property = require('../utility/property');
63758
63759         /**
63760          * The base implementation of `_.callback` which supports specifying the number
63761          * of arguments to provide to `func`.
63762          * 
63763          * @private
63764          * @param {*}
63765          *            [func=_.identity] The value to convert to a callback.
63766          * @param {*}
63767          *            [thisArg] The `this` binding of `func`.
63768          * @param {number}
63769          *            [argCount] The number of arguments to provide to `func`.
63770          * @returns {Function} Returns the callback.
63771          */
63772         function baseCallback(func, thisArg, argCount) {
63773             var type = typeof func;
63774             if (type == 'function') {
63775                 return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
63776             }
63777             if (func == null) {
63778                 return identity;
63779             }
63780             if (type == 'object') {
63781                 return baseMatches(func);
63782             }
63783             return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
63784         }
63785
63786         module.exports = baseCallback;
63787
63788     }, {
63789         "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js",
63790         "../utility/property": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\property.js",
63791         "./baseMatches": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatches.js",
63792         "./baseMatchesProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatchesProperty.js",
63793         "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js"
63794     }],
63795     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCompareAscending.js": [function(require, module, exports) {
63796         /**
63797          * The base implementation of `compareAscending` which compares values and sorts
63798          * them in ascending order without guaranteeing a stable sort.
63799          * 
63800          * @private
63801          * @param {*}
63802          *            value The value to compare.
63803          * @param {*}
63804          *            other The other value to compare.
63805          * @returns {number} Returns the sort order indicator for `value`.
63806          */
63807         function baseCompareAscending(value, other) {
63808             if (value !== other) {
63809                 var valIsNull = value === null,
63810                     valIsUndef = value === undefined,
63811                     valIsReflexive = value === value;
63812
63813                 var othIsNull = other === null,
63814                     othIsUndef = other === undefined,
63815                     othIsReflexive = other === other;
63816
63817                 if ((value > other && !othIsNull) || !valIsReflexive ||
63818                     (valIsNull && !othIsUndef && othIsReflexive) ||
63819                     (valIsUndef && othIsReflexive)) {
63820                     return 1;
63821                 }
63822                 if ((value < other && !valIsNull) || !othIsReflexive ||
63823                     (othIsNull && !valIsUndef && valIsReflexive) ||
63824                     (othIsUndef && valIsReflexive)) {
63825                     return -1;
63826                 }
63827             }
63828             return 0;
63829         }
63830
63831         module.exports = baseCompareAscending;
63832
63833     }, {}],
63834     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js": [function(require, module, exports) {
63835         /**
63836          * Copies properties of `source` to `object`.
63837          * 
63838          * @private
63839          * @param {Object}
63840          *            source The object to copy properties from.
63841          * @param {Array}
63842          *            props The property names to copy.
63843          * @param {Object}
63844          *            [object={}] The object to copy properties to.
63845          * @returns {Object} Returns `object`.
63846          */
63847         function baseCopy(source, props, object) {
63848             object || (object = {});
63849
63850             var index = -1,
63851                 length = props.length;
63852
63853             while (++index < length) {
63854                 var key = props[index];
63855                 object[key] = source[key];
63856             }
63857             return object;
63858         }
63859
63860         module.exports = baseCopy;
63861
63862     }, {}],
63863     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js": [function(require, module, exports) {
63864         var isObject = require('../lang/isObject');
63865
63866         /**
63867          * The base implementation of `_.create` without support for assigning
63868          * properties to the created object.
63869          * 
63870          * @private
63871          * @param {Object}
63872          *            prototype The object to inherit from.
63873          * @returns {Object} Returns the new object.
63874          */
63875         var baseCreate = (function() {
63876             function object() {}
63877             return function(prototype) {
63878                 if (isObject(prototype)) {
63879                     object.prototype = prototype;
63880                     var result = new object;
63881                     object.prototype = undefined;
63882                 }
63883                 return result || {};
63884             };
63885         }());
63886
63887         module.exports = baseCreate;
63888
63889     }, {
63890         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
63891     }],
63892     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDelay.js": [function(require, module, exports) {
63893         /** Used as the `TypeError` message for "Functions" methods. */
63894         var FUNC_ERROR_TEXT = 'Expected a function';
63895
63896         /**
63897          * The base implementation of `_.delay` and `_.defer` which accepts an index of
63898          * where to slice the arguments to provide to `func`.
63899          * 
63900          * @private
63901          * @param {Function}
63902          *            func The function to delay.
63903          * @param {number}
63904          *            wait The number of milliseconds to delay invocation.
63905          * @param {Object}
63906          *            args The arguments provide to `func`.
63907          * @returns {number} Returns the timer id.
63908          */
63909         function baseDelay(func, wait, args) {
63910             if (typeof func != 'function') {
63911                 throw new TypeError(FUNC_ERROR_TEXT);
63912             }
63913             return setTimeout(function() {
63914                 func.apply(undefined, args);
63915             }, wait);
63916         }
63917
63918         module.exports = baseDelay;
63919
63920     }, {}],
63921     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDifference.js": [function(require, module, exports) {
63922         var baseIndexOf = require('./baseIndexOf'),
63923             cacheIndexOf = require('./cacheIndexOf'),
63924             createCache = require('./createCache');
63925
63926         /** Used as the size to enable large array optimizations. */
63927         var LARGE_ARRAY_SIZE = 200;
63928
63929         /**
63930          * The base implementation of `_.difference` which accepts a single array of
63931          * values to exclude.
63932          * 
63933          * @private
63934          * @param {Array}
63935          *            array The array to inspect.
63936          * @param {Array}
63937          *            values The values to exclude.
63938          * @returns {Array} Returns the new array of filtered values.
63939          */
63940         function baseDifference(array, values) {
63941             var length = array ? array.length : 0,
63942                 result = [];
63943
63944             if (!length) {
63945                 return result;
63946             }
63947             var index = -1,
63948                 indexOf = baseIndexOf,
63949                 isCommon = true,
63950                 cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
63951                 valuesLength = values.length;
63952
63953             if (cache) {
63954                 indexOf = cacheIndexOf;
63955                 isCommon = false;
63956                 values = cache;
63957             }
63958             outer:
63959                 while (++index < length) {
63960                     var value = array[index];
63961
63962                     if (isCommon && value === value) {
63963                         var valuesIndex = valuesLength;
63964                         while (valuesIndex--) {
63965                             if (values[valuesIndex] === value) {
63966                                 continue outer;
63967                             }
63968                         }
63969                         result.push(value);
63970                     } else if (indexOf(values, value, 0) < 0) {
63971                         result.push(value);
63972                     }
63973                 }
63974             return result;
63975         }
63976
63977         module.exports = baseDifference;
63978
63979     }, {
63980         "./baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
63981         "./cacheIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js",
63982         "./createCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js"
63983     }],
63984     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js": [function(require, module, exports) {
63985         var baseForOwn = require('./baseForOwn'),
63986             createBaseEach = require('./createBaseEach');
63987
63988         /**
63989          * The base implementation of `_.forEach` without support for callback
63990          * shorthands and `this` binding.
63991          * 
63992          * @private
63993          * @param {Array|Object|string}
63994          *            collection The collection to iterate over.
63995          * @param {Function}
63996          *            iteratee The function invoked per iteration.
63997          * @returns {Array|Object|string} Returns `collection`.
63998          */
63999         var baseEach = createBaseEach(baseForOwn);
64000
64001         module.exports = baseEach;
64002
64003     }, {
64004         "./baseForOwn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForOwn.js",
64005         "./createBaseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseEach.js"
64006     }],
64007     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEvery.js": [function(require, module, exports) {
64008         var baseEach = require('./baseEach');
64009
64010         /**
64011          * The base implementation of `_.every` without support for callback shorthands
64012          * and `this` binding.
64013          * 
64014          * @private
64015          * @param {Array|Object|string}
64016          *            collection The collection to iterate over.
64017          * @param {Function}
64018          *            predicate The function invoked per iteration.
64019          * @returns {boolean} Returns `true` if all elements pass the predicate check,
64020          *          else `false`
64021          */
64022         function baseEvery(collection, predicate) {
64023             var result = true;
64024             baseEach(collection, function(value, index, collection) {
64025                 result = !!predicate(value, index, collection);
64026                 return result;
64027             });
64028             return result;
64029         }
64030
64031         module.exports = baseEvery;
64032
64033     }, {
64034         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
64035     }],
64036     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFilter.js": [function(require, module, exports) {
64037         var baseEach = require('./baseEach');
64038
64039         /**
64040          * The base implementation of `_.filter` without support for callback shorthands
64041          * and `this` binding.
64042          * 
64043          * @private
64044          * @param {Array|Object|string}
64045          *            collection The collection to iterate over.
64046          * @param {Function}
64047          *            predicate The function invoked per iteration.
64048          * @returns {Array} Returns the new filtered array.
64049          */
64050         function baseFilter(collection, predicate) {
64051             var result = [];
64052             baseEach(collection, function(value, index, collection) {
64053                 if (predicate(value, index, collection)) {
64054                     result.push(value);
64055                 }
64056             });
64057             return result;
64058         }
64059
64060         module.exports = baseFilter;
64061
64062     }, {
64063         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
64064     }],
64065     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFind.js": [function(require, module, exports) {
64066         /**
64067          * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and
64068          * `_.findLastKey`, without support for callback shorthands and `this` binding,
64069          * which iterates over `collection` using the provided `eachFunc`.
64070          * 
64071          * @private
64072          * @param {Array|Object|string}
64073          *            collection The collection to search.
64074          * @param {Function}
64075          *            predicate The function invoked per iteration.
64076          * @param {Function}
64077          *            eachFunc The function to iterate over `collection`.
64078          * @param {boolean}
64079          *            [retKey] Specify returning the key of the found element instead of
64080          *            the element itself.
64081          * @returns {*} Returns the found element or its key, else `undefined`.
64082          */
64083         function baseFind(collection, predicate, eachFunc, retKey) {
64084             var result;
64085             eachFunc(collection, function(value, key, collection) {
64086                 if (predicate(value, key, collection)) {
64087                     result = retKey ? key : value;
64088                     return false;
64089                 }
64090             });
64091             return result;
64092         }
64093
64094         module.exports = baseFind;
64095
64096     }, {}],
64097     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFindIndex.js": [function(require, module, exports) {
64098         /**
64099          * The base implementation of `_.findIndex` and `_.findLastIndex` without
64100          * support for callback shorthands and `this` binding.
64101          * 
64102          * @private
64103          * @param {Array}
64104          *            array The array to search.
64105          * @param {Function}
64106          *            predicate The function invoked per iteration.
64107          * @param {boolean}
64108          *            [fromRight] Specify iterating from right to left.
64109          * @returns {number} Returns the index of the matched value, else `-1`.
64110          */
64111         function baseFindIndex(array, predicate, fromRight) {
64112             var length = array.length,
64113                 index = fromRight ? length : -1;
64114
64115             while ((fromRight ? index-- : ++index < length)) {
64116                 if (predicate(array[index], index, array)) {
64117                     return index;
64118                 }
64119             }
64120             return -1;
64121         }
64122
64123         module.exports = baseFindIndex;
64124
64125     }, {}],
64126     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js": [function(require, module, exports) {
64127         var arrayPush = require('./arrayPush'),
64128             isArguments = require('../lang/isArguments'),
64129             isArray = require('../lang/isArray'),
64130             isArrayLike = require('./isArrayLike'),
64131             isObjectLike = require('./isObjectLike');
64132
64133         /**
64134          * The base implementation of `_.flatten` with added support for restricting
64135          * flattening and specifying the start index.
64136          * 
64137          * @private
64138          * @param {Array}
64139          *            array The array to flatten.
64140          * @param {boolean}
64141          *            [isDeep] Specify a deep flatten.
64142          * @param {boolean}
64143          *            [isStrict] Restrict flattening to arrays-like objects.
64144          * @param {Array}
64145          *            [result=[]] The initial result value.
64146          * @returns {Array} Returns the new flattened array.
64147          */
64148         function baseFlatten(array, isDeep, isStrict, result) {
64149             result || (result = []);
64150
64151             var index = -1,
64152                 length = array.length;
64153
64154             while (++index < length) {
64155                 var value = array[index];
64156                 if (isObjectLike(value) && isArrayLike(value) &&
64157                     (isStrict || isArray(value) || isArguments(value))) {
64158                     if (isDeep) {
64159                         // Recursively flatten arrays (susceptible to call stack limits).
64160                         baseFlatten(value, isDeep, isStrict, result);
64161                     } else {
64162                         arrayPush(result, value);
64163                     }
64164                 } else if (!isStrict) {
64165                     result[result.length] = value;
64166                 }
64167             }
64168             return result;
64169         }
64170
64171         module.exports = baseFlatten;
64172
64173     }, {
64174         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
64175         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64176         "./arrayPush": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayPush.js",
64177         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
64178         "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64179     }],
64180     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js": [function(require, module, exports) {
64181         var createBaseFor = require('./createBaseFor');
64182
64183         /**
64184          * The base implementation of `baseForIn` and `baseForOwn` which iterates over
64185          * `object` properties returned by `keysFunc` invoking `iteratee` for each
64186          * property. Iteratee functions may exit iteration early by explicitly returning
64187          * `false`.
64188          * 
64189          * @private
64190          * @param {Object}
64191          *            object The object to iterate over.
64192          * @param {Function}
64193          *            iteratee The function invoked per iteration.
64194          * @param {Function}
64195          *            keysFunc The function to get the keys of `object`.
64196          * @returns {Object} Returns `object`.
64197          */
64198         var baseFor = createBaseFor();
64199
64200         module.exports = baseFor;
64201
64202     }, {
64203         "./createBaseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseFor.js"
64204     }],
64205     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js": [function(require, module, exports) {
64206         var baseFor = require('./baseFor'),
64207             keysIn = require('../object/keysIn');
64208
64209         /**
64210          * The base implementation of `_.forIn` without support for callback shorthands
64211          * and `this` binding.
64212          * 
64213          * @private
64214          * @param {Object}
64215          *            object The object to iterate over.
64216          * @param {Function}
64217          *            iteratee The function invoked per iteration.
64218          * @returns {Object} Returns `object`.
64219          */
64220         function baseForIn(object, iteratee) {
64221             return baseFor(object, iteratee, keysIn);
64222         }
64223
64224         module.exports = baseForIn;
64225
64226     }, {
64227         "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js",
64228         "./baseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js"
64229     }],
64230     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForOwn.js": [function(require, module, exports) {
64231         var baseFor = require('./baseFor'),
64232             keys = require('../object/keys');
64233
64234         /**
64235          * The base implementation of `_.forOwn` without support for callback shorthands
64236          * and `this` binding.
64237          * 
64238          * @private
64239          * @param {Object}
64240          *            object The object to iterate over.
64241          * @param {Function}
64242          *            iteratee The function invoked per iteration.
64243          * @returns {Object} Returns `object`.
64244          */
64245         function baseForOwn(object, iteratee) {
64246             return baseFor(object, iteratee, keys);
64247         }
64248
64249         module.exports = baseForOwn;
64250
64251     }, {
64252         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
64253         "./baseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js"
64254     }],
64255     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js": [function(require, module, exports) {
64256         var toObject = require('./toObject');
64257
64258         /**
64259          * The base implementation of `get` without support for string paths and default
64260          * values.
64261          * 
64262          * @private
64263          * @param {Object}
64264          *            object The object to query.
64265          * @param {Array}
64266          *            path The path of the property to get.
64267          * @param {string}
64268          *            [pathKey] The key representation of path.
64269          * @returns {*} Returns the resolved value.
64270          */
64271         function baseGet(object, path, pathKey) {
64272             if (object == null) {
64273                 return;
64274             }
64275             if (pathKey !== undefined && pathKey in toObject(object)) {
64276                 path = [pathKey];
64277             }
64278             var index = 0,
64279                 length = path.length;
64280
64281             while (object != null && index < length) {
64282                 object = object[path[index++]];
64283             }
64284             return (index && index == length) ? object : undefined;
64285         }
64286
64287         module.exports = baseGet;
64288
64289     }, {
64290         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64291     }],
64292     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js": [function(require, module, exports) {
64293         var indexOfNaN = require('./indexOfNaN');
64294
64295         /**
64296          * The base implementation of `_.indexOf` without support for binary searches.
64297          * 
64298          * @private
64299          * @param {Array}
64300          *            array The array to search.
64301          * @param {*}
64302          *            value The value to search for.
64303          * @param {number}
64304          *            fromIndex The index to search from.
64305          * @returns {number} Returns the index of the matched value, else `-1`.
64306          */
64307         function baseIndexOf(array, value, fromIndex) {
64308             if (value !== value) {
64309                 return indexOfNaN(array, fromIndex);
64310             }
64311             var index = fromIndex - 1,
64312                 length = array.length;
64313
64314             while (++index < length) {
64315                 if (array[index] === value) {
64316                     return index;
64317                 }
64318             }
64319             return -1;
64320         }
64321
64322         module.exports = baseIndexOf;
64323
64324     }, {
64325         "./indexOfNaN": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\indexOfNaN.js"
64326     }],
64327     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js": [function(require, module, exports) {
64328         var baseIsEqualDeep = require('./baseIsEqualDeep'),
64329             isObject = require('../lang/isObject'),
64330             isObjectLike = require('./isObjectLike');
64331
64332         /**
64333          * The base implementation of `_.isEqual` without support for `this` binding
64334          * `customizer` functions.
64335          * 
64336          * @private
64337          * @param {*}
64338          *            value The value to compare.
64339          * @param {*}
64340          *            other The other value to compare.
64341          * @param {Function}
64342          *            [customizer] The function to customize comparing values.
64343          * @param {boolean}
64344          *            [isLoose] Specify performing partial comparisons.
64345          * @param {Array}
64346          *            [stackA] Tracks traversed `value` objects.
64347          * @param {Array}
64348          *            [stackB] Tracks traversed `other` objects.
64349          * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
64350          */
64351         function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
64352             if (value === other) {
64353                 return true;
64354             }
64355             if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
64356                 return value !== value && other !== other;
64357             }
64358             return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
64359         }
64360
64361         module.exports = baseIsEqual;
64362
64363     }, {
64364         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
64365         "./baseIsEqualDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqualDeep.js",
64366         "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64367     }],
64368     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqualDeep.js": [function(require, module, exports) {
64369         var equalArrays = require('./equalArrays'),
64370             equalByTag = require('./equalByTag'),
64371             equalObjects = require('./equalObjects'),
64372             isArray = require('../lang/isArray'),
64373             isTypedArray = require('../lang/isTypedArray');
64374
64375         /** `Object#toString` result references. */
64376         var argsTag = '[object Arguments]',
64377             arrayTag = '[object Array]',
64378             objectTag = '[object Object]';
64379
64380         /** Used for native method references. */
64381         var objectProto = Object.prototype;
64382
64383         /** Used to check objects for own properties. */
64384         var hasOwnProperty = objectProto.hasOwnProperty;
64385
64386         /**
64387          * Used to resolve the
64388          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
64389          * of values.
64390          */
64391         var objToString = objectProto.toString;
64392
64393         /**
64394          * A specialized version of `baseIsEqual` for arrays and objects which performs
64395          * deep comparisons and tracks traversed objects enabling objects with circular
64396          * references to be compared.
64397          * 
64398          * @private
64399          * @param {Object}
64400          *            object The object to compare.
64401          * @param {Object}
64402          *            other The other object to compare.
64403          * @param {Function}
64404          *            equalFunc The function to determine equivalents of values.
64405          * @param {Function}
64406          *            [customizer] The function to customize comparing objects.
64407          * @param {boolean}
64408          *            [isLoose] Specify performing partial comparisons.
64409          * @param {Array}
64410          *            [stackA=[]] Tracks traversed `value` objects.
64411          * @param {Array}
64412          *            [stackB=[]] Tracks traversed `other` objects.
64413          * @returns {boolean} Returns `true` if the objects are equivalent, else
64414          *          `false`.
64415          */
64416         function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
64417             var objIsArr = isArray(object),
64418                 othIsArr = isArray(other),
64419                 objTag = arrayTag,
64420                 othTag = arrayTag;
64421
64422             if (!objIsArr) {
64423                 objTag = objToString.call(object);
64424                 if (objTag == argsTag) {
64425                     objTag = objectTag;
64426                 } else if (objTag != objectTag) {
64427                     objIsArr = isTypedArray(object);
64428                 }
64429             }
64430             if (!othIsArr) {
64431                 othTag = objToString.call(other);
64432                 if (othTag == argsTag) {
64433                     othTag = objectTag;
64434                 } else if (othTag != objectTag) {
64435                     othIsArr = isTypedArray(other);
64436                 }
64437             }
64438             var objIsObj = objTag == objectTag,
64439                 othIsObj = othTag == objectTag,
64440                 isSameTag = objTag == othTag;
64441
64442             if (isSameTag && !(objIsArr || objIsObj)) {
64443                 return equalByTag(object, other, objTag);
64444             }
64445             if (!isLoose) {
64446                 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
64447                     othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
64448
64449                 if (objIsWrapped || othIsWrapped) {
64450                     return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
64451                 }
64452             }
64453             if (!isSameTag) {
64454                 return false;
64455             }
64456             // Assume cyclic values are equal.
64457             // For more information on detecting circular references see
64458             // https://es5.github.io/#JO.
64459             stackA || (stackA = []);
64460             stackB || (stackB = []);
64461
64462             var length = stackA.length;
64463             while (length--) {
64464                 if (stackA[length] == object) {
64465                     return stackB[length] == other;
64466                 }
64467             }
64468             // Add `object` and `other` to the stack of traversed objects.
64469             stackA.push(object);
64470             stackB.push(other);
64471
64472             var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
64473
64474             stackA.pop();
64475             stackB.pop();
64476
64477             return result;
64478         }
64479
64480         module.exports = baseIsEqualDeep;
64481
64482     }, {
64483         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64484         "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64485         "./equalArrays": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalArrays.js",
64486         "./equalByTag": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalByTag.js",
64487         "./equalObjects": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalObjects.js"
64488     }],
64489     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsMatch.js": [function(require, module, exports) {
64490         var baseIsEqual = require('./baseIsEqual'),
64491             toObject = require('./toObject');
64492
64493         /**
64494          * The base implementation of `_.isMatch` without support for callback
64495          * shorthands and `this` binding.
64496          * 
64497          * @private
64498          * @param {Object}
64499          *            object The object to inspect.
64500          * @param {Array}
64501          *            matchData The propery names, values, and compare flags to match.
64502          * @param {Function}
64503          *            [customizer] The function to customize comparing objects.
64504          * @returns {boolean} Returns `true` if `object` is a match, else `false`.
64505          */
64506         function baseIsMatch(object, matchData, customizer) {
64507             var index = matchData.length,
64508                 length = index,
64509                 noCustomizer = !customizer;
64510
64511             if (object == null) {
64512                 return !length;
64513             }
64514             object = toObject(object);
64515             while (index--) {
64516                 var data = matchData[index];
64517                 if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) {
64518                     return false;
64519                 }
64520             }
64521             while (++index < length) {
64522                 data = matchData[index];
64523                 var key = data[0],
64524                     objValue = object[key],
64525                     srcValue = data[1];
64526
64527                 if (noCustomizer && data[2]) {
64528                     if (objValue === undefined && !(key in object)) {
64529                         return false;
64530                     }
64531                 } else {
64532                     var result = customizer ? customizer(objValue, srcValue, key) : undefined;
64533                     if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
64534                         return false;
64535                     }
64536                 }
64537             }
64538             return true;
64539         }
64540
64541         module.exports = baseIsMatch;
64542
64543     }, {
64544         "./baseIsEqual": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js",
64545         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64546     }],
64547     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js": [function(require, module, exports) {
64548         /**
64549          * The function whose prototype all chaining wrappers inherit from.
64550          * 
64551          * @private
64552          */
64553         function baseLodash() {
64554             // No operation performed.
64555         }
64556
64557         module.exports = baseLodash;
64558
64559     }, {}],
64560     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js": [function(require, module, exports) {
64561         var baseEach = require('./baseEach'),
64562             isArrayLike = require('./isArrayLike');
64563
64564         /**
64565          * The base implementation of `_.map` without support for callback shorthands
64566          * and `this` binding.
64567          * 
64568          * @private
64569          * @param {Array|Object|string}
64570          *            collection The collection to iterate over.
64571          * @param {Function}
64572          *            iteratee The function invoked per iteration.
64573          * @returns {Array} Returns the new mapped array.
64574          */
64575         function baseMap(collection, iteratee) {
64576             var index = -1,
64577                 result = isArrayLike(collection) ? Array(collection.length) : [];
64578
64579             baseEach(collection, function(value, key, collection) {
64580                 result[++index] = iteratee(value, key, collection);
64581             });
64582             return result;
64583         }
64584
64585         module.exports = baseMap;
64586
64587     }, {
64588         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
64589         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js"
64590     }],
64591     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatches.js": [function(require, module, exports) {
64592         var baseIsMatch = require('./baseIsMatch'),
64593             getMatchData = require('./getMatchData'),
64594             toObject = require('./toObject');
64595
64596         /**
64597          * The base implementation of `_.matches` which does not clone `source`.
64598          * 
64599          * @private
64600          * @param {Object}
64601          *            source The object of property values to match.
64602          * @returns {Function} Returns the new function.
64603          */
64604         function baseMatches(source) {
64605             var matchData = getMatchData(source);
64606             if (matchData.length == 1 && matchData[0][2]) {
64607                 var key = matchData[0][0],
64608                     value = matchData[0][1];
64609
64610                 return function(object) {
64611                     if (object == null) {
64612                         return false;
64613                     }
64614                     return object[key] === value && (value !== undefined || (key in toObject(object)));
64615                 };
64616             }
64617             return function(object) {
64618                 return baseIsMatch(object, matchData);
64619             };
64620         }
64621
64622         module.exports = baseMatches;
64623
64624     }, {
64625         "./baseIsMatch": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsMatch.js",
64626         "./getMatchData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getMatchData.js",
64627         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64628     }],
64629     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatchesProperty.js": [function(require, module, exports) {
64630         var baseGet = require('./baseGet'),
64631             baseIsEqual = require('./baseIsEqual'),
64632             baseSlice = require('./baseSlice'),
64633             isArray = require('../lang/isArray'),
64634             isKey = require('./isKey'),
64635             isStrictComparable = require('./isStrictComparable'),
64636             last = require('../array/last'),
64637             toObject = require('./toObject'),
64638             toPath = require('./toPath');
64639
64640         /**
64641          * The base implementation of `_.matchesProperty` which does not clone
64642          * `srcValue`.
64643          * 
64644          * @private
64645          * @param {string}
64646          *            path The path of the property to get.
64647          * @param {*}
64648          *            srcValue The value to compare.
64649          * @returns {Function} Returns the new function.
64650          */
64651         function baseMatchesProperty(path, srcValue) {
64652             var isArr = isArray(path),
64653                 isCommon = isKey(path) && isStrictComparable(srcValue),
64654                 pathKey = (path + '');
64655
64656             path = toPath(path);
64657             return function(object) {
64658                 if (object == null) {
64659                     return false;
64660                 }
64661                 var key = pathKey;
64662                 object = toObject(object);
64663                 if ((isArr || !isCommon) && !(key in object)) {
64664                     object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
64665                     if (object == null) {
64666                         return false;
64667                     }
64668                     key = last(path);
64669                     object = toObject(object);
64670                 }
64671                 return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true);
64672             };
64673         }
64674
64675         module.exports = baseMatchesProperty;
64676
64677     }, {
64678         "../array/last": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\last.js",
64679         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64680         "./baseGet": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js",
64681         "./baseIsEqual": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js",
64682         "./baseSlice": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSlice.js",
64683         "./isKey": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js",
64684         "./isStrictComparable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js",
64685         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js",
64686         "./toPath": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js"
64687     }],
64688     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMerge.js": [function(require, module, exports) {
64689         var arrayEach = require('./arrayEach'),
64690             baseMergeDeep = require('./baseMergeDeep'),
64691             isArray = require('../lang/isArray'),
64692             isArrayLike = require('./isArrayLike'),
64693             isObject = require('../lang/isObject'),
64694             isObjectLike = require('./isObjectLike'),
64695             isTypedArray = require('../lang/isTypedArray'),
64696             keys = require('../object/keys');
64697
64698         /**
64699          * The base implementation of `_.merge` without support for argument juggling,
64700          * multiple sources, and `this` binding `customizer` functions.
64701          * 
64702          * @private
64703          * @param {Object}
64704          *            object The destination object.
64705          * @param {Object}
64706          *            source The source object.
64707          * @param {Function}
64708          *            [customizer] The function to customize merged values.
64709          * @param {Array}
64710          *            [stackA=[]] Tracks traversed source objects.
64711          * @param {Array}
64712          *            [stackB=[]] Associates values with source counterparts.
64713          * @returns {Object} Returns `object`.
64714          */
64715         function baseMerge(object, source, customizer, stackA, stackB) {
64716             if (!isObject(object)) {
64717                 return object;
64718             }
64719             var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
64720                 props = isSrcArr ? undefined : keys(source);
64721
64722             arrayEach(props || source, function(srcValue, key) {
64723                 if (props) {
64724                     key = srcValue;
64725                     srcValue = source[key];
64726                 }
64727                 if (isObjectLike(srcValue)) {
64728                     stackA || (stackA = []);
64729                     stackB || (stackB = []);
64730                     baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
64731                 } else {
64732                     var value = object[key],
64733                         result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
64734                         isCommon = result === undefined;
64735
64736                     if (isCommon) {
64737                         result = srcValue;
64738                     }
64739                     if ((result !== undefined || (isSrcArr && !(key in object))) &&
64740                         (isCommon || (result === result ? (result !== value) : (value === value)))) {
64741                         object[key] = result;
64742                     }
64743                 }
64744             });
64745             return object;
64746         }
64747
64748         module.exports = baseMerge;
64749
64750     }, {
64751         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64752         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
64753         "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64754         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
64755         "./arrayEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js",
64756         "./baseMergeDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMergeDeep.js",
64757         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
64758         "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64759     }],
64760     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMergeDeep.js": [function(require, module, exports) {
64761         var arrayCopy = require('./arrayCopy'),
64762             isArguments = require('../lang/isArguments'),
64763             isArray = require('../lang/isArray'),
64764             isArrayLike = require('./isArrayLike'),
64765             isPlainObject = require('../lang/isPlainObject'),
64766             isTypedArray = require('../lang/isTypedArray'),
64767             toPlainObject = require('../lang/toPlainObject');
64768
64769         /**
64770          * A specialized version of `baseMerge` for arrays and objects which performs
64771          * deep merges and tracks traversed objects enabling objects with circular
64772          * references to be merged.
64773          * 
64774          * @private
64775          * @param {Object}
64776          *            object The destination object.
64777          * @param {Object}
64778          *            source The source object.
64779          * @param {string}
64780          *            key The key of the value to merge.
64781          * @param {Function}
64782          *            mergeFunc The function to merge values.
64783          * @param {Function}
64784          *            [customizer] The function to customize merged values.
64785          * @param {Array}
64786          *            [stackA=[]] Tracks traversed source objects.
64787          * @param {Array}
64788          *            [stackB=[]] Associates values with source counterparts.
64789          * @returns {boolean} Returns `true` if the objects are equivalent, else
64790          *          `false`.
64791          */
64792         function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
64793             var length = stackA.length,
64794                 srcValue = source[key];
64795
64796             while (length--) {
64797                 if (stackA[length] == srcValue) {
64798                     object[key] = stackB[length];
64799                     return;
64800                 }
64801             }
64802             var value = object[key],
64803                 result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
64804                 isCommon = result === undefined;
64805
64806             if (isCommon) {
64807                 result = srcValue;
64808                 if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
64809                     result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []);
64810                 } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
64811                     result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {});
64812                 } else {
64813                     isCommon = false;
64814                 }
64815             }
64816             // Add the source value to the stack of traversed objects and associate
64817             // it with its merged value.
64818             stackA.push(srcValue);
64819             stackB.push(result);
64820
64821             if (isCommon) {
64822                 // Recursively merge objects and arrays (susceptible to call stack limits).
64823                 object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
64824             } else if (result === result ? (result !== value) : (value === value)) {
64825                 object[key] = result;
64826             }
64827         }
64828
64829         module.exports = baseMergeDeep;
64830
64831     }, {
64832         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
64833         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64834         "../lang/isPlainObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isPlainObject.js",
64835         "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64836         "../lang/toPlainObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\toPlainObject.js",
64837         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
64838         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js"
64839     }],
64840     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js": [function(require, module, exports) {
64841         /**
64842          * The base implementation of `_.property` without support for deep paths.
64843          * 
64844          * @private
64845          * @param {string}
64846          *            key The key of the property to get.
64847          * @returns {Function} Returns the new function.
64848          */
64849         function baseProperty(key) {
64850             return function(object) {
64851                 return object == null ? undefined : object[key];
64852             };
64853         }
64854
64855         module.exports = baseProperty;
64856
64857     }, {}],
64858     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\basePropertyDeep.js": [function(require, module, exports) {
64859         var baseGet = require('./baseGet'),
64860             toPath = require('./toPath');
64861
64862         /**
64863          * A specialized version of `baseProperty` which supports deep paths.
64864          * 
64865          * @private
64866          * @param {Array|string}
64867          *            path The path of the property to get.
64868          * @returns {Function} Returns the new function.
64869          */
64870         function basePropertyDeep(path) {
64871             var pathKey = (path + '');
64872             path = toPath(path);
64873             return function(object) {
64874                 return baseGet(object, path, pathKey);
64875             };
64876         }
64877
64878         module.exports = basePropertyDeep;
64879
64880     }, {
64881         "./baseGet": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js",
64882         "./toPath": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js"
64883     }],
64884     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseReduce.js": [function(require, module, exports) {
64885         /**
64886          * The base implementation of `_.reduce` and `_.reduceRight` without support for
64887          * callback shorthands and `this` binding, which iterates over `collection`
64888          * using the provided `eachFunc`.
64889          * 
64890          * @private
64891          * @param {Array|Object|string}
64892          *            collection The collection to iterate over.
64893          * @param {Function}
64894          *            iteratee The function invoked per iteration.
64895          * @param {*}
64896          *            accumulator The initial value.
64897          * @param {boolean}
64898          *            initFromCollection Specify using the first or last element of
64899          *            `collection` as the initial value.
64900          * @param {Function}
64901          *            eachFunc The function to iterate over `collection`.
64902          * @returns {*} Returns the accumulated value.
64903          */
64904         function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
64905             eachFunc(collection, function(value, index, collection) {
64906                 accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
64907             });
64908             return accumulator;
64909         }
64910
64911         module.exports = baseReduce;
64912
64913     }, {}],
64914     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js": [function(require, module, exports) {
64915         var identity = require('../utility/identity'),
64916             metaMap = require('./metaMap');
64917
64918         /**
64919          * The base implementation of `setData` without support for hot loop detection.
64920          * 
64921          * @private
64922          * @param {Function}
64923          *            func The function to associate metadata with.
64924          * @param {*}
64925          *            data The metadata.
64926          * @returns {Function} Returns `func`.
64927          */
64928         var baseSetData = !metaMap ? identity : function(func, data) {
64929             metaMap.set(func, data);
64930             return func;
64931         };
64932
64933         module.exports = baseSetData;
64934
64935     }, {
64936         "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js",
64937         "./metaMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js"
64938     }],
64939     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSlice.js": [function(require, module, exports) {
64940         /**
64941          * The base implementation of `_.slice` without an iteratee call guard.
64942          * 
64943          * @private
64944          * @param {Array}
64945          *            array The array to slice.
64946          * @param {number}
64947          *            [start=0] The start position.
64948          * @param {number}
64949          *            [end=array.length] The end position.
64950          * @returns {Array} Returns the slice of `array`.
64951          */
64952         function baseSlice(array, start, end) {
64953             var index = -1,
64954                 length = array.length;
64955
64956             start = start == null ? 0 : (+start || 0);
64957             if (start < 0) {
64958                 start = -start > length ? 0 : (length + start);
64959             }
64960             end = (end === undefined || end > length) ? length : (+end || 0);
64961             if (end < 0) {
64962                 end += length;
64963             }
64964             length = start > end ? 0 : ((end - start) >>> 0);
64965             start >>>= 0;
64966
64967             var result = Array(length);
64968             while (++index < length) {
64969                 result[index] = array[index + start];
64970             }
64971             return result;
64972         }
64973
64974         module.exports = baseSlice;
64975
64976     }, {}],
64977     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSome.js": [function(require, module, exports) {
64978         var baseEach = require('./baseEach');
64979
64980         /**
64981          * The base implementation of `_.some` without support for callback shorthands
64982          * and `this` binding.
64983          * 
64984          * @private
64985          * @param {Array|Object|string}
64986          *            collection The collection to iterate over.
64987          * @param {Function}
64988          *            predicate The function invoked per iteration.
64989          * @returns {boolean} Returns `true` if any element passes the predicate check,
64990          *          else `false`.
64991          */
64992         function baseSome(collection, predicate) {
64993             var result;
64994
64995             baseEach(collection, function(value, index, collection) {
64996                 result = predicate(value, index, collection);
64997                 return !result;
64998             });
64999             return !!result;
65000         }
65001
65002         module.exports = baseSome;
65003
65004     }, {
65005         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
65006     }],
65007     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSortBy.js": [function(require, module, exports) {
65008         /**
65009          * The base implementation of `_.sortBy` which uses `comparer` to define the
65010          * sort order of `array` and replaces criteria objects with their corresponding
65011          * values.
65012          * 
65013          * @private
65014          * @param {Array}
65015          *            array The array to sort.
65016          * @param {Function}
65017          *            comparer The function to define sort order.
65018          * @returns {Array} Returns `array`.
65019          */
65020         function baseSortBy(array, comparer) {
65021             var length = array.length;
65022
65023             array.sort(comparer);
65024             while (length--) {
65025                 array[length] = array[length].value;
65026             }
65027             return array;
65028         }
65029
65030         module.exports = baseSortBy;
65031
65032     }, {}],
65033     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseToString.js": [function(require, module, exports) {
65034         /**
65035          * Converts `value` to a string if it's not one. An empty string is returned for
65036          * `null` or `undefined` values.
65037          * 
65038          * @private
65039          * @param {*}
65040          *            value The value to process.
65041          * @returns {string} Returns the string.
65042          */
65043         function baseToString(value) {
65044             return value == null ? '' : (value + '');
65045         }
65046
65047         module.exports = baseToString;
65048
65049     }, {}],
65050     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseUniq.js": [function(require, module, exports) {
65051         var baseIndexOf = require('./baseIndexOf'),
65052             cacheIndexOf = require('./cacheIndexOf'),
65053             createCache = require('./createCache');
65054
65055         /** Used as the size to enable large array optimizations. */
65056         var LARGE_ARRAY_SIZE = 200;
65057
65058         /**
65059          * The base implementation of `_.uniq` without support for callback shorthands
65060          * and `this` binding.
65061          * 
65062          * @private
65063          * @param {Array}
65064          *            array The array to inspect.
65065          * @param {Function}
65066          *            [iteratee] The function invoked per iteration.
65067          * @returns {Array} Returns the new duplicate free array.
65068          */
65069         function baseUniq(array, iteratee) {
65070             var index = -1,
65071                 indexOf = baseIndexOf,
65072                 length = array.length,
65073                 isCommon = true,
65074                 isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
65075                 seen = isLarge ? createCache() : null,
65076                 result = [];
65077
65078             if (seen) {
65079                 indexOf = cacheIndexOf;
65080                 isCommon = false;
65081             } else {
65082                 isLarge = false;
65083                 seen = iteratee ? [] : result;
65084             }
65085             outer:
65086                 while (++index < length) {
65087                     var value = array[index],
65088                         computed = iteratee ? iteratee(value, index, array) : value;
65089
65090                     if (isCommon && value === value) {
65091                         var seenIndex = seen.length;
65092                         while (seenIndex--) {
65093                             if (seen[seenIndex] === computed) {
65094                                 continue outer;
65095                             }
65096                         }
65097                         if (iteratee) {
65098                             seen.push(computed);
65099                         }
65100                         result.push(value);
65101                     } else if (indexOf(seen, computed, 0) < 0) {
65102                         if (iteratee || isLarge) {
65103                             seen.push(computed);
65104                         }
65105                         result.push(value);
65106                     }
65107                 }
65108             return result;
65109         }
65110
65111         module.exports = baseUniq;
65112
65113     }, {
65114         "./baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
65115         "./cacheIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js",
65116         "./createCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js"
65117     }],
65118     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseValues.js": [function(require, module, exports) {
65119         /**
65120          * The base implementation of `_.values` and `_.valuesIn` which creates an array
65121          * of `object` property values corresponding to the property names of `props`.
65122          * 
65123          * @private
65124          * @param {Object}
65125          *            object The object to query.
65126          * @param {Array}
65127          *            props The property names to get values for.
65128          * @returns {Object} Returns the array of property values.
65129          */
65130         function baseValues(object, props) {
65131             var index = -1,
65132                 length = props.length,
65133                 result = Array(length);
65134
65135             while (++index < length) {
65136                 result[index] = object[props[index]];
65137             }
65138             return result;
65139         }
65140
65141         module.exports = baseValues;
65142
65143     }, {}],
65144     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js": [function(require, module, exports) {
65145         var identity = require('../utility/identity');
65146
65147         /**
65148          * A specialized version of `baseCallback` which only supports `this` binding
65149          * and specifying the number of arguments to provide to `func`.
65150          * 
65151          * @private
65152          * @param {Function}
65153          *            func The function to bind.
65154          * @param {*}
65155          *            thisArg The `this` binding of `func`.
65156          * @param {number}
65157          *            [argCount] The number of arguments to provide to `func`.
65158          * @returns {Function} Returns the callback.
65159          */
65160         function bindCallback(func, thisArg, argCount) {
65161             if (typeof func != 'function') {
65162                 return identity;
65163             }
65164             if (thisArg === undefined) {
65165                 return func;
65166             }
65167             switch (argCount) {
65168                 case 1:
65169                     return function(value) {
65170                         return func.call(thisArg, value);
65171                     };
65172                 case 3:
65173                     return function(value, index, collection) {
65174                         return func.call(thisArg, value, index, collection);
65175                     };
65176                 case 4:
65177                     return function(accumulator, value, index, collection) {
65178                         return func.call(thisArg, accumulator, value, index, collection);
65179                     };
65180                 case 5:
65181                     return function(value, other, key, object, source) {
65182                         return func.call(thisArg, value, other, key, object, source);
65183                     };
65184             }
65185             return function() {
65186                 return func.apply(thisArg, arguments);
65187             };
65188         }
65189
65190         module.exports = bindCallback;
65191
65192     }, {
65193         "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js"
65194     }],
65195     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js": [function(require, module, exports) {
65196         var isObject = require('../lang/isObject');
65197
65198         /**
65199          * Checks if `value` is in `cache` mimicking the return signature of `_.indexOf`
65200          * by returning `0` if the value is found, else `-1`.
65201          * 
65202          * @private
65203          * @param {Object}
65204          *            cache The cache to search.
65205          * @param {*}
65206          *            value The value to search for.
65207          * @returns {number} Returns `0` if `value` is found, else `-1`.
65208          */
65209         function cacheIndexOf(cache, value) {
65210             var data = cache.data,
65211                 result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
65212
65213             return result ? 0 : -1;
65214         }
65215
65216         module.exports = cacheIndexOf;
65217
65218     }, {
65219         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
65220     }],
65221     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cachePush.js": [function(require, module, exports) {
65222         var isObject = require('../lang/isObject');
65223
65224         /**
65225          * Adds `value` to the cache.
65226          * 
65227          * @private
65228          * @name push
65229          * @memberOf SetCache
65230          * @param {*}
65231          *            value The value to cache.
65232          */
65233         function cachePush(value) {
65234             var data = this.data;
65235             if (typeof value == 'string' || isObject(value)) {
65236                 data.set.add(value);
65237             } else {
65238                 data.hash[value] = true;
65239             }
65240         }
65241
65242         module.exports = cachePush;
65243
65244     }, {
65245         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
65246     }],
65247     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\compareAscending.js": [function(require, module, exports) {
65248         var baseCompareAscending = require('./baseCompareAscending');
65249
65250         /**
65251          * Used by `_.sortBy` to compare transformed elements of a collection and stable
65252          * sort them in ascending order.
65253          * 
65254          * @private
65255          * @param {Object}
65256          *            object The object to compare.
65257          * @param {Object}
65258          *            other The other object to compare.
65259          * @returns {number} Returns the sort order indicator for `object`.
65260          */
65261         function compareAscending(object, other) {
65262             return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
65263         }
65264
65265         module.exports = compareAscending;
65266
65267     }, {
65268         "./baseCompareAscending": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCompareAscending.js"
65269     }],
65270     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js": [function(require, module, exports) {
65271         /*
65272          * Native method references for those with the same name as other `lodash`
65273          * methods.
65274          */
65275         var nativeMax = Math.max;
65276
65277         /**
65278          * Creates an array that is the composition of partially applied arguments,
65279          * placeholders, and provided arguments into a single array of arguments.
65280          * 
65281          * @private
65282          * @param {Array|Object}
65283          *            args The provided arguments.
65284          * @param {Array}
65285          *            partials The arguments to prepend to those provided.
65286          * @param {Array}
65287          *            holders The `partials` placeholder indexes.
65288          * @returns {Array} Returns the new array of composed arguments.
65289          */
65290         function composeArgs(args, partials, holders) {
65291             var holdersLength = holders.length,
65292                 argsIndex = -1,
65293                 argsLength = nativeMax(args.length - holdersLength, 0),
65294                 leftIndex = -1,
65295                 leftLength = partials.length,
65296                 result = Array(leftLength + argsLength);
65297
65298             while (++leftIndex < leftLength) {
65299                 result[leftIndex] = partials[leftIndex];
65300             }
65301             while (++argsIndex < holdersLength) {
65302                 result[holders[argsIndex]] = args[argsIndex];
65303             }
65304             while (argsLength--) {
65305                 result[leftIndex++] = args[argsIndex++];
65306             }
65307             return result;
65308         }
65309
65310         module.exports = composeArgs;
65311
65312     }, {}],
65313     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js": [function(require, module, exports) {
65314         /*
65315          * Native method references for those with the same name as other `lodash`
65316          * methods.
65317          */
65318         var nativeMax = Math.max;
65319
65320         /**
65321          * This function is like `composeArgs` except that the arguments composition is
65322          * tailored for `_.partialRight`.
65323          * 
65324          * @private
65325          * @param {Array|Object}
65326          *            args The provided arguments.
65327          * @param {Array}
65328          *            partials The arguments to append to those provided.
65329          * @param {Array}
65330          *            holders The `partials` placeholder indexes.
65331          * @returns {Array} Returns the new array of composed arguments.
65332          */
65333         function composeArgsRight(args, partials, holders) {
65334             var holdersIndex = -1,
65335                 holdersLength = holders.length,
65336                 argsIndex = -1,
65337                 argsLength = nativeMax(args.length - holdersLength, 0),
65338                 rightIndex = -1,
65339                 rightLength = partials.length,
65340                 result = Array(argsLength + rightLength);
65341
65342             while (++argsIndex < argsLength) {
65343                 result[argsIndex] = args[argsIndex];
65344             }
65345             var offset = argsIndex;
65346             while (++rightIndex < rightLength) {
65347                 result[offset + rightIndex] = partials[rightIndex];
65348             }
65349             while (++holdersIndex < holdersLength) {
65350                 result[offset + holders[holdersIndex]] = args[argsIndex++];
65351             }
65352             return result;
65353         }
65354
65355         module.exports = composeArgsRight;
65356
65357     }, {}],
65358     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAggregator.js": [function(require, module, exports) {
65359         var baseCallback = require('./baseCallback'),
65360             baseEach = require('./baseEach'),
65361             isArray = require('../lang/isArray');
65362
65363         /**
65364          * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.
65365          * 
65366          * @private
65367          * @param {Function}
65368          *            setter The function to set keys and values of the accumulator
65369          *            object.
65370          * @param {Function}
65371          *            [initializer] The function to initialize the accumulator object.
65372          * @returns {Function} Returns the new aggregator function.
65373          */
65374         function createAggregator(setter, initializer) {
65375             return function(collection, iteratee, thisArg) {
65376                 var result = initializer ? initializer() : {};
65377                 iteratee = baseCallback(iteratee, thisArg, 3);
65378
65379                 if (isArray(collection)) {
65380                     var index = -1,
65381                         length = collection.length;
65382
65383                     while (++index < length) {
65384                         var value = collection[index];
65385                         setter(result, value, iteratee(value, index, collection), collection);
65386                     }
65387                 } else {
65388                     baseEach(collection, function(value, key, collection) {
65389                         setter(result, value, iteratee(value, key, collection), collection);
65390                     });
65391                 }
65392                 return result;
65393             };
65394         }
65395
65396         module.exports = createAggregator;
65397
65398     }, {
65399         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65400         "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65401         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
65402     }],
65403     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js": [function(require, module, exports) {
65404         var bindCallback = require('./bindCallback'),
65405             isIterateeCall = require('./isIterateeCall'),
65406             restParam = require('../function/restParam');
65407
65408         /**
65409          * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
65410          * 
65411          * @private
65412          * @param {Function}
65413          *            assigner The function to assign values.
65414          * @returns {Function} Returns the new assigner function.
65415          */
65416         function createAssigner(assigner) {
65417             return restParam(function(object, sources) {
65418                 var index = -1,
65419                     length = object == null ? 0 : sources.length,
65420                     customizer = length > 2 ? sources[length - 2] : undefined,
65421                     guard = length > 2 ? sources[2] : undefined,
65422                     thisArg = length > 1 ? sources[length - 1] : undefined;
65423
65424                 if (typeof customizer == 'function') {
65425                     customizer = bindCallback(customizer, thisArg, 5);
65426                     length -= 2;
65427                 } else {
65428                     customizer = typeof thisArg == 'function' ? thisArg : undefined;
65429                     length -= (customizer ? 1 : 0);
65430                 }
65431                 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
65432                     customizer = length < 3 ? undefined : customizer;
65433                     length = 1;
65434                 }
65435                 while (++index < length) {
65436                     var source = sources[index];
65437                     if (source) {
65438                         assigner(object, source, customizer);
65439                     }
65440                 }
65441                 return object;
65442             });
65443         }
65444
65445         module.exports = createAssigner;
65446
65447     }, {
65448         "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
65449         "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
65450         "./isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
65451     }],
65452     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseEach.js": [function(require, module, exports) {
65453         var getLength = require('./getLength'),
65454             isLength = require('./isLength'),
65455             toObject = require('./toObject');
65456
65457         /**
65458          * Creates a `baseEach` or `baseEachRight` function.
65459          * 
65460          * @private
65461          * @param {Function}
65462          *            eachFunc The function to iterate over a collection.
65463          * @param {boolean}
65464          *            [fromRight] Specify iterating from right to left.
65465          * @returns {Function} Returns the new base function.
65466          */
65467         function createBaseEach(eachFunc, fromRight) {
65468             return function(collection, iteratee) {
65469                 var length = collection ? getLength(collection) : 0;
65470                 if (!isLength(length)) {
65471                     return eachFunc(collection, iteratee);
65472                 }
65473                 var index = fromRight ? length : -1,
65474                     iterable = toObject(collection);
65475
65476                 while ((fromRight ? index-- : ++index < length)) {
65477                     if (iteratee(iterable[index], index, iterable) === false) {
65478                         break;
65479                     }
65480                 }
65481                 return collection;
65482             };
65483         }
65484
65485         module.exports = createBaseEach;
65486
65487     }, {
65488         "./getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
65489         "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
65490         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
65491     }],
65492     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseFor.js": [function(require, module, exports) {
65493         var toObject = require('./toObject');
65494
65495         /**
65496          * Creates a base function for `_.forIn` or `_.forInRight`.
65497          * 
65498          * @private
65499          * @param {boolean}
65500          *            [fromRight] Specify iterating from right to left.
65501          * @returns {Function} Returns the new base function.
65502          */
65503         function createBaseFor(fromRight) {
65504             return function(object, iteratee, keysFunc) {
65505                 var iterable = toObject(object),
65506                     props = keysFunc(object),
65507                     length = props.length,
65508                     index = fromRight ? length : -1;
65509
65510                 while ((fromRight ? index-- : ++index < length)) {
65511                     var key = props[index];
65512                     if (iteratee(iterable[key], key, iterable) === false) {
65513                         break;
65514                     }
65515                 }
65516                 return object;
65517             };
65518         }
65519
65520         module.exports = createBaseFor;
65521
65522     }, {
65523         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
65524     }],
65525     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBindWrapper.js": [function(require, module, exports) {
65526         (function(global) {
65527             var createCtorWrapper = require('./createCtorWrapper');
65528
65529             /**
65530              * Creates a function that wraps `func` and invokes it with the `this` binding
65531              * of `thisArg`.
65532              * 
65533              * @private
65534              * @param {Function}
65535              *            func The function to bind.
65536              * @param {*}
65537              *            [thisArg] The `this` binding of `func`.
65538              * @returns {Function} Returns the new bound function.
65539              */
65540             function createBindWrapper(func, thisArg) {
65541                 var Ctor = createCtorWrapper(func);
65542
65543                 function wrapper() {
65544                     var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
65545                     return fn.apply(thisArg, arguments);
65546                 }
65547                 return wrapper;
65548             }
65549
65550             module.exports = createBindWrapper;
65551
65552         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65553     }, {
65554         "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js"
65555     }],
65556     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js": [function(require, module, exports) {
65557         (function(global) {
65558             var SetCache = require('./SetCache'),
65559                 getNative = require('./getNative');
65560
65561             /** Native method references. */
65562             var Set = getNative(global, 'Set');
65563
65564             /*
65565              * Native method references for those with the same name as other `lodash`
65566              * methods.
65567              */
65568             var nativeCreate = getNative(Object, 'create');
65569
65570             /**
65571              * Creates a `Set` cache object to optimize linear searches of large arrays.
65572              * 
65573              * @private
65574              * @param {Array}
65575              *            [values] The values to cache.
65576              * @returns {null|Object} Returns the new cache object if `Set` is supported,
65577              *          else `null`.
65578              */
65579             function createCache(values) {
65580                 return (nativeCreate && Set) ? new SetCache(values) : null;
65581             }
65582
65583             module.exports = createCache;
65584
65585         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65586     }, {
65587         "./SetCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\SetCache.js",
65588         "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
65589     }],
65590     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js": [function(require, module, exports) {
65591         var baseCreate = require('./baseCreate'),
65592             isObject = require('../lang/isObject');
65593
65594         /**
65595          * Creates a function that produces an instance of `Ctor` regardless of whether
65596          * it was invoked as part of a `new` expression or by `call` or `apply`.
65597          * 
65598          * @private
65599          * @param {Function}
65600          *            Ctor The constructor to wrap.
65601          * @returns {Function} Returns the new wrapped function.
65602          */
65603         function createCtorWrapper(Ctor) {
65604             return function() {
65605                 // Use a `switch` statement to work with class constructors.
65606                 // See
65607                 // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
65608                 // for more details.
65609                 var args = arguments;
65610                 switch (args.length) {
65611                     case 0:
65612                         return new Ctor;
65613                     case 1:
65614                         return new Ctor(args[0]);
65615                     case 2:
65616                         return new Ctor(args[0], args[1]);
65617                     case 3:
65618                         return new Ctor(args[0], args[1], args[2]);
65619                     case 4:
65620                         return new Ctor(args[0], args[1], args[2], args[3]);
65621                     case 5:
65622                         return new Ctor(args[0], args[1], args[2], args[3], args[4]);
65623                     case 6:
65624                         return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
65625                     case 7:
65626                         return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
65627                 }
65628                 var thisBinding = baseCreate(Ctor.prototype),
65629                     result = Ctor.apply(thisBinding, args);
65630
65631                 // Mimic the constructor's `return` behavior.
65632                 // See https://es5.github.io/#x13.2.2 for more details.
65633                 return isObject(result) ? result : thisBinding;
65634             };
65635         }
65636
65637         module.exports = createCtorWrapper;
65638
65639     }, {
65640         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
65641         "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js"
65642     }],
65643     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createFind.js": [function(require, module, exports) {
65644         var baseCallback = require('./baseCallback'),
65645             baseFind = require('./baseFind'),
65646             baseFindIndex = require('./baseFindIndex'),
65647             isArray = require('../lang/isArray');
65648
65649         /**
65650          * Creates a `_.find` or `_.findLast` function.
65651          * 
65652          * @private
65653          * @param {Function}
65654          *            eachFunc The function to iterate over a collection.
65655          * @param {boolean}
65656          *            [fromRight] Specify iterating from right to left.
65657          * @returns {Function} Returns the new find function.
65658          */
65659         function createFind(eachFunc, fromRight) {
65660             return function(collection, predicate, thisArg) {
65661                 predicate = baseCallback(predicate, thisArg, 3);
65662                 if (isArray(collection)) {
65663                     var index = baseFindIndex(collection, predicate, fromRight);
65664                     return index > -1 ? collection[index] : undefined;
65665                 }
65666                 return baseFind(collection, predicate, eachFunc);
65667             };
65668         }
65669
65670         module.exports = createFind;
65671
65672     }, {
65673         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65674         "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65675         "./baseFind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFind.js",
65676         "./baseFindIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFindIndex.js"
65677     }],
65678     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createForEach.js": [function(require, module, exports) {
65679         var bindCallback = require('./bindCallback'),
65680             isArray = require('../lang/isArray');
65681
65682         /**
65683          * Creates a function for `_.forEach` or `_.forEachRight`.
65684          * 
65685          * @private
65686          * @param {Function}
65687          *            arrayFunc The function to iterate over an array.
65688          * @param {Function}
65689          *            eachFunc The function to iterate over a collection.
65690          * @returns {Function} Returns the new each function.
65691          */
65692         function createForEach(arrayFunc, eachFunc) {
65693             return function(collection, iteratee, thisArg) {
65694                 return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
65695             };
65696         }
65697
65698         module.exports = createForEach;
65699
65700     }, {
65701         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65702         "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js"
65703     }],
65704     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createHybridWrapper.js": [function(require, module, exports) {
65705         (function(global) {
65706             var arrayCopy = require('./arrayCopy'),
65707                 composeArgs = require('./composeArgs'),
65708                 composeArgsRight = require('./composeArgsRight'),
65709                 createCtorWrapper = require('./createCtorWrapper'),
65710                 isLaziable = require('./isLaziable'),
65711                 reorder = require('./reorder'),
65712                 replaceHolders = require('./replaceHolders'),
65713                 setData = require('./setData');
65714
65715             /** Used to compose bitmasks for wrapper metadata. */
65716             var BIND_FLAG = 1,
65717                 BIND_KEY_FLAG = 2,
65718                 CURRY_BOUND_FLAG = 4,
65719                 CURRY_FLAG = 8,
65720                 CURRY_RIGHT_FLAG = 16,
65721                 PARTIAL_FLAG = 32,
65722                 PARTIAL_RIGHT_FLAG = 64,
65723                 ARY_FLAG = 128;
65724
65725             /*
65726              * Native method references for those with the same name as other `lodash`
65727              * methods.
65728              */
65729             var nativeMax = Math.max;
65730
65731             /**
65732              * Creates a function that wraps `func` and invokes it with optional `this`
65733              * binding of, partial application, and currying.
65734              * 
65735              * @private
65736              * @param {Function|string}
65737              *            func The function or method name to reference.
65738              * @param {number}
65739              *            bitmask The bitmask of flags. See `createWrapper` for more
65740              *            details.
65741              * @param {*}
65742              *            [thisArg] The `this` binding of `func`.
65743              * @param {Array}
65744              *            [partials] The arguments to prepend to those provided to the new
65745              *            function.
65746              * @param {Array}
65747              *            [holders] The `partials` placeholder indexes.
65748              * @param {Array}
65749              *            [partialsRight] The arguments to append to those provided to the
65750              *            new function.
65751              * @param {Array}
65752              *            [holdersRight] The `partialsRight` placeholder indexes.
65753              * @param {Array}
65754              *            [argPos] The argument positions of the new function.
65755              * @param {number}
65756              *            [ary] The arity cap of `func`.
65757              * @param {number}
65758              *            [arity] The arity of `func`.
65759              * @returns {Function} Returns the new wrapped function.
65760              */
65761             function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
65762                 var isAry = bitmask & ARY_FLAG,
65763                     isBind = bitmask & BIND_FLAG,
65764                     isBindKey = bitmask & BIND_KEY_FLAG,
65765                     isCurry = bitmask & CURRY_FLAG,
65766                     isCurryBound = bitmask & CURRY_BOUND_FLAG,
65767                     isCurryRight = bitmask & CURRY_RIGHT_FLAG,
65768                     Ctor = isBindKey ? undefined : createCtorWrapper(func);
65769
65770                 function wrapper() {
65771                     // Avoid `arguments` object use disqualifying optimizations by
65772                     // converting it to an array before providing it to other functions.
65773                     var length = arguments.length,
65774                         index = length,
65775                         args = Array(length);
65776
65777                     while (index--) {
65778                         args[index] = arguments[index];
65779                     }
65780                     if (partials) {
65781                         args = composeArgs(args, partials, holders);
65782                     }
65783                     if (partialsRight) {
65784                         args = composeArgsRight(args, partialsRight, holdersRight);
65785                     }
65786                     if (isCurry || isCurryRight) {
65787                         var placeholder = wrapper.placeholder,
65788                             argsHolders = replaceHolders(args, placeholder);
65789
65790                         length -= argsHolders.length;
65791                         if (length < arity) {
65792                             var newArgPos = argPos ? arrayCopy(argPos) : undefined,
65793                                 newArity = nativeMax(arity - length, 0),
65794                                 newsHolders = isCurry ? argsHolders : undefined,
65795                                 newHoldersRight = isCurry ? undefined : argsHolders,
65796                                 newPartials = isCurry ? args : undefined,
65797                                 newPartialsRight = isCurry ? undefined : args;
65798
65799                             bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
65800                             bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
65801
65802                             if (!isCurryBound) {
65803                                 bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
65804                             }
65805                             var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
65806                                 result = createHybridWrapper.apply(undefined, newData);
65807
65808                             if (isLaziable(func)) {
65809                                 setData(result, newData);
65810                             }
65811                             result.placeholder = placeholder;
65812                             return result;
65813                         }
65814                     }
65815                     var thisBinding = isBind ? thisArg : this,
65816                         fn = isBindKey ? thisBinding[func] : func;
65817
65818                     if (argPos) {
65819                         args = reorder(args, argPos);
65820                     }
65821                     if (isAry && ary < args.length) {
65822                         args.length = ary;
65823                     }
65824                     if (this && this !== global && this instanceof wrapper) {
65825                         fn = Ctor || createCtorWrapper(func);
65826                     }
65827                     return fn.apply(thisBinding, args);
65828                 }
65829                 return wrapper;
65830             }
65831
65832             module.exports = createHybridWrapper;
65833
65834         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65835     }, {
65836         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
65837         "./composeArgs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js",
65838         "./composeArgsRight": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js",
65839         "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js",
65840         "./isLaziable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLaziable.js",
65841         "./reorder": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\reorder.js",
65842         "./replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js",
65843         "./setData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js"
65844     }],
65845     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createPartialWrapper.js": [function(require, module, exports) {
65846         (function(global) {
65847             var createCtorWrapper = require('./createCtorWrapper');
65848
65849             /** Used to compose bitmasks for wrapper metadata. */
65850             var BIND_FLAG = 1;
65851
65852             /**
65853              * Creates a function that wraps `func` and invokes it with the optional `this`
65854              * binding of `thisArg` and the `partials` prepended to those provided to the
65855              * wrapper.
65856              * 
65857              * @private
65858              * @param {Function}
65859              *            func The function to partially apply arguments to.
65860              * @param {number}
65861              *            bitmask The bitmask of flags. See `createWrapper` for more
65862              *            details.
65863              * @param {*}
65864              *            thisArg The `this` binding of `func`.
65865              * @param {Array}
65866              *            partials The arguments to prepend to those provided to the new
65867              *            function.
65868              * @returns {Function} Returns the new bound function.
65869              */
65870             function createPartialWrapper(func, bitmask, thisArg, partials) {
65871                 var isBind = bitmask & BIND_FLAG,
65872                     Ctor = createCtorWrapper(func);
65873
65874                 function wrapper() {
65875                     // Avoid `arguments` object use disqualifying optimizations by
65876                     // converting it to an array before providing it `func`.
65877                     var argsIndex = -1,
65878                         argsLength = arguments.length,
65879                         leftIndex = -1,
65880                         leftLength = partials.length,
65881                         args = Array(leftLength + argsLength);
65882
65883                     while (++leftIndex < leftLength) {
65884                         args[leftIndex] = partials[leftIndex];
65885                     }
65886                     while (argsLength--) {
65887                         args[leftIndex++] = arguments[++argsIndex];
65888                     }
65889                     var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
65890                     return fn.apply(isBind ? thisArg : this, args);
65891                 }
65892                 return wrapper;
65893             }
65894
65895             module.exports = createPartialWrapper;
65896
65897         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65898     }, {
65899         "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js"
65900     }],
65901     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createReduce.js": [function(require, module, exports) {
65902         var baseCallback = require('./baseCallback'),
65903             baseReduce = require('./baseReduce'),
65904             isArray = require('../lang/isArray');
65905
65906         /**
65907          * Creates a function for `_.reduce` or `_.reduceRight`.
65908          * 
65909          * @private
65910          * @param {Function}
65911          *            arrayFunc The function to iterate over an array.
65912          * @param {Function}
65913          *            eachFunc The function to iterate over a collection.
65914          * @returns {Function} Returns the new each function.
65915          */
65916         function createReduce(arrayFunc, eachFunc) {
65917             return function(collection, iteratee, accumulator, thisArg) {
65918                 var initFromArray = arguments.length < 3;
65919                 return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
65920             };
65921         }
65922
65923         module.exports = createReduce;
65924
65925     }, {
65926         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65927         "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65928         "./baseReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseReduce.js"
65929     }],
65930     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createWrapper.js": [function(require, module, exports) {
65931         var baseSetData = require('./baseSetData'),
65932             createBindWrapper = require('./createBindWrapper'),
65933             createHybridWrapper = require('./createHybridWrapper'),
65934             createPartialWrapper = require('./createPartialWrapper'),
65935             getData = require('./getData'),
65936             mergeData = require('./mergeData'),
65937             setData = require('./setData');
65938
65939         /** Used to compose bitmasks for wrapper metadata. */
65940         var BIND_FLAG = 1,
65941             BIND_KEY_FLAG = 2,
65942             PARTIAL_FLAG = 32,
65943             PARTIAL_RIGHT_FLAG = 64;
65944
65945         /** Used as the `TypeError` message for "Functions" methods. */
65946         var FUNC_ERROR_TEXT = 'Expected a function';
65947
65948         /*
65949          * Native method references for those with the same name as other `lodash`
65950          * methods.
65951          */
65952         var nativeMax = Math.max;
65953
65954         /**
65955          * Creates a function that either curries or invokes `func` with optional `this`
65956          * binding and partially applied arguments.
65957          * 
65958          * @private
65959          * @param {Function|string}
65960          *            func The function or method name to reference.
65961          * @param {number}
65962          *            bitmask The bitmask of flags. The bitmask may be composed of the
65963          *            following flags: 1 - `_.bind` 2 - `_.bindKey` 4 - `_.curry` or
65964          *            `_.curryRight` of a bound function 8 - `_.curry` 16 -
65965          *            `_.curryRight` 32 - `_.partial` 64 - `_.partialRight` 128 -
65966          *            `_.rearg` 256 - `_.ary`
65967          * @param {*}
65968          *            [thisArg] The `this` binding of `func`.
65969          * @param {Array}
65970          *            [partials] The arguments to be partially applied.
65971          * @param {Array}
65972          *            [holders] The `partials` placeholder indexes.
65973          * @param {Array}
65974          *            [argPos] The argument positions of the new function.
65975          * @param {number}
65976          *            [ary] The arity cap of `func`.
65977          * @param {number}
65978          *            [arity] The arity of `func`.
65979          * @returns {Function} Returns the new wrapped function.
65980          */
65981         function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
65982             var isBindKey = bitmask & BIND_KEY_FLAG;
65983             if (!isBindKey && typeof func != 'function') {
65984                 throw new TypeError(FUNC_ERROR_TEXT);
65985             }
65986             var length = partials ? partials.length : 0;
65987             if (!length) {
65988                 bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
65989                 partials = holders = undefined;
65990             }
65991             length -= (holders ? holders.length : 0);
65992             if (bitmask & PARTIAL_RIGHT_FLAG) {
65993                 var partialsRight = partials,
65994                     holdersRight = holders;
65995
65996                 partials = holders = undefined;
65997             }
65998             var data = isBindKey ? undefined : getData(func),
65999                 newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
66000
66001             if (data) {
66002                 mergeData(newData, data);
66003                 bitmask = newData[1];
66004                 arity = newData[9];
66005             }
66006             newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0);
66007
66008             if (bitmask == BIND_FLAG) {
66009                 var result = createBindWrapper(newData[0], newData[2]);
66010             } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
66011                 result = createPartialWrapper.apply(undefined, newData);
66012             } else {
66013                 result = createHybridWrapper.apply(undefined, newData);
66014             }
66015             var setter = data ? baseSetData : setData;
66016             return setter(result, newData);
66017         }
66018
66019         module.exports = createWrapper;
66020
66021     }, {
66022         "./baseSetData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js",
66023         "./createBindWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBindWrapper.js",
66024         "./createHybridWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createHybridWrapper.js",
66025         "./createPartialWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createPartialWrapper.js",
66026         "./getData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js",
66027         "./mergeData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\mergeData.js",
66028         "./setData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js"
66029     }],
66030     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalArrays.js": [function(require, module, exports) {
66031         var arraySome = require('./arraySome');
66032
66033         /**
66034          * A specialized version of `baseIsEqualDeep` for arrays with support for
66035          * partial deep comparisons.
66036          * 
66037          * @private
66038          * @param {Array}
66039          *            array The array to compare.
66040          * @param {Array}
66041          *            other The other array to compare.
66042          * @param {Function}
66043          *            equalFunc The function to determine equivalents of values.
66044          * @param {Function}
66045          *            [customizer] The function to customize comparing arrays.
66046          * @param {boolean}
66047          *            [isLoose] Specify performing partial comparisons.
66048          * @param {Array}
66049          *            [stackA] Tracks traversed `value` objects.
66050          * @param {Array}
66051          *            [stackB] Tracks traversed `other` objects.
66052          * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
66053          */
66054         function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
66055             var index = -1,
66056                 arrLength = array.length,
66057                 othLength = other.length;
66058
66059             if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
66060                 return false;
66061             }
66062             // Ignore non-index properties.
66063             while (++index < arrLength) {
66064                 var arrValue = array[index],
66065                     othValue = other[index],
66066                     result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
66067
66068                 if (result !== undefined) {
66069                     if (result) {
66070                         continue;
66071                     }
66072                     return false;
66073                 }
66074                 // Recursively compare arrays (susceptible to call stack limits).
66075                 if (isLoose) {
66076                     if (!arraySome(other, function(othValue) {
66077                             return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
66078                         })) {
66079                         return false;
66080                     }
66081                 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
66082                     return false;
66083                 }
66084             }
66085             return true;
66086         }
66087
66088         module.exports = equalArrays;
66089
66090     }, {
66091         "./arraySome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js"
66092     }],
66093     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalByTag.js": [function(require, module, exports) {
66094         /** `Object#toString` result references. */
66095         var boolTag = '[object Boolean]',
66096             dateTag = '[object Date]',
66097             errorTag = '[object Error]',
66098             numberTag = '[object Number]',
66099             regexpTag = '[object RegExp]',
66100             stringTag = '[object String]';
66101
66102         /**
66103          * A specialized version of `baseIsEqualDeep` for comparing objects of the same
66104          * `toStringTag`.
66105          * 
66106          * **Note:** This function only supports comparing values with tags of
66107          * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
66108          * 
66109          * @private
66110          * @param {Object}
66111          *            object The object to compare.
66112          * @param {Object}
66113          *            other The other object to compare.
66114          * @param {string}
66115          *            tag The `toStringTag` of the objects to compare.
66116          * @returns {boolean} Returns `true` if the objects are equivalent, else
66117          *          `false`.
66118          */
66119         function equalByTag(object, other, tag) {
66120             switch (tag) {
66121                 case boolTag:
66122                 case dateTag:
66123                     // Coerce dates and booleans to numbers, dates to milliseconds and
66124                     // booleans
66125                     // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
66126                     return +object == +other;
66127
66128                 case errorTag:
66129                     return object.name == other.name && object.message == other.message;
66130
66131                 case numberTag:
66132                     // Treat `NaN` vs. `NaN` as equal.
66133                     return (object != +object) ? other != +other : object == +other;
66134
66135                 case regexpTag:
66136                 case stringTag:
66137                     // Coerce regexes to strings and treat strings primitives and string
66138                     // objects as equal. See https://es5.github.io/#x15.10.6.4 for more
66139                     // details.
66140                     return object == (other + '');
66141             }
66142             return false;
66143         }
66144
66145         module.exports = equalByTag;
66146
66147     }, {}],
66148     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalObjects.js": [function(require, module, exports) {
66149         var keys = require('../object/keys');
66150
66151         /** Used for native method references. */
66152         var objectProto = Object.prototype;
66153
66154         /** Used to check objects for own properties. */
66155         var hasOwnProperty = objectProto.hasOwnProperty;
66156
66157         /**
66158          * A specialized version of `baseIsEqualDeep` for objects with support for
66159          * partial deep comparisons.
66160          * 
66161          * @private
66162          * @param {Object}
66163          *            object The object to compare.
66164          * @param {Object}
66165          *            other The other object to compare.
66166          * @param {Function}
66167          *            equalFunc The function to determine equivalents of values.
66168          * @param {Function}
66169          *            [customizer] The function to customize comparing values.
66170          * @param {boolean}
66171          *            [isLoose] Specify performing partial comparisons.
66172          * @param {Array}
66173          *            [stackA] Tracks traversed `value` objects.
66174          * @param {Array}
66175          *            [stackB] Tracks traversed `other` objects.
66176          * @returns {boolean} Returns `true` if the objects are equivalent, else
66177          *          `false`.
66178          */
66179         function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
66180             var objProps = keys(object),
66181                 objLength = objProps.length,
66182                 othProps = keys(other),
66183                 othLength = othProps.length;
66184
66185             if (objLength != othLength && !isLoose) {
66186                 return false;
66187             }
66188             var index = objLength;
66189             while (index--) {
66190                 var key = objProps[index];
66191                 if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
66192                     return false;
66193                 }
66194             }
66195             var skipCtor = isLoose;
66196             while (++index < objLength) {
66197                 key = objProps[index];
66198                 var objValue = object[key],
66199                     othValue = other[key],
66200                     result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
66201
66202                 // Recursively compare objects (susceptible to call stack limits).
66203                 if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
66204                     return false;
66205                 }
66206                 skipCtor || (skipCtor = key == 'constructor');
66207             }
66208             if (!skipCtor) {
66209                 var objCtor = object.constructor,
66210                     othCtor = other.constructor;
66211
66212                 // Non `Object` object instances with different constructors are not equal.
66213                 if (objCtor != othCtor &&
66214                     ('constructor' in object && 'constructor' in other) &&
66215                     !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
66216                         typeof othCtor == 'function' && othCtor instanceof othCtor)) {
66217                     return false;
66218                 }
66219             }
66220             return true;
66221         }
66222
66223         module.exports = equalObjects;
66224
66225     }, {
66226         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
66227     }],
66228     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js": [function(require, module, exports) {
66229         var metaMap = require('./metaMap'),
66230             noop = require('../utility/noop');
66231
66232         /**
66233          * Gets metadata for `func`.
66234          * 
66235          * @private
66236          * @param {Function}
66237          *            func The function to query.
66238          * @returns {*} Returns the metadata for `func`.
66239          */
66240         var getData = !metaMap ? noop : function(func) {
66241             return metaMap.get(func);
66242         };
66243
66244         module.exports = getData;
66245
66246     }, {
66247         "../utility/noop": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\noop.js",
66248         "./metaMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js"
66249     }],
66250     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getFuncName.js": [function(require, module, exports) {
66251         var realNames = require('./realNames');
66252
66253         /**
66254          * Gets the name of `func`.
66255          * 
66256          * @private
66257          * @param {Function}
66258          *            func The function to query.
66259          * @returns {string} Returns the function name.
66260          */
66261         function getFuncName(func) {
66262             var result = (func.name + ''),
66263                 array = realNames[result],
66264                 length = array ? array.length : 0;
66265
66266             while (length--) {
66267                 var data = array[length],
66268                     otherFunc = data.func;
66269                 if (otherFunc == null || otherFunc == func) {
66270                     return data.name;
66271                 }
66272             }
66273             return result;
66274         }
66275
66276         module.exports = getFuncName;
66277
66278     }, {
66279         "./realNames": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\realNames.js"
66280     }],
66281     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js": [function(require, module, exports) {
66282         var baseProperty = require('./baseProperty');
66283
66284         /**
66285          * Gets the "length" property value of `object`.
66286          * 
66287          * **Note:** This function is used to avoid a [JIT
66288          * bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects Safari on
66289          * at least iOS 8.1-8.3 ARM64.
66290          * 
66291          * @private
66292          * @param {Object}
66293          *            object The object to query.
66294          * @returns {*} Returns the "length" value.
66295          */
66296         var getLength = baseProperty('length');
66297
66298         module.exports = getLength;
66299
66300     }, {
66301         "./baseProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js"
66302     }],
66303     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getMatchData.js": [function(require, module, exports) {
66304         var isStrictComparable = require('./isStrictComparable'),
66305             pairs = require('../object/pairs');
66306
66307         /**
66308          * Gets the propery names, values, and compare flags of `object`.
66309          * 
66310          * @private
66311          * @param {Object}
66312          *            object The object to query.
66313          * @returns {Array} Returns the match data of `object`.
66314          */
66315         function getMatchData(object) {
66316             var result = pairs(object),
66317                 length = result.length;
66318
66319             while (length--) {
66320                 result[length][2] = isStrictComparable(result[length][1]);
66321             }
66322             return result;
66323         }
66324
66325         module.exports = getMatchData;
66326
66327     }, {
66328         "../object/pairs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pairs.js",
66329         "./isStrictComparable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js"
66330     }],
66331     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js": [function(require, module, exports) {
66332         var isNative = require('../lang/isNative');
66333
66334         /**
66335          * Gets the native function at `key` of `object`.
66336          * 
66337          * @private
66338          * @param {Object}
66339          *            object The object to query.
66340          * @param {string}
66341          *            key The key of the method to get.
66342          * @returns {*} Returns the function if it's native, else `undefined`.
66343          */
66344         function getNative(object, key) {
66345             var value = object == null ? undefined : object[key];
66346             return isNative(value) ? value : undefined;
66347         }
66348
66349         module.exports = getNative;
66350
66351     }, {
66352         "../lang/isNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNative.js"
66353     }],
66354     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\indexOfNaN.js": [function(require, module, exports) {
66355         /**
66356          * Gets the index at which the first occurrence of `NaN` is found in `array`.
66357          * 
66358          * @private
66359          * @param {Array}
66360          *            array The array to search.
66361          * @param {number}
66362          *            fromIndex The index to search from.
66363          * @param {boolean}
66364          *            [fromRight] Specify iterating from right to left.
66365          * @returns {number} Returns the index of the matched `NaN`, else `-1`.
66366          */
66367         function indexOfNaN(array, fromIndex, fromRight) {
66368             var length = array.length,
66369                 index = fromIndex + (fromRight ? 0 : -1);
66370
66371             while ((fromRight ? index-- : ++index < length)) {
66372                 var other = array[index];
66373                 if (other !== other) {
66374                     return index;
66375                 }
66376             }
66377             return -1;
66378         }
66379
66380         module.exports = indexOfNaN;
66381
66382     }, {}],
66383     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js": [function(require, module, exports) {
66384         var getLength = require('./getLength'),
66385             isLength = require('./isLength');
66386
66387         /**
66388          * Checks if `value` is array-like.
66389          * 
66390          * @private
66391          * @param {*}
66392          *            value The value to check.
66393          * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
66394          */
66395         function isArrayLike(value) {
66396             return value != null && isLength(getLength(value));
66397         }
66398
66399         module.exports = isArrayLike;
66400
66401     }, {
66402         "./getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
66403         "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js"
66404     }],
66405     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js": [function(require, module, exports) {
66406         /** Used to detect unsigned integer values. */
66407         var reIsUint = /^\d+$/;
66408
66409         /**
66410          * Used as the [maximum
66411          * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
66412          * of an array-like value.
66413          */
66414         var MAX_SAFE_INTEGER = 9007199254740991;
66415
66416         /**
66417          * Checks if `value` is a valid array-like index.
66418          * 
66419          * @private
66420          * @param {*}
66421          *            value The value to check.
66422          * @param {number}
66423          *            [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
66424          * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
66425          */
66426         function isIndex(value, length) {
66427             value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
66428             length = length == null ? MAX_SAFE_INTEGER : length;
66429             return value > -1 && value % 1 == 0 && value < length;
66430         }
66431
66432         module.exports = isIndex;
66433
66434     }, {}],
66435     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js": [function(require, module, exports) {
66436         var isArrayLike = require('./isArrayLike'),
66437             isIndex = require('./isIndex'),
66438             isObject = require('../lang/isObject');
66439
66440         /**
66441          * Checks if the provided arguments are from an iteratee call.
66442          * 
66443          * @private
66444          * @param {*}
66445          *            value The potential iteratee value argument.
66446          * @param {*}
66447          *            index The potential iteratee index or key argument.
66448          * @param {*}
66449          *            object The potential iteratee object argument.
66450          * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
66451          *          else `false`.
66452          */
66453         function isIterateeCall(value, index, object) {
66454             if (!isObject(object)) {
66455                 return false;
66456             }
66457             var type = typeof index;
66458             if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) {
66459                 var other = object[index];
66460                 return value === value ? (value === other) : (other !== other);
66461             }
66462             return false;
66463         }
66464
66465         module.exports = isIterateeCall;
66466
66467     }, {
66468         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
66469         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
66470         "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js"
66471     }],
66472     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js": [function(require, module, exports) {
66473         var isArray = require('../lang/isArray'),
66474             toObject = require('./toObject');
66475
66476         /** Used to match property names within property paths. */
66477         var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
66478             reIsPlainProp = /^\w*$/;
66479
66480         /**
66481          * Checks if `value` is a property name and not a property path.
66482          * 
66483          * @private
66484          * @param {*}
66485          *            value The value to check.
66486          * @param {Object}
66487          *            [object] The object to query keys on.
66488          * @returns {boolean} Returns `true` if `value` is a property name, else
66489          *          `false`.
66490          */
66491         function isKey(value, object) {
66492             var type = typeof value;
66493             if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
66494                 return true;
66495             }
66496             if (isArray(value)) {
66497                 return false;
66498             }
66499             var result = !reIsDeepProp.test(value);
66500             return result || (object != null && value in toObject(object));
66501         }
66502
66503         module.exports = isKey;
66504
66505     }, {
66506         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66507         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
66508     }],
66509     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLaziable.js": [function(require, module, exports) {
66510         var LazyWrapper = require('./LazyWrapper'),
66511             getData = require('./getData'),
66512             getFuncName = require('./getFuncName'),
66513             lodash = require('../chain/lodash');
66514
66515         /**
66516          * Checks if `func` has a lazy counterpart.
66517          * 
66518          * @private
66519          * @param {Function}
66520          *            func The function to check.
66521          * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else
66522          *          `false`.
66523          */
66524         function isLaziable(func) {
66525             var funcName = getFuncName(func),
66526                 other = lodash[funcName];
66527
66528             if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
66529                 return false;
66530             }
66531             if (func === other) {
66532                 return true;
66533             }
66534             var data = getData(other);
66535             return !!data && func === data[0];
66536         }
66537
66538         module.exports = isLaziable;
66539
66540     }, {
66541         "../chain/lodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\chain\\lodash.js",
66542         "./LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
66543         "./getData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js",
66544         "./getFuncName": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getFuncName.js"
66545     }],
66546     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js": [function(require, module, exports) {
66547         /**
66548          * Used as the [maximum
66549          * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
66550          * of an array-like value.
66551          */
66552         var MAX_SAFE_INTEGER = 9007199254740991;
66553
66554         /**
66555          * Checks if `value` is a valid array-like length.
66556          * 
66557          * **Note:** This function is based on
66558          * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
66559          * 
66560          * @private
66561          * @param {*}
66562          *            value The value to check.
66563          * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
66564          */
66565         function isLength(value) {
66566             return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
66567         }
66568
66569         module.exports = isLength;
66570
66571     }, {}],
66572     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js": [function(require, module, exports) {
66573         /**
66574          * Checks if `value` is object-like.
66575          * 
66576          * @private
66577          * @param {*}
66578          *            value The value to check.
66579          * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
66580          */
66581         function isObjectLike(value) {
66582             return !!value && typeof value == 'object';
66583         }
66584
66585         module.exports = isObjectLike;
66586
66587     }, {}],
66588     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js": [function(require, module, exports) {
66589         var isObject = require('../lang/isObject');
66590
66591         /**
66592          * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
66593          * 
66594          * @private
66595          * @param {*}
66596          *            value The value to check.
66597          * @returns {boolean} Returns `true` if `value` if suitable for strict equality
66598          *          comparisons, else `false`.
66599          */
66600         function isStrictComparable(value) {
66601             return value === value && !isObject(value);
66602         }
66603
66604         module.exports = isStrictComparable;
66605
66606     }, {
66607         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
66608     }],
66609     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\mergeData.js": [function(require, module, exports) {
66610         var arrayCopy = require('./arrayCopy'),
66611             composeArgs = require('./composeArgs'),
66612             composeArgsRight = require('./composeArgsRight'),
66613             replaceHolders = require('./replaceHolders');
66614
66615         /** Used to compose bitmasks for wrapper metadata. */
66616         var BIND_FLAG = 1,
66617             CURRY_BOUND_FLAG = 4,
66618             CURRY_FLAG = 8,
66619             ARY_FLAG = 128,
66620             REARG_FLAG = 256;
66621
66622         /** Used as the internal argument placeholder. */
66623         var PLACEHOLDER = '__lodash_placeholder__';
66624
66625         /*
66626          * Native method references for those with the same name as other `lodash`
66627          * methods.
66628          */
66629         var nativeMin = Math.min;
66630
66631         /**
66632          * Merges the function metadata of `source` into `data`.
66633          * 
66634          * Merging metadata reduces the number of wrappers required to invoke a
66635          * function. This is possible because methods like `_.bind`, `_.curry`, and
66636          * `_.partial` may be applied regardless of execution order. Methods like
66637          * `_.ary` and `_.rearg` augment function arguments, making the order in which
66638          * they are executed important, preventing the merging of metadata. However, we
66639          * make an exception for a safe common case where curried functions have `_.ary`
66640          * and or `_.rearg` applied.
66641          * 
66642          * @private
66643          * @param {Array}
66644          *            data The destination metadata.
66645          * @param {Array}
66646          *            source The source metadata.
66647          * @returns {Array} Returns `data`.
66648          */
66649         function mergeData(data, source) {
66650             var bitmask = data[1],
66651                 srcBitmask = source[1],
66652                 newBitmask = bitmask | srcBitmask,
66653                 isCommon = newBitmask < ARY_FLAG;
66654
66655             var isCombo =
66656                 (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
66657                 (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
66658                 (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
66659
66660             // Exit early if metadata can't be merged.
66661             if (!(isCommon || isCombo)) {
66662                 return data;
66663             }
66664             // Use source `thisArg` if available.
66665             if (srcBitmask & BIND_FLAG) {
66666                 data[2] = source[2];
66667                 // Set when currying a bound function.
66668                 newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
66669             }
66670             // Compose partial arguments.
66671             var value = source[3];
66672             if (value) {
66673                 var partials = data[3];
66674                 data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
66675                 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
66676             }
66677             // Compose partial right arguments.
66678             value = source[5];
66679             if (value) {
66680                 partials = data[5];
66681                 data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
66682                 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
66683             }
66684             // Use source `argPos` if available.
66685             value = source[7];
66686             if (value) {
66687                 data[7] = arrayCopy(value);
66688             }
66689             // Use source `ary` if it's smaller.
66690             if (srcBitmask & ARY_FLAG) {
66691                 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
66692             }
66693             // Use source `arity` if one is not provided.
66694             if (data[9] == null) {
66695                 data[9] = source[9];
66696             }
66697             // Use source `func` and merge bitmasks.
66698             data[0] = source[0];
66699             data[1] = newBitmask;
66700
66701             return data;
66702         }
66703
66704         module.exports = mergeData;
66705
66706     }, {
66707         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
66708         "./composeArgs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js",
66709         "./composeArgsRight": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js",
66710         "./replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js"
66711     }],
66712     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js": [function(require, module, exports) {
66713         (function(global) {
66714             var getNative = require('./getNative');
66715
66716             /** Native method references. */
66717             var WeakMap = getNative(global, 'WeakMap');
66718
66719             /** Used to store function metadata. */
66720             var metaMap = WeakMap && new WeakMap;
66721
66722             module.exports = metaMap;
66723
66724         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
66725     }, {
66726         "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
66727     }],
66728     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js": [function(require, module, exports) {
66729         var toObject = require('./toObject');
66730
66731         /**
66732          * A specialized version of `_.pick` which picks `object` properties specified
66733          * by `props`.
66734          * 
66735          * @private
66736          * @param {Object}
66737          *            object The source object.
66738          * @param {string[]}
66739          *            props The property names to pick.
66740          * @returns {Object} Returns the new object.
66741          */
66742         function pickByArray(object, props) {
66743             object = toObject(object);
66744
66745             var index = -1,
66746                 length = props.length,
66747                 result = {};
66748
66749             while (++index < length) {
66750                 var key = props[index];
66751                 if (key in object) {
66752                     result[key] = object[key];
66753                 }
66754             }
66755             return result;
66756         }
66757
66758         module.exports = pickByArray;
66759
66760     }, {
66761         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
66762     }],
66763     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js": [function(require, module, exports) {
66764         var baseForIn = require('./baseForIn');
66765
66766         /**
66767          * A specialized version of `_.pick` which picks `object` properties `predicate`
66768          * returns truthy for.
66769          * 
66770          * @private
66771          * @param {Object}
66772          *            object The source object.
66773          * @param {Function}
66774          *            predicate The function invoked per iteration.
66775          * @returns {Object} Returns the new object.
66776          */
66777         function pickByCallback(object, predicate) {
66778             var result = {};
66779             baseForIn(object, function(value, key, object) {
66780                 if (predicate(value, key, object)) {
66781                     result[key] = value;
66782                 }
66783             });
66784             return result;
66785         }
66786
66787         module.exports = pickByCallback;
66788
66789     }, {
66790         "./baseForIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js"
66791     }],
66792     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\realNames.js": [function(require, module, exports) {
66793         /** Used to lookup unminified function names. */
66794         var realNames = {};
66795
66796         module.exports = realNames;
66797
66798     }, {}],
66799     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\reorder.js": [function(require, module, exports) {
66800         var arrayCopy = require('./arrayCopy'),
66801             isIndex = require('./isIndex');
66802
66803         /*
66804          * Native method references for those with the same name as other `lodash`
66805          * methods.
66806          */
66807         var nativeMin = Math.min;
66808
66809         /**
66810          * Reorder `array` according to the specified indexes where the element at the
66811          * first index is assigned as the first element, the element at the second index
66812          * is assigned as the second element, and so on.
66813          * 
66814          * @private
66815          * @param {Array}
66816          *            array The array to reorder.
66817          * @param {Array}
66818          *            indexes The arranged array indexes.
66819          * @returns {Array} Returns `array`.
66820          */
66821         function reorder(array, indexes) {
66822             var arrLength = array.length,
66823                 length = nativeMin(indexes.length, arrLength),
66824                 oldArray = arrayCopy(array);
66825
66826             while (length--) {
66827                 var index = indexes[length];
66828                 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
66829             }
66830             return array;
66831         }
66832
66833         module.exports = reorder;
66834
66835     }, {
66836         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
66837         "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js"
66838     }],
66839     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js": [function(require, module, exports) {
66840         /** Used as the internal argument placeholder. */
66841         var PLACEHOLDER = '__lodash_placeholder__';
66842
66843         /**
66844          * Replaces all `placeholder` elements in `array` with an internal placeholder
66845          * and returns an array of their indexes.
66846          * 
66847          * @private
66848          * @param {Array}
66849          *            array The array to modify.
66850          * @param {*}
66851          *            placeholder The placeholder to replace.
66852          * @returns {Array} Returns the new array of placeholder indexes.
66853          */
66854         function replaceHolders(array, placeholder) {
66855             var index = -1,
66856                 length = array.length,
66857                 resIndex = -1,
66858                 result = [];
66859
66860             while (++index < length) {
66861                 if (array[index] === placeholder) {
66862                     array[index] = PLACEHOLDER;
66863                     result[++resIndex] = index;
66864                 }
66865             }
66866             return result;
66867         }
66868
66869         module.exports = replaceHolders;
66870
66871     }, {}],
66872     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js": [function(require, module, exports) {
66873         var baseSetData = require('./baseSetData'),
66874             now = require('../date/now');
66875
66876         /** Used to detect when a function becomes hot. */
66877         var HOT_COUNT = 150,
66878             HOT_SPAN = 16;
66879
66880         /**
66881          * Sets metadata for `func`.
66882          * 
66883          * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
66884          * period of time, it will trip its breaker and transition to an identity
66885          * function to avoid garbage collection pauses in V8. See [V8 issue
66886          * 2070](https://code.google.com/p/v8/issues/detail?id=2070) for more details.
66887          * 
66888          * @private
66889          * @param {Function}
66890          *            func The function to associate metadata with.
66891          * @param {*}
66892          *            data The metadata.
66893          * @returns {Function} Returns `func`.
66894          */
66895         var setData = (function() {
66896             var count = 0,
66897                 lastCalled = 0;
66898
66899             return function(key, value) {
66900                 var stamp = now(),
66901                     remaining = HOT_SPAN - (stamp - lastCalled);
66902
66903                 lastCalled = stamp;
66904                 if (remaining > 0) {
66905                     if (++count >= HOT_COUNT) {
66906                         return key;
66907                     }
66908                 } else {
66909                     count = 0;
66910                 }
66911                 return baseSetData(key, value);
66912             };
66913         }());
66914
66915         module.exports = setData;
66916
66917     }, {
66918         "../date/now": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js",
66919         "./baseSetData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js"
66920     }],
66921     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\shimKeys.js": [function(require, module, exports) {
66922         var isArguments = require('../lang/isArguments'),
66923             isArray = require('../lang/isArray'),
66924             isIndex = require('./isIndex'),
66925             isLength = require('./isLength'),
66926             keysIn = require('../object/keysIn');
66927
66928         /** Used for native method references. */
66929         var objectProto = Object.prototype;
66930
66931         /** Used to check objects for own properties. */
66932         var hasOwnProperty = objectProto.hasOwnProperty;
66933
66934         /**
66935          * A fallback implementation of `Object.keys` which creates an array of the own
66936          * enumerable property names of `object`.
66937          * 
66938          * @private
66939          * @param {Object}
66940          *            object The object to query.
66941          * @returns {Array} Returns the array of property names.
66942          */
66943         function shimKeys(object) {
66944             var props = keysIn(object),
66945                 propsLength = props.length,
66946                 length = propsLength && object.length;
66947
66948             var allowIndexes = !!length && isLength(length) &&
66949                 (isArray(object) || isArguments(object));
66950
66951             var index = -1,
66952                 result = [];
66953
66954             while (++index < propsLength) {
66955                 var key = props[index];
66956                 if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
66957                     result.push(key);
66958                 }
66959             }
66960             return result;
66961         }
66962
66963         module.exports = shimKeys;
66964
66965     }, {
66966         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
66967         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66968         "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js",
66969         "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js",
66970         "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js"
66971     }],
66972     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\sortedUniq.js": [function(require, module, exports) {
66973         /**
66974          * An implementation of `_.uniq` optimized for sorted arrays without support for
66975          * callback shorthands and `this` binding.
66976          * 
66977          * @private
66978          * @param {Array}
66979          *            array The array to inspect.
66980          * @param {Function}
66981          *            [iteratee] The function invoked per iteration.
66982          * @returns {Array} Returns the new duplicate free array.
66983          */
66984         function sortedUniq(array, iteratee) {
66985             var seen,
66986                 index = -1,
66987                 length = array.length,
66988                 resIndex = -1,
66989                 result = [];
66990
66991             while (++index < length) {
66992                 var value = array[index],
66993                     computed = iteratee ? iteratee(value, index, array) : value;
66994
66995                 if (!index || seen !== computed) {
66996                     seen = computed;
66997                     result[++resIndex] = value;
66998                 }
66999             }
67000             return result;
67001         }
67002
67003         module.exports = sortedUniq;
67004
67005     }, {}],
67006     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js": [function(require, module, exports) {
67007         var isObject = require('../lang/isObject');
67008
67009         /**
67010          * Converts `value` to an object if it's not one.
67011          * 
67012          * @private
67013          * @param {*}
67014          *            value The value to process.
67015          * @returns {Object} Returns the object.
67016          */
67017         function toObject(value) {
67018             return isObject(value) ? value : Object(value);
67019         }
67020
67021         module.exports = toObject;
67022
67023     }, {
67024         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67025     }],
67026     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js": [function(require, module, exports) {
67027         var baseToString = require('./baseToString'),
67028             isArray = require('../lang/isArray');
67029
67030         /** Used to match property names within property paths. */
67031         var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
67032
67033         /** Used to match backslashes in property paths. */
67034         var reEscapeChar = /\\(\\)?/g;
67035
67036         /**
67037          * Converts `value` to property path array if it's not one.
67038          * 
67039          * @private
67040          * @param {*}
67041          *            value The value to process.
67042          * @returns {Array} Returns the property path array.
67043          */
67044         function toPath(value) {
67045             if (isArray(value)) {
67046                 return value;
67047             }
67048             var result = [];
67049             baseToString(value).replace(rePropName, function(match, number, quote, string) {
67050                 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
67051             });
67052             return result;
67053         }
67054
67055         module.exports = toPath;
67056
67057     }, {
67058         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
67059         "./baseToString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseToString.js"
67060     }],
67061     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\wrapperClone.js": [function(require, module, exports) {
67062         var LazyWrapper = require('./LazyWrapper'),
67063             LodashWrapper = require('./LodashWrapper'),
67064             arrayCopy = require('./arrayCopy');
67065
67066         /**
67067          * Creates a clone of `wrapper`.
67068          * 
67069          * @private
67070          * @param {Object}
67071          *            wrapper The wrapper to clone.
67072          * @returns {Object} Returns the cloned wrapper.
67073          */
67074         function wrapperClone(wrapper) {
67075             return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
67076         }
67077
67078         module.exports = wrapperClone;
67079
67080     }, {
67081         "./LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
67082         "./LodashWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js",
67083         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js"
67084     }],
67085     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js": [function(require, module, exports) {
67086         var isArrayLike = require('../internal/isArrayLike'),
67087             isObjectLike = require('../internal/isObjectLike');
67088
67089         /** Used for native method references. */
67090         var objectProto = Object.prototype;
67091
67092         /** Used to check objects for own properties. */
67093         var hasOwnProperty = objectProto.hasOwnProperty;
67094
67095         /** Native method references. */
67096         var propertyIsEnumerable = objectProto.propertyIsEnumerable;
67097
67098         /**
67099          * Checks if `value` is classified as an `arguments` object.
67100          * 
67101          * @static
67102          * @memberOf _
67103          * @category Lang
67104          * @param {*}
67105          *            value The value to check.
67106          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67107          *          `false`.
67108          * @example
67109          * 
67110          * _.isArguments(function() { return arguments; }()); // => true
67111          * 
67112          * _.isArguments([1, 2, 3]); // => false
67113          */
67114         function isArguments(value) {
67115             return isObjectLike(value) && isArrayLike(value) &&
67116                 hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
67117         }
67118
67119         module.exports = isArguments;
67120
67121     }, {
67122         "../internal/isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
67123         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67124     }],
67125     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js": [function(require, module, exports) {
67126         var getNative = require('../internal/getNative'),
67127             isLength = require('../internal/isLength'),
67128             isObjectLike = require('../internal/isObjectLike');
67129
67130         /** `Object#toString` result references. */
67131         var arrayTag = '[object Array]';
67132
67133         /** Used for native method references. */
67134         var objectProto = Object.prototype;
67135
67136         /**
67137          * Used to resolve the
67138          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67139          * of values.
67140          */
67141         var objToString = objectProto.toString;
67142
67143         /*
67144          * Native method references for those with the same name as other `lodash`
67145          * methods.
67146          */
67147         var nativeIsArray = getNative(Array, 'isArray');
67148
67149         /**
67150          * Checks if `value` is classified as an `Array` object.
67151          * 
67152          * @static
67153          * @memberOf _
67154          * @category Lang
67155          * @param {*}
67156          *            value The value to check.
67157          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67158          *          `false`.
67159          * @example
67160          * 
67161          * _.isArray([1, 2, 3]); // => true
67162          * 
67163          * _.isArray(function() { return arguments; }()); // => false
67164          */
67165         var isArray = nativeIsArray || function(value) {
67166             return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
67167         };
67168
67169         module.exports = isArray;
67170
67171     }, {
67172         "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js",
67173         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67174         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67175     }],
67176     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js": [function(require, module, exports) {
67177         var isObject = require('./isObject');
67178
67179         /** `Object#toString` result references. */
67180         var funcTag = '[object Function]';
67181
67182         /** Used for native method references. */
67183         var objectProto = Object.prototype;
67184
67185         /**
67186          * Used to resolve the
67187          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67188          * of values.
67189          */
67190         var objToString = objectProto.toString;
67191
67192         /**
67193          * Checks if `value` is classified as a `Function` object.
67194          * 
67195          * @static
67196          * @memberOf _
67197          * @category Lang
67198          * @param {*}
67199          *            value The value to check.
67200          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67201          *          `false`.
67202          * @example
67203          * 
67204          * _.isFunction(_); // => true
67205          * 
67206          * _.isFunction(/abc/); // => false
67207          */
67208         function isFunction(value) {
67209             // The use of `Object#toString` avoids issues with the `typeof` operator
67210             // in older versions of Chrome and Safari which return 'function' for
67211             // regexes
67212             // and Safari 8 which returns 'object' for typed array constructors.
67213             return isObject(value) && objToString.call(value) == funcTag;
67214         }
67215
67216         module.exports = isFunction;
67217
67218     }, {
67219         "./isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67220     }],
67221     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNative.js": [function(require, module, exports) {
67222         var isFunction = require('./isFunction'),
67223             isObjectLike = require('../internal/isObjectLike');
67224
67225         /** Used to detect host constructors (Safari > 5). */
67226         var reIsHostCtor = /^\[object .+?Constructor\]$/;
67227
67228         /** Used for native method references. */
67229         var objectProto = Object.prototype;
67230
67231         /** Used to resolve the decompiled source of functions. */
67232         var fnToString = Function.prototype.toString;
67233
67234         /** Used to check objects for own properties. */
67235         var hasOwnProperty = objectProto.hasOwnProperty;
67236
67237         /** Used to detect if a method is native. */
67238         var reIsNative = RegExp('^' +
67239             fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
67240             .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
67241         );
67242
67243         /**
67244          * Checks if `value` is a native function.
67245          * 
67246          * @static
67247          * @memberOf _
67248          * @category Lang
67249          * @param {*}
67250          *            value The value to check.
67251          * @returns {boolean} Returns `true` if `value` is a native function, else
67252          *          `false`.
67253          * @example
67254          * 
67255          * _.isNative(Array.prototype.push); // => true
67256          * 
67257          * _.isNative(_); // => false
67258          */
67259         function isNative(value) {
67260             if (value == null) {
67261                 return false;
67262             }
67263             if (isFunction(value)) {
67264                 return reIsNative.test(fnToString.call(value));
67265             }
67266             return isObjectLike(value) && reIsHostCtor.test(value);
67267         }
67268
67269         module.exports = isNative;
67270
67271     }, {
67272         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
67273         "./isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js"
67274     }],
67275     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js": [function(require, module, exports) {
67276         var isObjectLike = require('../internal/isObjectLike');
67277
67278         /** `Object#toString` result references. */
67279         var numberTag = '[object Number]';
67280
67281         /** Used for native method references. */
67282         var objectProto = Object.prototype;
67283
67284         /**
67285          * Used to resolve the
67286          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67287          * of values.
67288          */
67289         var objToString = objectProto.toString;
67290
67291         /**
67292          * Checks if `value` is classified as a `Number` primitive or object.
67293          * 
67294          * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
67295          * as numbers, use the `_.isFinite` method.
67296          * 
67297          * @static
67298          * @memberOf _
67299          * @category Lang
67300          * @param {*}
67301          *            value The value to check.
67302          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67303          *          `false`.
67304          * @example
67305          * 
67306          * _.isNumber(8.4); // => true
67307          * 
67308          * _.isNumber(NaN); // => true
67309          * 
67310          * _.isNumber('8.4'); // => false
67311          */
67312         function isNumber(value) {
67313             return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
67314         }
67315
67316         module.exports = isNumber;
67317
67318     }, {
67319         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67320     }],
67321     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js": [function(require, module, exports) {
67322         /**
67323          * Checks if `value` is the [language type](https://es5.github.io/#x8) of
67324          * `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and
67325          * `new String('')`)
67326          * 
67327          * @static
67328          * @memberOf _
67329          * @category Lang
67330          * @param {*}
67331          *            value The value to check.
67332          * @returns {boolean} Returns `true` if `value` is an object, else `false`.
67333          * @example
67334          * 
67335          * _.isObject({}); // => true
67336          * 
67337          * _.isObject([1, 2, 3]); // => true
67338          * 
67339          * _.isObject(1); // => false
67340          */
67341         function isObject(value) {
67342             // Avoid a V8 JIT bug in Chrome 19-20.
67343             // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
67344             var type = typeof value;
67345             return !!value && (type == 'object' || type == 'function');
67346         }
67347
67348         module.exports = isObject;
67349
67350     }, {}],
67351     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isPlainObject.js": [function(require, module, exports) {
67352         var baseForIn = require('../internal/baseForIn'),
67353             isArguments = require('./isArguments'),
67354             isObjectLike = require('../internal/isObjectLike');
67355
67356         /** `Object#toString` result references. */
67357         var objectTag = '[object Object]';
67358
67359         /** Used for native method references. */
67360         var objectProto = Object.prototype;
67361
67362         /** Used to check objects for own properties. */
67363         var hasOwnProperty = objectProto.hasOwnProperty;
67364
67365         /**
67366          * Used to resolve the
67367          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67368          * of values.
67369          */
67370         var objToString = objectProto.toString;
67371
67372         /**
67373          * Checks if `value` is a plain object, that is, an object created by the
67374          * `Object` constructor or one with a `[[Prototype]]` of `null`.
67375          * 
67376          * **Note:** This method assumes objects created by the `Object` constructor
67377          * have no inherited enumerable properties.
67378          * 
67379          * @static
67380          * @memberOf _
67381          * @category Lang
67382          * @param {*}
67383          *            value The value to check.
67384          * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
67385          * @example
67386          * 
67387          * function Foo() { this.a = 1; }
67388          * 
67389          * _.isPlainObject(new Foo); // => false
67390          * 
67391          * _.isPlainObject([1, 2, 3]); // => false
67392          * 
67393          * _.isPlainObject({ 'x': 0, 'y': 0 }); // => true
67394          * 
67395          * _.isPlainObject(Object.create(null)); // => true
67396          */
67397         function isPlainObject(value) {
67398             var Ctor;
67399
67400             // Exit early for non `Object` objects.
67401             if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
67402                 (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
67403                 return false;
67404             }
67405             // IE < 9 iterates inherited properties before own properties. If the first
67406             // iterated property is an object's own property then there are no inherited
67407             // enumerable properties.
67408             var result;
67409             // In most environments an object's own properties are iterated before
67410             // its inherited properties. If the last iterated property is an object's
67411             // own property then there are no inherited enumerable properties.
67412             baseForIn(value, function(subValue, key) {
67413                 result = key;
67414             });
67415             return result === undefined || hasOwnProperty.call(value, result);
67416         }
67417
67418         module.exports = isPlainObject;
67419
67420     }, {
67421         "../internal/baseForIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js",
67422         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
67423         "./isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js"
67424     }],
67425     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js": [function(require, module, exports) {
67426         var isObjectLike = require('../internal/isObjectLike');
67427
67428         /** `Object#toString` result references. */
67429         var stringTag = '[object String]';
67430
67431         /** Used for native method references. */
67432         var objectProto = Object.prototype;
67433
67434         /**
67435          * Used to resolve the
67436          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67437          * of values.
67438          */
67439         var objToString = objectProto.toString;
67440
67441         /**
67442          * Checks if `value` is classified as a `String` primitive or object.
67443          * 
67444          * @static
67445          * @memberOf _
67446          * @category Lang
67447          * @param {*}
67448          *            value The value to check.
67449          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67450          *          `false`.
67451          * @example
67452          * 
67453          * _.isString('abc'); // => true
67454          * 
67455          * _.isString(1); // => false
67456          */
67457         function isString(value) {
67458             return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
67459         }
67460
67461         module.exports = isString;
67462
67463     }, {
67464         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67465     }],
67466     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js": [function(require, module, exports) {
67467         var isLength = require('../internal/isLength'),
67468             isObjectLike = require('../internal/isObjectLike');
67469
67470         /** `Object#toString` result references. */
67471         var argsTag = '[object Arguments]',
67472             arrayTag = '[object Array]',
67473             boolTag = '[object Boolean]',
67474             dateTag = '[object Date]',
67475             errorTag = '[object Error]',
67476             funcTag = '[object Function]',
67477             mapTag = '[object Map]',
67478             numberTag = '[object Number]',
67479             objectTag = '[object Object]',
67480             regexpTag = '[object RegExp]',
67481             setTag = '[object Set]',
67482             stringTag = '[object String]',
67483             weakMapTag = '[object WeakMap]';
67484
67485         var arrayBufferTag = '[object ArrayBuffer]',
67486             float32Tag = '[object Float32Array]',
67487             float64Tag = '[object Float64Array]',
67488             int8Tag = '[object Int8Array]',
67489             int16Tag = '[object Int16Array]',
67490             int32Tag = '[object Int32Array]',
67491             uint8Tag = '[object Uint8Array]',
67492             uint8ClampedTag = '[object Uint8ClampedArray]',
67493             uint16Tag = '[object Uint16Array]',
67494             uint32Tag = '[object Uint32Array]';
67495
67496         /** Used to identify `toStringTag` values of typed arrays. */
67497         var typedArrayTags = {};
67498         typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
67499             typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
67500             typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
67501             typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
67502             typedArrayTags[uint32Tag] = true;
67503         typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
67504             typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
67505             typedArrayTags[dateTag] = typedArrayTags[errorTag] =
67506             typedArrayTags[funcTag] = typedArrayTags[mapTag] =
67507             typedArrayTags[numberTag] = typedArrayTags[objectTag] =
67508             typedArrayTags[regexpTag] = typedArrayTags[setTag] =
67509             typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
67510
67511         /** Used for native method references. */
67512         var objectProto = Object.prototype;
67513
67514         /**
67515          * Used to resolve the
67516          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67517          * of values.
67518          */
67519         var objToString = objectProto.toString;
67520
67521         /**
67522          * Checks if `value` is classified as a typed array.
67523          * 
67524          * @static
67525          * @memberOf _
67526          * @category Lang
67527          * @param {*}
67528          *            value The value to check.
67529          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67530          *          `false`.
67531          * @example
67532          * 
67533          * _.isTypedArray(new Uint8Array); // => true
67534          * 
67535          * _.isTypedArray([]); // => false
67536          */
67537         function isTypedArray(value) {
67538             return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
67539         }
67540
67541         module.exports = isTypedArray;
67542
67543     }, {
67544         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67545         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67546     }],
67547     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\toPlainObject.js": [function(require, module, exports) {
67548         var baseCopy = require('../internal/baseCopy'),
67549             keysIn = require('../object/keysIn');
67550
67551         /**
67552          * Converts `value` to a plain object flattening inherited enumerable properties
67553          * of `value` to own properties of the plain object.
67554          * 
67555          * @static
67556          * @memberOf _
67557          * @category Lang
67558          * @param {*}
67559          *            value The value to convert.
67560          * @returns {Object} Returns the converted plain object.
67561          * @example
67562          * 
67563          * function Foo() { this.b = 2; }
67564          * 
67565          * Foo.prototype.c = 3;
67566          * 
67567          * _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 }
67568          * 
67569          * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2, 'c':
67570          * 3 }
67571          */
67572         function toPlainObject(value) {
67573             return baseCopy(value, keysIn(value));
67574         }
67575
67576         module.exports = toPlainObject;
67577
67578     }, {
67579         "../internal/baseCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js",
67580         "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js"
67581     }],
67582     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js": [function(require, module, exports) {
67583         var assignWith = require('../internal/assignWith'),
67584             baseAssign = require('../internal/baseAssign'),
67585             createAssigner = require('../internal/createAssigner');
67586
67587         /**
67588          * Assigns own enumerable properties of source object(s) to the destination
67589          * object. Subsequent sources overwrite property assignments of previous
67590          * sources. If `customizer` is provided it's invoked to produce the assigned
67591          * values. The `customizer` is bound to `thisArg` and invoked with five
67592          * arguments: (objectValue, sourceValue, key, object, source).
67593          * 
67594          * **Note:** This method mutates `object` and is based on
67595          * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
67596          * 
67597          * @static
67598          * @memberOf _
67599          * @alias extend
67600          * @category Object
67601          * @param {Object}
67602          *            object The destination object.
67603          * @param {...Object}
67604          *            [sources] The source objects.
67605          * @param {Function}
67606          *            [customizer] The function to customize assigned values.
67607          * @param {*}
67608          *            [thisArg] The `this` binding of `customizer`.
67609          * @returns {Object} Returns `object`.
67610          * @example
67611          * 
67612          * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); // => {
67613          * 'user': 'fred', 'age': 40 }
67614          *  // using a customizer callback var defaults = _.partialRight(_.assign,
67615          * function(value, other) { return _.isUndefined(value) ? other : value; });
67616          * 
67617          * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
67618          * 'user': 'barney', 'age': 36 }
67619          */
67620         var assign = createAssigner(function(object, source, customizer) {
67621             return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
67622         });
67623
67624         module.exports = assign;
67625
67626     }, {
67627         "../internal/assignWith": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\assignWith.js",
67628         "../internal/baseAssign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseAssign.js",
67629         "../internal/createAssigner": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js"
67630     }],
67631     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js": [function(require, module, exports) {
67632         var getNative = require('../internal/getNative'),
67633             isArrayLike = require('../internal/isArrayLike'),
67634             isObject = require('../lang/isObject'),
67635             shimKeys = require('../internal/shimKeys');
67636
67637         /*
67638          * Native method references for those with the same name as other `lodash`
67639          * methods.
67640          */
67641         var nativeKeys = getNative(Object, 'keys');
67642
67643         /**
67644          * Creates an array of the own enumerable property names of `object`.
67645          * 
67646          * **Note:** Non-object values are coerced to objects. See the [ES
67647          * spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for more
67648          * details.
67649          * 
67650          * @static
67651          * @memberOf _
67652          * @category Object
67653          * @param {Object}
67654          *            object The object to query.
67655          * @returns {Array} Returns the array of property names.
67656          * @example
67657          * 
67658          * function Foo() { this.a = 1; this.b = 2; }
67659          * 
67660          * Foo.prototype.c = 3;
67661          * 
67662          * _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed)
67663          * 
67664          * _.keys('hi'); // => ['0', '1']
67665          */
67666         var keys = !nativeKeys ? shimKeys : function(object) {
67667             var Ctor = object == null ? undefined : object.constructor;
67668             if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
67669                 (typeof object != 'function' && isArrayLike(object))) {
67670                 return shimKeys(object);
67671             }
67672             return isObject(object) ? nativeKeys(object) : [];
67673         };
67674
67675         module.exports = keys;
67676
67677     }, {
67678         "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js",
67679         "../internal/isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
67680         "../internal/shimKeys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\shimKeys.js",
67681         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67682     }],
67683     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js": [function(require, module, exports) {
67684         var isArguments = require('../lang/isArguments'),
67685             isArray = require('../lang/isArray'),
67686             isIndex = require('../internal/isIndex'),
67687             isLength = require('../internal/isLength'),
67688             isObject = require('../lang/isObject');
67689
67690         /** Used for native method references. */
67691         var objectProto = Object.prototype;
67692
67693         /** Used to check objects for own properties. */
67694         var hasOwnProperty = objectProto.hasOwnProperty;
67695
67696         /**
67697          * Creates an array of the own and inherited enumerable property names of
67698          * `object`.
67699          * 
67700          * **Note:** Non-object values are coerced to objects.
67701          * 
67702          * @static
67703          * @memberOf _
67704          * @category Object
67705          * @param {Object}
67706          *            object The object to query.
67707          * @returns {Array} Returns the array of property names.
67708          * @example
67709          * 
67710          * function Foo() { this.a = 1; this.b = 2; }
67711          * 
67712          * Foo.prototype.c = 3;
67713          * 
67714          * _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not guaranteed)
67715          */
67716         function keysIn(object) {
67717             if (object == null) {
67718                 return [];
67719             }
67720             if (!isObject(object)) {
67721                 object = Object(object);
67722             }
67723             var length = object.length;
67724             length = (length && isLength(length) &&
67725                 (isArray(object) || isArguments(object)) && length) || 0;
67726
67727             var Ctor = object.constructor,
67728                 index = -1,
67729                 isProto = typeof Ctor == 'function' && Ctor.prototype === object,
67730                 result = Array(length),
67731                 skipIndexes = length > 0;
67732
67733             while (++index < length) {
67734                 result[index] = (index + '');
67735             }
67736             for (var key in object) {
67737                 if (!(skipIndexes && isIndex(key, length)) &&
67738                     !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
67739                     result.push(key);
67740                 }
67741             }
67742             return result;
67743         }
67744
67745         module.exports = keysIn;
67746
67747     }, {
67748         "../internal/isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js",
67749         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67750         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
67751         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
67752         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67753     }],
67754     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\merge.js": [function(require, module, exports) {
67755         var baseMerge = require('../internal/baseMerge'),
67756             createAssigner = require('../internal/createAssigner');
67757
67758         /**
67759          * Recursively merges own enumerable properties of the source object(s), that
67760          * don't resolve to `undefined` into the destination object. Subsequent sources
67761          * overwrite property assignments of previous sources. If `customizer` is
67762          * provided it's invoked to produce the merged values of the destination and
67763          * source properties. If `customizer` returns `undefined` merging is handled by
67764          * the method instead. The `customizer` is bound to `thisArg` and invoked with
67765          * five arguments: (objectValue, sourceValue, key, object, source).
67766          * 
67767          * @static
67768          * @memberOf _
67769          * @category Object
67770          * @param {Object}
67771          *            object The destination object.
67772          * @param {...Object}
67773          *            [sources] The source objects.
67774          * @param {Function}
67775          *            [customizer] The function to customize assigned values.
67776          * @param {*}
67777          *            [thisArg] The `this` binding of `customizer`.
67778          * @returns {Object} Returns `object`.
67779          * @example
67780          * 
67781          * var users = { 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] };
67782          * 
67783          * var ages = { 'data': [{ 'age': 36 }, { 'age': 40 }] };
67784          * 
67785          * _.merge(users, ages); // => { 'data': [{ 'user': 'barney', 'age': 36 }, {
67786          * 'user': 'fred', 'age': 40 }] }
67787          *  // using a customizer callback var object = { 'fruits': ['apple'],
67788          * 'vegetables': ['beet'] };
67789          * 
67790          * var other = { 'fruits': ['banana'], 'vegetables': ['carrot'] };
67791          * 
67792          * _.merge(object, other, function(a, b) { if (_.isArray(a)) { return
67793          * a.concat(b); } }); // => { 'fruits': ['apple', 'banana'], 'vegetables':
67794          * ['beet', 'carrot'] }
67795          */
67796         var merge = createAssigner(baseMerge);
67797
67798         module.exports = merge;
67799
67800     }, {
67801         "../internal/baseMerge": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMerge.js",
67802         "../internal/createAssigner": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js"
67803     }],
67804     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\omit.js": [function(require, module, exports) {
67805         var arrayMap = require('../internal/arrayMap'),
67806             baseDifference = require('../internal/baseDifference'),
67807             baseFlatten = require('../internal/baseFlatten'),
67808             bindCallback = require('../internal/bindCallback'),
67809             keysIn = require('./keysIn'),
67810             pickByArray = require('../internal/pickByArray'),
67811             pickByCallback = require('../internal/pickByCallback'),
67812             restParam = require('../function/restParam');
67813
67814         /**
67815          * The opposite of `_.pick`; this method creates an object composed of the own
67816          * and inherited enumerable properties of `object` that are not omitted.
67817          * 
67818          * @static
67819          * @memberOf _
67820          * @category Object
67821          * @param {Object}
67822          *            object The source object.
67823          * @param {Function|...(string|string[])}
67824          *            [predicate] The function invoked per iteration or property names
67825          *            to omit, specified as individual property names or arrays of
67826          *            property names.
67827          * @param {*}
67828          *            [thisArg] The `this` binding of `predicate`.
67829          * @returns {Object} Returns the new object.
67830          * @example
67831          * 
67832          * var object = { 'user': 'fred', 'age': 40 };
67833          * 
67834          * _.omit(object, 'age'); // => { 'user': 'fred' }
67835          * 
67836          * _.omit(object, _.isNumber); // => { 'user': 'fred' }
67837          */
67838         var omit = restParam(function(object, props) {
67839             if (object == null) {
67840                 return {};
67841             }
67842             if (typeof props[0] != 'function') {
67843                 var props = arrayMap(baseFlatten(props), String);
67844                 return pickByArray(object, baseDifference(keysIn(object), props));
67845             }
67846             var predicate = bindCallback(props[0], props[1], 3);
67847             return pickByCallback(object, function(value, key, object) {
67848                 return !predicate(value, key, object);
67849             });
67850         });
67851
67852         module.exports = omit;
67853
67854     }, {
67855         "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
67856         "../internal/arrayMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js",
67857         "../internal/baseDifference": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDifference.js",
67858         "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
67859         "../internal/bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
67860         "../internal/pickByArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js",
67861         "../internal/pickByCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js",
67862         "./keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js"
67863     }],
67864     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pairs.js": [function(require, module, exports) {
67865         var keys = require('./keys'),
67866             toObject = require('../internal/toObject');
67867
67868         /**
67869          * Creates a two dimensional array of the key-value pairs for `object`, e.g.
67870          * `[[key1, value1], [key2, value2]]`.
67871          * 
67872          * @static
67873          * @memberOf _
67874          * @category Object
67875          * @param {Object}
67876          *            object The object to query.
67877          * @returns {Array} Returns the new array of key-value pairs.
67878          * @example
67879          * 
67880          * _.pairs({ 'barney': 36, 'fred': 40 }); // => [['barney', 36], ['fred', 40]]
67881          * (iteration order is not guaranteed)
67882          */
67883         function pairs(object) {
67884             object = toObject(object);
67885
67886             var index = -1,
67887                 props = keys(object),
67888                 length = props.length,
67889                 result = Array(length);
67890
67891             while (++index < length) {
67892                 var key = props[index];
67893                 result[index] = [key, object[key]];
67894             }
67895             return result;
67896         }
67897
67898         module.exports = pairs;
67899
67900     }, {
67901         "../internal/toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js",
67902         "./keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
67903     }],
67904     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js": [function(require, module, exports) {
67905         var baseFlatten = require('../internal/baseFlatten'),
67906             bindCallback = require('../internal/bindCallback'),
67907             pickByArray = require('../internal/pickByArray'),
67908             pickByCallback = require('../internal/pickByCallback'),
67909             restParam = require('../function/restParam');
67910
67911         /**
67912          * Creates an object composed of the picked `object` properties. Property names
67913          * may be specified as individual arguments or as arrays of property names. If
67914          * `predicate` is provided it's invoked for each property of `object` picking
67915          * the properties `predicate` returns truthy for. The predicate is bound to
67916          * `thisArg` and invoked with three arguments: (value, key, object).
67917          * 
67918          * @static
67919          * @memberOf _
67920          * @category Object
67921          * @param {Object}
67922          *            object The source object.
67923          * @param {Function|...(string|string[])}
67924          *            [predicate] The function invoked per iteration or property names
67925          *            to pick, specified as individual property names or arrays of
67926          *            property names.
67927          * @param {*}
67928          *            [thisArg] The `this` binding of `predicate`.
67929          * @returns {Object} Returns the new object.
67930          * @example
67931          * 
67932          * var object = { 'user': 'fred', 'age': 40 };
67933          * 
67934          * _.pick(object, 'user'); // => { 'user': 'fred' }
67935          * 
67936          * _.pick(object, _.isString); // => { 'user': 'fred' }
67937          */
67938         var pick = restParam(function(object, props) {
67939             if (object == null) {
67940                 return {};
67941             }
67942             return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
67943         });
67944
67945         module.exports = pick;
67946
67947     }, {
67948         "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
67949         "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
67950         "../internal/bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
67951         "../internal/pickByArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js",
67952         "../internal/pickByCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js"
67953     }],
67954     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js": [function(require, module, exports) {
67955         var baseValues = require('../internal/baseValues'),
67956             keys = require('./keys');
67957
67958         /**
67959          * Creates an array of the own enumerable property values of `object`.
67960          * 
67961          * **Note:** Non-object values are coerced to objects.
67962          * 
67963          * @static
67964          * @memberOf _
67965          * @category Object
67966          * @param {Object}
67967          *            object The object to query.
67968          * @returns {Array} Returns the array of property values.
67969          * @example
67970          * 
67971          * function Foo() { this.a = 1; this.b = 2; }
67972          * 
67973          * Foo.prototype.c = 3;
67974          * 
67975          * _.values(new Foo); // => [1, 2] (iteration order is not guaranteed)
67976          * 
67977          * _.values('hi'); // => ['h', 'i']
67978          */
67979         function values(object) {
67980             return baseValues(object, keys(object));
67981         }
67982
67983         module.exports = values;
67984
67985     }, {
67986         "../internal/baseValues": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseValues.js",
67987         "./keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
67988     }],
67989     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js": [function(require, module, exports) {
67990         /**
67991          * This method returns the first argument provided to it.
67992          * 
67993          * @static
67994          * @memberOf _
67995          * @category Utility
67996          * @param {*}
67997          *            value Any value.
67998          * @returns {*} Returns `value`.
67999          * @example
68000          * 
68001          * var object = { 'user': 'fred' };
68002          * 
68003          * _.identity(object) === object; // => true
68004          */
68005         function identity(value) {
68006             return value;
68007         }
68008
68009         module.exports = identity;
68010
68011     }, {}],
68012     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\noop.js": [function(require, module, exports) {
68013         /**
68014          * A no-operation function that returns `undefined` regardless of the arguments
68015          * it receives.
68016          * 
68017          * @static
68018          * @memberOf _
68019          * @category Utility
68020          * @example
68021          * 
68022          * var object = { 'user': 'fred' };
68023          * 
68024          * _.noop(object) === undefined; // => true
68025          */
68026         function noop() {
68027             // No operation performed.
68028         }
68029
68030         module.exports = noop;
68031
68032     }, {}],
68033     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\property.js": [function(require, module, exports) {
68034         var baseProperty = require('../internal/baseProperty'),
68035             basePropertyDeep = require('../internal/basePropertyDeep'),
68036             isKey = require('../internal/isKey');
68037
68038         /**
68039          * Creates a function that returns the property value at `path` on a given
68040          * object.
68041          * 
68042          * @static
68043          * @memberOf _
68044          * @category Utility
68045          * @param {Array|string}
68046          *            path The path of the property to get.
68047          * @returns {Function} Returns the new function.
68048          * @example
68049          * 
68050          * var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ];
68051          * 
68052          * _.map(objects, _.property('a.b.c')); // => [2, 1]
68053          * 
68054          * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // => [1,
68055          * 2]
68056          */
68057         function property(path) {
68058             return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
68059         }
68060
68061         module.exports = property;
68062
68063     }, {
68064         "../internal/baseProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js",
68065         "../internal/basePropertyDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\basePropertyDeep.js",
68066         "../internal/isKey": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js"
68067     }]
68068 }, {}, ["\\bpmn-js-examples-master\\modeler\\app\\index.js"]);