2014-03-03 01:52:17 -08:00
/ * !
* jQuery JavaScript Library v1 . 8.1
* http : //jquery.com/
*
* Includes Sizzle . js
* http : //sizzlejs.com/
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http : //jquery.org/license
*
* Date : Thu Aug 30 2012 17 : 17 : 22 GMT - 0400 ( Eastern Daylight Time )
* /
function BestInPlaceEditor ( e ) { this . element = e , this . initOptions ( ) , this . bindForm ( ) , this . initNil ( ) , jQuery ( this . activator ) . bind ( "click" , { editor : this } , this . clickHandler ) } function switchVisible ( e , t ) { categoryVisible [ e ] == 1 ? hideCategory ( e , t ) : categoryVisible [ e ] == 0 && showCategory ( e , t ) } function hideCategory ( e , t ) { t == null && ( t = 500 ) , Mconsole . graph . eachNode ( function ( t ) { t . getData ( "metacode" ) == e && ( t . setData ( "alpha" , . 4 , "end" ) , t . eachAdjacency ( function ( e ) { e . setData ( "alpha" , . 4 , "end" ) } ) ) } ) , Mconsole . fx . animate ( { modes : [ "node-property:alpha" , "edge-property:alpha" ] , duration : t } ) } function showCategory ( e , t ) { t == null && ( t = 500 ) , Mconsole . graph . eachNode ( function ( t ) { t . getData ( "metacode" ) == e && ( t . setData ( "alpha" , 1 , "end" ) , t . eachAdjacency ( function ( e ) { e . setData ( "alpha" , 1 , "end" ) } ) ) } ) , Mconsole . fx . animate ( { modes : [ "node-property:alpha" , "edge-property:alpha" ] , duration : t } ) } function hideAll ( e ) { e == null && ( e = 500 ) , Mconsole . graph . eachNode ( function ( e ) { e . setData ( "alpha" , . 4 , "end" ) , e . eachAdjacency ( function ( e ) { e . setData ( "alpha" , . 2 , "end" ) } ) } ) , Mconsole . fx . animate ( { modes : [ "node-property:alpha" , "edge-property:alpha" ] , duration : e } ) } function showAll ( e ) { e == null && ( e = 500 ) , Mconsole . graph . eachNode ( function ( e ) { e . setData ( "alpha" , 1 , "end" ) , e . eachAdjacency ( function ( e ) { e . setData ( "alpha" , . 4 , "end" ) } ) } ) , Mconsole . fx . animate ( { modes : [ "node-property:alpha" , "edge-property:alpha" ] , duration : e } ) } function filterTopicsByMap ( e ) { Mconsole . graph . eachNode ( function ( t ) { t . getData ( "inmaps" ) . indexOf ( parseInt ( e ) ) !== - 1 ? t . setData ( "alpha" , 1 , "end" ) : t . setData ( "alpha" , . 4 , "end" ) , Mconsole . fx . animate ( { modes : [ "node-property:alpha" , "edge-property:alpha" ] , duration : 500 } ) } ) } function filterTopicsByMapper ( e ) { Mconsole . graph . eachNode ( function ( t ) { t . getData ( "userid" ) . toString ( ) == e ? t . setData ( "alpha" , 1 , "end" ) : t . setData ( "alpha" , . 4 , "end" ) , Mconsole . fx . animate ( { modes : [ "node-property:alpha" , "edge-property:alpha" ] , duration : 500 } ) } ) } function filterTopicsByName ( e ) { Mconsole . graph . eachNode ( function ( t ) { nodeName = t . name . toLowerCase ( ) , nodeName . indexOf ( e ) !== - 1 && e != "" ? t . setData ( "alpha" , 1 , "end" ) : t . setData ( "alpha" , . 4 , "end" ) , Mconsole . fx . animate ( { modes : [ "node-property:alpha" , "edge-property:alpha" ] , duration : 500 } ) } ) } function clearCanvas ( ) { Mconsole . graph . eachNode ( function ( e ) { Mconsole . graph . removeNode ( e . id ) } ) , Mconsole . plot ( ) } function clearCanvasExceptRoot ( ) { var e = new Array ; Mconsole . graph . eachNode ( function ( t ) { e . push ( t . id ) } ) ; var t = Mconsole . graph . nodes [ Mconsole . root ] ; e . forEach ( function ( e , n ) { e != t . id && Mconsole . graph . removeNode ( e ) } ) , fetchRelatives ( t ) } function selectEdgeOnClickHandler ( e , t ) { if ( Mconsole . busy ) return ; if ( navigator . platform . indexOf ( "Mac" ) != - 1 && t . ctrlKey ) { selectEdgeOnRightClickHandler ( e , t ) ; return } if ( synapseWasDoubleClicked ( ) ) { synapseDoubleClickHandler ( e , t ) ; return } var n = MetamapsModel . selectedEdges . indexOf ( e ) ; n == - 1 ? n = ! 1 : n != - 1 && ( n = ! 0 ) , n && t . shiftKey ? deselectEdge ( e ) : ! n && t . shiftKey ? selectEdge ( e ) : n && ! t . shiftKey ? deselectAllEdges ( ) : ! n && ! t . shiftKey && ( deselectAllEdges ( ) , selectEdge ( e ) ) , Mconsole . plot ( ) } function selectEdgeOnRightClickHandler ( e , t ) { t . preventDefault ( ) , t . stopPropagation ( ) ; if ( Mconsole . busy ) return ; selectEdge ( e ) , $ ( ".rightclickmenu" ) . remove ( ) ; var n = document . createElement ( "div" ) ; n . className = "rightclickmenu" ; var r = "<ul>" ; userid != null && ( r += '<li class="rc-delete">Delete</li>' ) , mapid && userid != null && ( r += '<li class="rc-remove">Remove from map</li>' ) , r += '<li class="rc-hide">Hide until refresh</li>' ; if ( userid ) { var i = '<ul><li class="changeP toCommons">commons</li> <li class="changeP toPublic">public</li> <li class="changeP toPrivate">private</li> </ul>' ; r += '<li class="rc-permission">Change permissions' + i + "</li>" } r += "</ul>" , n . innerHTML = r , $ ( n ) . css ( { left : t . clientX , top : t . clientY } ) , $ ( "#center-container" ) . append ( n ) , $ ( ".rc-delete" ) . click ( function ( ) { $ ( ".rightclickmenu" ) . remove ( ) ; var e = MetamapsModel . selectedNodes . length , t = MetamapsModel . selectedEdges . length , n = e == 1 ? "1 topic" : e + " topics" , r = t == 1 ? "1 synapse" : t + " synapses" , i = "You have " + n + " and " + r + " selected. " , s = confirm ( i + "Are you sure you want to permanently delete them all? This will remove them from all maps they appear on." ) ; s == 1 && ( deleteSelectedEdges ( ) , deleteSelectedN
) , $ ( "#edit_synapse" ) . append ( '<input type="checkbox" id="edit_synapse_right">' ) , $ ( "#edit_synapse" ) . append ( '<label class="right">></label>' ) ; if ( e . nodeFrom . pos . x < e . nodeTo . pos . x || e . nodeFrom . pos . x == e . nodeTo . pos . x && e . nodeFrom . pos . y < e . nodeTo . pos . y ) var t = e . nodeTo , n = e . nodeFrom ; else var t = e . nodeFrom , n = e . nodeTo ; var r = e . getData ( "category" ) ; if ( r == "from-to" ) { var i = e . getData ( "direction" ) ; i [ 0 ] == t . id ? $ ( "#edit_synapse_left" ) . prop ( "checked" , ! 0 ) : $ ( "#edit_synapse_right" ) . prop ( "checked" , ! 0 ) } else r == "both" && ( $ ( "#edit_synapse_left" ) . prop ( "checked" , ! 0 ) , $ ( "#edit_synapse_right" ) . prop ( "checked" , ! 0 ) ) ; $ ( "#edit_synapse_left, #edit_synapse_right" ) . click ( function ( ) { var r = $ ( "#edit_synapse_left" ) . is ( ":checked" ) , i = $ ( "#edit_synapse_right" ) . is ( ":checked" ) , s = e . getData ( "direction" ) , o = "none" ; r && i ? o = "both" : ! r && i ? ( o = "from-to" , s = [ n . id , t . id ] ) : r && ! i && ( o = "from-to" , s = [ t . id , n . id ] ) , $ . ajax ( { type : "PUT" , url : "/synapses/" + e . getData ( "id" ) , data : { synapse : { category : o } , node1 _id : { node1 : s [ 0 ] } , node2 _id : { node2 : s [ 1 ] } } , success : function ( t ) { updateEdgeDisplay ( e , s , o ) } } ) } ) } function updateEdgeDisplay ( e , t , n ) { e . setData ( "category" , n ) , e . setData ( "direction" , t ) , Mconsole . plot ( ) } function best _in _place _perms ( e ) { var t = '<span class="best_in_place best_in_place_permission" id="best_in_place_topic_$_id_$_permission" data-url="/synapses/$_id_$" data-object="synapse" data-collection=$_permission_choices_$ data-attribute="permission" data-type="select" data-value="$_current_$">$_perm_$</span>' , n = "'[" ; return n += '["commons","commons"],' , n += '["public","public"],' , n += '["private","private"]' , n += "]'" , t = t . replace ( /\$_permission_choices_\$/g , n ) , t = t . replace ( /\$_id_\$/g , e . getData ( "id" ) ) , t = t . replace ( /\$_current_$\$/g , e . getData ( "permission" ) ) , t = t . replace ( /\$_perm_\$/g , e . getData ( "permission" ) ) , t } function deselectAllEdges ( ) { var e = MetamapsModel . selectedEdges . length ; for ( var t = e - 1 ; t >= 0 ; t -= 1 ) { var n = MetamapsModel . selectedEdges [ t ] ; deselectEdge ( n ) } } function deselectAllNodes ( ) { var e = MetamapsModel . selectedNodes . length ; for ( var t = e - 1 ; t >= 0 ; t -= 1 ) { var n = MetamapsModel . selectedNodes [ t ] ; deselectNode ( n ) } } function removeEdge ( e ) { var t = e . getData ( "id" ) ; $ . ajax ( { type : "DELETE" , url : "/synapses/" + t , success : function ( ) { hideEdge ( e ) } } ) } function hideEdge ( e ) { var t = e . nodeFrom . id , n = e . nodeTo . id ; e . setData ( "alpha" , 0 , "end" ) , Mconsole . fx . animate ( { modes : [ "edge-property:alpha" ] , duration : 1e3 } ) , Mconsole . graph . removeAdjacence ( t , n ) , Mconsole . plot ( ) } function hideSelectedEdges ( ) { var e = MetamapsModel . selectedEdges . length ; for ( var t = e - 1 ; t >= 0 ; t -= 1 ) { var n = MetamapsModel . selectedEdges [ t ] ; hideEdge ( n ) } MetamapsModel . selectedEdges = new Array } function removeSelectedEdges ( ) { var e = MetamapsModel . selectedEdges . length ; for ( var t = e - 1 ; t >= 0 ; t -= 1 ) { if ( mapid != null ) { var n = MetamapsModel . selectedEdges [ t ] , r = n . getData ( "id" ) ; $ . ajax ( { type : "POST" , url : "/synapses/" + mapid + "/" + r + "/removefrommap" } ) } hideEdge ( n ) } MetamapsModel . selectedEdges = new Array } function deleteSelectedEdges ( ) { var e = MetamapsModel . selectedEdges . length ; for ( var t = e - 1 ; t >= 0 ; t -= 1 ) { var n = MetamapsModel . selectedEdges [ t ] , r = n . getData ( "id" ) ; $ . ajax ( { type : "DELETE" , url : "/synapses/" + r } ) , hideEdge ( n ) } MetamapsModel . selectedEdges = new Array } function selectNode ( e ) { if ( MetamapsModel . selectedNodes . indexOf ( e ) != - 1 ) return ; e . selected = ! 0 , e . setData ( "dim" , 30 , "current" ) , e . setData ( "whiteCircle" , ! 0 ) , e . eachAdjacency ( function ( e ) { selectEdge ( e ) } ) , MetamapsModel . selectedNodes . push ( e ) } function deselectNode ( e ) { delete e . selected , e . setData ( "whiteCircle" , ! 1 ) , e . eachAdjacency ( function ( e ) { deselectEdge ( e ) } ) , e . setData ( "dim" , 25 , "current" ) , MetamapsModel . selectedNodes . splice ( MetamapsModel . selectedNodes . indexOf ( e ) , 1 ) } function selectEdge ( e ) { if ( MetamapsModel . selectedEdges . indexOf ( e ) != - 1 ) return ; e . setData ( "showDesc" , ! 0 , "current" ) , MetamapsModel . embed ? MetamapsModel . embed && e . setDataset ( "end" , { lineWidth : 4 , color : "#999" , alpha : 1 } ) : e . setDataset ( "end" , { lineWidth : 4 , color : "#FFFFFF" , alpha : 1 } ) , M
{ width : "4px" } ) . width === "4px" , o = i . createElement ( "div" ) , o . style . cssText = r . style . cssText = u , o . style . marginRight = o . style . width = "0" , r . style . width = "1px" , r . appendChild ( o ) , t . reliableMarginRight = ! parseFloat ( ( e . getComputedStyle ( o , null ) || { } ) . marginRight ) ) , typeof r . style . zoom != "undefined" && ( r . innerHTML = "" , r . style . cssText = u + "width:1px;padding:1px;display:inline;zoom:1" , t . inlineBlockNeedsLayout = r . offsetWidth === 3 , r . style . display = "block" , r . style . overflow = "visible" , r . innerHTML = "<div></div>" , r . firstChild . style . width = "5px" , t . shrinkWrapBlocks = r . offsetWidth !== 3 , n . style . zoom = 1 ) , a . removeChild ( n ) , n = r = s = o = null } ) , a . removeChild ( p ) , n = r = s = o = u = a = p = null , t } ( ) ; var D = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/ , P = /([A-Z])/g ; v . extend ( { cache : { } , deletedIds : [ ] , uuid : 0 , expando : "jQuery" + ( v . fn . jquery + Math . random ( ) ) . replace ( /\D/g , "" ) , noData : { embed : ! 0 , object : "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" , applet : ! 0 } , hasData : function ( e ) { return e = e . nodeType ? v . cache [ e [ v . expando ] ] : e [ v . expando ] , ! ! e && ! B ( e ) } , data : function ( e , n , r , i ) { if ( ! v . acceptData ( e ) ) return ; var s , o , u = v . expando , a = typeof n == "string" , f = e . nodeType , l = f ? v . cache : e , c = f ? e [ u ] : e [ u ] && u ; if ( ( ! c || ! l [ c ] || ! i && ! l [ c ] . data ) && a && r === t ) return ; c || ( f ? e [ u ] = c = v . deletedIds . pop ( ) || ++ v . uuid : c = u ) , l [ c ] || ( l [ c ] = { } , f || ( l [ c ] . toJSON = v . noop ) ) ; if ( typeof n == "object" || typeof n == "function" ) i ? l [ c ] = v . extend ( l [ c ] , n ) : l [ c ] . data = v . extend ( l [ c ] . data , n ) ; return s = l [ c ] , i || ( s . data || ( s . data = { } ) , s = s . data ) , r !== t && ( s [ v . camelCase ( n ) ] = r ) , a ? ( o = s [ n ] , o == null && ( o = s [ v . camelCase ( n ) ] ) ) : o = s , o } , removeData : function ( e , t , n ) { if ( ! v . acceptData ( e ) ) return ; var r , i , s , o = e . nodeType , u = o ? v . cache : e , a = o ? e [ v . expando ] : v . expando ; if ( ! u [ a ] ) return ; if ( t ) { r = n ? u [ a ] : u [ a ] . data ; if ( r ) { v . isArray ( t ) || ( t in r ? t = [ t ] : ( t = v . camelCase ( t ) , t in r ? t = [ t ] : t = t . split ( " " ) ) ) ; for ( i = 0 , s = t . length ; i < s ; i ++ ) delete r [ t [ i ] ] ; if ( ! ( n ? B : v . isEmptyObject ) ( r ) ) return } } if ( ! n ) { delete u [ a ] . data ; if ( ! B ( u [ a ] ) ) return } o ? v . cleanData ( [ e ] , ! 0 ) : v . support . deleteExpando || u != u . window ? delete u [ a ] : u [ a ] = null } , _data : function ( e , t , n ) { return v . data ( e , t , n , ! 0 ) } , acceptData : function ( e ) { var t = e . nodeName && v . noData [ e . nodeName . toLowerCase ( ) ] ; return ! t || t !== ! 0 && e . getAttribute ( "classid" ) === t } } ) , v . fn . extend ( { data : function ( e , n ) { var r , i , s , o , u , a = this [ 0 ] , f = 0 , l = null ; if ( e === t ) { if ( this . length ) { l = v . data ( a ) ; if ( a . nodeType === 1 && ! v . _data ( a , "parsedAttrs" ) ) { s = a . attributes ; for ( u = s . length ; f < u ; f ++ ) o = s [ f ] . name , o . indexOf ( "data-" ) === 0 && ( o = v . camelCase ( o . substring ( 5 ) ) , H ( a , o , l [ o ] ) ) ; v . _data ( a , "parsedAttrs" , ! 0 ) } } return l } return typeof e == "object" ? this . each ( function ( ) { v . data ( this , e ) } ) : ( r = e . split ( "." , 2 ) , r [ 1 ] = r [ 1 ] ? "." + r [ 1 ] : "" , i = r [ 1 ] + "!" , v . access ( this , function ( n ) { if ( n === t ) return l = this . triggerHandler ( "getData" + i , [ r [ 0 ] ] ) , l === t && a && ( l = v . data ( a , e ) , l = H ( a , e , l ) ) , l === t && r [ 1 ] ? this . data ( r [ 0 ] ) : l ; r [ 1 ] = n , this . each ( function ( ) { var t = v ( this ) ; t . triggerHandler ( "setData" + i , r ) , v . data ( this , e , n ) , t . triggerHandler ( "changeData" + i , r ) } ) } , null , n , arguments . length > 1 , null , ! 1 ) ) } , removeData : function ( e ) { return this . each ( function ( ) { v . removeData ( this , e ) } ) } } ) , v . extend ( { queue : function ( e , t , n ) { var r ; if ( e ) return t = ( t || "fx" ) + "queue" , r = v . _data ( e , t ) , n && ( ! r || v . isArray ( n ) ? r = v . _data ( e , t , v . makeArray ( n ) ) : r . push ( n ) ) , r || [ ] } , dequeue : function ( e , t ) { t = t || "fx" ; var n = v . queue ( e , t ) , r = n . length , i = n . shift ( ) , s = v . _queueHooks ( e , t ) , o = function ( ) { v . dequeue ( e , t ) } ; i === "inprogress" && ( i = n . shift ( ) , r -- ) , i && ( t === "fx" && n . unshift ( "inprogress" ) , delete s . stop , i . call ( e , o , s ) ) , ! r && s && s . empty . fire ( ) } , _queueHooks : function ( e , t ) { var n = t + "queueHooks" ; return v . _data ( e , n ) || v . _data ( e , n , { empty : v . Callbacks ( "once memory" ) . add ( function ( ) { v . removeData ( e , t + "queue" , ! 0 ) , v . removeData ( e , n , ! 0 ) } ) } ) } } ) , v . fn . extend ( { queue : function ( e , n ) { var r = 2 ; return typeof e != "string" && ( n = e , e = "fx" , r -- ) , arguments . length < r ? v . queue ( this [ 0 ] , e ) : n === t ? this : this . each ( function ( ) { var t = v . queue ( this , e , n ) ; v . _queueHooks ( this , e ) , e === "fx" && t [ 0 ] !== "inprogress" && v . dequeue ( this , e ) } ) } , dequeue : function ( e ) { return this . each ( function ( ) { v . dequeue ( this , e ) } ) } , delay : function ( e , t ) { return e = v . fx ? v . fx . speeds [ e ] || e : e , t = t || "fx" , this . queue ( t , function ( t , n ) { var r = setTimeout ( t , e ) ; n . stop = function ( ) { clearTimeout ( r ) } } ) } , clearQueue : function ( e ) { return this . queue ( e || "fx" , [ ] ) } , promise : function ( e , n ) { var r , i = 1 , s = v . Deferred ( ) , o = this , u = this . length , a = function ( ) { -- i || s . reso
: return n && s . indexOf ( n ) > - 1 ; case "$=" : return n && s . substr ( s . length - n . length ) === n ; case "~=" : return ( " " + s + " " ) . indexOf ( n ) > - 1 ; case "|=" : return s === n || s . substr ( 0 , n . length + 1 ) === n + "-" } } : function ( t ) { return Y . attr ( t , e ) != null } } , CHILD : function ( e , t , n , r ) { if ( e === "nth" ) { var i = y ++ ; return function ( e ) { var t , s , o = 0 , u = e ; if ( n === 1 && r === 0 ) return ! 0 ; t = e . parentNode ; if ( t && ( t [ d ] !== i || ! e . sizset ) ) { for ( u = t . firstChild ; u ; u = u . nextSibling ) if ( u . nodeType === 1 ) { u . sizset = ++ o ; if ( u === e ) break } t [ d ] = i } return s = e . sizset - r , n === 0 ? s === 0 : s % n === 0 && s / n >= 0 } } return function ( t ) { var n = t ; switch ( e ) { case "only" : case "first" : while ( n = n . previousSibling ) if ( n . nodeType === 1 ) return ! 1 ; if ( e === "first" ) return ! 0 ; n = t ; case "last" : while ( n = n . nextSibling ) if ( n . nodeType === 1 ) return ! 1 ; return ! 0 } } } , PSEUDO : function ( e , t , n , r ) { var i , o = s . pseudos [ e ] || s . pseudos [ e . toLowerCase ( ) ] ; return o || Y . error ( "unsupported pseudo: " + e ) , o [ d ] ? o ( t , n , r ) : o . length > 1 ? ( i = [ e , e , "" , t ] , function ( e ) { return o ( e , 0 , i ) } ) : o } } , pseudos : { not : E ( function ( e , t , n ) { var r = f ( e . replace ( D , "$1" ) , t , n ) ; return function ( e ) { return ! r ( e ) } } ) , enabled : function ( e ) { return e . disabled === ! 1 } , disabled : function ( e ) { return e . disabled === ! 0 } , checked : function ( e ) { var t = e . nodeName . toLowerCase ( ) ; return t === "input" && ! ! e . checked || t === "option" && ! ! e . selected } , selected : function ( e ) { return e . parentNode && e . parentNode . selectedIndex , e . selected === ! 0 } , parent : function ( e ) { return ! s . pseudos . empty ( e ) } , empty : function ( e ) { var t ; e = e . firstChild ; while ( e ) { if ( e . nodeName > "@" || ( t = e . nodeType ) === 3 || t === 4 ) return ! 1 ; e = e . nextSibling } return ! 0 } , contains : E ( function ( e ) { return function ( t ) { return ( t . textContent || t . innerText || o ( t ) ) . indexOf ( e ) > - 1 } } ) , has : E ( function ( e ) { return function ( t ) { return Y ( e , t ) . length > 0 } } ) , header : function ( e ) { return R . test ( e . nodeName ) } , text : function ( e ) { var t , n ; return e . nodeName . toLowerCase ( ) === "input" && ( t = e . type ) === "text" && ( ( n = e . getAttribute ( "type" ) ) == null || n . toLowerCase ( ) === t ) } , radio : Z ( "radio" ) , checkbox : Z ( "checkbox" ) , file : Z ( "file" ) , password : Z ( "password" ) , image : Z ( "image" ) , submit : et ( "submit" ) , reset : et ( "reset" ) , button : function ( e ) { var t = e . nodeName . toLowerCase ( ) ; return t === "input" && e . type === "button" || t === "button" } , input : function ( e ) { return U . test ( e . nodeName ) } , focus : function ( e ) { var t = e . ownerDocument ; return e === t . activeElement && ( ! t . hasFocus || t . hasFocus ( ) ) && ( ! ! e . type || ! ! e . href ) } , active : function ( e ) { return e === e . ownerDocument . activeElement } } , setFilters : { first : function ( e , t , n ) { return n ? e . slice ( 1 ) : [ e [ 0 ] ] } , last : function ( e , t , n ) { var r = e . pop ( ) ; return n ? e : [ r ] } , even : function ( e , t , n ) { var r = [ ] , i = n ? 1 : 0 , s = e . length ; for ( ; i < s ; i += 2 ) r . push ( e [ i ] ) ; return r } , odd : function ( e , t , n ) { var r = [ ] , i = n ? 0 : 1 , s = e . length ; for ( ; i < s ; i += 2 ) r . push ( e [ i ] ) ; return r } , lt : function ( e , t , n ) { return n ? e . slice ( + t ) : e . slice ( 0 , + t ) } , gt : function ( e , t , n ) { return n ? e . slice ( 0 , + t + 1 ) : e . slice ( + t + 1 ) } , eq : function ( e , t , n ) { var r = e . splice ( + t , 1 ) ; return n ? e : r } } } , l = g . compareDocumentPosition ? function ( e , t ) { return e === t ? ( c = ! 0 , 0 ) : ( ! e . compareDocumentPosition || ! t . compareDocumentPosition ? e . compareDocumentPosition : e . compareDocumentPosition ( t ) & 4 ) ? - 1 : 1 } : function ( e , t ) { if ( e === t ) return c = ! 0 , 0 ; if ( e . sourceIndex && t . sourceIndex ) return e . sourceIndex - t . sourceIndex ; var n , r , i = [ ] , s = [ ] , o = e . parentNode , u = t . parentNode , a = o ; if ( o === u ) return tt ( e , t ) ; if ( ! o ) return - 1 ; if ( ! u ) return 1 ; while ( a ) i . unshift ( a ) , a = a . parentNode ; a = u ; while ( a ) s . unshift ( a ) , a = a . parentNode ; n = i . length , r = s . length ; for ( var f = 0 ; f < n && f < r ; f ++ ) if ( i [ f ] !== s [ f ] ) return tt ( i [ f ] , s [ f ] ) ; return f === n ? tt ( e , s [ f ] , - 1 ) : tt ( i [ f ] , t , 1 ) } , [ 0 , 0 ] . sort ( l ) , h = ! c , Y . uniqueSort = function ( e ) { var t , n = 1 ; c = h , e . sort ( l ) ; if ( c ) for ( ; t = e [ n ] ; n ++ ) t === e [ n - 1 ] && e . splice ( n -- , 1 ) ; return e } , Y . error = function ( e ) { throw new Error ( "Syntax error, unrecognized expression: " + e ) } , f = Y . compile = function ( e , t , n ) { var r , i , s , o = N [ d ] [ e ] ; if ( o && o . context === t ) return o ; r = nt ( e , t , n ) ; for ( i = 0 , s = r . length ; i < s ; i ++ ) r [ i ] = st ( r [ i ] , t , n ) ; return o = N ( e , ot ( r ) ) , o . context = t , o . runs = o . dirruns = 0 , o } , m . querySelectorAll && function ( ) { var e , t = lt , n = /'|\\/g , r = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g , i = [ ] , s = [ ":active" ] , o = g . matchesSelector || g . mozMatchesSelector || g . webkitMatchesSelector || g . oMatchesSelector || g . msMatchesSelector ; X ( function ( e ) { e . innerHTML = "<select><option selected=''></option></select>" , e . querySelectorAll ( "[selected]" ) . length || i . push ( "\\[" + C + " * ( ? : c
parentNode && ( e . elem [ e . prop ] = e . now ) } } , v . each ( [ "toggle" , "show" , "hide" ] , function ( e , t ) { var n = v . fn [ t ] ; v . fn [ t ] = function ( r , i , s ) { return r == null || typeof r == "boolean" || ! e && v . isFunction ( r ) && v . isFunction ( i ) ? n . apply ( this , arguments ) : this . animate ( Zn ( t , ! 0 ) , r , i , s ) } } ) , v . fn . extend ( { fadeTo : function ( e , t , n , r ) { return this . filter ( Gt ) . css ( "opacity" , 0 ) . show ( ) . end ( ) . animate ( { opacity : t } , e , n , r ) } , animate : function ( e , t , n , r ) { var i = v . isEmptyObject ( e ) , s = v . speed ( t , n , r ) , o = function ( ) { var t = Kn ( this , v . extend ( { } , e ) , s ) ; i && t . stop ( ! 0 ) } ; return i || s . queue === ! 1 ? this . each ( o ) : this . queue ( s . queue , o ) } , stop : function ( e , n , r ) { var i = function ( e ) { var t = e . stop ; delete e . stop , t ( r ) } ; return typeof e != "string" && ( r = n , n = e , e = t ) , n && e !== ! 1 && this . queue ( e || "fx" , [ ] ) , this . each ( function ( ) { var t = ! 0 , n = e != null && e + "queueHooks" , s = v . timers , o = v . _data ( this ) ; if ( n ) o [ n ] && o [ n ] . stop && i ( o [ n ] ) ; else for ( n in o ) o [ n ] && o [ n ] . stop && Wn . test ( n ) && i ( o [ n ] ) ; for ( n = s . length ; n -- ; ) s [ n ] . elem === this && ( e == null || s [ n ] . queue === e ) && ( s [ n ] . anim . stop ( r ) , t = ! 1 , s . splice ( n , 1 ) ) ; ( t || ! r ) && v . dequeue ( this , e ) } ) } } ) , v . each ( { slideDown : Zn ( "show" ) , slideUp : Zn ( "hide" ) , slideToggle : Zn ( "toggle" ) , fadeIn : { opacity : "show" } , fadeOut : { opacity : "hide" } , fadeToggle : { opacity : "toggle" } } , function ( e , t ) { v . fn [ e ] = function ( e , n , r ) { return this . animate ( t , e , n , r ) } } ) , v . speed = function ( e , t , n ) { var r = e && typeof e == "object" ? v . extend ( { } , e ) : { complete : n || ! n && t || v . isFunction ( e ) && e , duration : e , easing : n && t || t && ! v . isFunction ( t ) && t } ; r . duration = v . fx . off ? 0 : typeof r . duration == "number" ? r . duration : r . duration in v . fx . speeds ? v . fx . speeds [ r . duration ] : v . fx . speeds . _default ; if ( r . queue == null || r . queue === ! 0 ) r . queue = "fx" ; return r . old = r . complete , r . complete = function ( ) { v . isFunction ( r . old ) && r . old . call ( this ) , r . queue && v . dequeue ( this , r . queue ) } , r } , v . easing = { linear : function ( e ) { return e } , swing : function ( e ) { return . 5 - Math . cos ( e * Math . PI ) / 2 } } , v . timers = [ ] , v . fx = Yn . prototype . init , v . fx . tick = function ( ) { var e , t = v . timers , n = 0 ; for ( ; n < t . length ; n ++ ) e = t [ n ] , ! e ( ) && t [ n ] === e && t . splice ( n -- , 1 ) ; t . length || v . fx . stop ( ) } , v . fx . timer = function ( e ) { e ( ) && v . timers . push ( e ) && ! Rn && ( Rn = setInterval ( v . fx . tick , v . fx . interval ) ) } , v . fx . interval = 13 , v . fx . stop = function ( ) { clearInterval ( Rn ) , Rn = null } , v . fx . speeds = { slow : 600 , fast : 200 , _default : 400 } , v . fx . step = { } , v . expr && v . expr . filters && ( v . expr . filters . animated = function ( e ) { return v . grep ( v . timers , function ( t ) { return e === t . elem } ) . length } ) ; var er = /^(?:body|html)$/i ; v . fn . offset = function ( e ) { if ( arguments . length ) return e === t ? this : this . each ( function ( t ) { v . offset . setOffset ( this , e , t ) } ) ; var n , r , i , s , o , u , a , f , l , c , h = this [ 0 ] , p = h && h . ownerDocument ; if ( ! p ) return ; return ( i = p . body ) === h ? v . offset . bodyOffset ( h ) : ( r = p . documentElement , v . contains ( r , h ) ? ( n = h . getBoundingClientRect ( ) , s = tr ( p ) , o = r . clientTop || i . clientTop || 0 , u = r . clientLeft || i . clientLeft || 0 , a = s . pageYOffset || r . scrollTop , f = s . pageXOffset || r . scrollLeft , l = n . top + a - o , c = n . left + f - u , { top : l , left : c } ) : { top : 0 , left : 0 } ) } , v . offset = { bodyOffset : function ( e ) { var t = e . offsetTop , n = e . offsetLeft ; return v . support . doesNotIncludeMarginInBodyOffset && ( t += parseFloat ( v . css ( e , "marginTop" ) ) || 0 , n += parseFloat ( v . css ( e , "marginLeft" ) ) || 0 ) , { top : t , left : n } } , setOffset : function ( e , t , n ) { var r = v . css ( e , "position" ) ; r === "static" && ( e . style . position = "relative" ) ; var i = v ( e ) , s = i . offset ( ) , o = v . css ( e , "top" ) , u = v . css ( e , "left" ) , a = ( r === "absolute" || r === "fixed" ) && v . inArray ( "auto" , [ o , u ] ) > - 1 , f = { } , l = { } , c , h ; a ? ( l = i . position ( ) , c = l . top , h = l . left ) : ( c = parseFloat ( o ) || 0 , h = parseFloat ( u ) || 0 ) , v . isFunction ( t ) && ( t = t . call ( e , n , s ) ) , t . top != null && ( f . top = t . top - s . top + c ) , t . left != null && ( f . left = t . left - s . left + h ) , "using" in t ? t . using . call ( e , f ) : i . css ( f ) } } , v . fn . extend ( { position : function ( ) { if ( ! this [ 0 ] ) return ; var e = this [ 0 ] , t = this . offsetParent ( ) , n = this . offset ( ) , r = er . test ( t [ 0 ] . nodeName ) ? { top : 0 , left : 0 } : t . offset ( ) ; return n . top -= parseFloat ( v . css ( e , "marginTop" ) ) || 0 , n . left -= parseFloat ( v . css ( e , "marginLeft" ) ) || 0 , r . top += parseFloat ( v . css ( t [ 0 ] , "borderTopWidth" ) ) || 0 , r . left += parseFloat ( v . css ( t [ 0 ] , "borderLeftWidth" ) ) || 0 , { top : n . top - r . top , left : n . left - r . left } } , offsetParent : function ( ) { return this . map ( function ( ) { var e = this . offsetParent || i . body ; while ( e && ! er . test ( e . nodeName ) && v . css ( e , "position" ) === "static" ) e = e . offsetParent ; return e || i . body } ) } } ) , v . each ( { scrollLeft : "pageXOffset" , scrollTop : "pageYOffset" } , function ( e , n ) { v
r . _uiHash ( ) , { snapItem : r . snapElements [ l ] . item } ) ) , r . snapElements [ l ] . snapping = v || m || g || y || b } } } ) , e . ui . plugin . add ( "draggable" , "stack" , { start : function ( t , n ) { var r = e ( this ) . data ( "draggable" ) . options , i = e . makeArray ( e ( r . stack ) ) . sort ( function ( t , n ) { return ( parseInt ( e ( t ) . css ( "zIndex" ) , 10 ) || 0 ) - ( parseInt ( e ( n ) . css ( "zIndex" ) , 10 ) || 0 ) } ) ; if ( ! i . length ) return ; var s = parseInt ( i [ 0 ] . style . zIndex ) || 0 ; e ( i ) . each ( function ( e ) { this . style . zIndex = s + e } ) , this [ 0 ] . style . zIndex = s + i . length } } ) , e . ui . plugin . add ( "draggable" , "zIndex" , { start : function ( t , n ) { var r = e ( n . helper ) , i = e ( this ) . data ( "draggable" ) . options ; r . css ( "zIndex" ) && ( i . _zIndex = r . css ( "zIndex" ) ) , r . css ( "zIndex" , i . zIndex ) } , stop : function ( t , n ) { var r = e ( this ) . data ( "draggable" ) . options ; r . _zIndex && e ( n . helper ) . css ( "zIndex" , r . _zIndex ) } } ) } ( jQuery ) , function ( e , t ) { e . widget ( "ui.droppable" , { widgetEventPrefix : "drop" , options : { accept : "*" , activeClass : ! 1 , addClasses : ! 0 , greedy : ! 1 , hoverClass : ! 1 , scope : "default" , tolerance : "intersect" } , _create : function ( ) { var t = this . options , n = t . accept ; this . isover = 0 , this . isout = 1 , this . accept = e . isFunction ( n ) ? n : function ( e ) { return e . is ( n ) } , this . proportions = { width : this . element [ 0 ] . offsetWidth , height : this . element [ 0 ] . offsetHeight } , e . ui . ddmanager . droppables [ t . scope ] = e . ui . ddmanager . droppables [ t . scope ] || [ ] , e . ui . ddmanager . droppables [ t . scope ] . push ( this ) , t . addClasses && this . element . addClass ( "ui-droppable" ) } , destroy : function ( ) { var t = e . ui . ddmanager . droppables [ this . options . scope ] ; for ( var n = 0 ; n < t . length ; n ++ ) t [ n ] == this && t . splice ( n , 1 ) ; return this . element . removeClass ( "ui-droppable ui-droppable-disabled" ) . removeData ( "droppable" ) . unbind ( ".droppable" ) , this } , _setOption : function ( t , n ) { t == "accept" && ( this . accept = e . isFunction ( n ) ? n : function ( e ) { return e . is ( n ) } ) , e . Widget . prototype . _setOption . apply ( this , arguments ) } , _activate : function ( t ) { var n = e . ui . ddmanager . current ; this . options . activeClass && this . element . addClass ( this . options . activeClass ) , n && this . _trigger ( "activate" , t , this . ui ( n ) ) } , _deactivate : function ( t ) { var n = e . ui . ddmanager . current ; this . options . activeClass && this . element . removeClass ( this . options . activeClass ) , n && this . _trigger ( "deactivate" , t , this . ui ( n ) ) } , _over : function ( t ) { var n = e . ui . ddmanager . current ; if ( ! n || ( n . currentItem || n . element ) [ 0 ] == this . element [ 0 ] ) return ; this . accept . call ( this . element [ 0 ] , n . currentItem || n . element ) && ( this . options . hoverClass && this . element . addClass ( this . options . hoverClass ) , this . _trigger ( "over" , t , this . ui ( n ) ) ) } , _out : function ( t ) { var n = e . ui . ddmanager . current ; if ( ! n || ( n . currentItem || n . element ) [ 0 ] == this . element [ 0 ] ) return ; this . accept . call ( this . element [ 0 ] , n . currentItem || n . element ) && ( this . options . hoverClass && this . element . removeClass ( this . options . hoverClass ) , this . _trigger ( "out" , t , this . ui ( n ) ) ) } , _drop : function ( t , n ) { var r = n || e . ui . ddmanager . current ; if ( ! r || ( r . currentItem || r . element ) [ 0 ] == this . element [ 0 ] ) return ! 1 ; var i = ! 1 ; return this . element . find ( ":data(droppable)" ) . not ( ".ui-draggable-dragging" ) . each ( function ( ) { var t = e . data ( this , "droppable" ) ; if ( t . options . greedy && ! t . options . disabled && t . options . scope == r . options . scope && t . accept . call ( t . element [ 0 ] , r . currentItem || r . element ) && e . ui . intersect ( r , e . extend ( t , { offset : t . element . offset ( ) } ) , t . options . tolerance ) ) return i = ! 0 , ! 1 } ) , i ? ! 1 : this . accept . call ( this . element [ 0 ] , r . currentItem || r . element ) ? ( this . options . activeClass && this . element . removeClass ( this . options . activeClass ) , this . options . hoverClass && this . element . removeClass ( this . options . hoverClass ) , this . _trigger ( "drop" , t , this . ui ( r ) ) , this . element ) : ! 1 } , ui : function ( e ) { return { draggable : e . currentItem || e . element , helper : e . helper , position : e . position , offset : e . positionAbs } } } ) , e . extend ( e . ui . droppable , { version : "1.8.23" } ) , e . ui . intersect = function ( t , n , r ) { if ( ! n . offset ) return ! 1 ; var i = ( t . positionAbs || t . position . absolute ) . left , s = i + t . helperProportions . width , o = ( t . positionAbs || t . position . absolute ) . top , u = o + t . helperProportions . height , a = n . offset . left , f = a + n . proportions . width , l = n . offset . top , c = l + n . proportions . height ; switch ( r ) { case "fit" : return a <= i && s <= f && l <= o && u <= c ; case "intersect" : return a < i + t . helperProportions . width / 2 && s - t . helperProportions . width / 2 < f && l < o + t . helperProportions . height / 2 && u - t . helperProportions . height / 2 < c ; case "pointer" : var h = ( t . positionAbs || t . position . absolute ) . left + ( t . clickOffset |
) ) ) , r !== ! 1 && e . ui . ddmanager && ! n . dropBehaviour && e . ui . ddmanager . prepareOffsets ( this , t ) } this . positionAbs = this . _convertPositionTo ( "absolute" ) ; if ( ! this . options . axis || this . options . axis != "y" ) this . helper [ 0 ] . style . left = this . position . left + "px" ; if ( ! this . options . axis || this . options . axis != "x" ) this . helper [ 0 ] . style . top = this . position . top + "px" ; for ( var i = this . items . length - 1 ; i >= 0 ; i -- ) { var s = this . items [ i ] , o = s . item [ 0 ] , u = this . _intersectsWithPointer ( s ) ; if ( ! u ) continue ; if ( o != this . currentItem [ 0 ] && this . placeholder [ u == 1 ? "next" : "prev" ] ( ) [ 0 ] != o && ! e . ui . contains ( this . placeholder [ 0 ] , o ) && ( this . options . type == "semi-dynamic" ? ! e . ui . contains ( this . element [ 0 ] , o ) : ! 0 ) ) { this . direction = u == 1 ? "down" : "up" ; if ( this . options . tolerance != "pointer" && ! this . _intersectsWithSides ( s ) ) break ; this . _rearrange ( t , s ) , this . _trigger ( "change" , t , this . _uiHash ( ) ) ; break } } return this . _contactContainers ( t ) , e . ui . ddmanager && e . ui . ddmanager . drag ( this , t ) , this . _trigger ( "sort" , t , this . _uiHash ( ) ) , this . lastPositionAbs = this . positionAbs , ! 1 } , _mouseStop : function ( t , n ) { if ( ! t ) return ; e . ui . ddmanager && ! this . options . dropBehaviour && e . ui . ddmanager . drop ( this , t ) ; if ( this . options . revert ) { var r = this , i = r . placeholder . offset ( ) ; r . reverting = ! 0 , e ( this . helper ) . animate ( { left : i . left - this . offset . parent . left - r . margins . left + ( this . offsetParent [ 0 ] == document . body ? 0 : this . offsetParent [ 0 ] . scrollLeft ) , top : i . top - this . offset . parent . top - r . margins . top + ( this . offsetParent [ 0 ] == document . body ? 0 : this . offsetParent [ 0 ] . scrollTop ) } , parseInt ( this . options . revert , 10 ) || 500 , function ( ) { r . _clear ( t ) } ) } else this . _clear ( t , n ) ; return ! 1 } , cancel : function ( ) { var t = this ; if ( this . dragging ) { this . _mouseUp ( { target : null } ) , this . options . helper == "original" ? this . currentItem . css ( this . _storedCSS ) . removeClass ( "ui-sortable-helper" ) : this . currentItem . show ( ) ; for ( var n = this . containers . length - 1 ; n >= 0 ; n -- ) this . containers [ n ] . _trigger ( "deactivate" , null , t . _uiHash ( this ) ) , this . containers [ n ] . containerCache . over && ( this . containers [ n ] . _trigger ( "out" , null , t . _uiHash ( this ) ) , this . containers [ n ] . containerCache . over = 0 ) } return this . placeholder && ( this . placeholder [ 0 ] . parentNode && this . placeholder [ 0 ] . parentNode . removeChild ( this . placeholder [ 0 ] ) , this . options . helper != "original" && this . helper && this . helper [ 0 ] . parentNode && this . helper . remove ( ) , e . extend ( this , { helper : null , dragging : ! 1 , reverting : ! 1 , _noFinalSort : null } ) , this . domPosition . prev ? e ( this . domPosition . prev ) . after ( this . currentItem ) : e ( this . domPosition . parent ) . prepend ( this . currentItem ) ) , this } , serialize : function ( t ) { var n = this . _getItemsAsjQuery ( t && t . connected ) , r = [ ] ; return t = t || { } , e ( n ) . each ( function ( ) { var n = ( e ( t . item || this ) . attr ( t . attribute || "id" ) || "" ) . match ( t . expression || /(.+)[-=_](.+)/ ) ; n && r . push ( ( t . key || n [ 1 ] + "[]" ) + "=" + ( t . key && t . expression ? n [ 1 ] : n [ 2 ] ) ) } ) , ! r . length && t . key && r . push ( t . key + "=" ) , r . join ( "&" ) } , toArray : function ( t ) { var n = this . _getItemsAsjQuery ( t && t . connected ) , r = [ ] ; return t = t || { } , n . each ( function ( ) { r . push ( e ( t . item || this ) . attr ( t . attribute || "id" ) || "" ) } ) , r } , _intersectsWith : function ( e ) { var t = this . positionAbs . left , n = t + this . helperProportions . width , r = this . positionAbs . top , i = r + this . helperProportions . height , s = e . left , o = s + e . width , u = e . top , a = u + e . height , f = this . offset . click . top , l = this . offset . click . left , c = r + f > u && r + f < a && t + l > s && t + l < o ; return this . options . tolerance == "pointer" || this . options . forcePointerForContainers || this . options . tolerance != "pointer" && this . helperProportions [ this . floating ? "width" : "height" ] > e [ this . floating ? "width" : "height" ] ? c : s < t + this . helperProportions . width / 2 && n - this . helperProportions . width / 2 < o && u < r + this . helperProportions . height / 2 && i - this . helperProportions . height / 2 < a } , _intersectsWithPointer : function ( t ) { var n = this . options . axis === "x" || e . ui . isOverAxis ( this . positionAbs . top + this . offset . click . top , t . top , t . height ) , r = this . options . axis === "y" || e . ui . isOverAxis ( this . positionAbs . left + this . offset . click . left , t . left , t . width ) , i = n && r , s = this . _getDragVerticalDirection ( ) , o = this . _getDragHorizontalDirection ( ) ; return i ? this . floating ? o && o == "right" || s == "down" ? 2 : 1 : s && ( s == "down" ? 2 : 1 ) : ! 1 } , _intersectsWithSides : function ( t ) { var n = e . ui . isOverAxis ( this . positionAbs . top + this . offset . click . top , t . top + t . height / 2 , t . height ) , r = e . ui . isOverAxis ( this . positionAbs . left + this . offset . click . left , t . left + t . width / 2 , t . width ) , i = thi
t ) { return this . queue ( function ( ) { var n = e ( this ) , r = [ "backgroundImage" , "backgroundColor" , "opacity" ] , i = e . effects . setMode ( n , t . options . mode || "show" ) , s = { backgroundColor : n . css ( "backgroundColor" ) } ; i == "hide" && ( s . opacity = 0 ) , e . effects . save ( n , r ) , n . show ( ) . css ( { backgroundImage : "none" , backgroundColor : t . options . color || "#ffff99" } ) . animate ( s , { queue : ! 1 , duration : t . duration , easing : t . options . easing , complete : function ( ) { i == "hide" && n . hide ( ) , e . effects . restore ( n , r ) , i == "show" && ! e . support . opacity && this . style . removeAttribute ( "filter" ) , t . callback && t . callback . apply ( this , arguments ) , n . dequeue ( ) } } ) } ) } } ( jQuery ) , function ( e , t ) { e . effects . pulsate = function ( t ) { return this . queue ( function ( ) { var n = e ( this ) , r = e . effects . setMode ( n , t . options . mode || "show" ) , i = ( t . options . times || 5 ) * 2 - 1 , s = t . duration ? t . duration / 2 : e . fx . speeds . _default / 2 , u = n . is ( ":visible" ) , a = 0 ; u || ( n . css ( "opacity" , 0 ) . show ( ) , a = 1 ) , ( r == "hide" && u || r == "show" && ! u ) && i -- ; for ( var f = 0 ; f < i ; f ++ ) n . animate ( { opacity : a } , s , t . options . easing ) , a = ( a + 1 ) % 2 ; n . animate ( { opacity : a } , s , t . options . easing , function ( ) { a == 0 && n . hide ( ) , t . callback && t . callback . apply ( this , arguments ) } ) , n . queue ( "fx" , function ( ) { n . dequeue ( ) } ) . dequeue ( ) } ) } } ( jQuery ) , function ( e , t ) { e . effects . puff = function ( t ) { return this . queue ( function ( ) { var n = e ( this ) , r = e . effects . setMode ( n , t . options . mode || "hide" ) , i = parseInt ( t . options . percent , 10 ) || 150 , s = i / 100 , u = { height : n . height ( ) , width : n . width ( ) } ; e . extend ( t . options , { fade : ! 0 , mode : r , percent : r == "hide" ? i : 100 , from : r == "hide" ? u : { height : u . height * s , width : u . width * s } } ) , n . effect ( "scale" , t . options , t . duration , t . callback ) , n . dequeue ( ) } ) } , e . effects . scale = function ( t ) { return this . queue ( function ( ) { var n = e ( this ) , r = e . extend ( ! 0 , { } , t . options ) , i = e . effects . setMode ( n , t . options . mode || "effect" ) , s = parseInt ( t . options . percent , 10 ) || ( parseInt ( t . options . percent , 10 ) == 0 ? 0 : i == "hide" ? 0 : 100 ) , u = t . options . direction || "both" , a = t . options . origin ; i != "effect" && ( r . origin = a || [ "middle" , "center" ] , r . restore = ! 0 ) ; var f = { height : n . height ( ) , width : n . width ( ) } ; n . from = t . options . from || ( i == "show" ? { height : 0 , width : 0 } : f ) ; var l = { y : u != "horizontal" ? s / 100 : 1 , x : u != "vertical" ? s / 100 : 1 } ; n . to = { height : f . height * l . y , width : f . width * l . x } , t . options . fade && ( i == "show" && ( n . from . opacity = 0 , n . to . opacity = 1 ) , i == "hide" && ( n . from . opacity = 1 , n . to . opacity = 0 ) ) , r . from = n . from , r . to = n . to , r . mode = i , n . effect ( "size" , r , t . duration , t . callback ) , n . dequeue ( ) } ) } , e . effects . size = function ( t ) { return this . queue ( function ( ) { var n = e ( this ) , r = [ "position" , "top" , "bottom" , "left" , "right" , "width" , "height" , "overflow" , "opacity" ] , i = [ "position" , "top" , "bottom" , "left" , "right" , "overflow" , "opacity" ] , s = [ "width" , "height" , "overflow" ] , u = [ "fontSize" ] , a = [ "borderTopWidth" , "borderBottomWidth" , "paddingTop" , "paddingBottom" ] , f = [ "borderLeftWidth" , "borderRightWidth" , "paddingLeft" , "paddingRight" ] , l = e . effects . setMode ( n , t . options . mode || "effect" ) , c = t . options . restore || ! 1 , h = t . options . scale || "both" , p = t . options . origin , d = { height : n . height ( ) , width : n . width ( ) } ; n . from = t . options . from || d , n . to = t . options . to || d ; if ( p ) { var v = e . effects . getBaseline ( p , d ) ; n . from . top = ( d . height - n . from . height ) * v . y , n . from . left = ( d . width - n . from . width ) * v . x , n . to . top = ( d . height - n . to . height ) * v . y , n . to . left = ( d . width - n . to . width ) * v . x } var m = { from : { y : n . from . height / d . height , x : n . from . width / d . width } , to : { y : n . to . height / d . height , x : n . to . width / d . width } } ; if ( h == "box" || h == "both" ) m . from . y != m . to . y && ( r = r . concat ( a ) , n . from = e . effects . setTransition ( n , a , m . from . y , n . from ) , n . to = e . effects . setTransition ( n , a , m . to . y , n . to ) ) , m . from . x != m . to . x && ( r = r . concat ( f ) , n . from = e . effects . setTransition ( n , f , m . from . x , n . from ) , n . to = e . effects . setTransition ( n , f , m . to . x , n . to ) ) ; ( h == "content" || h == "both" ) && m . from . y != m . to . y && ( r = r . concat ( u ) , n . from = e . effects . setTransition ( n , u , m . from . y , n . from ) , n . to = e . effects . setTransition ( n , u , m . to . y , n . to ) ) , e . effects . save ( n , c ? r : i ) , n . show ( ) , e . effects . createWrapper ( n ) , n . css ( "overflow" , "hidden" ) . css ( n . from ) ; if ( h == "content" || h == "both" ) a = a . concat ( [ "marginTop" , "marginBottom" ] ) . concat ( u ) , f = f . concat ( [ "marginLeft" , "marginRight" ] ) , s = r . concat ( a ) . concat ( f ) , n . find ( "*[width]" ) . each ( function ( ) { var n = e ( this ) ; c && e . effects . save ( n , s ) ; var r = { height : n . height ( ) , width : n . width ( ) } ; n . from = { height : r . height * m . from . y , width : r . width * m . from . x } , n . to = { height : r . height * m . to . y , width : r . width * m . to . x } , m . from . y != m . t
: ! 1 , hideIfNoPrevNext : ! 1 , navigationAsDateFormat : ! 1 , gotoCurrent : ! 1 , changeMonth : ! 1 , changeYear : ! 1 , yearRange : "c-10:c+10" , showOtherMonths : ! 1 , selectOtherMonths : ! 1 , showWeek : ! 1 , calculateWeek : this . iso8601Week , shortYearCutoff : "+10" , minDate : null , maxDate : null , duration : "fast" , beforeShowDay : null , beforeShow : null , onSelect : null , onChangeMonthYear : null , onClose : null , numberOfMonths : 1 , showCurrentAtPos : 0 , stepMonths : 1 , stepBigMonths : 12 , altField : "" , altFormat : "" , constrainInput : ! 0 , showButtonPanel : ! 1 , autoSize : ! 1 , disabled : ! 1 } , $ . extend ( this . _defaults , this . regional [ "" ] ) , this . dpDiv = bindHover ( $ ( '<div id="' + this . _mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>' ) ) } function bindHover ( e ) { var t = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a" ; return e . bind ( "mouseout" , function ( e ) { var n = $ ( e . target ) . closest ( t ) ; if ( ! n . length ) return ; n . removeClass ( "ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover" ) } ) . bind ( "mouseover" , function ( n ) { var r = $ ( n . target ) . closest ( t ) ; if ( $ . datepicker . _isDisabledDatepicker ( instActive . inline ? e . parent ( ) [ 0 ] : instActive . input [ 0 ] ) || ! r . length ) return ; r . parents ( ".ui-datepicker-calendar" ) . find ( "a" ) . removeClass ( "ui-state-hover" ) , r . addClass ( "ui-state-hover" ) , r . hasClass ( "ui-datepicker-prev" ) && r . addClass ( "ui-datepicker-prev-hover" ) , r . hasClass ( "ui-datepicker-next" ) && r . addClass ( "ui-datepicker-next-hover" ) } ) } function extendRemove ( e , t ) { $ . extend ( e , t ) ; for ( var n in t ) if ( t [ n ] == null || t [ n ] == undefined ) e [ n ] = t [ n ] ; return e } function isArray ( e ) { return e && ( $ . browser . safari && typeof e == "object" && e . length || e . constructor && e . constructor . toString ( ) . match ( /\Array\(\)/ ) ) } $ . extend ( $ . ui , { datepicker : { version : "1.8.23" } } ) ; var PROP _NAME = "datepicker" , dpuuid = ( new Date ) . getTime ( ) , instActive ; $ . extend ( Datepicker . prototype , { markerClassName : "hasDatepicker" , maxRows : 4 , log : function ( ) { this . debug && console . log . apply ( "" , arguments ) } , _widgetDatepicker : function ( ) { return this . dpDiv } , setDefaults : function ( e ) { return extendRemove ( this . _defaults , e || { } ) , this } , _attachDatepicker : function ( target , settings ) { var inlineSettings = null ; for ( var attrName in this . _defaults ) { var attrValue = target . getAttribute ( "date:" + attrName ) ; if ( attrValue ) { inlineSettings = inlineSettings || { } ; try { inlineSettings [ attrName ] = eval ( attrValue ) } catch ( err ) { inlineSettings [ attrName ] = attrValue } } } var nodeName = target . nodeName . toLowerCase ( ) , inline = nodeName == "div" || nodeName == "span" ; target . id || ( this . uuid += 1 , target . id = "dp" + this . uuid ) ; var inst = this . _newInst ( $ ( target ) , inline ) ; inst . settings = $ . extend ( { } , settings || { } , inlineSettings || { } ) , nodeName == "input" ? this . _connectDatepicker ( target , inst ) : inline && this . _inlineDatepicker ( target , inst ) } , _newInst : function ( e , t ) { var n = e [ 0 ] . id . replace ( /([^A-Za-z0-9_-])/g , "\\\\$1" ) ; return { id : n , input : e , selectedDay : 0 , selectedMonth : 0 , selectedYear : 0 , drawMonth : 0 , drawYear : 0 , inline : t , dpDiv : t ? bindHover ( $ ( '<div class="' + this . _inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>' ) ) : this . dpDiv } } , _connectDatepicker : function ( e , t ) { var n = $ ( e ) ; t . append = $ ( [ ] ) , t . trigger = $ ( [ ] ) ; if ( n . hasClass ( this . markerClassName ) ) return ; this . _attachments ( n , t ) , n . addClass ( this . markerClassName ) . keydown ( this . _doKeyDown ) . keypress ( this . _doKeyPress ) . keyup ( this . _doKeyUp ) . bind ( "setData.datepicker" , function ( e , n , r ) { t . settings [ n ] = r } ) . bind ( "getData.datepicker" , function ( e , n ) { return this . _get ( t , n ) } ) , this . _autoSize ( t ) , $ . data ( e , PROP _NAME , t ) , t . settings . disabled && this . _disableDatepicker ( e ) } , _attachments : function ( e , t ) { var n = this . _get ( t , "appendText" ) , r = this . _get ( t , "isRTL" ) ; t . append && t . append . remove ( ) , n && ( t . append = $ ( '<span class="' + this . _appendClass + '">' + n + "</span>" ) , e [ r ? "before" : "after" ] ( t . append ) ) , e . unbind ( "focus" , this . _showDatepicker ) , t . trigger && t . trigger . remove ( ) ; var i = this . _get ( t , "showOn" ) ; ( i == "focus" || i == "both" ) && e . focus ( this . _showDatepicker ) ; if ( i == "button" || i == "both" ) { var s = this . _get ( t , "buttonText" ) , o = this . _get ( t , "buttonImage" ) ; t . trigger = $ ( this . _get ( t , "buttonImageOnly" ) ? $ ( "<img/>" ) . addClass ( this . _triggerClass ) . attr ( { src : o , alt : s , title : s } ) : $ ( '<button type="button"></button>' ) . addClass ( this . _triggerClass ) . html ( o == "" ? s : $ ( "<img/>" ) . attr ( { src : o , alt : s , tit
( ) , y = function ( e ) { var t = e . match ( /c[+-].*/ ) ? n + parseInt ( e . substring ( 1 ) , 10 ) : e . match ( /[+-].*/ ) ? g + parseInt ( e , 10 ) : parseInt ( e , 10 ) ; return isNaN ( t ) ? g : t } , b = y ( m [ 0 ] ) , w = Math . max ( b , y ( m [ 1 ] || "" ) ) ; b = r ? Math . max ( b , r . getFullYear ( ) ) : b , w = i ? Math . min ( w , i . getFullYear ( ) ) : w , e . yearshtml += '<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">' ; for ( ; b <= w ; b ++ ) e . yearshtml += '<option value="' + b + '"' + ( b == n ? ' selected="selected"' : "" ) + ">" + b + "</option>" ; e . yearshtml += "</select>" , c += e . yearshtml , e . yearshtml = null } } return c += this . _get ( e , "yearSuffix" ) , l && ( c += ( s || ! a || ! f ? " " : "" ) + h ) , c += "</div>" , c } , _adjustInstDate : function ( e , t , n ) { var r = e . drawYear + ( n == "Y" ? t : 0 ) , i = e . drawMonth + ( n == "M" ? t : 0 ) , s = Math . min ( e . selectedDay , this . _getDaysInMonth ( r , i ) ) + ( n == "D" ? t : 0 ) , o = this . _restrictMinMax ( e , this . _daylightSavingAdjust ( new Date ( r , i , s ) ) ) ; e . selectedDay = o . getDate ( ) , e . drawMonth = e . selectedMonth = o . getMonth ( ) , e . drawYear = e . selectedYear = o . getFullYear ( ) , ( n == "M" || n == "Y" ) && this . _notifyChange ( e ) } , _restrictMinMax : function ( e , t ) { var n = this . _getMinMaxDate ( e , "min" ) , r = this . _getMinMaxDate ( e , "max" ) , i = n && t < n ? n : t ; return i = r && i > r ? r : i , i } , _notifyChange : function ( e ) { var t = this . _get ( e , "onChangeMonthYear" ) ; t && t . apply ( e . input ? e . input [ 0 ] : null , [ e . selectedYear , e . selectedMonth + 1 , e ] ) } , _getNumberOfMonths : function ( e ) { var t = this . _get ( e , "numberOfMonths" ) ; return t == null ? [ 1 , 1 ] : typeof t == "number" ? [ 1 , t ] : t } , _getMinMaxDate : function ( e , t ) { return this . _determineDate ( e , this . _get ( e , t + "Date" ) , null ) } , _getDaysInMonth : function ( e , t ) { return 32 - this . _daylightSavingAdjust ( new Date ( e , t , 32 ) ) . getDate ( ) } , _getFirstDayOfMonth : function ( e , t ) { return ( new Date ( e , t , 1 ) ) . getDay ( ) } , _canAdjustMonth : function ( e , t , n , r ) { var i = this . _getNumberOfMonths ( e ) , s = this . _daylightSavingAdjust ( new Date ( n , r + ( t < 0 ? t : i [ 0 ] * i [ 1 ] ) , 1 ) ) ; return t < 0 && s . setDate ( this . _getDaysInMonth ( s . getFullYear ( ) , s . getMonth ( ) ) ) , this . _isInRange ( e , s ) } , _isInRange : function ( e , t ) { var n = this . _getMinMaxDate ( e , "min" ) , r = this . _getMinMaxDate ( e , "max" ) ; return ( ! n || t . getTime ( ) >= n . getTime ( ) ) && ( ! r || t . getTime ( ) <= r . getTime ( ) ) } , _getFormatConfig : function ( e ) { var t = this . _get ( e , "shortYearCutoff" ) ; return t = typeof t != "string" ? t : ( new Date ) . getFullYear ( ) % 100 + parseInt ( t , 10 ) , { shortYearCutoff : t , dayNamesShort : this . _get ( e , "dayNamesShort" ) , dayNames : this . _get ( e , "dayNames" ) , monthNamesShort : this . _get ( e , "monthNamesShort" ) , monthNames : this . _get ( e , "monthNames" ) } } , _formatDate : function ( e , t , n , r ) { t || ( e . currentDay = e . selectedDay , e . currentMonth = e . selectedMonth , e . currentYear = e . selectedYear ) ; var i = t ? typeof t == "object" ? t : this . _daylightSavingAdjust ( new Date ( r , n , t ) ) : this . _daylightSavingAdjust ( new Date ( e . currentYear , e . currentMonth , e . currentDay ) ) ; return this . formatDate ( this . _get ( e , "dateFormat" ) , i , this . _getFormatConfig ( e ) ) } } ) , $ . fn . datepicker = function ( e ) { if ( ! this . length ) return this ; $ . datepicker . initialized || ( $ ( document ) . mousedown ( $ . datepicker . _checkExternalClick ) . find ( "body" ) . append ( $ . datepicker . dpDiv ) , $ . datepicker . initialized = ! 0 ) ; var t = Array . prototype . slice . call ( arguments , 1 ) ; return typeof e != "string" || e != "isDisabled" && e != "getDate" && e != "widget" ? e == "option" && arguments . length == 2 && typeof arguments [ 1 ] == "string" ? $ . datepicker [ "_" + e + "Datepicker" ] . apply ( $ . datepicker , [ this [ 0 ] ] . concat ( t ) ) : this . each ( function ( ) { typeof e == "string" ? $ . datepicker [ "_" + e + "Datepicker" ] . apply ( $ . datepicker , [ this ] . concat ( t ) ) : $ . datepicker . _attachDatepicker ( this , e ) } ) : $ . datepicker [ "_" + e + "Datepicker" ] . apply ( $ . datepicker , [ this [ 0 ] ] . concat ( t ) ) } , $ . datepicker = new Datepicker , $ . datepicker . initialized = ! 1 , $ . datepicker . uuid = ( new Date ) . getTime ( ) , $ . datepicker . version = "1.8.23" , window [ "DP_jQuery_" + dpuuid ] = $ } ( jQuery ) , function ( e , t ) { var n = "ui-dialog ui-widget ui-widget-content ui-corner-all " , r = { buttons : ! 0 , height : ! 0 , maxHeight : ! 0 , maxWidth : ! 0 , minHeight : ! 0 , minWidth : ! 0 , width : ! 0 } , i = { maxHeight : ! 0 , maxWidth : ! 0 , minHeight : ! 0 , minWidth : ! 0 } ; e . widget ( "ui.dialog" , { options : { autoOpen : ! 0 , buttons : { } , closeOnEscape : ! 0 , closeText : "close" , dialogClass : "" , draggable : ! 0 , hide : null , height : "auto" , maxHeight : ! 1 , maxWidth : ! 1 , minHeight : 150 , minWidth : 150 , modal : ! 1 , position : { my : "center" , at : "center" , collision : "fit" , using : function ( t ) { var n = e ( this ) . css ( t ) . offset ( ) . top ; n < 0 && e ( this ) . css ( "top" , t . top - n ) } } , resizable : ! 0 , show : null , stack :
, i . disabled ) != - 1 && i . disabled . splice ( e . inArray ( i . selected , i . disabled ) , 1 ) , this . panels . addClass ( "ui-tabs-hide" ) , this . lis . removeClass ( "ui-tabs-selected ui-state-active" ) , i . selected >= 0 && this . anchors . length && ( r . element . find ( r . _sanitizeSelector ( r . anchors [ i . selected ] . hash ) ) . removeClass ( "ui-tabs-hide" ) , this . lis . eq ( i . selected ) . addClass ( "ui-tabs-selected ui-state-active" ) , r . element . queue ( "tabs" , function ( ) { r . _trigger ( "show" , null , r . _ui ( r . anchors [ i . selected ] , r . element . find ( r . _sanitizeSelector ( r . anchors [ i . selected ] . hash ) ) [ 0 ] ) ) } ) , this . load ( i . selected ) ) , e ( window ) . bind ( "unload" , function ( ) { r . lis . add ( r . anchors ) . unbind ( ".tabs" ) , r . lis = r . anchors = r . panels = null } ) ) : i . selected = this . lis . index ( this . lis . filter ( ".ui-tabs-selected" ) ) , this . element [ i . collapsible ? "addClass" : "removeClass" ] ( "ui-tabs-collapsible" ) , i . cookie && this . _cookie ( i . selected , i . cookie ) ; for ( var o = 0 , u ; u = this . lis [ o ] ; o ++ ) e ( u ) [ e . inArray ( o , i . disabled ) != - 1 && ! e ( u ) . hasClass ( "ui-tabs-selected" ) ? "addClass" : "removeClass" ] ( "ui-state-disabled" ) ; i . cache === ! 1 && this . anchors . removeData ( "cache.tabs" ) , this . lis . add ( this . anchors ) . unbind ( ".tabs" ) ; if ( i . event !== "mouseover" ) { var a = function ( e , t ) { t . is ( ":not(.ui-state-disabled)" ) && t . addClass ( "ui-state-" + e ) } , f = function ( e , t ) { t . removeClass ( "ui-state-" + e ) } ; this . lis . bind ( "mouseover.tabs" , function ( ) { a ( "hover" , e ( this ) ) } ) , this . lis . bind ( "mouseout.tabs" , function ( ) { f ( "hover" , e ( this ) ) } ) , this . anchors . bind ( "focus.tabs" , function ( ) { a ( "focus" , e ( this ) . closest ( "li" ) ) } ) , this . anchors . bind ( "blur.tabs" , function ( ) { f ( "focus" , e ( this ) . closest ( "li" ) ) } ) } var l , c ; i . fx && ( e . isArray ( i . fx ) ? ( l = i . fx [ 0 ] , c = i . fx [ 1 ] ) : l = c = i . fx ) ; var p = c ? function ( t , n ) { e ( t ) . closest ( "li" ) . addClass ( "ui-tabs-selected ui-state-active" ) , n . hide ( ) . removeClass ( "ui-tabs-hide" ) . animate ( c , c . duration || "normal" , function ( ) { h ( n , c ) , r . _trigger ( "show" , null , r . _ui ( t , n [ 0 ] ) ) } ) } : function ( t , n ) { e ( t ) . closest ( "li" ) . addClass ( "ui-tabs-selected ui-state-active" ) , n . removeClass ( "ui-tabs-hide" ) , r . _trigger ( "show" , null , r . _ui ( t , n [ 0 ] ) ) } , d = l ? function ( e , t ) { t . animate ( l , l . duration || "normal" , function ( ) { r . lis . removeClass ( "ui-tabs-selected ui-state-active" ) , t . addClass ( "ui-tabs-hide" ) , h ( t , l ) , r . element . dequeue ( "tabs" ) } ) } : function ( e , t , n ) { r . lis . removeClass ( "ui-tabs-selected ui-state-active" ) , t . addClass ( "ui-tabs-hide" ) , r . element . dequeue ( "tabs" ) } ; this . anchors . bind ( i . event + ".tabs" , function ( ) { var t = this , n = e ( t ) . closest ( "li" ) , s = r . panels . filter ( ":not(.ui-tabs-hide)" ) , o = r . element . find ( r . _sanitizeSelector ( t . hash ) ) ; if ( n . hasClass ( "ui-tabs-selected" ) && ! i . collapsible || n . hasClass ( "ui-state-disabled" ) || n . hasClass ( "ui-state-processing" ) || r . panels . filter ( ":animated" ) . length || r . _trigger ( "select" , null , r . _ui ( this , o [ 0 ] ) ) === ! 1 ) return this . blur ( ) , ! 1 ; i . selected = r . anchors . index ( this ) , r . abort ( ) ; if ( i . collapsible ) { if ( n . hasClass ( "ui-tabs-selected" ) ) return i . selected = - 1 , i . cookie && r . _cookie ( i . selected , i . cookie ) , r . element . queue ( "tabs" , function ( ) { d ( t , s ) } ) . dequeue ( "tabs" ) , this . blur ( ) , ! 1 ; if ( ! s . length ) return i . cookie && r . _cookie ( i . selected , i . cookie ) , r . element . queue ( "tabs" , function ( ) { p ( t , o ) } ) , r . load ( r . anchors . index ( this ) ) , this . blur ( ) , ! 1 } i . cookie && r . _cookie ( i . selected , i . cookie ) ; if ( ! o . length ) throw "jQuery UI Tabs: Mismatching fragment identifier." ; s . length && r . element . queue ( "tabs" , function ( ) { d ( t , s ) } ) , r . element . queue ( "tabs" , function ( ) { p ( t , o ) } ) , r . load ( r . anchors . index ( this ) ) , e . browser . msie && this . blur ( ) } ) , this . anchors . bind ( "click.tabs" , function ( ) { return ! 1 } ) } , _getIndex : function ( e ) { return typeof e == "string" && ( e = this . anchors . index ( this . anchors . filter ( "[href$='" + e + "']" ) ) ) , e } , destroy : function ( ) { var t = this . options ; return this . abort ( ) , this . element . unbind ( ".tabs" ) . removeClass ( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" ) . removeData ( "tabs" ) , this . list . removeClass ( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) , this . anchors . each ( function ( ) { var t = e . data ( this , "href.tabs" ) ; t && ( this . href = t ) ; var n = e ( this ) . unbind ( ".tabs" ) ; e . each ( [ "href" , "load" , "cache" ] , function ( e , t ) { n . removeData ( t + ".tabs" ) } ) } ) , this . lis . unbind ( ".tabs" ) . add ( this . panels ) . each ( function ( ) { e . data ( this , "destroy.tabs" ) ? e ( this ) . remove ( ) : e ( this ) . removeClass ( [ "ui-state-default" , "ui-corner-top" , "ui-tabs-selected" , " ui - st
. text ( ) === "" && ( this . isNil = ! 0 , this . element . html ( this . nil ) ) } , getValue : function ( ) { alert ( "The form was not properly initialized. getValue is unbound" ) } , sanitizeValue : function ( e ) { return jQuery . trim ( e ) } , requestData : function ( ) { csrf _token = jQuery ( "meta[name=csrf-token]" ) . attr ( "content" ) , csrf _param = jQuery ( "meta[name=csrf-param]" ) . attr ( "content" ) ; var e = "_method=put" ; return e += "&" + this . objectName + "[" + this . attributeName + "]=" + encodeURIComponent ( this . getValue ( ) ) , csrf _param !== undefined && csrf _token !== undefined && ( e += "&" + csrf _param + "=" + encodeURIComponent ( csrf _token ) ) , e } , ajax : function ( e ) { return e . url = this . url , e . beforeSend = function ( e ) { e . setRequestHeader ( "Accept" , "application/json" ) } , jQuery . ajax ( e ) } , loadSuccessCallback : function ( e ) { var t = jQuery . parseJSON ( jQuery . trim ( e ) ) ; t !== null && t . hasOwnProperty ( "display_as" ) && ( this . element . attr ( "data-original-content" , this . element . text ( ) ) , this . original _content = this . element . text ( ) , this . element . html ( t . display _as ) ) , this . element . trigger ( jQuery . Event ( "ajax:success" ) , e ) , jQuery ( this . activator ) . bind ( "click" , { editor : this } , this . clickHandler ) , this . element . trigger ( jQuery . Event ( "best_in_place:deactivate" ) ) , this . collectionValue !== null && ( this . collectionValue = this . previousCollectionValue , this . previousCollectionValue = null ) } , loadErrorCallback : function ( e , t ) { this . element . html ( this . oldValue ) , this . element . trigger ( jQuery . Event ( "best_in_place:error" ) , [ e , t ] ) , this . element . trigger ( jQuery . Event ( "ajax:error" ) ) , jQuery ( this . activator ) . bind ( "click" , { editor : this } , this . clickHandler ) , this . element . trigger ( jQuery . Event ( "best_in_place:deactivate" ) ) } , clickHandler : function ( e ) { e . preventDefault ( ) , e . data . editor . activate ( ) } , setHtmlAttributes : function ( ) { var e = this . element . find ( this . formType ) , t = jQuery . parseJSON ( this . html _attrs ) ; for ( var n in t ) e . attr ( n , t [ n ] ) } } , BestInPlaceEditor . forms = { input : { activateForm : function ( ) { var e = jQuery ( document . createElement ( "form" ) ) . addClass ( "form_in_place" ) . attr ( "action" , "javascript:void(0);" ) . attr ( "style" , "display:inline" ) , t = jQuery ( document . createElement ( "input" ) ) . attr ( "type" , "text" ) . attr ( "name" , this . attributeName ) . val ( this . display _value ) ; this . inner _class !== null && t . addClass ( this . inner _class ) , e . append ( t ) , this . okButton && e . append ( jQuery ( document . createElement ( "input" ) ) . attr ( "type" , "submit" ) . attr ( "value" , this . okButton ) ) , this . cancelButton && e . append ( jQuery ( document . createElement ( "input" ) ) . attr ( "type" , "button" ) . attr ( "value" , this . cancelButton ) ) , this . element . html ( e ) , this . setHtmlAttributes ( ) , this . element . find ( "input[type='text']" ) [ 0 ] . select ( ) , this . element . find ( "form" ) . bind ( "submit" , { editor : this } , BestInPlaceEditor . forms . input . submitHandler ) , this . cancelButton && this . element . find ( "input[type='button']" ) . bind ( "click" , { editor : this } , BestInPlaceEditor . forms . input . cancelButtonHandler ) , this . element . find ( "input[type='text']" ) . bind ( "blur" , { editor : this } , BestInPlaceEditor . forms . input . inputBlurHandler ) , this . element . find ( "input[type='text']" ) . bind ( "keyup" , { editor : this } , BestInPlaceEditor . forms . input . keyupHandler ) , this . blurTimer = null , this . userClicked = ! 1 } , getValue : function ( ) { return this . sanitizeValue ( this . element . find ( "input" ) . val ( ) ) } , inputBlurHandler : function ( e ) { e . data . editor . okButton ? e . data . editor . blurTimer = setTimeout ( function ( ) { e . data . editor . userClicked || e . data . editor . abort ( ) } , 500 ) : e . data . editor . cancelButton ? e . data . editor . blurTimer = setTimeout ( function ( ) { e . data . editor . userClicked || e . data . editor . update ( ) } , 500 ) : e . data . editor . update ( ) } , submitHandler : function ( e ) { e . data . editor . userClicked = ! 0 , clearTimeout ( e . data . editor . blurTimer ) , e . data . editor . update ( ) } , cancelButtonHandler : function ( e ) { e . data . editor . userClicked = ! 0 , clearTimeout ( e . data . editor . blurTimer ) , e . data . editor . abort ( ) , e . stopPropagation ( ) } , keyupHandler : function ( e ) { e . keyCode == 27 && e . data . editor . abort ( ) } } , date : { activateForm : function ( ) { var e = this , t = jQuery ( document . createElement ( "form" ) ) . addClass ( "form_in_place" ) . attr ( "action" , "javascript:void(0);" ) . attr ( "style" , "display:inline" ) , n = jQuery ( document . createElement ( "input" ) ) . attr ( "type" , "text" ) . attr ( "name" , this . attributeName ) . attr ( "value" , this . sanitizeValue ( this . display _value ) ) ; this . inner _class !== null && n . addClass ( this . inner _class ) , t . append ( n ) , this . element . html ( t )
2014-03-03 02:17:44 -08:00
. strokeText = function ( e , t , n , r ) { this . drawText _ ( e , t , n , r , ! 0 ) } , q . measureText = function ( e ) { if ( ! this . textMeasureEl _ ) { var t = '<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>' ; this . element _ . insertAdjacentHTML ( "beforeEnd" , t ) , this . textMeasureEl _ = this . element _ . lastChild } var n = this . element _ . ownerDocument ; return this . textMeasureEl _ . innerHTML = "" , this . textMeasureEl _ . style . font = this . font , this . textMeasureEl _ . appendChild ( n . createTextNode ( e ) ) , { width : this . textMeasureEl _ . offsetWidth } } , q . clip = function ( ) { } , q . arcTo = function ( ) { } , q . createPattern = function ( e , t ) { return new J ( e , t ) } , $ . prototype . addColorStop = function ( e , t ) { t = M ( t ) , this . colors _ . push ( { offset : e , color : t . color , alpha : t . alpha } ) } ; var Y = G . prototype = new Error ; Y . INDEX _SIZE _ERR = 1 , Y . DOMSTRING _SIZE _ERR = 2 , Y . HIERARCHY _REQUEST _ERR = 3 , Y . WRONG _DOCUMENT _ERR = 4 , Y . INVALID _CHARACTER _ERR = 5 , Y . NO _DATA _ALLOWED _ERR = 6 , Y . NO _MODIFICATION _ALLOWED _ERR = 7 , Y . NOT _FOUND _ERR = 8 , Y . NOT _SUPPORTED _ERR = 9 , Y . INUSE _ATTRIBUTE _ERR = 10 , Y . INVALID _STATE _ERR = 11 , Y . SYNTAX _ERR = 12 , Y . INVALID _MODIFICATION _ERR = 13 , Y . NAMESPACE _ERR = 14 , Y . INVALID _ACCESS _ERR = 15 , Y . VALIDATION _ERR = 16 , Y . TYPE _MISMATCH _ERR = 17 , G _vmlCanvasManager = v , CanvasRenderingContext2D = I , CanvasGradient = $ , CanvasPattern = J , DOMException = G } ( ) , $ ( document ) . ready ( function ( ) { $ ( ".sidebarFilterBox .showAll" ) . click ( function ( e ) { showAll ( ) , $ ( "#filter_by_metacode ul li" ) . removeClass ( "toggledOff" ) ; for ( var t in categoryVisible ) categoryVisible [ t ] = ! 0 } ) , $ ( ".sidebarFilterBox .hideAll" ) . click ( function ( e ) { hideAll ( ) , $ ( "#filter_by_metacode ul li" ) . addClass ( "toggledOff" ) ; for ( var t in categoryVisible ) categoryVisible [ t ] = ! 1 } ) , $ ( "#filter_by_metacode ul li" ) . click ( function ( e ) { var t = $ ( this ) . children ( "img" ) . attr ( "alt" ) ; switchVisible ( t ) , categoryVisible [ t ] == 1 ? ( $ ( this ) . addClass ( "toggledOff" ) , categoryVisible [ t ] = ! 1 ) : categoryVisible [ t ] == 0 && ( $ ( this ) . removeClass ( "toggledOff" ) , categoryVisible [ t ] = ! 0 ) } ) } ) ; var lastDist = 0 , MetamapsModel = new Object ; MetamapsModel . embed = ! 1 , MetamapsModel . selectedEdges = new Array , MetamapsModel . selectedNodes = new Array , MetamapsModel . didPan = ! 1 , MetamapsModel . showcardInUse = null , MetamapsModel . widthOfLabel = null , MetamapsModel . edgecardInUse = null , MetamapsModel . edgeHoveringOver = ! 1 , MetamapsModel . boxStartCoordinates = ! 1 , MetamapsModel . boxEndCoordinates = ! 1 , MetamapsModel . synapseStartCoord = ! 1 , MetamapsModel . synapseEndCoord = ! 1 , MetamapsModel . lastSynapseClick = 0 , MetamapsModel . lastNodeClick = 0 , MetamapsModel . lastCanvasClick = 0 , MetamapsModel . DOUBLE _CLICK _TOLERANCE = 300 , MetamapsModel . edgePermTimer1 = null , MetamapsModel . edgePermTimer2 = null , MetamapsModel . edgePermSliding = ! 1 , MetamapsModel . topicPermTimer1 = null , MetamapsModel . topicPermTimer2 = null , MetamapsModel . topicPermSliding = ! 1 ; var renderMidArrow = function ( e , t , n , r , i , s , o ) { var u = i . getCtx ( ) ; if ( r ) { var a = e ; e = t , t = a } var f = new $jit . Complex ( t . x - e . x , t . y - e . y ) ; f . $scale ( n / f . norm ( ) ) ; var l = ( t . x - e . x ) * s + e . x , c = ( t . y - e . y ) * s + e . y , h = new $jit . Complex ( l , c ) , p = new $jit . Complex ( f . x / . 7 + h . x , f . y / . 7 + h . y ) , d = new $jit . Complex ( p . x - f . x , p . y - f . y ) , v = new $jit . Complex ( - f . y / 2 , f . x / 2 ) , m = d . add ( v ) , g = d . $add ( v . $scale ( - 1 ) ) ; o && ( u . strokeStyle = "#222222" , u . lineWidth = 2 , u . globalAlpha = . 4 ) , u . beginPath ( ) , u . moveTo ( e . x , e . y ) , u . lineTo ( t . x , t . y ) , u . stroke ( ) , u . beginPath ( ) , u . moveTo ( m . x , m . y ) , u . lineTo ( p . x , p . y ) , u . lineTo ( g . x , g . y ) , u . stroke ( ) } , nodeSettings = { customNode : { render : function ( e , t ) { var n = e . pos . getc ( ! 0 ) , r = e . getData ( "dim" ) , i = e . getData ( "metacode" ) , s = e . getData ( "greenCircle" ) , o = e . getData ( "whiteCircle" ) , u = t . getCtx ( ) ; s && ( u . beginPath ( ) , u . arc ( n . x , n . y , r + 3 , 0 , 2 * Math . PI , ! 1 ) , u . strokeStyle = "#67be5f" , u . lineWidth = 2 , u . stroke ( ) ) , o && ( u . beginPath ( ) , u . arc ( n . x , n . y , r + 3 , 0 , 2 * Math . PI , ! 1 ) , MetamapsModel . embed || ( u . strokeStyle = "white" ) , MetamapsModel . embed && ( u . strokeStyle = "#999" ) , u . lineWidth = 2 , u . stroke ( ) ) , u . drawImage ( imgArray [ i ] , n . x - r , n . y - r , r * 2 , r * 2 ) } , contains : function ( e , t ) { var n = e . pos . getc ( ! 0 ) , r = e . getData ( "dim" ) ; return this . nodeHelper . circle . contains ( n , t , r ) } } } , renderEdgeArrows = function ( e , t ) { var n = Mconsole . canvas , r = t . getData ( "category" ) , i = t . getData ( "direction" ) , s = t . nodeFrom . pos . getc ( ! 0 ) , o = t . nodeTo . pos . getc ( ! 0 ) ; if ( r == "none" ) e . line . render ( { x : s . x , y : s . y } , { x : o . x , y : o . y } , n ) ; else if ( r == "both" ) renderMidArrow ( { x : s . x , y : s . y } , { x : o . x , y : o . y } , 13 , ! 0 , n , . 7 ) , r
. beginPath ( ) , n . arc ( 0 , 0 , u * a , 0 , 2 * Math . PI , ! 1 ) , n . stroke ( ) , n . closePath ( ) } } ) } ) ( ) ; var l = function ( e , t ) { this . theta = e , this . rho = t } ; $jit . Polar = l , l . prototype = { getc : function ( e ) { return this . toComplex ( e ) } , getp : function ( ) { return this } , set : function ( e ) { e = e . getp ( ) , this . theta = e . theta , this . rho = e . rho } , setc : function ( e , t ) { this . rho = Math . sqrt ( e * e + t * t ) , this . theta = Math . atan2 ( t , e ) , this . theta < 0 && ( this . theta += Math . PI * 2 ) } , setp : function ( e , t ) { this . theta = e , this . rho = t } , clone : function ( ) { return new l ( this . theta , this . rho ) } , toComplex : function ( e ) { var t = Math . cos ( this . theta ) * this . rho , n = Math . sin ( this . theta ) * this . rho ; return e ? { x : t , y : n } : new h ( t , n ) } , add : function ( e ) { return new l ( this . theta + e . theta , this . rho + e . rho ) } , scale : function ( e ) { return new l ( this . theta , this . rho * e ) } , equals : function ( e ) { return this . theta == e . theta && this . rho == e . rho } , $add : function ( e ) { return this . theta = this . theta + e . theta , this . rho += e . rho , this } , $madd : function ( e ) { return this . theta = ( this . theta + e . theta ) % ( Math . PI * 2 ) , this . rho += e . rho , this } , $scale : function ( e ) { return this . rho *= e , this } , interpolate : function ( e , t ) { var n = Math . PI , r = n * 2 , i = function ( e ) { var t = e < 0 ? e % r + r : e % r ; return t } , s = this . theta , o = e . theta , u , a = Math . abs ( s - o ) ; a == n ? s > o ? u = i ( o + ( s - r - o ) * t ) : u = i ( o - r + ( s - o ) * t ) : a >= n ? s > o ? u = i ( o + ( s - r - o ) * t ) : u = i ( o - r + ( s - ( o - r ) ) * t ) : u = i ( o + ( s - o ) * t ) ; var f = ( this . rho - e . rho ) * t + e . rho ; return { theta : u , rho : f } } } ; var c = function ( e , t ) { return new l ( e , t ) } ; l . KER = c ( 0 , 0 ) ; var h = function ( e , t ) { this . x = e , this . y = t } ; $jit . Complex = h , h . prototype = { getc : function ( ) { return this } , getp : function ( e ) { return this . toPolar ( e ) } , set : function ( e ) { e = e . getc ( ! 0 ) , this . x = e . x , this . y = e . y } , setc : function ( e , t ) { this . x = e , this . y = t } , setp : function ( e , t ) { this . x = Math . cos ( e ) * t , this . y = Math . sin ( e ) * t } , clone : function ( ) { return new h ( this . x , this . y ) } , toPolar : function ( e ) { var t = this . norm ( ) , n = Math . atan2 ( this . y , this . x ) ; return n < 0 && ( n += Math . PI * 2 ) , e ? { theta : n , rho : t } : new l ( n , t ) } , norm : function ( ) { return Math . sqrt ( this . squaredNorm ( ) ) } , squaredNorm : function ( ) { return this . x * this . x + this . y * this . y } , add : function ( e ) { return new h ( this . x + e . x , this . y + e . y ) } , prod : function ( e ) { return new h ( this . x * e . x - this . y * e . y , this . y * e . x + this . x * e . y ) } , conjugate : function ( ) { return new h ( this . x , - this . y ) } , scale : function ( e ) { return new h ( this . x * e , this . y * e ) } , equals : function ( e ) { return this . x == e . x && this . y == e . y } , $add : function ( e ) { return this . x += e . x , this . y += e . y , this } , $prod : function ( e ) { var t = this . x , n = this . y ; return this . x = t * e . x - n * e . y , this . y = n * e . x + t * e . y , this } , $conjugate : function ( ) { return this . y = - this . y , this } , $scale : function ( e ) { return this . x *= e , this . y *= e , this } , $div : function ( e ) { var t = this . x , n = this . y , r = e . squaredNorm ( ) ; return this . x = t * e . x + n * e . y , this . y = n * e . x - t * e . y , this . $scale ( 1 / r ) } } ; var p = function ( e , t ) { return new h ( e , t ) } ; h . KER = p ( 0 , 0 ) , $jit . Graph = new t ( { initialize : function ( t , n , r , i ) { var s = { complex : ! 1 , Node : { } } ; this . Node = n , this . Edge = r , this . Label = i , this . opt = e . merge ( s , t || { } ) , this . nodes = { } , this . edges = { } ; var o = this ; this . nodeList = { } ; for ( var u in v ) o . nodeList [ u ] = function ( e ) { return function ( ) { var t = Array . prototype . slice . call ( arguments ) ; o . eachNode ( function ( n ) { n [ e ] . apply ( n , t ) } ) } } ( u ) } , getNode : function ( e ) { return this . hasNode ( e ) ? this . nodes [ e ] : ! 1 } , getByName : function ( e ) { for ( var t in this . nodes ) { var n = this . nodes [ t ] ; if ( n . name == e ) return n } return ! 1 } , getAdjacence : function ( e , t ) { return e in this . edges ? this . edges [ e ] [ t ] : ! 1 } , addNode : function ( t ) { if ( ! this . nodes [ t . id ] ) { var n = this . edges [ t . id ] = { } ; this . nodes [ t . id ] = new d . Node ( e . extend ( { id : t . id , name : t . name , data : e . merge ( t . data || { } , { } ) , adjacencies : n } , this . opt . Node ) , this . opt . complex , this . Node , this . Edge , this . Label ) } return this . nodes [ t . id ] } , addAdjacence : function ( e , t , n ) { this . hasNode ( e . id ) || this . addNode ( e ) , this . hasNode ( t . id ) || this . addNode ( t ) , e = this . nodes [ e . id ] , t = this . nodes [ t . id ] ; if ( ! e . adjacentTo ( t ) ) { var r = this . edges [ e . id ] = this . edges [ e . id ] || { } , i = this . edges [ t . id ] = this . edges [ t . id ] || { } ; return r [ t . id ] = i [ e . id ] = new d . Adjacence ( e , t , n , this . Edge , this . Label ) , r [ t . id ] } return this . edges [ e . id ] [ t . id ] } , removeNode : function ( e ) { if ( this . hasNode ( e ) ) { delete this . nodes [ e ] ; var t = this . edges [ e ] ; for ( var n in t ) delete this . edges [ n ] [ e ] ; delete this . edges [ e ] } } , removeAdjacence : function ( e , t ) { delete this . edges [ e ] [ t ] , delete this . edges [ t ] [ e ] } , hasNode : function ( e ) { return e in this . nodes } , empty : function ( ) { this .
) return t ; if ( t . length == 0 ) return e ; var n = e . shift ( ) , r = t . shift ( ) ; return [ [ n [ 0 ] , r [ 1 ] ] ] . concat ( o ( e , t ) ) } function u ( e , t ) { t = t || [ ] ; if ( e . length == 0 ) return t ; var n = e . pop ( ) ; return u ( e , o ( n , t ) ) } function a ( e , t , n , r , i ) { if ( e . length <= i || t . length <= i ) return 0 ; var s = e [ i ] [ 1 ] , o = t [ i ] [ 0 ] ; return Math . max ( a ( e , t , n , r , ++ i ) + n , s - o + r ) } function f ( e , t , n ) { function r ( e , i , u ) { if ( i . length <= u ) return [ ] ; var f = i [ u ] , l = a ( e , f , t , n , 0 ) ; return [ l ] . concat ( r ( o ( e , s ( f , l ) ) , i , ++ u ) ) } return r ( [ ] , e , 0 ) } function l ( e , t , r ) { function i ( e , n , u ) { if ( n . length <= u ) return [ ] ; var f = n [ u ] , l = - a ( f , e , t , r , 0 ) ; return [ l ] . concat ( i ( o ( s ( f , l ) , e ) , n , ++ u ) ) } e = n . call ( e ) ; var u = i ( [ ] , e . reverse ( ) , 0 ) ; return u . reverse ( ) } function c ( e , t , n , r ) { var i = f ( e , t , n ) , s = l ( e , t , n ) ; r == "left" ? s = i : r == "right" && ( i = s ) ; for ( var o = 0 , u = [ ] ; o < i . length ; o ++ ) u [ o ] = ( i [ o ] + s [ o ] ) / 2 ; return u } function h ( e , t , n , o , a ) { function S ( t , l , h ) { var p = t . getData ( g , n ) , m = l || t . getData ( y , n ) , x = [ ] , T = [ ] , N = ! 1 , C = m + o . levelDistance ; t . eachSubnode ( function ( t ) { if ( t . exist && ( ! f || "$orn" in t . data && t . data . $orn == a ) ) { N || ( N = r ( e , o , t . _depth , a , n ) ) ; var i = S ( t , N [ y ] , h + C ) ; x . push ( i . tree ) , T . push ( i . extent ) } } ) ; var k = c ( T , w , b , E ) ; for ( var L = 0 , A = [ ] , O = [ ] ; L < x . length ; L ++ ) i ( x [ L ] , n , k [ L ] , a ) , O . push ( s ( T [ L ] , k [ L ] ) ) ; var M = [ [ - p / 2 , p / 2 ] ] . concat ( u ( O ) ) ; return t . getPos ( n ) [ d ] = 0 , a == "top" || a == "left" ? t . getPos ( n ) [ v ] = h : t . getPos ( n ) [ v ] = - h , { tree : t , extent : M } } var f = o . multitree , l = [ "x" , "y" ] , h = [ "width" , "height" ] , p = + ( a == "left" || a == "right" ) , d = l [ p ] , v = l [ 1 - p ] , m = o . Node , g = h [ p ] , y = h [ 1 - p ] , b = o . siblingOffset , w = o . subtreeOffset , E = o . align ; S ( t , ! 1 , 0 ) } var n = Array . prototype . slice ; return new t ( { compute : function ( t , n ) { var r = t || "start" , i = this . graph . getNode ( this . root ) ; e . extend ( i , { drawn : ! 0 , exist : ! 0 , selected : ! 0 } ) , w . compute ( this . graph , r , this . config ) , ( ! ! n || ! ( "_depth" in i ) ) && this . graph . computeLevels ( this . root , 0 , "ignore" ) , this . computePositions ( i , r ) } , computePositions : function ( t , n ) { var r = this . config , i = r . multitree , s = r . align , o = s !== "center" && r . indent , u = r . orientation , a = i ? [ "top" , "right" , "bottom" , "left" ] : [ u ] , f = this ; e . each ( a , function ( e ) { h ( f . graph , t , n , f . config , e , n ) ; var r = [ "x" , "y" ] [ + ( e == "left" || e == "right" ) ] ; ( function u ( t ) { t . eachSubnode ( function ( a ) { a . exist && ( ! i || "$orn" in a . data && a . data . $orn == e ) && ( a . getPos ( n ) [ r ] += t . getPos ( n ) [ r ] , o && ( a . getPos ( n ) [ r ] += s == "left" ? o : - o ) , u ( a ) ) } ) } ) ( t ) } ) } } ) } ( ) , b . ForceDirected = new t ( { getOptions : function ( e ) { var t = this . canvas . getSize ( ) , n = t . width , r = t . height , i = 0 ; this . graph . eachNode ( function ( e ) { i ++ } ) ; var s = n * r / i , o = Math . sqrt ( s ) , u = this . config . levelDistance ; return { width : n , height : r , tstart : n * . 1 , nodef : function ( e ) { return s / ( e || 1 ) } , edgef : function ( e ) { return o * ( e - u ) } } } , compute : function ( t , n ) { var r = e . splat ( t || [ "current" , "start" , "end" ] ) , i = this . getOptions ( ) ; w . compute ( this . graph , r , this . config ) , this . graph . computeLevels ( this . root , 0 , "ignore" ) , this . graph . eachNode ( function ( t ) { e . each ( r , function ( n ) { var s = t . getPos ( n ) ; s . equals ( h . KER ) && ( s . x = i . width / 5 * ( Math . random ( ) - . 5 ) , s . y = i . height / 5 * ( Math . random ( ) - . 5 ) ) , t . disp = { } , e . each ( r , function ( e ) { t . disp [ e ] = p ( 0 , 0 ) } ) } ) } ) , this . computePositions ( r , i , n ) } , computePositions : function ( e , t , n ) { var r = this . config . iterations , i = 0 , s = this ; if ( n ) ( function o ( ) { for ( var u = n . iter , a = 0 ; a < u ; a ++ ) { t . t = t . tstart * ( 1 - i ++ /(r-1)),s.computePositionStep(e,t);if(i>=r){n.onComplete();return}}n.onStep(Math.round(i/ ( r - 1 ) * 100 ) ) , setTimeout ( o , 1 ) } ) ( ) ; else for ( ; i < r ; i ++ ) t . t = t . tstart * ( 1 - i / ( r - 1 ) ) , this . computePositionStep ( e , t ) } , computePositionStep : function ( t , n ) { var r = this . graph , i = Math . min , s = Math . max , o = p ( 0 , 0 ) ; r . eachNode ( function ( i ) { e . each ( t , function ( e ) { i . disp [ e ] . x = 0 , i . disp [ e ] . y = 0 } ) , r . eachNode ( function ( r ) { r . id != i . id && e . each ( t , function ( e ) { var t = i . getPos ( e ) , s = r . getPos ( e ) ; o . x = t . x - s . x , o . y = t . y - s . y ; var u = o . norm ( ) || 1 ; i . disp [ e ] . $add ( o . $scale ( n . nodef ( u ) / u ) ) } ) } ) } ) ; var u = ! ! r . getNode ( this . root ) . visited ; r . eachNode ( function ( r ) { r . eachAdjacency ( function ( i ) { var s = i . nodeTo ; ! ! s . visited === u && e . each ( t , function ( e ) { var t = r . getPos ( e ) , i = s . getPos ( e ) ; o . x = t . x - i . x , o . y = t . y - i . y ; var u = o . norm ( ) || 1 ; r . disp [ e ] . $add ( o . $scale ( - n . edgef ( u ) / u ) ) , s . disp [ e ] . $add ( o . $scale ( - 1 ) ) } ) } ) , r . visited = ! u } ) ; var a = n . t , f = n . width / 2 , l = n . height / 2 ; r . eachNode ( function ( n ) { e . each ( t , function ( e ) { var t = n . disp [ e ] , r = t . norm ( ) || 1 , e = n . getPos ( e ) ; e . $add ( p ( t . x * i ( Math . abs ( t . x ) , a ) / r , t . y * i ( Math . abs ( t . y ) , a ) / r ) ) , e . x = i ( f , s ( - f , e . x ) ) , e . y = i ( l , s ( - l , e . y ) ) } ) } ) } } ) , b . Radial = new t ( { compute : functi
{ return n === t ? u [ "inner" + r ] . call ( this ) : this . each ( function ( ) { e ( this ) . css ( o , i ( this , n ) + "px" ) } ) } , e . fn [ "outer" + r ] = function ( t , n ) { return typeof t != "number" ? u [ "outer" + r ] . call ( this , t ) : this . each ( function ( ) { e ( this ) . css ( o , i ( this , t , ! 0 , n ) + "px" ) } ) } } ) , e . extend ( e . expr [ ":" ] , { data : e . expr . createPseudo ? e . expr . createPseudo ( function ( t ) { return function ( n ) { return ! ! e . data ( n , t ) } } ) : function ( t , n , r ) { return ! ! e . data ( t , r [ 3 ] ) } , focusable : function ( t ) { return n ( t , ! isNaN ( e . attr ( t , "tabindex" ) ) ) } , tabbable : function ( t ) { var r = e . attr ( t , "tabindex" ) , i = isNaN ( r ) ; return ( i || r >= 0 ) && n ( t , ! i ) } } ) , e ( function ( ) { var t = document . body , n = t . appendChild ( n = document . createElement ( "div" ) ) ; n . offsetHeight , e . extend ( n . style , { minHeight : "100px" , height : "auto" , padding : 0 , borderWidth : 0 } ) , e . support . minHeight = n . offsetHeight === 100 , e . support . selectstart = "onselectstart" in n , t . removeChild ( n ) . style . display = "none" } ) , e . curCSS || ( e . curCSS = e . css ) , e . extend ( e . ui , { plugin : { add : function ( t , n , r ) { var i = e . ui [ t ] . prototype ; for ( var s in r ) i . plugins [ s ] = i . plugins [ s ] || [ ] , i . plugins [ s ] . push ( [ n , r [ s ] ] ) } , call : function ( e , t , n ) { var r = e . plugins [ t ] ; if ( ! r || ! e . element [ 0 ] . parentNode ) return ; for ( var i = 0 ; i < r . length ; i ++ ) e . options [ r [ i ] [ 0 ] ] && r [ i ] [ 1 ] . apply ( e . element , n ) } } , contains : function ( e , t ) { return document . compareDocumentPosition ? e . compareDocumentPosition ( t ) & 16 : e !== t && e . contains ( t ) } , hasScroll : function ( t , n ) { if ( e ( t ) . css ( "overflow" ) === "hidden" ) return ! 1 ; var r = n && n === "left" ? "scrollLeft" : "scrollTop" , i = ! 1 ; return t [ r ] > 0 ? ! 0 : ( t [ r ] = 1 , i = t [ r ] > 0 , t [ r ] = 0 , i ) } , isOverAxis : function ( e , t , n ) { return e > t && e < t + n } , isOver : function ( t , n , r , i , s , o ) { return e . ui . isOverAxis ( t , r , s ) && e . ui . isOverAxis ( n , i , o ) } } ) } ( jQuery ) , function ( e , t ) { if ( e . cleanData ) { var n = e . cleanData ; e . cleanData = function ( t ) { for ( var r = 0 , i ; ( i = t [ r ] ) != null ; r ++ ) try { e ( i ) . triggerHandler ( "remove" ) } catch ( s ) { } n ( t ) } } else { var r = e . fn . remove ; e . fn . remove = function ( t , n ) { return this . each ( function ( ) { return n || ( ! t || e . filter ( t , [ this ] ) . length ) && e ( "*" , this ) . add ( [ this ] ) . each ( function ( ) { try { e ( this ) . triggerHandler ( "remove" ) } catch ( t ) { } } ) , r . call ( e ( this ) , t , n ) } ) } } e . widget = function ( t , n , r ) { var i = t . split ( "." ) [ 0 ] , s ; t = t . split ( "." ) [ 1 ] , s = i + "-" + t , r || ( r = n , n = e . Widget ) , e . expr [ ":" ] [ s ] = function ( n ) { return ! ! e . data ( n , t ) } , e [ i ] = e [ i ] || { } , e [ i ] [ t ] = function ( e , t ) { arguments . length && this . _createWidget ( e , t ) } ; var o = new n ; o . options = e . extend ( ! 0 , { } , o . options ) , e [ i ] [ t ] . prototype = e . extend ( ! 0 , o , { namespace : i , widgetName : t , widgetEventPrefix : e [ i ] [ t ] . prototype . widgetEventPrefix || t , widgetBaseClass : s } , r ) , e . widget . bridge ( t , e [ i ] [ t ] ) } , e . widget . bridge = function ( n , r ) { e . fn [ n ] = function ( i ) { var s = typeof i == "string" , o = Array . prototype . slice . call ( arguments , 1 ) , u = this ; return i = ! s && o . length ? e . extend . apply ( null , [ ! 0 , i ] . concat ( o ) ) : i , s && i . charAt ( 0 ) === "_" ? u : ( s ? this . each ( function ( ) { var r = e . data ( this , n ) , s = r && e . isFunction ( r [ i ] ) ? r [ i ] . apply ( r , o ) : r ; if ( s !== r && s !== t ) return u = s , ! 1 } ) : this . each ( function ( ) { var t = e . data ( this , n ) ; t ? t . option ( i || { } ) . _init ( ) : e . data ( this , n , new r ( i , this ) ) } ) , u ) } } , e . Widget = function ( e , t ) { arguments . length && this . _createWidget ( e , t ) } , e . Widget . prototype = { widgetName : "widget" , widgetEventPrefix : "" , options : { disabled : ! 1 } , _createWidget : function ( t , n ) { e . data ( n , this . widgetName , this ) , this . element = e ( n ) , this . options = e . extend ( ! 0 , { } , this . options , this . _getCreateOptions ( ) , t ) ; var r = this ; this . element . bind ( "remove." + this . widgetName , function ( ) { r . destroy ( ) } ) , this . _create ( ) , this . _trigger ( "create" ) , this . _init ( ) } , _getCreateOptions : function ( ) { return e . metadata && e . metadata . get ( this . element [ 0 ] ) [ this . widgetName ] } , _create : function ( ) { } , _init : function ( ) { } , destroy : function ( ) { this . element . unbind ( "." + this . widgetName ) . removeData ( this . widgetName ) , this . widget ( ) . unbind ( "." + this . widgetName ) . removeAttr ( "aria-disabled" ) . removeClass ( this . widgetBaseClass + "-disabled " + "ui-state-disabled" ) } , widget : function ( ) { return this . element } , option : function ( n , r ) { var i = n ; if ( arguments . length === 0 ) return e . extend ( { } , this . options ) ; if ( typeof n == "string" ) { if ( r === t ) return this . options [ n ] ; i = { } , i [ n ] = r } return this . _setOptions ( i ) , this } , _setOptions : function ( t ) { var n = this ; return e . each ( t , function ( e , t ) { n . _setOption ( e , t ) } ) , this } , _setOption : function ( e , t ) { return this . options [ e ] = t , e === "disabled" && this . widget ( ) [ t ? "addClass" : "removeClass" ] ( this . widgetBaseClass + "-disabled" + "
: [ 224 , 255 , 255 ] , lightgreen : [ 144 , 238 , 144 ] , lightgrey : [ 211 , 211 , 211 ] , lightpink : [ 255 , 182 , 193 ] , lightyellow : [ 255 , 255 , 224 ] , lime : [ 0 , 255 , 0 ] , magenta : [ 255 , 0 , 255 ] , maroon : [ 128 , 0 , 0 ] , navy : [ 0 , 0 , 128 ] , olive : [ 128 , 128 , 0 ] , orange : [ 255 , 165 , 0 ] , pink : [ 255 , 192 , 203 ] , purple : [ 128 , 0 , 128 ] , violet : [ 128 , 0 , 128 ] , red : [ 255 , 0 , 0 ] , silver : [ 192 , 192 , 192 ] , white : [ 255 , 255 , 255 ] , yellow : [ 255 , 255 , 0 ] , transparent : [ 255 , 255 , 255 ] } , l = [ "add" , "remove" , "toggle" ] , c = { border : 1 , borderBottom : 1 , borderColor : 1 , borderLeft : 1 , borderRight : 1 , borderTop : 1 , borderWidth : 1 , margin : 1 , padding : 1 } ; e . effects . animateClass = function ( t , n , r , u ) { return e . isFunction ( r ) && ( u = r , r = null ) , this . queue ( function ( ) { var a = e ( this ) , f = a . attr ( "style" ) || " " , c = s ( i . call ( this ) ) , h , p = a . attr ( "class" ) || "" ; e . each ( l , function ( e , n ) { t [ n ] && a [ n + "Class" ] ( t [ n ] ) } ) , h = s ( i . call ( this ) ) , a . attr ( "class" , p ) , a . animate ( o ( c , h ) , { queue : ! 1 , duration : n , easing : r , complete : function ( ) { e . each ( l , function ( e , n ) { t [ n ] && a [ n + "Class" ] ( t [ n ] ) } ) , typeof a . attr ( "style" ) == "object" ? ( a . attr ( "style" ) . cssText = "" , a . attr ( "style" ) . cssText = f ) : a . attr ( "style" , f ) , u && u . apply ( this , arguments ) , e . dequeue ( this ) } } ) } ) } , e . fn . extend ( { _addClass : e . fn . addClass , addClass : function ( t , n , r , i ) { return n ? e . effects . animateClass . apply ( this , [ { add : t } , n , r , i ] ) : this . _addClass ( t ) } , _removeClass : e . fn . removeClass , removeClass : function ( t , n , r , i ) { return n ? e . effects . animateClass . apply ( this , [ { remove : t } , n , r , i ] ) : this . _removeClass ( t ) } , _toggleClass : e . fn . toggleClass , toggleClass : function ( n , r , i , s , o ) { return typeof r == "boolean" || r === t ? i ? e . effects . animateClass . apply ( this , [ r ? { add : n } : { remove : n } , i , s , o ] ) : this . _toggleClass ( n , r ) : e . effects . animateClass . apply ( this , [ { toggle : n } , r , i , s ] ) } , switchClass : function ( t , n , r , i , s ) { return e . effects . animateClass . apply ( this , [ { add : n , remove : t } , r , i , s ] ) } } ) , e . extend ( e . effects , { version : "1.8.23" , save : function ( e , t ) { for ( var n = 0 ; n < t . length ; n ++ ) t [ n ] !== null && e . data ( "ec.storage." + t [ n ] , e [ 0 ] . style [ t [ n ] ] ) } , restore : function ( e , t ) { for ( var n = 0 ; n < t . length ; n ++ ) t [ n ] !== null && e . css ( t [ n ] , e . data ( "ec.storage." + t [ n ] ) ) } , setMode : function ( e , t ) { return t == "toggle" && ( t = e . is ( ":hidden" ) ? "show" : "hide" ) , t } , getBaseline : function ( e , t ) { var n , r ; switch ( e [ 0 ] ) { case "top" : n = 0 ; break ; case "middle" : n = . 5 ; break ; case "bottom" : n = 1 ; break ; default : n = e [ 0 ] / t . height } switch ( e [ 1 ] ) { case "left" : r = 0 ; break ; case "center" : r = . 5 ; break ; case "right" : r = 1 ; break ; default : r = e [ 1 ] / t . width } return { x : r , y : n } } , createWrapper : function ( t ) { if ( t . parent ( ) . is ( ".ui-effects-wrapper" ) ) return t . parent ( ) ; var n = { width : t . outerWidth ( ! 0 ) , height : t . outerHeight ( ! 0 ) , "float" : t . css ( "float" ) } , r = e ( "<div></div>" ) . addClass ( "ui-effects-wrapper" ) . css ( { fontSize : "100%" , background : "transparent" , border : "none" , margin : 0 , padding : 0 } ) , i = document . activeElement ; try { i . id } catch ( s ) { i = document . body } return t . wrap ( r ) , ( t [ 0 ] === i || e . contains ( t [ 0 ] , i ) ) && e ( i ) . focus ( ) , r = t . parent ( ) , t . css ( "position" ) == "static" ? ( r . css ( { position : "relative" } ) , t . css ( { position : "relative" } ) ) : ( e . extend ( n , { position : t . css ( "position" ) , zIndex : t . css ( "z-index" ) } ) , e . each ( [ "top" , "left" , "bottom" , "right" ] , function ( e , r ) { n [ r ] = t . css ( r ) , isNaN ( parseInt ( n [ r ] , 10 ) ) && ( n [ r ] = "auto" ) } ) , t . css ( { position : "relative" , top : 0 , left : 0 , right : "auto" , bottom : "auto" } ) ) , r . css ( n ) . show ( ) } , removeWrapper : function ( t ) { var n , r = document . activeElement ; return t . parent ( ) . is ( ".ui-effects-wrapper" ) ? ( n = t . parent ( ) . replaceWith ( t ) , ( t [ 0 ] === r || e . contains ( t [ 0 ] , r ) ) && e ( r ) . focus ( ) , n ) : t } , setTransition : function ( t , n , r , i ) { return i = i || { } , e . each ( n , function ( e , n ) { var s = t . cssUnit ( n ) ; s [ 0 ] > 0 && ( i [ n ] = s [ 0 ] * r + s [ 1 ] ) } ) , i } } ) , e . fn . extend ( { effect : function ( t , n , r , i ) { var s = u . apply ( this , arguments ) , o = { options : s [ 1 ] , duration : s [ 2 ] , callback : s [ 3 ] } , a = o . options . mode , f = e . effects [ t ] ; return e . fx . off || ! f ? a ? this [ a ] ( o . duration , o . callback ) : this . each ( function ( ) { o . callback && o . callback . call ( this ) } ) : f . call ( this , o ) } , _show : e . fn . show , show : function ( e ) { if ( a ( e ) ) return this . _show . apply ( this , arguments ) ; var t = u . apply ( this , arguments ) ; return t [ 1 ] . mode = "show" , this . effect . apply ( this , t ) } , _hide : e . fn . hide , hide : function ( e ) { if ( a ( e ) ) return this . _hide . apply ( this , arguments ) ; var t = u . apply ( this , arguments ) ; return t [ 1 ] . mode = "hide" , this . effect . apply ( this , t ) } , _ _toggle : e . fn . toggle , toggle : function ( t ) { if ( a ( t ) || typeof t == "boolean" || e . isFunction ( t ) ) return this . _ _toggle . apply ( this , arguments ) ; var n = u . apply ( this , argum
( e . prototype , t . prototype ) } , n . inherit = function ( e , t ) { function n ( ) { } n . prototype = t . prototype , e . prototype = new n } , n . isArray = Array . isArray || function ( e ) { return Object . prototype . toString . call ( e ) === "[object Array]" } , n . intersect = function ( e , t ) { var r = [ ] , i = e . length > t . length ? e : t , s = e . length > t . length ? t : e ; for ( var o = 0 , u = s . length ; o < u ; o ++ ) ~ n . indexOf ( i , s [ o ] ) && r . push ( s [ o ] ) ; return r } , n . indexOf = function ( e , t , n ) { for ( var r = e . length , n = n < 0 ? n + r < 0 ? 0 : n + r : n || 0 ; n < r && e [ n ] !== t ; n ++ ) ; return r <= n ? - 1 : n } , n . toArray = function ( e ) { var t = [ ] ; for ( var n = 0 , r = e . length ; n < r ; n ++ ) t . push ( e [ n ] ) ; return t } , n . ua = { } , n . ua . hasCORS = "undefined" != typeof XMLHttpRequest && function ( ) { try { var e = new XMLHttpRequest } catch ( t ) { return ! 1 } return e . withCredentials != undefined } ( ) , n . ua . webkit = "undefined" != typeof navigator && /webkit/i . test ( navigator . userAgent ) , n . ua . iDevice = "undefined" != typeof navigator && /iPad|iPhone|iPod/i . test ( navigator . userAgent ) } ( "undefined" != typeof io ? io : module . exports , this ) , function ( e , t ) { function n ( ) { } e . EventEmitter = n , n . prototype . on = function ( e , n ) { return this . $events || ( this . $events = { } ) , this . $events [ e ] ? t . util . isArray ( this . $events [ e ] ) ? this . $events [ e ] . push ( n ) : this . $events [ e ] = [ this . $events [ e ] , n ] : this . $events [ e ] = n , this } , n . prototype . addListener = n . prototype . on , n . prototype . once = function ( e , t ) { function r ( ) { n . removeListener ( e , r ) , t . apply ( this , arguments ) } var n = this ; return r . listener = t , this . on ( e , r ) , this } , n . prototype . removeListener = function ( e , n ) { if ( this . $events && this . $events [ e ] ) { var r = this . $events [ e ] ; if ( t . util . isArray ( r ) ) { var i = - 1 ; for ( var s = 0 , o = r . length ; s < o ; s ++ ) if ( r [ s ] === n || r [ s ] . listener && r [ s ] . listener === n ) { i = s ; break } if ( i < 0 ) return this ; r . splice ( i , 1 ) , r . length || delete this . $events [ e ] } else ( r === n || r . listener && r . listener === n ) && delete this . $events [ e ] } return this } , n . prototype . removeAllListeners = function ( e ) { return e === undefined ? ( this . $events = { } , this ) : ( this . $events && this . $events [ e ] && ( this . $events [ e ] = null ) , this ) } , n . prototype . listeners = function ( e ) { return this . $events || ( this . $events = { } ) , this . $events [ e ] || ( this . $events [ e ] = [ ] ) , t . util . isArray ( this . $events [ e ] ) || ( this . $events [ e ] = [ this . $events [ e ] ] ) , this . $events [ e ] } , n . prototype . emit = function ( e ) { if ( ! this . $events ) return ! 1 ; var n = this . $events [ e ] ; if ( ! n ) return ! 1 ; var r = Array . prototype . slice . call ( arguments , 1 ) ; if ( "function" == typeof n ) n . apply ( this , r ) ; else { if ( ! t . util . isArray ( n ) ) return ! 1 ; var i = n . slice ( ) ; for ( var s = 0 , o = i . length ; s < o ; s ++ ) i [ s ] . apply ( this , r ) } return ! 0 } } ( "undefined" != typeof io ? io : module . exports , "undefined" != typeof io ? io : module . parent . exports ) , function ( exports , nativeJSON ) { "use strict" ; function f ( e ) { return e < 10 ? "0" + e : e } function date ( e , t ) { return isFinite ( e . valueOf ( ) ) ? e . getUTCFullYear ( ) + "-" + f ( e . getUTCMonth ( ) + 1 ) + "-" + f ( e . getUTCDate ( ) ) + "T" + f ( e . getUTCHours ( ) ) + ":" + f ( e . getUTCMinutes ( ) ) + ":" + f ( e . getUTCSeconds ( ) ) + "Z" : null } function quote ( e ) { return escapable . lastIndex = 0 , escapable . test ( e ) ? '"' + e . replace ( escapable , function ( e ) { var t = meta [ e ] ; return typeof t == "string" ? t : "\\u" + ( "0000" + e . charCodeAt ( 0 ) . toString ( 16 ) ) . slice ( - 4 ) } ) + '"' : '"' + e + '"' } function str ( e , t ) { var n , r , i , s , o = gap , u , a = t [ e ] ; a instanceof Date && ( a = date ( e ) ) , typeof rep == "function" && ( a = rep . call ( t , e , a ) ) ; switch ( typeof a ) { case "string" : return quote ( a ) ; case "number" : return isFinite ( a ) ? String ( a ) : "null" ; case "boolean" : case "null" : return String ( a ) ; case "object" : if ( ! a ) return "null" ; gap += indent , u = [ ] ; if ( Object . prototype . toString . apply ( a ) === "[object Array]" ) { s = a . length ; for ( n = 0 ; n < s ; n += 1 ) u [ n ] = str ( n , a ) || "null" ; return i = u . length === 0 ? "[]" : gap ? "[\n" + gap + u . join ( ",\n" + gap ) + "\n" + o + "]" : "[" + u . join ( "," ) + "]" , gap = o , i } if ( rep && typeof rep == "object" ) { s = rep . length ; for ( n = 0 ; n < s ; n += 1 ) typeof rep [ n ] == "string" && ( r = rep [ n ] , i = str ( r , a ) , i && u . push ( quote ( r ) + ( gap ? ": " : ":" ) + i ) ) } else for ( r in a ) Object . prototype . hasOwnProperty . call ( a , r ) && ( i = str ( r , a ) , i && u . push ( quote ( r ) + ( gap ? ": " : ":" ) + i ) ) ; return i = u . length === 0 ? "{}" : gap ? "{\n" + gap + u . join ( ",\n" + gap ) + "\n" + o + "}" : "{" + u . join ( "," ) + "}" , gap = o , i } } if ( nativeJSON && nativeJSON . parse ) return exports . JSON = { parse : nativeJSON . parse , stringify : nativeJSON . stringify } ; var JSON = exports . JSON = { } , cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g , escapable = / [ \ \ \ " \ x 0 0 - \ x 1 f \ x 7 f - \ x 9 f \ u 0 0 a d \ u 0 6 0 0 - \ u 0 6 0 4 \ u 0 7 0 f \ u 1 7 b 4 \ u 1 7
} return { type : e , data : t , bubbles : ! 1 , cancelable : ! 1 } } , WebSocket . CONNECTING = 0 , WebSocket . OPEN = 1 , WebSocket . CLOSING = 2 , WebSocket . CLOSED = 3 , WebSocket . _ _flash = null , WebSocket . _ _instances = { } , WebSocket . _ _tasks = [ ] , WebSocket . _ _nextId = 0 , WebSocket . loadFlashPolicyFile = function ( e ) { WebSocket . _ _addTask ( function ( ) { WebSocket . _ _flash . loadManualPolicyFile ( e ) } ) } , WebSocket . _ _initialize = function ( ) { if ( WebSocket . _ _flash ) return ; WebSocket . _ _swfLocation && ( window . WEB _SOCKET _SWF _LOCATION = WebSocket . _ _swfLocation ) ; if ( ! window . WEB _SOCKET _SWF _LOCATION ) { e . error ( "[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf" ) ; return } var t = document . createElement ( "div" ) ; t . id = "webSocketContainer" , t . style . position = "absolute" , WebSocket . _ _isFlashLite ( ) ? ( t . style . left = "0px" , t . style . top = "0px" ) : ( t . style . left = "-100px" , t . style . top = "-100px" ) ; var n = document . createElement ( "div" ) ; n . id = "webSocketFlash" , t . appendChild ( n ) , document . body . appendChild ( t ) , swfobject . embedSWF ( WEB _SOCKET _SWF _LOCATION , "webSocketFlash" , "1" , "1" , "10.0.0" , null , null , { hasPriority : ! 0 , swliveconnect : ! 0 , allowScriptAccess : "always" } , null , function ( t ) { t . success || e . error ( "[WebSocket] swfobject.embedSWF failed" ) } ) } , WebSocket . _ _onFlashInitialized = function ( ) { setTimeout ( function ( ) { WebSocket . _ _flash = document . getElementById ( "webSocketFlash" ) , WebSocket . _ _flash . setCallerUrl ( location . href ) , WebSocket . _ _flash . setDebug ( ! ! window . WEB _SOCKET _DEBUG ) ; for ( var e = 0 ; e < WebSocket . _ _tasks . length ; ++ e ) WebSocket . _ _tasks [ e ] ( ) ; WebSocket . _ _tasks = [ ] } , 0 ) } , WebSocket . _ _onFlashEvent = function ( ) { return setTimeout ( function ( ) { try { var t = WebSocket . _ _flash . receiveEvents ( ) ; for ( var n = 0 ; n < t . length ; ++ n ) WebSocket . _ _instances [ t [ n ] . webSocketId ] . _ _handleEvent ( t [ n ] ) } catch ( r ) { e . error ( r ) } } , 0 ) , ! 0 } , WebSocket . _ _log = function ( t ) { e . log ( decodeURIComponent ( t ) ) } , WebSocket . _ _error = function ( t ) { e . error ( decodeURIComponent ( t ) ) } , WebSocket . _ _addTask = function ( e ) { WebSocket . _ _flash ? e ( ) : WebSocket . _ _tasks . push ( e ) } , WebSocket . _ _isFlashLite = function ( ) { if ( ! window . navigator || ! window . navigator . mimeTypes ) return ! 1 ; var e = window . navigator . mimeTypes [ "application/x-shockwave-flash" ] ; return ! e || ! e . enabledPlugin || ! e . enabledPlugin . filename ? ! 1 : e . enabledPlugin . filename . match ( /flashlite/i ) ? ! 0 : ! 1 } , window . WEB _SOCKET _DISABLE _AUTO _INITIALIZATION || ( window . addEventListener ? window . addEventListener ( "load" , function ( ) { WebSocket . _ _initialize ( ) } , ! 1 ) : window . attachEvent ( "onload" , function ( ) { WebSocket . _ _initialize ( ) } ) ) } ) ( ) , function ( e , t , n ) { function r ( e ) { if ( ! e ) return ; t . Transport . apply ( this , arguments ) , this . sendBuffer = [ ] } function i ( ) { } e . XHR = r , t . util . inherit ( r , t . Transport ) , r . prototype . open = function ( ) { return this . socket . setBuffer ( ! 1 ) , this . onOpen ( ) , this . get ( ) , this . setCloseTimeout ( ) , this } , r . prototype . payload = function ( e ) { var n = [ ] ; for ( var r = 0 , i = e . length ; r < i ; r ++ ) n . push ( t . parser . encodePacket ( e [ r ] ) ) ; this . send ( t . parser . encodePayload ( n ) ) } , r . prototype . send = function ( e ) { return this . post ( e ) , this } , r . prototype . post = function ( e ) { function r ( ) { this . readyState == 4 && ( this . onreadystatechange = i , t . posting = ! 1 , this . status == 200 ? t . socket . setBuffer ( ! 1 ) : t . onClose ( ) ) } function s ( ) { this . onload = i , t . socket . setBuffer ( ! 1 ) } var t = this ; this . socket . setBuffer ( ! 0 ) , this . sendXHR = this . request ( "POST" ) , n . XDomainRequest && this . sendXHR instanceof XDomainRequest ? this . sendXHR . onload = this . sendXHR . onerror = s : this . sendXHR . onreadystatechange = r , this . sendXHR . send ( e ) } , r . prototype . close = function ( ) { return this . onClose ( ) , this } , r . prototype . request = function ( e ) { var n = t . util . request ( this . socket . isXDomain ( ) ) , r = t . util . query ( this . socket . options . query , "t=" + + ( new Date ) ) ; n . open ( e || "GET" , this . prepareUrl ( ) + r , ! 0 ) ; if ( e == "POST" ) try { n . setRequestHeader ? n . setRequestHeader ( "Content-type" , "text/plain;charset=UTF-8" ) : n . contentType = "text/plain" } catch ( i ) { } return n } , r . prototype . scheme = function ( ) { return this . socket . options . secure ? "https" : "http" } , r . check = function ( e , r ) { try { var i = t . util . request ( r ) , s = n . XDomainRequest && i instanceof XDomainRequest , o = e && e . options && e . options . secure ? "https:" : "http:" , u = n . location && o != n . location . protocol ; if ( i && ( ! s || ! u ) ) return ! 0 } catch ( a ) { } return ! 1 } , r . xdomainCheck = function ( e ) { return r . check ( e , ! 0 ) } } ( "undefined" != typeof io ? io . Transport : module . exports , "undefined" != typeof io ? io : module . parent . expo
( { width : "0" } , 200 , function ( ) { $ ( ".sidebarSearchField" ) . typeahead ( "setQuery" , "" ) , t = ! 1 , e = ! 1 } ) ) } , r ) } ; $ ( ".sidebarSearch" ) . hover ( function ( ) { r ( ) } , function ( ) { i ( 800 ) } ) , $ ( ".sidebarSearchIcon" ) . click ( function ( e ) { $ ( ".sidebarSearchField" ) . focus ( ) } ) , $ ( ".sidebarSearch" ) . click ( function ( e ) { e . stopPropagation ( ) } ) , $ ( "body" ) . click ( function ( e ) { i ( 0 ) } ) , $ ( "body" ) . bind ( "keyup" , function ( t ) { switch ( t . which ) { case 83 : t . shiftKey && ! e && r ( ) ; break ; default : } } ) ; var s = userid ? '<h3 class="search-header">Maps</h3><input type="checkbox" class="limitToMe" id="limitMapsToMe"></input><label for="limitMapsToMe" class="limitToMeLabel">added by me</label><div class="minimizeResults minimizeMapResults"></div><div class="clearfloat"></div>' : '<h3 class="search-header">Maps</h3><div class="minimizeResults minimizeMapResults"></div><div class="clearfloat"></div>' , o = userid ? '<h3 class="search-header">Topics</h3><input type="checkbox" class="limitToMe" id="limitTopicsToMe"></input><label for="limitTopicsToMe" class="limitToMeLabel">added by me</label><div class="minimizeResults minimizeTopicResults"></div><div class="clearfloat"></div>' : '<h3 class="search-header">Topics</h3><div class="minimizeResults minimizeTopicResults"></div><div class="clearfloat"></div>' ; $ ( ".sidebarSearchField" ) . typeahead ( [ { name : "topics" , dupChecker : function ( e , t ) { return ! 1 } , template : $ ( ".topicTemplate" ) . html ( ) , remote : { url : "/search/topics?term=%QUERY" , replace : function ( ) { var e = "/search/topics?term=" + $ ( ".sidebarSearchField" ) . val ( ) ; return $ ( "#limitTopicsToMe" ) . is ( ":checked" ) && ( e += "&user=" + userid . toString ( ) ) , e } , filter : function ( e ) { return e . length == 0 && e . push ( { value : "No results" , label : "No results" , typeImageURL : "/assets/wildcard.png" , rtype : "noresult" } ) , e } } , engine : Hogan , header : o } , { name : "maps" , dupChecker : function ( e , t ) { return ! 1 } , template : $ ( ".mapTemplate" ) . html ( ) , remote : { url : "/search/maps?term=%QUERY" , replace : function ( ) { var e = "/search/maps?term=" + $ ( ".sidebarSearchField" ) . val ( ) ; return $ ( "#limitMapsToMe" ) . is ( ":checked" ) && ( e += "&user=" + userid . toString ( ) ) , e } , filter : function ( e ) { return e . length == 0 && e . push ( { value : "No results" , label : "No results" , rtype : "noresult" } ) , e } } , engine : Hogan , header : s } , { name : "mappers" , dupChecker : function ( e , t ) { return ! 1 } , template : $ ( ".mapperTemplate" ) . html ( ) , remote : { url : "/search/mappers?term=%QUERY" , filter : function ( e ) { return e . length == 0 && e . push ( { value : "No results" , label : "No results" , rtype : "noresult" } ) , e } } , engine : Hogan , header : '<h3 class="search-header">Mappers</h3><div class="minimizeResults minimizeMapperResults"></div><div class="clearfloat"></div>' } ] ) , $ ( ".sidebarSearchField" ) . bind ( "typeahead:selected" , function ( e , t , n ) { console . log ( e ) ; if ( t . rtype != "noresult" ) { var r ; n == "topics" ? r = window . open ( "/topics/" + t . id , "_blank" ) : n == "maps" ? r = window . open ( "/maps/" + t . id , "_blank" ) : n == "mappers" && ( r = window . open ( "/maps/mappers/" + t . id , "_blank" ) ) , r . focus ( ) , i ( 0 ) } } ) ; var u = ! 1 , a = ! 1 ; $ ( ".sidebarSearchField" ) . bind ( "keyup" , function ( ) { u || ( $ ( ".limitToMe" ) . bind ( "change" , function ( t ) { e = ! 1 , $ ( ".sidebarSearchField" ) . typeahead ( "setQuery" , $ ( ".sidebarSearchField" ) . val ( ) ) , setTimeout ( function ( ) { e = ! 0 } , 2e3 ) } ) , u = ! 0 ) , a || ( $ ( ".minimizeMapperResults" ) . click ( function ( e ) { var t = $ ( ".tt-dataset-mappers .tt-suggestions" ) ; console . log ( t . css ( "height" ) ) , t . css ( "height" ) == "0px" ? ( $ ( ".tt-dataset-mappers .tt-suggestions" ) . css ( { height : "auto" , overflow : "visible" } ) , $ ( this ) . removeClass ( "maximizeResults" ) . addClass ( "minimizeResults" ) ) : ( $ ( ".tt-dataset-mappers .tt-suggestions" ) . css ( { height : "0" , overflow : "hidden" } ) , $ ( this ) . removeClass ( "minimizeResults" ) . addClass ( "maximizeResults" ) ) } ) , $ ( ".minimizeTopicResults" ) . click ( function ( e ) { var t = $ ( ".tt-dataset-topics .tt-suggestions" ) ; console . log ( t . css ( "height" ) ) , t . css ( "height" ) == "0px" ? ( t . css ( { height : "auto" , "border-top" : "none" , overflow : "visible" } ) , $ ( this ) . removeClass ( "maximizeResults" ) . addClass ( "minimizeResults" ) ) : ( t . css ( { height : "0" , "border-top" : "1px solid #222" , overflow : "hidden" } ) , $ ( this ) . removeClass ( "minimizeResults" ) . addClass ( "maximizeResults" ) ) } ) , $ ( ".minimizeMapResults" ) . click ( function ( e ) { var t = $ ( ".tt-dataset-maps .tt-suggestions" ) ; console . log ( t . css ( "height" ) ) , t . css ( "height" ) == "0px" ? ( t . css ( { height : "auto" , "border-top" : "none" , overflow : "visible" } ) ,