1
restaurant-search/client/dist/all.min.js

15 lines
443 KiB
JavaScript
Raw Normal View History

2014-09-26 08:14:42 +00:00
function Column(t,e,i,n,r,s){this.clearShapes=function(){_.each(this.shapes,function(t){this.canvas.remove(t)}),this.shapes=[]},this.updateShapes=function(t){if(this.columnBounds=this.getColumnBounds(this.bounds),this.labelBounds=this.getLabelBounds(this.columnBounds),this.hintBounds=this.getHintBounds(this.columnBounds),this.fillBounds=this.getFillBounds(this.columnBounds),this.handleBounds=this.getHandleBounds(this.columnBounds,this.fillBounds),t&&(this.updateRect("boundsRect",{left:this.columnBounds.left,top:this.columnBounds.top,width:this.columnBounds.width,height:this.columnBounds.height,stroke:this.strokeColor,fill:this.emptyColor}),this.updateRect("hintRect",{left:this.hintBounds.left,top:this.hintBounds.top,width:this.hintBounds.width,height:this.hintBounds.height,stroke:this.strokeColor}),this.hintRect.setGradient("fill",{x1:0,y1:0,x2:0,y2:this.hintRect.height,colorStops:this.decimateHints(this.steps,this.scale)}),this.updateRect("labelRect",{left:this.labelBounds.left,top:this.labelBounds.top,width:this.labelBounds.width,height:this.labelBounds.height,fill:this.strokeColor}),this.updateText("label",this.name,{left:this.fillBounds.left+this.fillBounds.width/2,top:this.labelBounds.top+this.labelBounds.height/2,fontSize:this.labelFontSize,originX:"center",originY:"center"})),this.updateRect("fillRect",{left:this.fillBounds.left,top:this.fillBounds.top,width:this.fillBounds.width,height:this.fillBounds.height,fill:this.getFillColor()}),this.updateRect("handleRect",{left:this.handleBounds.left,top:this.handleBounds.top,width:this.handleBounds.width,height:this.handleBounds.height,fill:this.getHandleColor()}),t&&goog.math.Range.containsPoint(this.range,0)){var e=this.getPosFromValue(0),i=[this.bounds.left,e,this.bounds.left+this.tickLength,e];this.updateLine("baseline",i,{stroke:this.tickColor})}this.canvas.renderAll()},this.updateRect=function(t,e){if(t in this)this[t].set(e);else{var i=new fabric.Rect(e);this.canvas.add(i),this.shapes.push(i),this[t]=i}},this.updateText=function(t,e,i){if(t in this)this[t].set(i);else{var e=new fabric.Text(e,i);this.canvas.add(e),this.shapes.push(e),this[t]=e}},this.updateLine=function(t,e,i){if(t in this)this[t].set(i);else{var n=new fabric.Line(e,i);this.canvas.add(n),this.shapes.push(n),this[t]=n}},this.decimateHints=function(t,e){var i=this.groupHints(t),n={};return _.each(i,function(i,r){var s=0;e.getLength()>0&&(s=Math.max(0,i-e.start)/e.getLength());var o=255-Math.min(255,Math.round(255*s)),a=tinycolor({r:o,g:o,b:o}),h=a.toHexString();n[r/t]=h}),n},this.groupHints=function(t){for(var e=this.range.getLength()/t,i=[],n=0;t>n;++n){var r=this.range.end-e*n,s=r-e,o=0;_.each(this.hints,function(t){t.sample>s&&t.sample<=r&&(o+=t.count)}),i.push(o)}return i},this.setClampedValue=function(t,e){this.value=goog.math.clamp(t,this.range.start,this.range.end),this.updateShapes(e),this.onValueChanged&&e&&this.onValueChanged(this.name,this.value)},this.setHints=function(t,e){this.hints=t,this.scale=e,this.updateShapes(!0)},this.getLabelBounds=function(t){return new goog.math.Rect(t.left,t.top+t.height,t.width,this.labelSize)},this.getColumnBounds=function(t){return new goog.math.Rect(t.left+this.tickLength,t.top,t.width-this.tickLength,t.height-this.labelSize)},this.getHintBounds=function(t){return new goog.math.Rect(t.left+t.width-this.hintSize,t.top,this.hintSize,t.height)},this.getFillBounds=function(t){var e=this.getPosFromValue(0),i=this.getPosFromValue(this.value);return new goog.math.Rect(t.left,Math.min(e,i),t.width-this.hintSize,Math.abs(e-i))},this.getHandleBounds=function(t,e){var i=new goog.math.Rect(e.left,this.getPosFromValue(this.value)-this.handleSize/2,e.width,this.handleSize);return i.intersection(t),i},this.valueColorAdjust=function(t,e){var i=tinycolor(t),n=this.value>=0?this.range.end:this.range.start,r=(this.range.start+this.range.end)/2,s=(this.value-r)/(n-r),o=100*Math.max(0,1-s+e);return i.desaturate(o).toHexString()},this.getFillColor=function(){var t=this.value>=0?this.fillColorPos:this.fillColorNeg;return this.valueColorAdjust(t,this.desatOffset)},this.getHandl
}else s.push(l)}this.original=r,this.parts=s,this.string=s.join("."),this.depth=o,this.isSimple=1===t.length&&!this.isScoped&&0===o,this.stringModeValue=this.string},PartialNameNode:function(t,i){e.call(this,i),this.type="PARTIAL_NAME",this.name=t.original},DataNode:function(t,i){e.call(this,i),this.type="DATA",this.id=t},StringNode:function(t,i){e.call(this,i),this.type="STRING",this.original=this.string=this.stringModeValue=t},IntegerNode:function(t,i){e.call(this,i),this.type="INTEGER",this.original=this.integer=t,this.stringModeValue=Number(t)},BooleanNode:function(t,i){e.call(this,i),this.type="BOOLEAN",this.bool=t,this.stringModeValue="true"===t},CommentNode:function(t,i){e.call(this,i),this.type="comment",this.comment=t}};return i=r}(i),a=function(){"use strict";var t,e=function(){function t(t,e){return{left:"~"===t.charAt(2),right:"~"===e.charAt(0)||"~"===e.charAt(1)}}function e(){this.yy={}}var i={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(e,i,n,r,s,o){var a=o.length-1;switch(s){case 1:return new r.ProgramNode(o[a-1],this._$);case 2:return new r.ProgramNode([],this._$);case 3:this.$=new r.ProgramNode([],o[a-1],o[a],this._$);break;case 4:this.$=new r.ProgramNode(o[a-2],o[a-1],o[a],this._$);break;case 5:this.$=new r.ProgramNode(o[a-1],o[a],[],this._$);break;case 6:this.$=new r.ProgramNode(o[a],this._$);break;case 7:this.$=new r.ProgramNode([],this._$);break;case 8:this.$=new r.ProgramNode([],this._$);break;case 9:this.$=[o[a]];break;case 10:o[a-1].push(o[a]),this.$=o[a-1];break;case 11:this.$=new r.BlockNode(o[a-2],o[a-1].inverse,o[a-1],o[a],this._$);break;case 12:this.$=new r.BlockNode(o[a-2],o[a-1],o[a-1].inverse,o[a],this._$);break;case 13:this.$=o[a];break;case 14:this.$=o[a];break;case 15:this.$=new r.ContentNode(o[a],this._$);break;case 16:this.$=new r.CommentNode(o[a],this._$);break;case 17:this.$=new r.MustacheNode(o[a-1],null,o[a-2],t(o[a-2],o[a]),this._$);break;case 18:this.$=new r.MustacheNode(o[a-1],null,o[a-2],t(o[a-2],o[a]),this._$);break;case 19:this.$={path:o[a-1],strip:t(o[a-2],o[a])};break;case 20:this.$=new r.MustacheNode(o[a-1],null,o[a-2],t(o[a-2],o[a]),this._$);break;case 21:this.$=new r.MustacheNode(o[a-1],null,o[a-2],t(o[a-2],o[a]),this._$);break;case 22:this.$=new r.PartialNode(o[a-2],o[a-1],t(o[a-3],o[a]),this._$);break;case 23:this.$=t(o[a-1],o[a]);break;case 24:this.$=new r.SexprNode([o[a-2]].concat(o[a-1]),o[a],this._$);break;case 25:this.$=new r.SexprNode([o[a]],null,this._$);break;case 26:this.$=o[a];break;case 27:this.$=new r.StringNode(o[a],this._$);break;case 28:this.$=new r.IntegerNode(o[a],this._$);break;case 29:this.$=new r.BooleanNode(o[a],this._$);break;case 30:this.$=o[a];break;case 31:o[a-1].isHelper=!0,this.$=o[a-1];break;case 32:this.$=new r.HashNode(o[a],this._$);break;case 33:this.$=[o[a-2],o[a]];break;case 34:this.$=new r.PartialNameNode(o[a],this._$);break;case 35:this.$=new r.Part
},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;if(t.length){this.inlineStack=[];for(var e=0,n=t.length;n>e;e++){var r=t[e];r instanceof i?this.compileStack.push(r):this.pushStack(r)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var e=this.isInline(),n=(e?this.inlineStack:this.compileStack).pop();if(!t&&n instanceof i)return n.value;if(!e){if(!this.stackSlot)throw new h("Invalid stack pop");this.stackSlot--}return n},topStack:function(t){var e=this.isInline()?this.inlineStack:this.compileStack,n=e[e.length-1];return!t&&n instanceof i?n.value:n},quotedString:function(t){return'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(t,e,i){var n=[],r=this.setupParams(t,n,i),s=this.nameLookup("helpers",e,"helper");return{params:n,paramsInit:r,name:s,callParams:["depth0"].concat(n).join(", "),helperMissingParams:i&&["depth0",this.quotedString(e)].concat(n).join(", ")}},setupOptions:function(t,e){var i,n,r,s=[],o=[],a=[];s.push("hash:"+this.popStack()),this.options.stringParams&&(s.push("hashTypes:"+this.popStack()),s.push("hashContexts:"+this.popStack())),n=this.popStack(),r=this.popStack(),(r||n)&&(r||(this.context.aliases.self="this",r="self.noop"),n||(this.context.aliases.self="this",n="self.noop"),s.push("inverse:"+n),s.push("fn:"+r));for(var h=0;t>h;h++)i=this.popStack(),e.push(i),this.options.stringParams&&(a.push(this.popStack()),o.push(this.popStack()));return this.options.stringParams&&(s.push("contexts:["+o.join(",")+"]"),s.push("types:["+a.join(",")+"]")),this.options.data&&s.push("data:data"),s},setupParams:function(t,e,i){var n="{"+this.setupOptions(t,e).join(",")+"}";return i?(this.useRegister("options"),e.push("options"),"options="+n):(e.push(n),"")}};for(var l="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),c=n.RESERVED_WORDS={},u=0,f=l.length;f>u;u++)c[l[u]]=!0;return n.isValidJavaScriptVariableName=function(t){return!n.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)?!0:!1},r=n}(n,i),u=function(t,e,i,n,r){"use strict";var s,o=t,a=e,h=i.parser,l=i.parse,c=n.Compiler,u=n.compile,f=n.precompile,d=r,p=o.create,g=function(){var t=p();return t.compile=function(e,i){return u(e,i,t)},t.precompile=function(e,i){return f(e,i,t)},t.AST=a,t.Compiler=c,t.JavaScriptCompiler=d,t.Parser=h,t.parse=l,t};return o=g(),o.create=g,s=o}(s,o,h,l,c);return u}(),COMPILED=!1,goog=goog||{};if(goog.global=this,goog.global.CLOSURE_UNCOMPILED_DEFINES,goog.global.CLOSURE_DEFINES,goog.isDef=function(t){return void 0!==t},goog.exportPath_=function(t,e,i){var n=t.split("."),r=i||goog.global;n[0]in r||!r.execScript||r.execScript("var "+n[0]);for(var s;n.length&&(s=n.shift());)!n.length&&goog.isDef(e)?r[s]=e:r=r[s]?r[s]:r[s]={}},goog.define=function(t,e){var i=e;COMPILED||(goog.global.CLOSURE_UNCOMPILED_DEFINES&&Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_UNCOMPILED_DEFINES,t)?i=goog.global.CLOSURE_UNCOMPILED_DEFINES[t]:goog.global.CLOSURE_DEFINES&&Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES,t)&&(i=goog.global.CLOSURE_DEFINES[t])),goog.exportPath_(t,i)},goog.DEBUG=!0,goog.define("goog.LOCALE","en"),goog.define("goog.TRUSTED_SITE",!0),goog.define("goog.STRICT_MODE_COMPATIBLE",!1),goog.provide=function(t){if(!COMPILED){if(goog.isProvided_(t))throw Error('Namespace "'+t+'" already declared.');delete goog.implicitNamespaces_[t];for(var e=t;(e=e.substring(0,e.lastIndexOf(".")))
}}}return O(t.replace(he,"$1"),e,i,n)}function i(){function t(i,n){return e.push(i+" ")>w.cacheLength&&delete t[e.shift()],t[i+" "]=n}var e=[];return t}function n(t){return t[F]=!0,t}function r(t){var e=D.createElement("div");try{return!!t(e)}catch(i){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function s(t,e){for(var i=t.split("|"),n=t.length;n--;)w.attrHandle[i[n]]=e}function o(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||q)-(~t.sourceIndex||q);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function a(t){return function(e){var i=e.nodeName.toLowerCase();return"input"===i&&e.type===t}}function h(t){return function(e){var i=e.nodeName.toLowerCase();return("input"===i||"button"===i)&&e.type===t}}function l(t){return n(function(e){return e=+e,n(function(i,n){for(var r,s=t([],i.length,e),o=s.length;o--;)i[r=s[o]]&&(i[r]=!(n[r]=i[r]))})})}function c(t){return t&&typeof t.getElementsByTagName!==z&&t}function u(){}function f(t){for(var e=0,i=t.length,n="";i>e;e++)n+=t[e].value;return n}function d(t,e,i){var n=e.dir,r=i&&"parentNode"===n,s=W++;return e.first?function(e,i,s){for(;e=e[n];)if(1===e.nodeType||r)return t(e,i,s)}:function(e,i,o){var a,h,l=[H,s];if(o){for(;e=e[n];)if((1===e.nodeType||r)&&t(e,i,o))return!0}else for(;e=e[n];)if(1===e.nodeType||r){if(h=e[F]||(e[F]={}),(a=h[n])&&a[0]===H&&a[1]===s)return l[2]=a[2];if(h[n]=l,l[2]=t(e,i,o))return!0}}}function p(t){return t.length>1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function g(t,i,n){for(var r=0,s=i.length;s>r;r++)e(t,i[r],n);return n}function v(t,e,i,n,r){for(var s,o=[],a=0,h=t.length,l=null!=e;h>a;a++)(s=t[a])&&(!i||i(s,n,r))&&(o.push(s),l&&e.push(a));return o}function m(t,e,i,r,s,o){return r&&!r[F]&&(r=m(r)),s&&!s[F]&&(s=m(s,o)),n(function(n,o,a,h){var l,c,u,f=[],d=[],p=o.length,m=n||g(e||"*",a.nodeType?[a]:a,[]),y=!t||!n&&e?m:v(m,f,t,a,h),b=i?s||(n?t:p||r)?[]:o:y;if(i&&i(y,b,a,h),r)for(l=v(b,d),r(l,[],a,h),c=l.length;c--;)(u=l[c])&&(b[d[c]]=!(y[d[c]]=u));if(n){if(s||t){if(s){for(l=[],c=b.length;c--;)(u=b[c])&&l.push(y[c]=u);s(null,b=[],l,h)}for(c=b.length;c--;)(u=b[c])&&(l=s?ee.call(n,u):f[c])>-1&&(n[l]=!(o[l]=u))}}else b=v(b===o?b.splice(p,b.length):b),s?s(null,o,b,h):Z.apply(o,b)})}function y(t){for(var e,i,n,r=t.length,s=w.relative[t[0].type],o=s||w.relative[" "],a=s?1:0,h=d(function(t){return t===e},o,!0),l=d(function(t){return ee.call(e,t)>-1},o,!0),c=[function(t,i,n){return!s&&(n||i!==E)||((e=i).nodeType?h(t,i,n):l(t,i,n))}];r>a;a++)if(i=w.relative[t[a].type])c=[d(p(c),i)];else{if(i=w.filter[t[a].type].apply(null,t[a].matches),i[F]){for(n=++a;r>n&&!w.relative[t[n].type];n++);return m(a>1&&p(c),a>1&&f(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(he,"$1"),i,n>a&&y(t.slice(a,n)),r>n&&y(t=t.slice(n)),r>n&&f(t))}c.push(i)}return p(c)}function b(t,i){var r=i.length>0,s=t.length>0,o=function(n,o,a,h,l){var c,u,f,d=0,p="0",g=n&&[],m=[],y=E,b=n||s&&w.find.TAG("*",l),x=H+=null==y?1:Math.random()||.1,_=b.length;for(l&&(E=o!==D&&o);p!==_&&null!=(c=b[p]);p++){if(s&&c){for(u=0;f=t[u++];)if(f(c,o,a)){h.push(c);break}l&&(H=x)}r&&((c=!f&&c)&&d--,n&&g.push(c))}if(d+=p,r&&p!==d){for(u=0;f=i[u++];)f(g,m,o,a);if(n){if(d>0)for(;p--;)g[p]||m[p]||(m[p]=J.call(h));m=v(m)}Z.apply(h,m),l&&!n&&m.length>0&&d+i.length>1&&e.uniqueSort(h)}return l&&(H=x,E=y),g};return r?n(o):o}var x,_,w,C,S,T,k,O,E,A,P,j,D,L,I,M,N,R,$,F="sizzle"+-new Date,B=t.document,H=0,W=0,G=i(),X=i(),U=i(),V=function(t,e){return t===e&&(P=!0),0},z="undefined",q=1<<31,Y={}.hasOwnProperty,K=[],J=K.pop,Q=K.push,Z=K.push,te=K.slice,ee=K.indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(this[e]===t)return e;return-1},ie="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",se=re.replace("w","w#"),oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+se+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.
return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(t,e){var i,n,r,s,o=[],a=e.delegateCount,h=t.target;if(a&&h.nodeType&&(!t.button||"click"!==t.type))for(;h!==this;h=h.parentNode||this)if(h.disabled!==!0||"click"!==t.type){for(n=[],i=0;a>i;i++)s=e[i],r=s.selector+" ",void 0===n[r]&&(n[r]=s.needsContext?Z(r,this).index(h)>=0:Z.find(r,this,null,[h]).length),n[r]&&n.push(s);n.length&&o.push({elem:h,handlers:n})}return a<e.length&&o.push({elem:this,handlers:e.slice(a)}),o},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var i,n,r,s=e.button;return null==t.pageX&&null!=e.clientX&&(i=t.target.ownerDocument||J,n=i.documentElement,r=i.body,t.pageX=e.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),t.pageY=e.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)),t.which||void 0===s||(t.which=1&s?1:2&s?3:4&s?2:0),t}},fix:function(t){if(t[Z.expando])return t;var e,i,n,r=t.type,s=t,o=this.fixHooks[r];for(o||(this.fixHooks[r]=o=Oe.test(r)?this.mouseHooks:ke.test(r)?this.keyHooks:{}),n=o.props?this.props.concat(o.props):this.props,t=new Z.Event(s),e=n.length;e--;)i=n[e],t[i]=s[i];return t.target||(t.target=J),3===t.target.nodeType&&(t.target=t.target.parentNode),o.filter?o.filter(t,s):t},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==u()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===u()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&Z.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(t){return Z.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,i,n){var r=Z.extend(new Z.Event,i,{type:t,isSimulated:!0,originalEvent:{}});n?Z.event.trigger(r,null,e):Z.event.dispatch.call(e,r),r.isDefaultPrevented()&&i.preventDefault()}},Z.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i,!1)},Z.Event=function(t,e){return this instanceof Z.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?l:c):this.type=t,e&&Z.extend(this,e),this.timeStamp=t&&t.timeStamp||Z.now(),void(this[Z.expando]=!0)):new Z.Event(t,e)},Z.Event.prototype={isDefaultPrevented:c,isPropagationStopped:c,isImmediatePropagationStopped:c,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=l,t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=l,t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=l,t&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),this.stopPropagation()}},Z.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){Z.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,n=this,r=t.relatedTarget,s=t.handleObj;return(!r||r!==n&&!Z.contains(n,r))&&(t.type=s.origType,i=s.handler.apply(this,arguments),t.type=e),i}}}),K.focusinBubbles||Z.each({focus:"focusin",blur:"focusout"},function(t,e){var i=function(t){Z.event.simulate(e,t.target,Z.event.fix(t),!0)};Z.event.special[e]={setup:function(){var n=this.ownerDocument||this,r=me.access(n,e);r||n.addEventListener(t,i,!0),me.access(n,e,(r||0)+1)},teardown:function(){var n=this.ownerDocument||this,r=me.access(n,e)-1;r?me.access(n,e,r):(n.removeEventListener(t,i,!0),me.remove(n,e))}}}),Z.fn.extend({on:functio
for(r in i)s.setRequestHeader(r,i[r]);e=function(t){return function(){e&&(delete Pi[o],e=s.onload=s.onerror=null,"abort"===t?s.abort():"error"===t?n(s.status,s.statusText):n(ji[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:void 0,s.getAllResponseHeaders()))}},s.onload=e(),s.onerror=e("error"),e=Pi[o]=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(a){if(e)throw a}},abort:function(){e&&e()}}:void 0}),Z.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return Z.globalEval(t),t}}}),Z.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),Z.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,r){e=Z("<script>").prop({async:!0,charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&r("error"===t.type?404:200,t.type)}),J.head.appendChild(e[0])},abort:function(){i&&i()}}}});var Li=[],Ii=/(=)\?(?=&|$)|\?\?/;Z.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Li.pop()||Z.expando+"_"+li++;return this[t]=!0,t}}),Z.ajaxPrefilter("json jsonp",function(e,i,n){var r,s,o,a=e.jsonp!==!1&&(Ii.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ii.test(e.data)&&"data");return a||"jsonp"===e.dataTypes[0]?(r=e.jsonpCallback=Z.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ii,"$1"+r):e.jsonp!==!1&&(e.url+=(ci.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||Z.error(r+" was not called"),o[0]},e.dataTypes[0]="json",s=t[r],t[r]=function(){o=arguments},n.always(function(){t[r]=s,e[r]&&(e.jsonpCallback=i.jsonpCallback,Li.push(r)),o&&Z.isFunction(s)&&s(o[0]),o=s=void 0}),"script"):void 0}),Z.parseHTML=function(t,e,i){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(i=e,e=!1),e=e||J;var n=oe.exec(t),r=!i&&[];return n?[e.createElement(n[1])]:(n=Z.buildFragment([t],e,r),r&&r.length&&Z(r).remove(),Z.merge([],n.childNodes))};var Mi=Z.fn.load;Z.fn.load=function(t,e,i){if("string"!=typeof t&&Mi)return Mi.apply(this,arguments);var n,r,s,o=this,a=t.indexOf(" ");return a>=0&&(n=Z.trim(t.slice(a)),t=t.slice(0,a)),Z.isFunction(e)?(i=e,e=void 0):e&&"object"==typeof e&&(r="POST"),o.length>0&&Z.ajax({url:t,type:r,dataType:"html",data:e}).done(function(t){s=arguments,o.html(n?Z("<div>").append(Z.parseHTML(t)).find(n):t)}).complete(i&&function(t,e){o.each(i,s||[t.responseText,e,t])}),this},Z.expr.filters.animated=function(t){return Z.grep(Z.timers,function(e){return t===e.elem}).length};var Ni=t.document.documentElement;Z.offset={setOffset:function(t,e,i){var n,r,s,o,a,h,l,c=Z.css(t,"position"),u=Z(t),f={};"static"===c&&(t.style.position="relative"),a=u.offset(),s=Z.css(t,"top"),h=Z.css(t,"left"),l=("absolute"===c||"fixed"===c)&&(s+h).indexOf("auto")>-1,l?(n=u.position(),o=n.top,r=n.left):(o=parseFloat(s)||0,r=parseFloat(h)||0),Z.isFunction(e)&&(e=e.call(t,i,a)),null!=e.top&&(f.top=e.top-a.top+o),null!=e.left&&(f.left=e.left-a.left+r),"using"in e?e.using.call(t,f):u.css(f)}},Z.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){Z.offset.setOffset(this,t,e)});var e,i,n=this[0],r={top:0,left:0},s=n&&n.ownerDocument;return s?(e=s.documentElement,Z.contains(e,n)?(typeof n.getBoundingClientRect!==Te&&(r=n.getBoundingClientRect()),i=H(s),{top:r.top+i.pageYOffset-e.clientTop,left:r.left+i.pageXOffset-e.clientLeft}):r):void 0},position:function(){if(this[0]){var t,e,i=this[0],n={top:0,left:0};return"fixed"===Z.css(i,"position")?e=i.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),Z.nodeName(t[0],"html")||(n=t.offset()),n.top+=Z.css(t[0],"borderTopWidth",!0),n.left+=Z.css(t[0],"borderLeftWidth",!0)),{top:e.top-n.top-Z.css(i,"marginTop",!0),left:e.left-n.left-Z.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||Ni;t&&!Z.n
t.isWindow(this.$scrollElement[0])||(e="position",i=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var n=this;this.$body.find(this.selector).map(function(){var n=t(this),r=n.data("target")||n.attr("href"),s=/^#./.test(r)&&t(r);return s&&s.length&&s.is(":visible")&&[[s[e]().top+i,r]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){n.offsets.push(this[0]),n.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),n=this.options.offset+i-this.$scrollElement.height(),r=this.offsets,s=this.targets,o=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=n)return o!=(t=s[s.length-1])&&this.activate(t);if(o&&e<=r[0])return o!=(t=s[0])&&this.activate(t);for(t=r.length;t--;)o!=s[t]&&e>=r[t]&&(!r[t+1]||e<=r[t+1])&&this.activate(s[t])},e.prototype.activate=function(e){this.activeTarget=e,t(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var i=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',n=t(i).parents("li").addClass("active");n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate.bs.scrollspy")};var n=t.fn.scrollspy;t.fn.scrollspy=i,t.fn.scrollspy.Constructor=e,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=n,this},t(window).on("load.bs.scrollspy.data-api",function(){t('[data-spy="scroll"]').each(function(){var e=t(this);i.call(e,e.data())})})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var n=t(this),r=n.data("bs.tab");r||n.data("bs.tab",r=new i(this)),"string"==typeof e&&r[e]()})}var i=function(e){this.element=t(e)};i.VERSION="3.2.0",i.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),n=e.data("target");if(n||(n=e.attr("href"),n=n&&n.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var r=i.find(".active:last a")[0],s=t.Event("show.bs.tab",{relatedTarget:r});if(e.trigger(s),!s.isDefaultPrevented()){var o=t(n);this.activate(e.closest("li"),i),this.activate(o,o.parent(),function(){e.trigger({type:"shown.bs.tab",relatedTarget:r})})}}},i.prototype.activate=function(e,i,n){function r(){s.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),o?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),n&&n()}var s=i.find("> .active"),o=n&&t.support.transition&&s.hasClass("fade");o?s.one("bsTransitionEnd",r).emulateTransitionEnd(150):r(),s.removeClass("in")};var n=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=n,this},t(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(i){i.preventDefault(),e.call(t(this),"show")})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var n=t(this),r=n.data("bs.affix"),s="object"==typeof e&&e;r||n.data("bs.affix",r=new i(this,s)),"string"==typeof e&&r[e]()})}var i=function(e,n){this.options=t.extend({},i.DEFAULTS,n),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.2.0",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=t(document).height(),n=this.$target.scrollTop(),r=this.$element.offset(),s=this.options.offset,o=s.top,a=s.bottom;"object"!=typeof s&&(a=o=s),"function"==typeof o&&(o=s.to
g.parseTransformAttribute=function(){function t(t,e){var i=e[0];t[0]=Math.cos(i),t[1]=Math.sin(i),t[2]=-Math.sin(i),t[3]=Math.cos(i)}function e(t,e){var i=e[0],n=2===e.length?e[1]:e[0];t[0]=i,t[3]=n}function i(t,e){t[2]=e[0]}function n(t,e){t[1]=e[0]}function r(t,e){t[4]=e[0],2===e.length&&(t[5]=e[1])}var s=[1,0,0,1,0,0],o="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:e[-+]?\\d+)?)",a="(?:\\s+,?\\s*|,\\s*)",h="(?:(skewX)\\s*\\(\\s*("+o+")\\s*\\))",l="(?:(skewY)\\s*\\(\\s*("+o+")\\s*\\))",c="(?:(rotate)\\s*\\(\\s*("+o+")(?:"+a+"("+o+")"+a+"("+o+"))?\\s*\\))",u="(?:(scale)\\s*\\(\\s*("+o+")(?:"+a+"("+o+"))?\\s*\\))",f="(?:(translate)\\s*\\(\\s*("+o+")(?:"+a+"("+o+"))?\\s*\\))",d="(?:(matrix)\\s*\\(\\s*("+o+")"+a+"("+o+")"+a+"("+o+")"+a+"("+o+")"+a+"("+o+")"+a+"("+o+")\\s*\\))",p="(?:"+d+"|"+f+"|"+u+"|"+c+"|"+h+"|"+l+")",v="(?:"+p+"(?:"+a+p+")*)",m="^\\s*(?:"+v+"?)\\s*$",y=new RegExp(m),b=new RegExp(p,"g");return function(o){var a=s.concat(),h=[];if(!o||o&&!y.test(o))return a;o.replace(b,function(o){var l=new RegExp(p).exec(o).filter(function(t){return""!==t&&null!=t}),c=l[1],u=l.slice(2).map(parseFloat);switch(c){case"translate":r(a,u);break;case"rotate":u[0]=g.util.degreesToRadians(u[0]),t(a,u);break;case"scale":e(a,u);break;case"skewX":i(a,u);break;case"skewY":n(a,u);break;case"matrix":a=u}h.push(a.concat()),a=s.concat()});for(var l=h[0];h.length>1;)h.shift(),l=g.util.multiplyTransformMatrices(l,h[0]);return l}}(),g.parseSVGDocument=function(){function t(t,e){for(;t&&(t=t.parentNode);)if(e.test(t.nodeName))return!0;return!1}var e=/^(path|circle|polygon|polyline|ellipse|rect|line|image|text)$/,i="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:e[-+]?\\d+)?)",n=new RegExp("^\\s*("+i+"+)\\s*,?\\s*("+i+"+)\\s*,?\\s*("+i+"+)\\s*,?\\s*("+i+"+)\\s*$");return function(i,r,s){if(i){var o=new Date;u(i);var a,h,l=i.getAttribute("viewBox"),c=x(i.getAttribute("width")),d=x(i.getAttribute("height"));if(l&&(l=l.match(n))){var p=parseFloat(l[1]),v=parseFloat(l[2]),m=1,b=1;a=parseFloat(l[3]),h=parseFloat(l[4]),c&&c!==a&&(m=c/a),d&&d!==h&&(b=d/h),f(i,[m,0,0,b,m*-p,b*-v])}var _=g.util.toArray(i.getElementsByTagName("*"));if(0===_.length&&g.isLikelyNode){_=i.selectNodes('//*[name(.)!="svg"]');for(var w=[],C=0,S=_.length;S>C;C++)w[C]=_[C];_=w}var T=_.filter(function(i){return e.test(i.tagName)&&!t(i,/^(?:pattern|defs)$/)});if(!T||T&&!T.length)return void(r&&r([],{}));var k={width:c?c:a,height:d?d:h,widthAttr:c,heightAttr:d};g.gradientDefs=g.getGradientDefs(i),g.cssRules=g.getCSSRules(i),g.parseElements(T,function(t){g.documentParsingTime=new Date-o,r&&r(t,k)},y(k),s)}}}();var S={has:function(t,e){e(!1)},get:function(){},set:function(){}};v(g,{getGradientDefs:function(t){var e,i,n,r,s=t.getElementsByTagName("linearGradient"),o=t.getElementsByTagName("radialGradient"),a=0,h=[],l={},c={};for(h.length=s.length+o.length,i=s.length;i--;)h[a++]=s[i];for(i=o.length;i--;)h[a++]=o[i];for(;a--;)e=h[a],r=e.getAttribute("xlink:href"),n=e.getAttribute("id"),r&&(c[n]=r.substr(1)),l[n]=e;for(n in c){var u=l[c[n]].cloneNode(!0);for(e=l[n];u.firstChild;)e.appendChild(u.firstChild)}return l},parseAttributes:function(t,r){if(t){var s,o={};t.parentNode&&/^symbol|[g|a]$/i.test(t.parentNode.nodeName)&&(o=g.parseAttributes(t.parentNode,r));var h=r.reduce(function(n,r){return s=t.getAttribute(r),s&&(r=e(r),s=i(r,s,o),n[r]=s),n},{});return h=v(h,v(a(t),g.parseStyleAttribute(t))),n(v(o,h))}},parseElements:function(t,e,i,n){new g.ElementsParser(t,e,i,n).parse()},parseStyleAttribute:function(t){var e={},i=t.getAttribute("style");return i?("string"==typeof i?s(i,e):o(i,e),e):e},parsePointsAttribute:function(t){if(!t)return null;t=t.replace(/,/g," ").trim(),t=t.split(/\s+/);var e,i,n=[];for(e=0,i=t.length;i>e;e+=2)n.push({x:parseFloat(t[e]),y:parseFloat(t[e+1])});return n},getCSSRules:function(t){for(var n,r=t.getElementsByTagName("style"),s={},o=0,a=r.length;a>o;o++){var h=r[0].textContent;h=h.replace(/\/\*[\s\S]*?\*\//g,""),n=h.match(/[^{]*\{[\s\S]*?\}/g),n=n.map(function(t){return t.trim()}),n.forEach(function(t){for(var n=t.match(/([\s\S]*?)\s*\{([^}]*)\}/),r={},o=n[2].trim(),a=o.replace(/;$/,"").
},toSVG:function(t,e){t||(t={});var i=[];return this._setSVGPreamble(i,t),this._setSVGHeader(i,t),this._setSVGBgOverlayColor(i,"backgroundColor"),this._setSVGBgOverlayImage(i,"backgroundImage"),this._setSVGObjects(i,e),this._setSVGBgOverlayColor(i,"overlayColor"),this._setSVGBgOverlayImage(i,"overlayImage"),i.push("</svg>"),i.join("")},_setSVGPreamble:function(t,e){e.suppressPreamble||t.push('<?xml version="1.0" encoding="',e.encoding||"UTF-8",'" standalone="no" ?>','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(t,e){t.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',e.viewBox?e.viewBox.width:this.width,'" ','height="',e.viewBox?e.viewBox.height:this.height,'" ',this.backgroundColor&&!this.backgroundColor.toLive?'style="background-color: '+this.backgroundColor+'" ':null,e.viewBox?'viewBox="'+e.viewBox.x+" "+e.viewBox.y+" "+e.viewBox.width+" "+e.viewBox.height+'" ':null,'xml:space="preserve">',"<desc>Created with Fabric.js ",fabric.version,"</desc>","<defs>",fabric.createSVGFontFacesMarkup(this.getObjects()),fabric.createSVGRefElementsMarkup(this),"</defs>")},_setSVGObjects:function(t,e){var i=this.getActiveGroup();i&&this.discardActiveGroup();for(var n=0,r=this.getObjects(),s=r.length;s>n;n++)t.push(r[n].toSVG(e));i&&(this.setActiveGroup(new fabric.Group(i.getObjects())),i.forEachObject(function(t){t.set("active",!0)}))},_setSVGBgOverlayImage:function(t,e){this[e]&&this[e].toSVG&&t.push(this[e].toSVG())},_setSVGBgOverlayColor:function(t,e){this[e]&&this[e].source?t.push('<rect x="',this[e].offsetX,'" y="',this[e].offsetY,'" ','width="',"repeat-y"===this[e].repeat||"no-repeat"===this[e].repeat?this[e].source.width:this.width,'" height="',"repeat-x"===this[e].repeat||"no-repeat"===this[e].repeat?this[e].source.height:this.height,'" fill="url(#'+e+'Pattern)"',"></rect>"):this[e]&&"overlayColor"===e&&t.push('<rect x="0" y="0" ','width="',this.width,'" height="',this.height,'" fill="',this[e],'"',"></rect>")},sendToBack:function(t){return i(this._objects,t),this._objects.unshift(t),this.renderAll&&this.renderAll()},bringToFront:function(t){return i(this._objects,t),this._objects.push(t),this.renderAll&&this.renderAll()},sendBackwards:function(t,e){var n=this._objects.indexOf(t);if(0!==n){var r=this._findNewLowerIndex(t,n,e);i(this._objects,t),this._objects.splice(r,0,t),this.renderAll&&this.renderAll()}return this},_findNewLowerIndex:function(t,e,i){var n;if(i){n=e;for(var r=e-1;r>=0;--r){var s=t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t);if(s){n=r;break}}}else n=e-1;return n},bringForward:function(t,e){var n=this._objects.indexOf(t);if(n!==this._objects.length-1){var r=this._findNewUpperIndex(t,n,e);i(this._objects,t),this._objects.splice(r,0,t),this.renderAll&&this.renderAll()}return this},_findNewUpperIndex:function(t,e,i){var n;if(i){n=e;for(var r=e+1;r<this._objects.length;++r){var s=t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t);if(s){n=r;break}}}else n=e+1;return n},moveTo:function(t,e){return i(this._objects,t),this._objects.splice(e,0,t),this.renderAll&&this.renderAll()},dispose:function(){return this.clear(),this.interactive&&this.removeListeners(),this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this.getObjects().length+" }>"}}),t(fabric.StaticCanvas.prototype,fabric.Observable),t(fabric.StaticCanvas.prototype,fabric.Collection),t(fabric.StaticCanvas.prototype,fabric.DataURLExporter),t(fabric.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(t){var e=fabric.util.createCanvasElement();if(!e||!e.getContext)return null;var i=e.getContext("2d");if(!i)return null;switch(t){case"getImageData":return"undefined"!=typeof i.getImageData;case"setLineDash":return"undefined"!=typeof i.setLineDash;case"toDataURL":return"undefined"!=ty
},_fire:function(t,e,i){this.fire("object:"+t,{target:e,e:i}),e.fire(t,{e:i})},_beforeScaleTransform:function(t,e){if("scale"===e.action||"scaleX"===e.action||"scaleY"===e.action){var i=this._shouldCenterTransform(t,e.target);(i&&("center"!==e.originX||"center"!==e.originY)||!i&&"center"===e.originX&&"center"===e.originY)&&(this._resetCurrentTransform(t),e.reset=!0)}},_onScale:function(t,e,i,n){!t.shiftKey&&!this.uniScaleTransform||e.target.get("lockUniScaling")?(!e.reset&&"scale"===e.currentAction&&this._resetCurrentTransform(t,e.target),e.currentAction="scaleEqually",this._scaleObject(i,n,"equally")):(e.currentAction="scale",this._scaleObject(i,n))},_setCursorFromEvent:function(t,e){if(!e||!e.selectable)return this.setCursor(this.defaultCursor),!1;var i=this.getActiveGroup(),n=e._findTargetCorner&&(!i||!i.contains(e))&&e._findTargetCorner(this.getPointer(t,!0));return n?this._setCornerCursor(n,e):this.setCursor(e.hoverCursor||this.hoverCursor),!0},_setCornerCursor:function(e,i){if(e in t)this.setCursor(this._getRotatedCornerCursor(e,i));else{if("mtr"!==e||!i.hasRotatingPoint)return this.setCursor(this.defaultCursor),!1;this.setCursor(this.rotationCursor)}},_getRotatedCornerCursor:function(e,i){var n=Math.round(i.getAngle()%360/45);return 0>n&&(n+=8),n+=t[e],n%=8,this.cursorMap[n]}})}(),function(){var t=Math.min,e=Math.max;fabric.util.object.extend(fabric.Canvas.prototype,{_shouldGroup:function(t,e){var i=this.getActiveObject();return t.shiftKey&&(this.getActiveGroup()||i&&i!==e)&&this.selection},_handleGrouping:function(t,e){(e!==this.getActiveGroup()||(e=this.findTarget(t,!0),e&&!e.isType("group")))&&(this.getActiveGroup()?this._updateActiveGroup(e,t):this._createActiveGroup(e,t),this._activeGroup&&this._activeGroup.saveCoords())},_updateActiveGroup:function(t,e){var i=this.getActiveGroup();if(i.contains(t)){if(i.removeWithUpdate(t),this._resetObjectTransform(i),t.set("active",!1),1===i.size())return this.discardActiveGroup(e),void this.setActiveObject(i.item(0))}else i.addWithUpdate(t),this._resetObjectTransform(i);this.fire("selection:created",{target:i,e:e}),i.set("active",!0)},_createActiveGroup:function(t,e){if(this._activeObject&&t!==this._activeObject){var i=this._createGroup(t);i.addWithUpdate(),this.setActiveGroup(i),this._activeObject=null,this.fire("selection:created",{target:i,e:e})}t.set("active",!0)},_createGroup:function(t){var e=this.getObjects(),i=e.indexOf(this._activeObject)<e.indexOf(t),n=i?[this._activeObject,t]:[t,this._activeObject];return new fabric.Group(n,{originX:"center",originY:"center",canvas:this})},_groupSelectedObjects:function(t){var e=this._collectObjects();1===e.length?this.setActiveObject(e[0],t):e.length>1&&(e=new fabric.Group(e.reverse(),{originX:"center",originY:"center",canvas:this}),e.addWithUpdate(),this.setActiveGroup(e,t),e.saveCoords(),this.fire("selection:created",{target:e}),this.renderAll())},_collectObjects:function(){for(var i,n=[],r=this._groupSelector.ex,s=this._groupSelector.ey,o=r+this._groupSelector.left,a=s+this._groupSelector.top,h=new fabric.Point(t(r,o),t(s,a)),l=new fabric.Point(e(r,o),e(s,a)),c=r===o&&s===a,u=this._objects.length;u--&&(i=this._objects[u],!(i&&i.selectable&&i.visible&&(i.intersectsWithRect(h,l)||i.isContainedWithinRect(h,l)||i.containsPoint(h)||i.containsPoint(l))&&(i.set("active",!0),n.push(i),c))););return n},_maybeGroupObjects:function(t){this.selection&&this._groupSelector&&this._groupSelectedObjects(t);var e=this.getActiveGroup();e&&(e.setObjectsCoords().setCoords(),e.isMoving=!1,this.setCursor(this.defaultCursor)),this._groupSelector=null,this._currentTransform=null}})}(),fabric.util.object.extend(fabric.StaticCanvas.prototype,{toDataURL:function(t){t||(t={});var e=t.format||"png",i=t.quality||1,n=t.multiplier||1,r={left:t.left,top:t.top,width:t.width,height:t.height};return 1!==n?this.__toDataURLWithMultiplier(e,i,r,n):this.__toDataURL(e,i,r)},__toDataURL:function(t,e,i){this.renderAll(!0);var n=this.upperCanvasEl||this.lowerCanvasEl,r=this.__getCroppedCanvas(n,i);"jpg"===t&&(t="jpeg");var s=fabric.StaticCanvas.supports("toDataURLWit
},_drawControl:function(t,i,n,r,s){var o=this.cornerSize;this.isControlVisible(t)&&(e()||this.transparentCorners||i.clearRect(r,s,o,o),i[n](r,s,o,o))},isControlVisible:function(t){return this._getControlsVisibility()[t]},setControlVisible:function(t,e){return this._getControlsVisibility()[t]=e,this},setControlsVisibility:function(t){t||(t={});for(var e in t)this.setControlVisible(e,t[e]);return this},_getControlsVisibility:function(){return this._controlsVisibility||(this._controlsVisibility={tl:!0,tr:!0,br:!0,bl:!0,ml:!0,mt:!0,mr:!0,mb:!0,mtr:!0}),this._controlsVisibility}})}(),fabric.util.object.extend(fabric.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(t,e){e=e||{};var i=function(){},n=e.onComplete||i,r=e.onChange||i,s=this;return fabric.util.animate({startValue:t.get("left"),endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(e){t.set("left",e),s.renderAll(),r()},onComplete:function(){t.setCoords(),n()}}),this},fxCenterObjectV:function(t,e){e=e||{};var i=function(){},n=e.onComplete||i,r=e.onChange||i,s=this;return fabric.util.animate({startValue:t.get("top"),endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(e){t.set("top",e),s.renderAll(),r()},onComplete:function(){t.setCoords(),n()}}),this},fxRemove:function(t,e){e=e||{};var i=function(){},n=e.onComplete||i,r=e.onChange||i,s=this;return fabric.util.animate({startValue:t.get("opacity"),endValue:0,duration:this.FX_DURATION,onStart:function(){t.set("active",!1)},onChange:function(e){t.set("opacity",e),s.renderAll(),r()},onComplete:function(){s.remove(t),n()}}),this}}),fabric.util.object.extend(fabric.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var t,e,i=[];for(t in arguments[0])i.push(t);for(var n=0,r=i.length;r>n;n++)t=i[n],e=n!==r-1,this._animate(t,arguments[0][t],arguments[1],e)}else this._animate.apply(this,arguments);return this},_animate:function(t,e,i,n){var r,s=this;e=e.toString(),i=i?fabric.util.object.clone(i):{},~t.indexOf(".")&&(r=t.split("."));var o=r?this.get(r[0])[r[1]]:this.get(t);"from"in i||(i.from=o),e=~e.indexOf("=")?o+parseFloat(e.replace("=","")):parseFloat(e),fabric.util.animate({startValue:i.from,endValue:e,byValue:i.by,easing:i.easing,duration:i.duration,abort:i.abort&&function(){return i.abort.call(s)},onChange:function(e){r?s[r[0]][r[1]]=e:s.set(t,e),n||i.onChange&&i.onChange()},onComplete:function(){n||(s.setCoords(),i.onComplete&&i.onComplete())}})}}),function(t){"use strict";function e(t,e){var i=t.origin,n=t.axis1,r=t.axis2,s=t.dimension,o=e.nearest,a=e.center,h=e.farthest;return function(){switch(this.get(i)){case o:return Math.min(this.get(n),this.get(r));case a:return Math.min(this.get(n),this.get(r))+.5*this.get(s);case h:return Math.max(this.get(n),this.get(r))}}}var i=t.fabric||(t.fabric={}),n=i.util.object.extend,r={x1:1,x2:1,y1:1,y2:1},s=i.StaticCanvas.supports("setLineDash");return i.Line?void i.warn("fabric.Line is already defined"):(i.Line=i.util.createClass(i.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,initialize:function(t,e){e=e||{},t||(t=[0,0,0,0]),this.callSuper("initialize",e),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(e)},_setWidthHeight:function(t){t||(t={}),this.width=Math.abs(this.x2-this.x1)||1,this.height=Math.abs(this.y2-this.y1)||1,this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,e){return this[t]=e,"undefined"!=typeof r[t]&&this._setWidthHeight(),this},_getLeftToOriginX:e({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:e({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t,e){if(t.beginPath(),e){var i=this.getCenterPoint();t.translate(i.x,i.y)}if(!this.strokeDashArray||this.strokeDashArray&&s){var n=this.x1<=this.x2?-1:1,r=this.y1<=this.y2?-1:1;t.moveTo(1===this.width?0:n*this.width/2,1===this.height?0:r*this.height/2),t.lineTo(1==
},applyFilters:function(t){if(this._originalElement){if(0===this.filters.length)return this._element=this._originalElement,void(t&&t());var e=this._originalElement,i=fabric.util.createCanvasElement(),n=fabric.util.createImage(),r=this;return i.width=e.width,i.height=e.height,i.getContext("2d").drawImage(e,0,0,e.width,e.height),this.filters.forEach(function(t){t&&t.applyTo(i)}),n.width=e.width,n.height=e.height,fabric.isLikelyNode?(n.src=i.toBuffer(void 0,fabric.Image.pngCompression),r._element=n,t&&t()):(n.onload=function(){r._element=n,t&&t(),n.onload=i=e=null},n.src=i.toDataURL("image/png")),this}},_render:function(t,e){this._element&&t.drawImage(this._element,e?this.left:-this.width/2,e?this.top:-this.height/2,this.width,this.height),this._renderStroke(t)},_resetWidthHeight:function(){var t=this.getElement();this.set("width",t.width),this.set("height",t.height)},_initElement:function(t){this.setElement(fabric.util.getById(t)),fabric.util.addClass(this.getElement(),fabric.Image.CSS_CANVAS)},_initConfig:function(t){t||(t={}),this.setOptions(t),this._setWidthHeight(t),this._element&&this.crossOrigin&&(this._element.crossOrigin=this.crossOrigin)},_initFilters:function(t,e){t.filters&&t.filters.length?fabric.util.enlivenObjects(t.filters,function(t){e&&e(t)},"fabric.Image.filters"):e&&e()},_setWidthHeight:function(t){this.width="width"in t?t.width:this.getElement()?this.getElement().width||0:0,this.height="height"in t?t.height:this.getElement()?this.getElement().height||0:0},complexity:function(){return 1}}),fabric.Image.CSS_CANVAS="canvas-img",fabric.Image.prototype.getSvgSrc=fabric.Image.prototype.getSrc,fabric.Image.fromObject=function(t,e){fabric.util.loadImage(t.src,function(i){fabric.Image.prototype._initFilters.call(t,t,function(n){t.filters=n||[];var r=new fabric.Image(i,t);e&&e(r)})},null,t.crossOrigin)},fabric.Image.fromURL=function(t,e,i){fabric.util.loadImage(t,function(t){e(new fabric.Image(t,i))},null,i&&i.crossOrigin)},fabric.Image.ATTRIBUTE_NAMES=fabric.SHARED_ATTRIBUTES.concat("x y width height xlink:href".split(" ")),fabric.Image.fromElement=function(t,i,n){var r=fabric.parseAttributes(t,fabric.Image.ATTRIBUTE_NAMES);fabric.Image.fromURL(r["xlink:href"],i,e(n?fabric.util.object.clone(n):{},r))},fabric.Image.async=!0,fabric.Image.pngCompression=1,void 0)}("undefined"!=typeof exports?exports:this),fabric.util.object.extend(fabric.Object.prototype,{_getAngleValueForStraighten:function(){var t=this.getAngle()%360;return t>0?90*Math.round((t-1)/90):90*Math.round(t/90)},straighten:function(){return this.setAngle(this._getAngleValueForStraighten()),this},fxStraighten:function(t){t=t||{};var e=function(){},i=t.onComplete||e,n=t.onChange||e,r=this;return fabric.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(t){r.setAngle(t),n()},onComplete:function(){r.setCoords(),i()},onStart:function(){r.set("active",!1)}}),this}}),fabric.util.object.extend(fabric.StaticCanvas.prototype,{straightenObject:function(t){return t.straighten(),this.renderAll(),this},fxStraightenObject:function(t){return t.fxStraighten({onChange:this.renderAll.bind(this)}),this}}),fabric.Image.filters=fabric.Image.filters||{},fabric.Image.filters.BaseFilter=fabric.util.createClass({type:"BaseFilter",toObject:function(){return{type:this.type}},toJSON:function(){return this.toObject()}}),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend;e.Image.filters.Brightness=e.util.createClass(e.Image.filters.BaseFilter,{type:"Brightness",initialize:function(t){t=t||{},this.brightness=t.brightness||0},applyTo:function(t){for(var e=t.getContext("2d"),i=e.getImageData(0,0,t.width,t.height),n=i.data,r=this.brightness,s=0,o=n.length;o>s;s+=4)n[s]+=r,n[s+1]+=r,n[s+2]+=r;e.putImageData(i,0,0)},toObject:function(){return i(this.callSuper("toObject"),{brightness:this.brightness})}}),e.Image.filters.Brightness.fromObject=function(t){return new e.Image.filters.Brightness(t)}}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabr
},_renderCharDecoration:function(t,e,i,n,r,s,o){var a=e?e.textDecoration||this.textDecoration:this.textDecoration,h=(e?e.fontSize:null)||this.fontSize;a&&(a.indexOf("underline")>-1&&this._renderCharDecorationAtOffset(t,i,n+this.fontSize/this._fontSizeFraction,r,0,this.fontSize/20),a.indexOf("line-through")>-1&&this._renderCharDecorationAtOffset(t,i,n+this.fontSize/this._fontSizeFraction,r,o/2,h/20),a.indexOf("overline")>-1&&this._renderCharDecorationAtOffset(t,i,n,r,s-this.fontSize/this._fontSizeFraction,this.fontSize/20))},_renderCharDecorationAtOffset:function(t,e,i,n,r,s){t.fillRect(e,i-r,n,s)},_renderTextLine:function(t,e,i,n,r,s){r+=this.fontSize/4,this.callSuper("_renderTextLine",t,e,i,n,r,s)},_renderTextDecoration:function(t,e){return this.isEmptyStyles()?this.callSuper("_renderTextDecoration",t,e):void 0},_renderTextLinesBackground:function(t,e){if(this.textBackgroundColor||this.styles){t.save(),this.textBackgroundColor&&(t.fillStyle=this.textBackgroundColor);for(var i=0,n=this.fontSize/this._fontSizeFraction,r=0,s=e.length;s>r;r++){var o=this._getHeightOfLine(t,r,e);if(""!==e[r]){var a=this._getWidthOfLine(t,r,e),h=this._getLineLeftOffset(a);if(this.textBackgroundColor&&(t.fillStyle=this.textBackgroundColor,t.fillRect(this._getLeftOffset()+h,this._getTopOffset()+i+n,a,o)),this.styles[r])for(var l=0,c=e[r].length;c>l;l++)if(this.styles[r]&&this.styles[r][l]&&this.styles[r][l].textBackgroundColor){var u=e[r][l];t.fillStyle=this.styles[r][l].textBackgroundColor,t.fillRect(this._getLeftOffset()+h+this._getWidthOfCharsAt(t,r,l,e),this._getTopOffset()+i+n,this._getWidthOfChar(t,u,r,l,e)+1,o)}i+=o}else i+=o}t.restore()}},_getCacheProp:function(t,e){return t+e.fontFamily+e.fontSize+e.fontWeight+e.fontStyle+e.shadow},_applyCharStylesGetWidth:function(e,i,n,r,s){var o=s||this.styles[n]&&this.styles[n][r];o=o?t(o):{},this._applyFontStyles(o);var a=this._getCacheProp(i,o);if(this.isEmptyStyles()&&this._charWidthsCache[a]&&this.caching)return this._charWidthsCache[a];"string"==typeof o.shadow&&(o.shadow=new fabric.Shadow(o.shadow));var h=o.fill||this.fill;return e.fillStyle=h.toLive?h.toLive(e):h,o.stroke&&(e.strokeStyle=o.stroke&&o.stroke.toLive?o.stroke.toLive(e):o.stroke),e.lineWidth=o.strokeWidth||this.strokeWidth,e.font=this._getFontDeclaration.call(o),this._setShadow.call(o,e),this.caching?(this._charWidthsCache[a]||(this._charWidthsCache[a]=e.measureText(i).width),this._charWidthsCache[a]):e.measureText(i).width},_applyFontStyles:function(t){t.fontFamily||(t.fontFamily=this.fontFamily),t.fontSize||(t.fontSize=this.fontSize),t.fontWeight||(t.fontWeight=this.fontWeight),t.fontStyle||(t.fontStyle=this.fontStyle)},_getStyleDeclaration:function(e,i){return this.styles[e]&&this.styles[e][i]?t(this.styles[e][i]):{}},_getWidthOfChar:function(t,e,i,n){var r=this._getStyleDeclaration(i,n);this._applyFontStyles(r);var s=this._getCacheProp(e,r);if(this._charWidthsCache[s]&&this.caching)return this._charWidthsCache[s];if(t){t.save();var o=this._applyCharStylesGetWidth(t,e,i,n);return t.restore(),o}},_getHeightOfChar:function(t,e,i,n){return this.styles[i]&&this.styles[i][n]?this.styles[i][n].fontSize||this.fontSize:this.fontSize},_getWidthOfCharAt:function(t,e,i,n){n=n||this.text.split(this._reNewline);var r=n[e].split("")[i];return this._getWidthOfChar(t,r,e,i)},_getHeightOfCharAt:function(t,e,i,n){n=n||this.text.split(this._reNewline);var r=n[e].split("")[i];return this._getHeightOfChar(t,r,e,i)},_getWidthOfCharsAt:function(t,e,i,n){for(var r=0,s=0;i>s;s++)r+=this._getWidthOfCharAt(t,e,s,n);return r},_getWidthOfLine:function(t,e,i){return this._getWidthOfCharsAt(t,e,i[e].length,i)},_getTextWidth:function(t,e){if(this.isEmptyStyles())return this.callSuper("_getTextWidth",t,e);for(var i=this._getWidthOfLine(t,0,e),n=1,r=e.length;r>n;n++){var s=this._getWidthOfLine(t,n,e);s>i&&(i=s)}return i},_getHeightOfLine:function(t,e,i){i=i||this.text.split(this._reNewline);for(var n=this._getHeightOfChar(t,i[e][0],e,0),r=i[e],s=r.split(""),o=1,a=s.length;a>o;o++){var h=this._getHeightOfChar(t,s[o],e,o);h>n&&(n=h)}return n*this.lineHeight},_g
})),this.checkDisabled(),this.clickListener(),this.options.liveSearch&&this.liveSearchListener(),this.render(),this.liHeight(),this.setStyle(),this.setWidth(),this.options.container&&this.selectPosition(),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile()},createDropdown:function(){var e=this.multiple?" show-tick":"",i=this.$element.parent().hasClass("input-group")?" input-group-btn":"",n=this.autofocus?" autofocus":"",r=this.options.header?'<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;</button>'+this.options.header+"</div>":"",s=this.options.liveSearch?'<div class="bootstrap-select-searchbox"><input type="text" class="input-block-level form-control" autocomplete="off" /></div>':"",o=this.options.actionsBox?'<div class="bs-actionsbox"><div class="btn-group btn-block"><button class="actions-btn bs-select-all btn btn-sm btn-default">Select All</button><button class="actions-btn bs-deselect-all btn btn-sm btn-default">Deselect All</button></div></div>':"",a='<div class="btn-group bootstrap-select'+e+i+'"><button type="button" class="btn dropdown-toggle selectpicker" data-toggle="dropdown"'+n+'><span class="filter-option pull-left"></span>&nbsp;<span class="caret"></span></button><div class="dropdown-menu open">'+r+s+o+'<ul class="dropdown-menu inner selectpicker" role="menu"></ul></div></div>';return t(a)},createView:function(){var t=this.createDropdown(),e=this.createLi();return t.find("ul").append(e),t},reloadLi:function(){this.destroyLi();var t=this.createLi();this.$menu.find("ul").append(t)},destroyLi:function(){this.$menu.find("li").remove()},createLi:function(){var e=this,i=[],n="",r=0;return this.$element.find("option").each(function(){var n=t(this),s=n.attr("class")||"",o=n.attr("style")||"",a=n.data("content")?n.data("content"):n.html(),h="undefined"!=typeof n.data("subtext")?'<small class="muted text-muted">'+n.data("subtext")+"</small>":"",l="undefined"!=typeof n.data("icon")?'<i class="'+e.options.iconBase+" "+n.data("icon")+'"></i> ':"";if(""!==l&&(n.is(":disabled")||n.parent().is(":disabled"))&&(l="<span>"+l+"</span>"),n.data("content")||(a=l+'<span class="text">'+a+h+"</span>"),e.options.hideDisabled&&(n.is(":disabled")||n.parent().is(":disabled")))i.push('<a style="min-height: 0; padding: 0"></a>');else if(n.parent().is("optgroup")&&n.data("divider")!==!0)if(0===n.index()){var c=n.parent().attr("label"),u="undefined"!=typeof n.parent().data("subtext")?'<small class="muted text-muted">'+n.parent().data("subtext")+"</small>":"",f=n.parent().data("icon")?'<i class="'+e.options.iconBase+" "+n.parent().data("icon")+'"></i> ':"";c=f+'<span class="text">'+c+u+"</span>",r+=1,i.push(0!==n[0].index?'<div class="div-contain"><div class="divider"></div></div><dt>'+c+"</dt>"+e.createA(a,"opt "+s,o,r):"<dt>"+c+"</dt>"+e.createA(a,"opt "+s,o,r))}else i.push(e.createA(a,"opt "+s,o,r));else i.push(n.data("divider")===!0?'<div class="div-contain"><div class="divider"></div></div>':t(this).data("hidden")===!0?"<a></a>":e.createA(a,s,o))}),t.each(i,function(t,e){var i="<a></a>"===e?'class="hide is-hidden"':"";n+='<li rel="'+t+'"'+i+">"+e+"</li>"}),this.multiple||0!==this.$element.find("option:selected").length||this.options.title||this.$element.find("option").eq(0).prop("selected",!0).attr("selected","selected"),t(n)},createA:function(t,e,i,n){return'<a tabindex="0" class="'+e+'" style="'+i+'"'+("undefined"!=typeof n?'data-optgroup="'+n+'"':"")+">"+t+'<i class="'+this.options.iconBase+" "+this.options.tickIcon+' icon-ok check-mark"></i></a>'},render:function(e){var i=this;e!==!1&&this.$element.find("option").each(function(e){i.setDisabled(e,t(this).is(":disabled")||t(this).parent().is(":disabled")),i.setSelected(e,t(this).is(":selected"))}),this.tabIndex();var n=this.$element.find("option:selected").map(function(){var e,n=t(this),r=n.data("icon")&&i.options.showIcon?'<i class="'+i.options.iconBase+" "+n.data("icon")+'"></i> ':"";return e=i.options.showSubtext&&n.attr("data-subtext")&&!i.multiple?' <small class="muted text-muted">'+n.dat
}();"undefined"!=typeof module&&module.exports?module.exports=H:"function"==typeof define&&define.amd?define(function(){return H}):window.tinycolor=H}(),function(){function t(t,e){s.searchParams[t]=e;var i={searchParams:s.searchParams,searchRange:s.searchRange,minScore:s.minScore,hintSteps:s.hintSteps,maxResults:s.maxResults};$.getJSON("/node/search",i,function(t){var e={};for(var i in t.columns)e[i]=t.columns[i].hints;s.grapher.setColumnHints(e),r(t.items,t.count)})}function e(){for(var e=$("#keywordsToSearch").val()||[],i={},n=0,o=e.length;o>n;++n)i[e[n]]=1;var a={searchParams:i,searchRange:{min:-1,max:1},minScore:parseFloat($("#minScore").val()),hintSteps:parseInt($("#hintSteps").val()),maxResults:parseInt($("#maxResults").val())};$.getJSON("/node/search",a,function(i){s.searchParams=a.searchParams,s.searchRange=a.searchRange,s.minScore=a.minScore,s.hintSteps=a.hintSteps,s.maxResults=a.maxResults,s.grapher=new Grapher("grapher",s.searchRange,150,!0,!0),s.grapher.setColumns(i.columns),s.grapher.setValueChangedListener(t),r(i.items,i.count),$("#query").text(e.join(", ")),$("#useLocalScale").click(function(){var t=$("#useLocalScale").is(":checked");s.grapher.setUseLocalScale(t)}),$("#useRelativeScale").click(function(){var t=$("#useRelativeScale").is(":checked");s.grapher.setUseRelativeScale(t)}),$("#input").fadeOut(function(){$("#output").fadeIn()})})}function i(){$("#learnKeyword").prop("disabled",!0),$("#learnError").slideUp(function(){var t={keyword:$("#keywordToLearn").val(),params:s.searchParams};$.getJSON("/node/addKeyword",t,function(t){t.success?$("#learnDialog").modal("hide"):$("#learnError").slideDown(function(){$("#learnKeyword").prop("disabled",!1)})})})}function n(){$("#forgetKeyword").prop("disabled",!0),$("#forgetError").slideUp(function(){var t={keyword:$("#keywordToForget").val()};$.getJSON("/node/removeKeyword",t,function(t){t.success?$("#forgetDialog").modal("hide"):$("#forgetError").slideDown(function(){$("#forgetKeyword").prop("disabled",!1)})})})}function r(t,e){var i=String(t.length);t.length<e&&(i+=" of "+e),$("#count").text(i);var n=Handlebars.compile($("#template").html());$("#results").empty(),$("#results").append(n({results:t}))}var s={};$(document).on({ajaxStart:function(){$("#spinner").show()},ajaxStop:function(){$("#spinner").hide()},ready:function(){$("#keywordsToSearch").selectpicker(),$.getJSON("/node/getKeywords",function(t){$("#searchKeywords").click(e);for(var r=0,s=t.length;s>r;++r)$("#keywordsToSearch").append($("<option></option>",{value:t[r],text:t[r]}));$("#keywordsToSearch").selectpicker("refresh"),$("#keywordsToSearch").change(function(){$("#searchKeywords").prop("disabled",!$(this).val())}),$("#forgetKeyword").click(n),$("#forgetDialog").on("show.bs.modal",function(){$("#forgetError").hide(),$.getJSON("/node/getKeywords",function(t){$("#forgetKeyword").prop("disabled",0===t.length),$("#keywordToForget").empty();for(var e=0,i=t.length;i>e;++e)$("#keywordToForget").append($("<option></option>",{value:t[e],text:t[e]}))})}),$("#learnKeyword").click(i),$("#keywordToLearn").bind("input",function(){$("#learnKeyword").prop("disabled",!$(this).val())}),$("#learnDialog").on("show.bs.modal",function(){$("#learnKeyword").prop("disabled",!0),$("#keywordToLearn").val(""),$("#learnError").hide()})})}})}(window.hscd=window.hscd||{}),goog.require("goog.math"),goog.require("goog.math.Coordinate"),goog.require("goog.math.Range"),goog.require("goog.math.Rect");