My presentations, using Reveal.js (mostly in Portuguese).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
206 KiB

/*! JointJS v0.9.0 - JavaScript diagramming library 2014-05-13
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
if(function(a,b){function c(a){var b=a.length,c=fb.type(a);return fb.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||"function"!==c&&(0===b||"number"==typeof b&&b>0&&b-1 in a)}function d(a){var b=ob[a]={};return fb.each(a.match(hb)||[],function(a,c){b[c]=!0}),b}function e(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=fb.expando+Math.random()}function f(a,c,d){var e;if(d===b&&1===a.nodeType)if(e="data-"+c.replace(sb,"-$1").toLowerCase(),d=a.getAttribute(e),"string"==typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:+d+""===d?+d:rb.test(d)?JSON.parse(d):d}catch(f){}pb.set(a,c,d)}else d=b;return d}function g(){return!0}function h(){return!1}function i(){try{return T.activeElement}catch(a){}}function j(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function k(a,b,c){if(fb.isFunction(b))return fb.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return fb.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(Cb.test(b))return fb.filter(b,a,c);b=fb.filter(b,a)}return fb.grep(a,function(a){return bb.call(b,a)>=0!==c})}function l(a,b){return fb.nodeName(a,"table")&&fb.nodeName(1===b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function m(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function n(a){var b=Nb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function o(a,b){for(var c=a.length,d=0;c>d;d++)qb.set(a[d],"globalEval",!b||qb.get(b[d],"globalEval"))}function p(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(qb.hasData(a)&&(f=qb.access(a),g=qb.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)fb.event.add(b,e,j[e][c])}pb.hasData(a)&&(h=pb.access(a),i=fb.extend({},h),pb.set(b,i))}}function q(a,c){var d=a.getElementsByTagName?a.getElementsByTagName(c||"*"):a.querySelectorAll?a.querySelectorAll(c||"*"):[];return c===b||c&&fb.nodeName(a,c)?fb.merge([a],d):d}function r(a,b){var c=b.nodeName.toLowerCase();"input"===c&&Kb.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function s(a,b){if(b in a)return b;for(var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=_b.length;e--;)if(b=_b[e]+c,b in a)return b;return d}function t(a,b){return a=b||a,"none"===fb.css(a,"display")||!fb.contains(a.ownerDocument,a)}function u(b){return a.getComputedStyle(b,null)}function v(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=qb.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&t(d)&&(f[g]=qb.access(d,"olddisplay",z(d.nodeName)))):f[g]||(e=t(d),(c&&"none"!==c||!e)&&qb.set(d,"olddisplay",e?c:fb.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function w(a,b,c){var d=Ub.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function x(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=fb.css(a,c+$b[f],!0,e)),d?("content"===c&&(g-=fb.css(a,"padding"+$b[f],!0,e)),"margin"!==c&&(g-=fb.css(a,"border"+$b[f]+"Width",!0,e))):(g+=fb.css(a,"padding"+$b[f],!0,e),"padding"!==c&&(g+=fb.css(a,"border"+$b[f]+"Width",!0,e)));return g}function y(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=u(a),g=fb.support.boxSizing&&"border-box"===fb.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Qb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Vb.test(e))return e;d=g&&(fb.support.boxSizingReliable||e===a.style[b]),e=parseFloat(e)||0}return e+x(a,b,c||(g?"border":"content"),d,f)+"px"}function z(a){var b=T,c=Xb[a];return c||(c=A(a,b),"none"!==c&&c||(Rb=(Rb||fb("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(b.documentElement),b=(Rb[0].contentWindow||Rb[0].contentDocument).document,b.write("<!doctype html><html><body>"),b.close(),c=A(a,b),Rb.detach()),Xb[a]=c),c}function A(a,b){var c=fb(b.createElement(a)).appendTo(b.body),d=fb.css(c[0],"display");retur
for(w in{submit:!0,reset:!0})z.pseudos[w]=j(w);l.prototype=z.filters=z.pseudos,z.setFilters=new l,C=c.compile=function(a,b){var c,d=[],e=[],f=T[a+" "];if(!f){for(b||(b=m(a)),c=b.length;c--;)f=s(b[c]),f[N]?d.push(f):e.push(f);f=T(a,t(e,d))}return f},x.sortStable=N.split("").sort(V).join("")===N,x.detectDuplicates=U,F(),x.sortDetached=f(function(a){return 1&a.compareDocumentPosition(G.createElement("div"))}),f(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||g("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),x.attributes&&f(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||g("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),f(function(a){return null==a.getAttribute("disabled")})||g(db,function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&d.specified?d.value:a[b]===!0?b.toLowerCase():null}),fb.find=c,fb.expr=c.selectors,fb.expr[":"]=fb.expr.pseudos,fb.unique=c.uniqueSort,fb.text=c.getText,fb.isXMLDoc=c.isXML,fb.contains=c.contains}(a);var ob={};fb.Callbacks=function(a){a="string"==typeof a?ob[a]||d(a):fb.extend({},a);var c,e,f,g,h,i,j=[],k=!a.once&&[],l=function(b){for(c=a.memory&&b,e=!0,i=g||0,g=0,h=j.length,f=!0;j&&h>i;i++)if(j[i].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}f=!1,j&&(k?k.length&&l(k.shift()):c?j=[]:m.disable())},m={add:function(){if(j){var b=j.length;!function d(b){fb.each(b,function(b,c){var e=fb.type(c);"function"===e?a.unique&&m.has(c)||j.push(c):c&&c.length&&"string"!==e&&d(c)})}(arguments),f?h=j.length:c&&(g=b,l(c))}return this},remove:function(){return j&&fb.each(arguments,function(a,b){for(var c;(c=fb.inArray(b,j,c))>-1;)j.splice(c,1),f&&(h>=c&&h--,i>=c&&i--)}),this},has:function(a){return a?fb.inArray(a,j)>-1:!(!j||!j.length)},empty:function(){return j=[],h=0,this},disable:function(){return j=k=c=b,this},disabled:function(){return!j},lock:function(){return k=b,c||m.disable(),this},locked:function(){return!k},fireWith:function(a,b){return!j||e&&!k||(b=b||[],b=[a,b.slice?b.slice():b],f?k.push(b):l(b)),this},fire:function(){return m.fireWith(this,arguments),this},fired:function(){return!!e}};return m},fb.extend({Deferred:function(a){var b=[["resolve","done",fb.Callbacks("once memory"),"resolved"],["reject","fail",fb.Callbacks("once memory"),"rejected"],["notify","progress",fb.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return fb.Deferred(function(c){fb.each(b,function(b,f){var g=f[0],h=fb.isFunction(a[b])&&a[b];e[f[1]](function(){var a=h&&h.apply(this,arguments);a&&fb.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[g+"With"](this===d?c.promise():this,h?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?fb.extend(a,d):d}},e={};return d.pipe=d.then,fb.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b,c,d,e=0,f=ab.call(arguments),g=f.length,h=1!==g||a&&fb.isFunction(a.promise)?g:0,i=1===h?a:fb.Deferred(),j=function(a,c,d){return function(e){c[a]=this,d[a]=arguments.length>1?ab.call(arguments):e,d===b?i.notifyWith(c,d):--h||i.resolveWith(c,d)}};if(g>1)for(b=new Array(g),c=new Array(g),d=new Array(g);g>e;e++)f[e]&&fb.isFunction(f[e].promise)?f[e].promise().done(j(e,d,f)).fail(i.reject).progress(j(e,c,b)):--h;return h||i.resolveWith(d,f),i.promise()}}),fb.support=function(b){var c=T.createElement("input"),d=T.createDocumentFragment(),e=T.createElement("div"),f=T.createElement("select"),g=f.appendChild(T.createElement("option"));return c.type?(c.type="checkbox",b.checkOn=""!==c.value,b.optSelected=g.selected,b.reliableMarginRight=!0,b.boxSizingReliable=!0,b.pixelPosition=!1,c.checked=!0,b.noC
if(fb.isArray(c)){for(e=u(a),f=c.length;f>h;h++)g[c[h]]=fb.css(a,c[h],!1,e);return g}return d!==b?fb.style(a,c,d):fb.css(a,c)},a,c,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){t(this)?fb(this).show():fb(this).hide()})}}),fb.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Qb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g,h,i=fb.camelCase(c),j=a.style;return c=fb.cssProps[i]||(fb.cssProps[i]=s(j,i)),h=fb.cssHooks[c]||fb.cssHooks[i],d===b?h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c]:(g=typeof d,"string"===g&&(f=Wb.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(fb.css(a,c)),g="number"),null==d||"number"===g&&isNaN(d)||("number"!==g||fb.cssNumber[i]||(d+="px"),fb.support.clearCloneStyle||""!==d||0!==c.indexOf("background")||(j[c]="inherit"),h&&"set"in h&&(d=h.set(a,d,e))===b||(j[c]=d)),void 0)}},css:function(a,c,d,e){var f,g,h,i=fb.camelCase(c);return c=fb.cssProps[i]||(fb.cssProps[i]=s(a.style,i)),h=fb.cssHooks[c]||fb.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,d)),f===b&&(f=Qb(a,c,e)),"normal"===f&&c in Zb&&(f=Zb[c]),""===d||d?(g=parseFloat(f),d===!0||fb.isNumeric(g)?g||0:f):f}}),Qb=function(a,c,d){var e,f,g,h=d||u(a),i=h?h.getPropertyValue(c)||h[c]:b,j=a.style;return h&&(""!==i||fb.contains(a.ownerDocument,a)||(i=fb.style(a,c)),Vb.test(i)&&Tb.test(c)&&(e=j.width,f=j.minWidth,g=j.maxWidth,j.minWidth=j.maxWidth=j.width=i,i=h.width,j.width=e,j.minWidth=f,j.maxWidth=g)),i},fb.each(["height","width"],function(a,b){fb.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Sb.test(fb.css(a,"display"))?fb.swap(a,Yb,function(){return y(a,b,d)}):y(a,b,d):void 0},set:function(a,c,d){var e=d&&u(a);return w(a,c,d?x(a,b,d,fb.support.boxSizing&&"border-box"===fb.css(a,"boxSizing",!1,e),e):0)}}}),fb(function(){fb.support.reliableMarginRight||(fb.cssHooks.marginRight={get:function(a,b){return b?fb.swap(a,{display:"inline-block"},Qb,[a,"marginRight"]):void 0}}),!fb.support.pixelPosition&&fb.fn.position&&fb.each(["top","left"],function(a,b){fb.cssHooks[b]={get:function(a,c){return c?(c=Qb(a,b),Vb.test(c)?fb(a).position()[b]+"px":c):void 0}}})}),fb.expr&&fb.expr.filters&&(fb.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},fb.expr.filters.visible=function(a){return!fb.expr.filters.hidden(a)}),fb.each({margin:"",padding:"",border:"Width"},function(a,b){fb.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+$b[d]+b]=f[d]||f[d-2]||f[0];return e}},Tb.test(a)||(fb.cssHooks[a+b].set=w)});var ac=/%20/g,bc=/\[\]$/,cc=/\r?\n/g,dc=/^(?:submit|button|image|reset|file)$/i,ec=/^(?:input|select|textarea|keygen)/i;fb.fn.extend({serialize:function(){return fb.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=fb.prop(this,"elements");return a?fb.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!fb(this).is(":disabled")&&ec.test(this.nodeName)&&!dc.test(a)&&(this.checked||!Kb.test(a))}).map(function(a,b){var c=fb(this).val();return null==c?null:fb.isArray(c)?fb.map(c,function(a){return{name:b.name,value:a.replace(cc,"\r\n")}}):{name:b.name,value:c.replace(cc,"\r\n")}}).get()}}),fb.param=function(a,c){var d,e=[],f=function(a,b){b=fb.isFunction(b)?b():null==b?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(c===b&&(c=fb.ajaxSettings&&fb.ajaxSettings.traditional),fb.isArray(a)||a.jquery&&!fb.isPlainObject(a))fb.each(a,function(){f(this.name,this.value)});else for(d in a)B(d,a[d],c,f);return e.join("&").replace(ac,"+")},fb.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){fb
}function jc(a,b,c){var d=-1,e=a?a.length:0;for(b=p.createCallback(b,c,3);++d<e;)if(b(a[d],d,a))return d;return-1}function kc(a,b,c){var d=a?a.length:0;for(b=p.createCallback(b,c,3);d--;)if(b(a[d],d,a))return d;return-1}function lc(a,b,c){var d=0,e=a?a.length:0;if("number"!=typeof b&&null!=b){var f=-1;for(b=p.createCallback(b,c,3);++f<e&&b(a[f],f,a);)d++}else if(d=b,null==d||c)return a?a[0]:o;return m(a,0,Od(Nd(0,d),e))}function mc(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c=d&&d[b]===a?null:b,b=!1),null!=c&&(a=Wb(a,c,d)),Y(a,b)}function nc(b,c,d){if("number"==typeof d){var e=b?b.length:0;d=0>d?Nd(0,e+d):d||0}else if(d){var f=wc(b,c);return b[f]===c?f:-1}return a(b,c,d)}function oc(a,b,c){var d=0,e=a?a.length:0;if("number"!=typeof b&&null!=b){var f=e;for(b=p.createCallback(b,c,3);f--&&b(a[f],f,a);)d++}else d=null==b||c?1:b||d;return m(a,0,Od(Nd(0,e-d),e))}function pc(c){for(var d=arguments,e=d.length,g=-1,i=h(),j=-1,m=gb(),n=c?c.length:0,o=[],p=h();++g<e;){var q=d[g];i[g]=m===a&&(q?q.length:0)>=t&&f(g?d[g]:p)}a:for(;++j<n;){var r=i[0];if(q=c[j],(r?b(r,q):m(p,q))<0){for(g=e,(r||p).push(q);--g;)if(r=i[g],(r?b(r,q):m(d[g],q))<0)continue a;o.push(q)}}for(;e--;)r=i[e],r&&l(r);return k(i),k(p),o}function qc(a,b,c){var d=0,e=a?a.length:0;if("number"!=typeof b&&null!=b){var f=e;for(b=p.createCallback(b,c,3);f--&&b(a[f],f,a);)d++}else if(d=b,null==d||c)return a?a[e-1]:o;return m(a,Nd(0,e-d))}function rc(a,b,c){var d=a?a.length:0;for("number"==typeof c&&(d=(0>c?Nd(0,d+c):Od(c,d-1))+1);d--;)if(a[d]===b)return d;return-1}function sc(a){for(var b=arguments,c=0,d=b.length,e=a?a.length:0;++c<d;)for(var f=-1,g=b[c];++f<e;)a[f]===g&&(Dd.call(a,f--,1),e--);return a}function tc(a,b,c){a=+a||0,c="number"==typeof c?c:+c||1,null==b&&(b=a,a=0);for(var d=-1,e=Nd(0,td((b-a)/(c||1))),f=fd(e);++d<e;)f[d]=a,a+=c;return f}function uc(a,b,c){var d=-1,e=a?a.length:0,f=[];for(b=p.createCallback(b,c,3);++d<e;){var g=a[d];b(g,d,a)&&(f.push(g),Dd.call(a,d--,1),e--)}return f}function vc(a,b,c){if("number"!=typeof b&&null!=b){var d=0,e=-1,f=a?a.length:0;for(b=p.createCallback(b,c,3);++e<f&&b(a[e],e,a);)d++}else d=null==b||c?1:Nd(0,b);return m(a,d)}function wc(a,b,c,d){var e=0,f=a?a.length:e;for(c=c?p.createCallback(c,d,1):Tc,b=c(b);f>e;){var g=e+f>>>1;c(a[g])<b?e=g+1:f=g}return e}function xc(){return bb(Y(arguments,!0,!0))}function yc(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c=d&&d[b]===a?null:b,b=!1),null!=c&&(c=p.createCallback(c,d,3)),bb(a,b,c)}function zc(a){return ic(a,Rd.call(arguments,1))}function Ac(){for(var a=arguments.length>1?arguments:arguments[0],b=-1,c=a?Xb(Zb(a,"length")):0,d=fd(0>c?0:c);++b<c;)d[b]=Zb(a,b);return d}function Bc(a,b){for(var c=-1,d=a?a.length:0,e={};++c<d;){var f=a[c];b?e[f]=b[c]:f&&(e[f[0]]=f[1])}return e}function Cc(a,b){if(!zb(b))throw new od;return function(){return--a<1?b.apply(this,arguments):void 0}}function Dc(a,b){return arguments.length>2?db(a,17,Rd.call(arguments,2),null,b):db(a,1,null,null,b)}function Ec(a){for(var b=arguments.length>1?Y(arguments,!0,!1,1):qb(a),c=-1,d=b.length;++c<d;){var e=b[c];a[e]=db(a[e],1,null,null,a)}return a}function Fc(a,b){return arguments.length>2?db(b,19,Rd.call(arguments,2),null,a):db(b,3,null,null,a)}function Gc(){for(var a=arguments,b=a.length;b--;)if(!zb(a[b]))throw new od;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}}function Hc(a,b,c){var d=typeof a;if(null==a||"function"==d)return W(a,b,c);if("object"!=d)return function(b){return b[a]};var e=Zd(a),f=e[0],g=a[f];return 1!=e.length||g!==g||Ab(g)?function(b){for(var c=e.length,d=!1;c--&&(d=Z(b[e[c]],a[e[c]],null,!0)););return d}:function(a){var b=a[f];return g===b&&(0!==g||1/g==1/b)}}function Ic(a,b){return b="number"==typeof b?b:+b||a.length,db(a,4,null,null,null,b)}function Jc(a,b,c){var d,e,f,g,h,i,j,k=0,l=!1,m=!0;if(!zb(a))throw new od;if(b=Nd(0,b)||0,c===!0){var n=!0;m=!1}else Ab(c)&&(n=c.leading,l="maxWait"in c&&(Nd(b,c.maxWait)||0),m="trailing"in c?c.trailing:m);var p=function(){var c=b-(zd()-g);if(0>=c){e&&ud(e);var l=j;e=i=j=o,l&&(k=zd(),f=a.apply(h,d))}else i=C
},loadUrl:function(a){var b=this.fragment=this.getFragment(a),c=h.any(this.handlers,function(a){return a.route.test(b)?(a.callback(b),!0):void 0});return c},navigate:function(a,b){if(!E.started)return!1;if(b&&b!==!0||(b={trigger:b}),a=this.getFragment(a||""),this.fragment!==a){this.fragment=a;var c=this.root+a;if(this._hasPushState)this.history[b.replace?"replaceState":"pushState"]({},document.title,c);else{if(!this._wantsHashChange)return this.location.assign(c);this._updateHash(this.location,a,b.replace),this.iframe&&a!==this.getFragment(this.getHash(this.iframe))&&(b.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,a,b.replace))}b.trigger&&this.loadUrl(a)}},_updateHash:function(a,b,c){if(c){var d=a.href.replace(/(javascript:|#).*$/,"");a.replace(d+"#"+b)}else a.hash="#"+b}}),a.history=new E;var J=function(a,b){var c,d=this;c=a&&h.has(a,"constructor")?a.constructor:function(){return d.apply(this,arguments)},h.extend(c,d,b);var e=function(){this.constructor=c};return e.prototype=d.prototype,c.prototype=new e,a&&h.extend(c.prototype,a),c.__super__=d.prototype,c};n.extend=q.extend=z.extend=v.extend=E.extend=J;var K=function(){throw new Error('A "url" property or function must be specified')},L=function(a,b){var c=b.error;b.error=function(d){c&&c(a,d,b),a.trigger("error",a,d,b)}}}.call(this),function(a,b){"function"==typeof define&&define.amd?define([],b):a.Vectorizer=a.V=b()}(this,function(){function a(){var a=++l+"";return"v-"+a}function b(a,b,d){if(!a)return void 0;if("object"==typeof a)return new h(a);if(b=b||{},"svg"===a.toLowerCase())b.xmlns=j.xmlns,b["xmlns:xlink"]=j.xlink,b.version=k;else if("<"===a[0]){var e='<svg xmlns="'+j.xmlns+'" xmlns:xlink="'+j.xlink+'" version="'+k+'">'+a+"</svg>",f=new DOMParser;f.async=!1;var g=f.parseFromString(e,"text/xml").documentElement;if(g.childNodes.length>1){for(var i=[],l=0,m=g.childNodes.length;m>l;l++){var n=g.childNodes[l];i.push(new h(document.importNode(n,!0)))}return i}return new h(document.importNode(g.firstChild,!0))}a=document.createElementNS(j.xmlns,a);for(var o in b)c(a,o,b[o]);"[object Array]"!=Object.prototype.toString.call(d)&&(d=[d]);for(var p,l=0,m=d[0]&&d.length||0;m>l;l++)p=d[l],a.appendChild(p instanceof h?p.node:p);return new h(a)}function c(a,b,c){if(b.indexOf(":")>-1){var d=b.split(":");a.setAttributeNS(j[d[0]],d[1],c)}else"id"===b?a.id=c:a.setAttribute(b,c)}function d(a){var b,c,d;if(a){var e=a.match(/translate\((.*)\)/);e&&(b=e[1].split(","));var f=a.match(/rotate\((.*)\)/);f&&(c=f[1].split(","));var g=a.match(/scale\((.*)\)/);g&&(d=g[1].split(","))}var h=d&&d[0]?parseFloat(d[0]):1;return{translate:{tx:b&&b[0]?parseInt(b[0],10):0,ty:b&&b[1]?parseInt(b[1],10):0},rotate:{angle:c&&c[0]?parseInt(c[0],10):0,cx:c&&c[1]?parseInt(c[1],10):void 0,cy:c&&c[2]?parseInt(c[2],10):void 0},scale:{sx:h,sy:d&&d[1]?parseFloat(d[1]):h}}}function e(a,b){var c=b.x*a.a+b.y*a.c+0,d=b.x*a.b+b.y*a.d+0;return{x:c,y:d}}function f(a){var b=e(a,{x:0,y:1}),c=e(a,{x:1,y:0}),d=180/Math.PI*Math.atan2(b.y,b.x)-90,f=180/Math.PI*Math.atan2(c.y,c.x);return{translateX:a.e,translateY:a.f,scaleX:Math.sqrt(a.a*a.a+a.b*a.b),scaleY:Math.sqrt(a.c*a.c+a.d*a.d),skewX:d,skewY:f,rotation:d}}function h(b){this.node=b,this.node.id||(this.node.id=a())}function i(a){var b=a.rx||a["top-rx"]||0,c=a.rx||a["bottom-rx"]||0,d=a.ry||a["top-ry"]||0,e=a.ry||a["bottom-ry"]||0;return["M",a.x,a.y+d,"v",a.height-d-e,"a",c,e,0,0,0,c,e,"h",a.width-2*c,"a",c,e,0,0,0,c,-e,"v",-(a.height-e-d),"a",b,d,0,0,0,-b,-d,"h",-(a.width-2*b),"a",b,d,0,0,0,-b,d].join(" ")}!(!window.SVGAngle&&!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));var j={xmlns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"},k="1.1",l=0;h.prototype={translate:function(a,b){b=b||0;var c=this.attr("transform")||"",e=d(c);if("undefined"==typeof a)return e.translate;c=c.replace(/translate\([^\)]*\)/g,"").trim();var f=e.translate.tx+a,g=e.translate.ty+b;return this.attr("transform","translate("+f+","+g+") "+c),this},rotate:function(a,b,c){var e=this.attr("transform")|
});var e=this.collection.getConnectedLinks(this,{outbound:!0});_.each(e,function(a){c[a.get("source").port]&&a.remove()})}this.ports=b},remove:function(a){var b=this.collection;b&&b.trigger("batch:start");var c=this.get("parent");if(c){var d=this.collection&&this.collection.get(c);d.unembed(this)}_.invoke(this.getEmbeddedCells(),"remove",a),this.trigger("remove",this,this.collection,a),b&&b.trigger("batch:stop")},toFront:function(){this.collection&&this.set("z",(this.collection.last().get("z")||0)+1)},toBack:function(){this.collection&&this.set("z",(this.collection.first().get("z")||0)-1)},embed:function(a){if(this.get("parent")==a.id)throw new Error("Recursive embedding not allowed.");this.trigger("batch:start"),a.set("parent",this.id),this.set("embeds",_.uniq((this.get("embeds")||[]).concat([a.id]))),this.trigger("batch:stop")},unembed:function(a){this.trigger("batch:start");var b=a.id;a.unset("parent"),this.set("embeds",_.without(this.get("embeds"),b)),this.trigger("batch:stop")},getEmbeddedCells:function(){return this.collection?_.map(this.get("embeds")||[],function(a){return this.collection.get(a)},this):[]},clone:function(a){a=a||{};var b=Backbone.Model.prototype.clone.apply(this,arguments);if(b.set("id",joint.util.uuid(),{silent:!0}),b.set("embeds",""),!a.deep)return b;var c=this.getEmbeddedCells(),d=[b],e={};return _.each(c,function(a){var c=a.clone({deep:!0});b.embed(c[0]),_.each(c,function(b){if(d.push(b),!(b instanceof joint.dia.Link)){var c=this.collection.getConnectedLinks(a,{inbound:!0});_.each(c,function(a){var c=e[a.id]||a.clone();e[a.id]=c;var d=_.clone(c.get("target"));d.id=b.id,c.set("target",d)});var f=this.collection.getConnectedLinks(a,{outbound:!0});_.each(f,function(a){var c=e[a.id]||a.clone();e[a.id]=c;var d=_.clone(c.get("source"));d.id=b.id,c.set("source",d)})}},this)},this),d=d.concat(_.values(e))},attr:function(a,b,c){var d=this.get("attrs"),e="/";if(_.isString(a)){if("undefined"!=typeof b){var f={};return joint.util.setByPath(f,a,b,e),this.set("attrs",_.merge({},d,f),c)}return joint.util.getByPath(d,a,e)}return this.set("attrs",_.merge({},d,a),b,c)},removeAttr:function(a,b){if(_.isArray(a))return _.each(a,function(a){this.removeAttr(a,b)},this),this;var c=joint.util.unsetByPath(_.merge({},this.get("attrs")),a,"/");return this.set("attrs",c,_.extend({dirty:!0},b))},transition:function(a,b,c,d){d=d||"/";var e={duration:100,delay:10,timingFunction:joint.util.timing.linear,valueFunction:joint.util.interpolate.number};c=_.extend(e,c);var f,g=a.split(d),h=g[0],i=g.length>1,j=0,k=_.bind(function(b){var e,g,l;if(j=j||b,b-=j,g=b/c.duration,1>g?this._transitionIds[a]=e=joint.util.nextFrame(k):(g=1,delete this._transitionIds[a]),l=f(c.timingFunction(g)),i){var m=joint.util.setByPath({},a,l,d)[h];l=_.merge({},this.get(h),m)}c.transitionId=e,this.set(h,l,c),e||this.trigger("transition:end",this,a)},this),l=_.bind(function(e){this.stopTransitions(a),f=c.valueFunction(joint.util.getByPath(this.attributes,a,d),b),this._transitionIds[a]=joint.util.nextFrame(e),this.trigger("transition:start",this,a)},this);return _.delay(l,c.delay,k)},getTransitions:function(){return _.keys(this._transitionIds)},stopTransitions:function(a,b){b=b||"/";var c=a&&a.split(b);_(this._transitionIds).keys().filter(c&&function(a){return _.isEqual(c,a.split(b).slice(0,c.length))}).each(function(a){joint.util.cancelFrame(this._transitionIds[a]),delete this._transitionIds[a],this.trigger("transition:end",this,a)},this)}}),joint.dia.CellView=Backbone.View.extend({tagName:"g",attributes:function(){return{"model-id":this.model.id}},initialize:function(){_.bindAll(this,"remove","update"),this.$el.data("view",this),this.listenTo(this.model,"remove",this.remove),this.listenTo(this.model,"change:attrs",this.onChangeAttrs)},onChangeAttrs:function(a,b,c){return c.dirty?this.render():this.update()},_configure:function(a){a.id=a.id||joint.util.guid(this),Backbone.View.prototype._configure.apply(this,arguments)},_ensureElement:function(){var a;if(this.el)a=_.result(this,"el");else{var b=_.extend({id:this.id},_.result(this,"attributes"));this.class
},setDimensions:function(a,b){a&&(this.options.width=a),b&&(this.options.height=b),V(this.svg).attr("width",this.options.width),V(this.svg).attr("height",this.options.height),this.trigger("resize")},fitToContent:function(a,b,c){a=a||1,b=b||1,c=c||0;var d=V(this.viewport).bbox(!0,this.svg),e=Math.ceil((d.width+d.x)/a)*a,f=Math.ceil((d.height+d.y)/b)*b;e+=c,f+=c,(e!=this.options.width||f!=this.options.height)&&this.setDimensions(e||this.options.width,f||this.options.height)},getContentBBox:function(){var a=this.viewport.getBoundingClientRect(),b=this.viewport.getScreenCTM(),c=g.rect(Math.abs(a.left-b.e),Math.abs(a.top-b.f),a.width,a.height);return c},createViewForModel:function(a){var b,c=a.get("type"),d=c.split(".")[0],e=c.split(".")[1];return b=joint.shapes[d]&&joint.shapes[d][e+"View"]?new joint.shapes[d][e+"View"]({model:a,interactive:this.options.interactive}):a instanceof joint.dia.Element?new this.options.elementView({model:a,interactive:this.options.interactive}):new this.options.linkView({model:a,interactive:this.options.interactive})},addCell:function(a){var b=this.createViewForModel(a);V(this.viewport).append(b.el),b.paper=this,b.render(),$(b.el).find("image").on("dragstart",function(){return!1})},resetCells:function(a){$(this.viewport).empty();var b=a.models.slice();b.sort(function(a){return a instanceof joint.dia.Link?1:-1}),_.each(b,this.addCell,this),this.sortCells()},sortCells:function(){var a=$(this.viewport).children("[model-id]"),b=this.model.get("cells");this.sortElements(a,function(a,c){var d=b.get($(a).attr("model-id")),e=b.get($(c).attr("model-id"));return(d.get("z")||0)>(e.get("z")||0)?1:-1})},sortElements:function(a,b){var c=$(a),d=c.map(function(){var a=this,b=a.parentNode,c=b.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(b===this)throw new Error("You can't sort elements if any one is a descendant of another.");b.insertBefore(this,c),b.removeChild(c)}});return Array.prototype.sort.call(c,b).each(function(a){d[a].call(this)})},scale:function(a,b,c,d){return c||(c=0,d=0),V(this.viewport).attr("transform",""),(c||d)&&V(this.viewport).translate(-c*(a-1),-d*(b-1)),V(this.viewport).scale(a,b),this.trigger("scale",c,d),this},rotate:function(a,b,c){if(_.isUndefined(b)){var d=this.viewport.getBBox();b=d.width/2,c=d.height/2}V(this.viewport).rotate(a,b,c)},findView:function(a){var b=this.$(a);return 0===b.length||b[0]===this.el?void 0:b.data("view")?b.data("view"):this.findView(b.parent())},findViewByModel:function(a){var b=_.isString(a)?a:a.id,c=this.$('[model-id="'+b+'"]');return c.length?c.data("view"):void 0},findViewsFromPoint:function(a){a=g.point(a);var b=_.map(this.model.getElements(),this.findViewByModel);return _.filter(b,function(b){return g.rect(V(b.el).bbox(!1,this.viewport)).containsPoint(a)},this)},findViewsInArea:function(a){a=g.rect(a);var b=_.map(this.model.getElements(),this.findViewByModel);return _.filter(b,function(b){return a.intersect(g.rect(V(b.el).bbox(!1,this.viewport)))},this)},getModelById:function(a){return this.model.getCell(a)},snapToGrid:function(a){var b=V(this.viewport).toLocalPoint(a.x,a.y);return{x:g.snapToGrid(b.x,this.options.gridSize),y:g.snapToGrid(b.y,this.options.gridSize)}},getDefaultLink:function(a,b){return _.isFunction(this.options.defaultLink)?this.options.defaultLink.call(this,a,b):this.options.defaultLink.clone()},mousedblclick:function(a){a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target),c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerdblclick(a,c.x,c.y):this.trigger("blank:pointerdblclick",a,c.x,c.y)},mouseclick:function(a){if(!this._mousemoved){a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target),c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerclick(a,c.x,c.y):this.trigger("blank:pointerclick",a,c.x,c.y)}this._mousemoved=!1},pointerdown:function(a){a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target),c=this.snapToGrid({x:a.clientX,y:a.clientY});b?(this.sourceView=b,b.pointerdown(a,c.x,c.y)):this.trigger("blank:pointerdown",a,